From 1c5ad6a48c267e6846b762b621ee4c92fd3edadb Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 10 Apr 2020 17:08:22 +0800 Subject: [PATCH] Generated 2017-05-25 for Dypnsapi. --- CHANGELOG | 3 + VERSION | 2 +- dypnsapi/CMakeLists.txt | 8 +- .../alibabacloud/dypnsapi/DypnsapiClient.h | 8 ++ .../dypnsapi/model/TwiceTelVerifyResult.h | 4 +- .../model/VerifyPhoneWithTokenRequest.h | 63 ++++++++++++ .../model/VerifyPhoneWithTokenResult.h | 60 ++++++++++++ dypnsapi/src/DypnsapiClient.cc | 42 +++++++- .../src/model/VerifyPhoneWithTokenRequest.cc | 95 +++++++++++++++++++ .../src/model/VerifyPhoneWithTokenResult.cc | 68 +++++++++++++ 10 files changed, 345 insertions(+), 8 deletions(-) create mode 100644 dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h create mode 100644 dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h create mode 100644 dypnsapi/src/model/VerifyPhoneWithTokenRequest.cc create mode 100644 dypnsapi/src/model/VerifyPhoneWithTokenResult.cc diff --git a/CHANGELOG b/CHANGELOG index f369fb892..4fc03442c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-04-10 Version: 1.36.352 +- Generated 2017-05-25 for `Dypnsapi`. + 2020-04-10 Version: 1.36.351 - Support GetOfficeEditURL. - Support RefreshOfficeEditToken. diff --git a/VERSION b/VERSION index 6d598381a..e1bc72d9c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.351 \ No newline at end of file +1.36.352 \ No newline at end of file diff --git a/dypnsapi/CMakeLists.txt b/dypnsapi/CMakeLists.txt index cc76564ca..5d1556a6d 100644 --- a/dypnsapi/CMakeLists.txt +++ b/dypnsapi/CMakeLists.txt @@ -32,7 +32,9 @@ set(dypnsapi_public_header_model include/alibabacloud/dypnsapi/model/TwiceTelVerifyRequest.h include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h include/alibabacloud/dypnsapi/model/VerifyMobileRequest.h - include/alibabacloud/dypnsapi/model/VerifyMobileResult.h ) + include/alibabacloud/dypnsapi/model/VerifyMobileResult.h + include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h + include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h ) set(dypnsapi_src src/DypnsapiClient.cc @@ -47,7 +49,9 @@ set(dypnsapi_src src/model/TwiceTelVerifyRequest.cc src/model/TwiceTelVerifyResult.cc src/model/VerifyMobileRequest.cc - src/model/VerifyMobileResult.cc ) + src/model/VerifyMobileResult.cc + src/model/VerifyPhoneWithTokenRequest.cc + src/model/VerifyPhoneWithTokenResult.cc ) add_library(dypnsapi ${LIB_TYPE} ${dypnsapi_public_header} diff --git a/dypnsapi/include/alibabacloud/dypnsapi/DypnsapiClient.h b/dypnsapi/include/alibabacloud/dypnsapi/DypnsapiClient.h index 6c92aa34b..5bd62ced0 100644 --- a/dypnsapi/include/alibabacloud/dypnsapi/DypnsapiClient.h +++ b/dypnsapi/include/alibabacloud/dypnsapi/DypnsapiClient.h @@ -34,6 +34,8 @@ #include "model/TwiceTelVerifyResult.h" #include "model/VerifyMobileRequest.h" #include "model/VerifyMobileResult.h" +#include "model/VerifyPhoneWithTokenRequest.h" +#include "model/VerifyPhoneWithTokenResult.h" namespace AlibabaCloud @@ -61,6 +63,9 @@ namespace AlibabaCloud typedef Outcome VerifyMobileOutcome; typedef std::future VerifyMobileOutcomeCallable; typedef std::function&)> VerifyMobileAsyncHandler; + typedef Outcome VerifyPhoneWithTokenOutcome; + typedef std::future VerifyPhoneWithTokenOutcomeCallable; + typedef std::function&)> VerifyPhoneWithTokenAsyncHandler; DypnsapiClient(const Credentials &credentials, const ClientConfiguration &configuration); DypnsapiClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -84,6 +89,9 @@ namespace AlibabaCloud VerifyMobileOutcome verifyMobile(const Model::VerifyMobileRequest &request)const; void verifyMobileAsync(const Model::VerifyMobileRequest& request, const VerifyMobileAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; VerifyMobileOutcomeCallable verifyMobileCallable(const Model::VerifyMobileRequest& request) const; + VerifyPhoneWithTokenOutcome verifyPhoneWithToken(const Model::VerifyPhoneWithTokenRequest &request)const; + void verifyPhoneWithTokenAsync(const Model::VerifyPhoneWithTokenRequest& request, const VerifyPhoneWithTokenAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + VerifyPhoneWithTokenOutcomeCallable verifyPhoneWithTokenCallable(const Model::VerifyPhoneWithTokenRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/dypnsapi/include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h b/dypnsapi/include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h index 482a54a04..23c2315c2 100644 --- a/dypnsapi/include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h +++ b/dypnsapi/include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h @@ -43,14 +43,14 @@ namespace AlibabaCloud explicit TwiceTelVerifyResult(const std::string &payload); ~TwiceTelVerifyResult(); std::string getMessage()const; - TwiceTelVerifyResult getTwiceTelVerifyResult()const; + Result getTwiceTelVerifyResult()const; std::string getCode()const; protected: void parse(const std::string &payload); private: std::string message_; - TwiceTelVerifyResult twiceTelVerifyResult_; + Result twiceTelVerifyResult_; std::string code_; }; diff --git a/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h b/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h new file mode 100644 index 000000000..83531ad02 --- /dev/null +++ b/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_ +#define ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dypnsapi + { + namespace Model + { + class ALIBABACLOUD_DYPNSAPI_EXPORT VerifyPhoneWithTokenRequest : public RpcServiceRequest + { + + public: + VerifyPhoneWithTokenRequest(); + ~VerifyPhoneWithTokenRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getPhoneNumber()const; + void setPhoneNumber(const std::string& phoneNumber); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getSpToken()const; + void setSpToken(const std::string& spToken); + + private: + long resourceOwnerId_; + std::string resourceOwnerAccount_; + std::string phoneNumber_; + long ownerId_; + std::string accessKeyId_; + std::string spToken_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_ \ No newline at end of file diff --git a/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h b/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h new file mode 100644 index 000000000..28025db87 --- /dev/null +++ b/dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_ +#define ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dypnsapi + { + namespace Model + { + class ALIBABACLOUD_DYPNSAPI_EXPORT VerifyPhoneWithTokenResult : public ServiceResult + { + public: + struct GateVerify + { + std::string verifyResult; + std::string verifyId; + }; + + + VerifyPhoneWithTokenResult(); + explicit VerifyPhoneWithTokenResult(const std::string &payload); + ~VerifyPhoneWithTokenResult(); + std::string getMessage()const; + GateVerify getGateVerify()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + GateVerify gateVerify_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_ \ No newline at end of file diff --git a/dypnsapi/src/DypnsapiClient.cc b/dypnsapi/src/DypnsapiClient.cc index 4d86f544b..33558bf6b 100644 --- a/dypnsapi/src/DypnsapiClient.cc +++ b/dypnsapi/src/DypnsapiClient.cc @@ -31,21 +31,21 @@ DypnsapiClient::DypnsapiClient(const Credentials &credentials, const ClientConfi RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dypns"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DypnsapiClient::DypnsapiClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dypns"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DypnsapiClient::DypnsapiClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dypns"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DypnsapiClient::~DypnsapiClient() @@ -267,3 +267,39 @@ DypnsapiClient::VerifyMobileOutcomeCallable DypnsapiClient::verifyMobileCallable return task->get_future(); } +DypnsapiClient::VerifyPhoneWithTokenOutcome DypnsapiClient::verifyPhoneWithToken(const VerifyPhoneWithTokenRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return VerifyPhoneWithTokenOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return VerifyPhoneWithTokenOutcome(VerifyPhoneWithTokenResult(outcome.result())); + else + return VerifyPhoneWithTokenOutcome(outcome.error()); +} + +void DypnsapiClient::verifyPhoneWithTokenAsync(const VerifyPhoneWithTokenRequest& request, const VerifyPhoneWithTokenAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, verifyPhoneWithToken(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DypnsapiClient::VerifyPhoneWithTokenOutcomeCallable DypnsapiClient::verifyPhoneWithTokenCallable(const VerifyPhoneWithTokenRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->verifyPhoneWithToken(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/dypnsapi/src/model/VerifyPhoneWithTokenRequest.cc b/dypnsapi/src/model/VerifyPhoneWithTokenRequest.cc new file mode 100644 index 000000000..08a163fe8 --- /dev/null +++ b/dypnsapi/src/model/VerifyPhoneWithTokenRequest.cc @@ -0,0 +1,95 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Dypnsapi::Model::VerifyPhoneWithTokenRequest; + +VerifyPhoneWithTokenRequest::VerifyPhoneWithTokenRequest() : + RpcServiceRequest("dypnsapi", "2017-05-25", "VerifyPhoneWithToken") +{ + setMethod(HttpRequest::Method::Post); +} + +VerifyPhoneWithTokenRequest::~VerifyPhoneWithTokenRequest() +{} + +long VerifyPhoneWithTokenRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void VerifyPhoneWithTokenRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string VerifyPhoneWithTokenRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void VerifyPhoneWithTokenRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string VerifyPhoneWithTokenRequest::getPhoneNumber()const +{ + return phoneNumber_; +} + +void VerifyPhoneWithTokenRequest::setPhoneNumber(const std::string& phoneNumber) +{ + phoneNumber_ = phoneNumber; + setParameter("PhoneNumber", phoneNumber); +} + +long VerifyPhoneWithTokenRequest::getOwnerId()const +{ + return ownerId_; +} + +void VerifyPhoneWithTokenRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string VerifyPhoneWithTokenRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void VerifyPhoneWithTokenRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string VerifyPhoneWithTokenRequest::getSpToken()const +{ + return spToken_; +} + +void VerifyPhoneWithTokenRequest::setSpToken(const std::string& spToken) +{ + spToken_ = spToken; + setParameter("SpToken", spToken); +} + diff --git a/dypnsapi/src/model/VerifyPhoneWithTokenResult.cc b/dypnsapi/src/model/VerifyPhoneWithTokenResult.cc new file mode 100644 index 000000000..f1ea511eb --- /dev/null +++ b/dypnsapi/src/model/VerifyPhoneWithTokenResult.cc @@ -0,0 +1,68 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Dypnsapi; +using namespace AlibabaCloud::Dypnsapi::Model; + +VerifyPhoneWithTokenResult::VerifyPhoneWithTokenResult() : + ServiceResult() +{} + +VerifyPhoneWithTokenResult::VerifyPhoneWithTokenResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +VerifyPhoneWithTokenResult::~VerifyPhoneWithTokenResult() +{} + +void VerifyPhoneWithTokenResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto gateVerifyNode = value["GateVerify"]; + if(!gateVerifyNode["VerifyId"].isNull()) + gateVerify_.verifyId = gateVerifyNode["VerifyId"].asString(); + if(!gateVerifyNode["VerifyResult"].isNull()) + gateVerify_.verifyResult = gateVerifyNode["VerifyResult"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string VerifyPhoneWithTokenResult::getMessage()const +{ + return message_; +} + +VerifyPhoneWithTokenResult::GateVerify VerifyPhoneWithTokenResult::getGateVerify()const +{ + return gateVerify_; +} + +std::string VerifyPhoneWithTokenResult::getCode()const +{ + return code_; +} +