From 70dddee991d1ff0d2f5e2fa2bed6076a6af16c7e Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 19 Oct 2023 07:12:11 +0000 Subject: [PATCH] Coupon template --- VERSION | 2 +- cams/CMakeLists.txt | 8 ++ cams/include/alibabacloud/cams/CamsClient.h | 16 ++++ .../cams/model/CreateChatappTemplateRequest.h | 23 ++++++ .../model/GetChatappTemplateDetailResult.h | 24 ++++++ .../cams/model/GetCommerceSettingRequest.h | 51 ++++++++++++ .../cams/model/GetCommerceSettingResult.h | 60 ++++++++++++++ .../cams/model/ModifyChatappTemplateRequest.h | 23 ++++++ .../cams/model/UpdateCommerceSettingRequest.h | 57 +++++++++++++ .../cams/model/UpdateCommerceSettingResult.h | 53 ++++++++++++ cams/src/CamsClient.cc | 78 +++++++++++++++++- .../src/model/CreateChatappTemplateRequest.cc | 17 ++++ .../model/GetChatappTemplateDetailResult.cc | 42 ++++++++++ cams/src/model/GetCommerceSettingRequest.cc | 63 +++++++++++++++ cams/src/model/GetCommerceSettingResult.cc | 68 ++++++++++++++++ .../src/model/ModifyChatappTemplateRequest.cc | 17 ++++ .../src/model/UpdateCommerceSettingRequest.cc | 81 +++++++++++++++++++ cams/src/model/UpdateCommerceSettingResult.cc | 58 +++++++++++++ 18 files changed, 737 insertions(+), 4 deletions(-) create mode 100644 cams/include/alibabacloud/cams/model/GetCommerceSettingRequest.h create mode 100644 cams/include/alibabacloud/cams/model/GetCommerceSettingResult.h create mode 100644 cams/include/alibabacloud/cams/model/UpdateCommerceSettingRequest.h create mode 100644 cams/include/alibabacloud/cams/model/UpdateCommerceSettingResult.h create mode 100644 cams/src/model/GetCommerceSettingRequest.cc create mode 100644 cams/src/model/GetCommerceSettingResult.cc create mode 100644 cams/src/model/UpdateCommerceSettingRequest.cc create mode 100644 cams/src/model/UpdateCommerceSettingResult.cc diff --git a/VERSION b/VERSION index 4751960fe..12b0a09e4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1785 \ No newline at end of file +1.36.1786 \ No newline at end of file diff --git a/cams/CMakeLists.txt b/cams/CMakeLists.txt index a30cc60e0..c8da84f9f 100644 --- a/cams/CMakeLists.txt +++ b/cams/CMakeLists.txt @@ -61,6 +61,8 @@ set(cams_public_header_model include/alibabacloud/cams/model/GetChatappUploadAuthorizationResult.h include/alibabacloud/cams/model/GetChatappVerifyCodeRequest.h include/alibabacloud/cams/model/GetChatappVerifyCodeResult.h + include/alibabacloud/cams/model/GetCommerceSettingRequest.h + include/alibabacloud/cams/model/GetCommerceSettingResult.h include/alibabacloud/cams/model/GetMigrationVerifyCodeRequest.h include/alibabacloud/cams/model/GetMigrationVerifyCodeResult.h include/alibabacloud/cams/model/GetPhoneNumberVerificationStatusRequest.h @@ -97,6 +99,8 @@ set(cams_public_header_model include/alibabacloud/cams/model/SubmitIsvCustomerTermsResult.h include/alibabacloud/cams/model/UpdateAccountWebhookRequest.h include/alibabacloud/cams/model/UpdateAccountWebhookResult.h + include/alibabacloud/cams/model/UpdateCommerceSettingRequest.h + include/alibabacloud/cams/model/UpdateCommerceSettingResult.h include/alibabacloud/cams/model/UpdatePhoneWebhookRequest.h include/alibabacloud/cams/model/UpdatePhoneWebhookResult.h ) @@ -142,6 +146,8 @@ set(cams_src src/model/GetChatappUploadAuthorizationResult.cc src/model/GetChatappVerifyCodeRequest.cc src/model/GetChatappVerifyCodeResult.cc + src/model/GetCommerceSettingRequest.cc + src/model/GetCommerceSettingResult.cc src/model/GetMigrationVerifyCodeRequest.cc src/model/GetMigrationVerifyCodeResult.cc src/model/GetPhoneNumberVerificationStatusRequest.cc @@ -178,6 +184,8 @@ set(cams_src src/model/SubmitIsvCustomerTermsResult.cc src/model/UpdateAccountWebhookRequest.cc src/model/UpdateAccountWebhookResult.cc + src/model/UpdateCommerceSettingRequest.cc + src/model/UpdateCommerceSettingResult.cc src/model/UpdatePhoneWebhookRequest.cc src/model/UpdatePhoneWebhookResult.cc ) diff --git a/cams/include/alibabacloud/cams/CamsClient.h b/cams/include/alibabacloud/cams/CamsClient.h index f4fd76973..f4a3d6f42 100644 --- a/cams/include/alibabacloud/cams/CamsClient.h +++ b/cams/include/alibabacloud/cams/CamsClient.h @@ -62,6 +62,8 @@ #include "model/GetChatappUploadAuthorizationResult.h" #include "model/GetChatappVerifyCodeRequest.h" #include "model/GetChatappVerifyCodeResult.h" +#include "model/GetCommerceSettingRequest.h" +#include "model/GetCommerceSettingResult.h" #include "model/GetMigrationVerifyCodeRequest.h" #include "model/GetMigrationVerifyCodeResult.h" #include "model/GetPhoneNumberVerificationStatusRequest.h" @@ -98,6 +100,8 @@ #include "model/SubmitIsvCustomerTermsResult.h" #include "model/UpdateAccountWebhookRequest.h" #include "model/UpdateAccountWebhookResult.h" +#include "model/UpdateCommerceSettingRequest.h" +#include "model/UpdateCommerceSettingResult.h" #include "model/UpdatePhoneWebhookRequest.h" #include "model/UpdatePhoneWebhookResult.h" @@ -169,6 +173,9 @@ namespace AlibabaCloud typedef Outcome GetChatappVerifyCodeOutcome; typedef std::future GetChatappVerifyCodeOutcomeCallable; typedef std::function&)> GetChatappVerifyCodeAsyncHandler; + typedef Outcome GetCommerceSettingOutcome; + typedef std::future GetCommerceSettingOutcomeCallable; + typedef std::function&)> GetCommerceSettingAsyncHandler; typedef Outcome GetMigrationVerifyCodeOutcome; typedef std::future GetMigrationVerifyCodeOutcomeCallable; typedef std::function&)> GetMigrationVerifyCodeAsyncHandler; @@ -223,6 +230,9 @@ namespace AlibabaCloud typedef Outcome UpdateAccountWebhookOutcome; typedef std::future UpdateAccountWebhookOutcomeCallable; typedef std::function&)> UpdateAccountWebhookAsyncHandler; + typedef Outcome UpdateCommerceSettingOutcome; + typedef std::future UpdateCommerceSettingOutcomeCallable; + typedef std::function&)> UpdateCommerceSettingAsyncHandler; typedef Outcome UpdatePhoneWebhookOutcome; typedef std::future UpdatePhoneWebhookOutcomeCallable; typedef std::function&)> UpdatePhoneWebhookAsyncHandler; @@ -291,6 +301,9 @@ namespace AlibabaCloud GetChatappVerifyCodeOutcome getChatappVerifyCode(const Model::GetChatappVerifyCodeRequest &request)const; void getChatappVerifyCodeAsync(const Model::GetChatappVerifyCodeRequest& request, const GetChatappVerifyCodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetChatappVerifyCodeOutcomeCallable getChatappVerifyCodeCallable(const Model::GetChatappVerifyCodeRequest& request) const; + GetCommerceSettingOutcome getCommerceSetting(const Model::GetCommerceSettingRequest &request)const; + void getCommerceSettingAsync(const Model::GetCommerceSettingRequest& request, const GetCommerceSettingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetCommerceSettingOutcomeCallable getCommerceSettingCallable(const Model::GetCommerceSettingRequest& request) const; GetMigrationVerifyCodeOutcome getMigrationVerifyCode(const Model::GetMigrationVerifyCodeRequest &request)const; void getMigrationVerifyCodeAsync(const Model::GetMigrationVerifyCodeRequest& request, const GetMigrationVerifyCodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetMigrationVerifyCodeOutcomeCallable getMigrationVerifyCodeCallable(const Model::GetMigrationVerifyCodeRequest& request) const; @@ -345,6 +358,9 @@ namespace AlibabaCloud UpdateAccountWebhookOutcome updateAccountWebhook(const Model::UpdateAccountWebhookRequest &request)const; void updateAccountWebhookAsync(const Model::UpdateAccountWebhookRequest& request, const UpdateAccountWebhookAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateAccountWebhookOutcomeCallable updateAccountWebhookCallable(const Model::UpdateAccountWebhookRequest& request) const; + UpdateCommerceSettingOutcome updateCommerceSetting(const Model::UpdateCommerceSettingRequest &request)const; + void updateCommerceSettingAsync(const Model::UpdateCommerceSettingRequest& request, const UpdateCommerceSettingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateCommerceSettingOutcomeCallable updateCommerceSettingCallable(const Model::UpdateCommerceSettingRequest& request) const; UpdatePhoneWebhookOutcome updatePhoneWebhook(const Model::UpdatePhoneWebhookRequest &request)const; void updatePhoneWebhookAsync(const Model::UpdatePhoneWebhookRequest& request, const UpdatePhoneWebhookAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdatePhoneWebhookOutcomeCallable updatePhoneWebhookCallable(const Model::UpdatePhoneWebhookRequest& request) const; diff --git a/cams/include/alibabacloud/cams/model/CreateChatappTemplateRequest.h b/cams/include/alibabacloud/cams/model/CreateChatappTemplateRequest.h index 279de9711..a84771606 100644 --- a/cams/include/alibabacloud/cams/model/CreateChatappTemplateRequest.h +++ b/cams/include/alibabacloud/cams/model/CreateChatappTemplateRequest.h @@ -45,6 +45,7 @@ public: std::string packageName; std::string autofillText; bool isOptOut; + std::string couponCode; }; ButtonsItem buttonsItem; std::vector buttons; @@ -53,6 +54,28 @@ public: std::string fileType; int codeExpirationMinutes; bool addSecretRecommendation; + bool hasExpiration; + struct CardsItem { + struct CardComponentsItem { + std::string type; + std::string format; + std::string text; + std::string url; + struct ButtonsItem { + std::string text; + std::string type; + std::string url; + std::string urlType; + std::string phoneNumber; + }; + ButtonsItem buttonsItem; + std::vector buttons; + }; + CardComponentsItem cardComponentsItem; + std::vector cardComponents; + }; + CardsItem cardsItem; + std::vector cards; }; CreateChatappTemplateRequest(); ~CreateChatappTemplateRequest(); diff --git a/cams/include/alibabacloud/cams/model/GetChatappTemplateDetailResult.h b/cams/include/alibabacloud/cams/model/GetChatappTemplateDetailResult.h index c905dbc43..53926737f 100644 --- a/cams/include/alibabacloud/cams/model/GetChatappTemplateDetailResult.h +++ b/cams/include/alibabacloud/cams/model/GetChatappTemplateDetailResult.h @@ -48,6 +48,7 @@ namespace AlibabaCloud }; std::string autofillText; std::string type; + std::string couponCode; bool isOptOut; std::string signatureHash; std::string packageName; @@ -57,12 +58,34 @@ namespace AlibabaCloud ExtendAttrs extendAttrs; std::string url; }; + struct 轮播卡片列表 + { + struct 卡片控件列表 + { + struct 卡片按钮列表 + { + std::string type; + std::string phoneNumber; + std::string text; + std::string urlType; + std::string url; + }; + std::string type; + std::string format; + std::string text; + std::string url; + std::vector<卡片控件列表::卡片按钮列表> buttons1; + }; + std::vector<轮播卡片列表::卡片控件列表> cardComponents; + }; + bool hasExpiration; std::string thumbUrl; std::string fileName; std::string text; int duration; std::string latitude; std::string longitude; + std::string offerExpirationTimeMs; std::string url; std::string caption; bool addSecretRecommendation; @@ -73,6 +96,7 @@ namespace AlibabaCloud std::string fileType; std::string locationAddress; std::vector buttons; + std::vector cards; }; std::vector components; std::string templateCode; diff --git a/cams/include/alibabacloud/cams/model/GetCommerceSettingRequest.h b/cams/include/alibabacloud/cams/model/GetCommerceSettingRequest.h new file mode 100644 index 000000000..3810cfc1c --- /dev/null +++ b/cams/include/alibabacloud/cams/model/GetCommerceSettingRequest.h @@ -0,0 +1,51 @@ +/* + * 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_CAMS_MODEL_GETCOMMERCESETTINGREQUEST_H_ +#define ALIBABACLOUD_CAMS_MODEL_GETCOMMERCESETTINGREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Cams { +namespace Model { +class ALIBABACLOUD_CAMS_EXPORT GetCommerceSettingRequest : public RpcServiceRequest { +public: + GetCommerceSettingRequest(); + ~GetCommerceSettingRequest(); + std::string getPhoneNumber() const; + void setPhoneNumber(const std::string &phoneNumber); + std::string getApiCode() const; + void setApiCode(const std::string &apiCode); + std::string getProdCode() const; + void setProdCode(const std::string &prodCode); + std::string getCustSpaceId() const; + void setCustSpaceId(const std::string &custSpaceId); + +private: + std::string phoneNumber_; + std::string apiCode_; + std::string prodCode_; + std::string custSpaceId_; +}; +} // namespace Model +} // namespace Cams +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CAMS_MODEL_GETCOMMERCESETTINGREQUEST_H_ diff --git a/cams/include/alibabacloud/cams/model/GetCommerceSettingResult.h b/cams/include/alibabacloud/cams/model/GetCommerceSettingResult.h new file mode 100644 index 000000000..c0b4a63a2 --- /dev/null +++ b/cams/include/alibabacloud/cams/model/GetCommerceSettingResult.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_CAMS_MODEL_GETCOMMERCESETTINGRESULT_H_ +#define ALIBABACLOUD_CAMS_MODEL_GETCOMMERCESETTINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Cams + { + namespace Model + { + class ALIBABACLOUD_CAMS_EXPORT GetCommerceSettingResult : public ServiceResult + { + public: + struct Data + { + bool cartEnable; + bool catalogVisible; + }; + + + GetCommerceSettingResult(); + explicit GetCommerceSettingResult(const std::string &payload); + ~GetCommerceSettingResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CAMS_MODEL_GETCOMMERCESETTINGRESULT_H_ \ No newline at end of file diff --git a/cams/include/alibabacloud/cams/model/ModifyChatappTemplateRequest.h b/cams/include/alibabacloud/cams/model/ModifyChatappTemplateRequest.h index d5c4944dc..2f79a4eeb 100644 --- a/cams/include/alibabacloud/cams/model/ModifyChatappTemplateRequest.h +++ b/cams/include/alibabacloud/cams/model/ModifyChatappTemplateRequest.h @@ -45,6 +45,7 @@ public: std::string packageName; std::string autofillText; bool isOptOut; + std::string couponCode; }; ButtonsItem buttonsItem; std::vector buttons; @@ -53,6 +54,28 @@ public: std::string fileType; int codeExpirationMinutes; bool addSecretRecommendation; + bool hasExpiration; + struct CardsItem { + struct CardComponentsItem { + std::string type; + std::string format; + std::string text; + std::string url; + struct ButtonsItem { + std::string text; + std::string type; + std::string url; + std::string urlType; + std::string phoneNumber; + }; + ButtonsItem buttonsItem; + std::vector buttons; + }; + CardComponentsItem cardComponentsItem; + std::vector cardComponents; + }; + CardsItem cardsItem; + std::vector cards; }; ModifyChatappTemplateRequest(); ~ModifyChatappTemplateRequest(); diff --git a/cams/include/alibabacloud/cams/model/UpdateCommerceSettingRequest.h b/cams/include/alibabacloud/cams/model/UpdateCommerceSettingRequest.h new file mode 100644 index 000000000..1880d1089 --- /dev/null +++ b/cams/include/alibabacloud/cams/model/UpdateCommerceSettingRequest.h @@ -0,0 +1,57 @@ +/* + * 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_CAMS_MODEL_UPDATECOMMERCESETTINGREQUEST_H_ +#define ALIBABACLOUD_CAMS_MODEL_UPDATECOMMERCESETTINGREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Cams { +namespace Model { +class ALIBABACLOUD_CAMS_EXPORT UpdateCommerceSettingRequest : public RpcServiceRequest { +public: + UpdateCommerceSettingRequest(); + ~UpdateCommerceSettingRequest(); + std::string getPhoneNumber() const; + void setPhoneNumber(const std::string &phoneNumber); + std::string getApiCode() const; + void setApiCode(const std::string &apiCode); + bool getCatalogVisible() const; + void setCatalogVisible(bool catalogVisible); + bool getCartEnable() const; + void setCartEnable(bool cartEnable); + std::string getProdCode() const; + void setProdCode(const std::string &prodCode); + std::string getCustSpaceId() const; + void setCustSpaceId(const std::string &custSpaceId); + +private: + std::string phoneNumber_; + std::string apiCode_; + bool catalogVisible_; + bool cartEnable_; + std::string prodCode_; + std::string custSpaceId_; +}; +} // namespace Model +} // namespace Cams +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CAMS_MODEL_UPDATECOMMERCESETTINGREQUEST_H_ diff --git a/cams/include/alibabacloud/cams/model/UpdateCommerceSettingResult.h b/cams/include/alibabacloud/cams/model/UpdateCommerceSettingResult.h new file mode 100644 index 000000000..13190a14d --- /dev/null +++ b/cams/include/alibabacloud/cams/model/UpdateCommerceSettingResult.h @@ -0,0 +1,53 @@ +/* + * 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_CAMS_MODEL_UPDATECOMMERCESETTINGRESULT_H_ +#define ALIBABACLOUD_CAMS_MODEL_UPDATECOMMERCESETTINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Cams + { + namespace Model + { + class ALIBABACLOUD_CAMS_EXPORT UpdateCommerceSettingResult : public ServiceResult + { + public: + + + UpdateCommerceSettingResult(); + explicit UpdateCommerceSettingResult(const std::string &payload); + ~UpdateCommerceSettingResult(); + std::string getMessage()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CAMS_MODEL_UPDATECOMMERCESETTINGRESULT_H_ \ No newline at end of file diff --git a/cams/src/CamsClient.cc b/cams/src/CamsClient.cc index a9501b2ce..cbecb19cc 100644 --- a/cams/src/CamsClient.cc +++ b/cams/src/CamsClient.cc @@ -31,21 +31,21 @@ CamsClient::CamsClient(const Credentials &credentials, const ClientConfiguration RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cams"); } CamsClient::CamsClient(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, ""); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cams"); } CamsClient::CamsClient(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, ""); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cams"); } CamsClient::~CamsClient() @@ -771,6 +771,42 @@ CamsClient::GetChatappVerifyCodeOutcomeCallable CamsClient::getChatappVerifyCode return task->get_future(); } +CamsClient::GetCommerceSettingOutcome CamsClient::getCommerceSetting(const GetCommerceSettingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetCommerceSettingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetCommerceSettingOutcome(GetCommerceSettingResult(outcome.result())); + else + return GetCommerceSettingOutcome(outcome.error()); +} + +void CamsClient::getCommerceSettingAsync(const GetCommerceSettingRequest& request, const GetCommerceSettingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getCommerceSetting(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CamsClient::GetCommerceSettingOutcomeCallable CamsClient::getCommerceSettingCallable(const GetCommerceSettingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getCommerceSetting(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CamsClient::GetMigrationVerifyCodeOutcome CamsClient::getMigrationVerifyCode(const GetMigrationVerifyCodeRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1419,6 +1455,42 @@ CamsClient::UpdateAccountWebhookOutcomeCallable CamsClient::updateAccountWebhook return task->get_future(); } +CamsClient::UpdateCommerceSettingOutcome CamsClient::updateCommerceSetting(const UpdateCommerceSettingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateCommerceSettingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateCommerceSettingOutcome(UpdateCommerceSettingResult(outcome.result())); + else + return UpdateCommerceSettingOutcome(outcome.error()); +} + +void CamsClient::updateCommerceSettingAsync(const UpdateCommerceSettingRequest& request, const UpdateCommerceSettingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateCommerceSetting(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CamsClient::UpdateCommerceSettingOutcomeCallable CamsClient::updateCommerceSettingCallable(const UpdateCommerceSettingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateCommerceSetting(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CamsClient::UpdatePhoneWebhookOutcome CamsClient::updatePhoneWebhook(const UpdatePhoneWebhookRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/cams/src/model/CreateChatappTemplateRequest.cc b/cams/src/model/CreateChatappTemplateRequest.cc index 9cbe724dc..92f34d9e2 100644 --- a/cams/src/model/CreateChatappTemplateRequest.cc +++ b/cams/src/model/CreateChatappTemplateRequest.cc @@ -48,12 +48,29 @@ void CreateChatappTemplateRequest::setComponents(const std::vector + +using AlibabaCloud::Cams::Model::GetCommerceSettingRequest; + +GetCommerceSettingRequest::GetCommerceSettingRequest() + : RpcServiceRequest("cams", "2020-06-06", "GetCommerceSetting") { + setMethod(HttpRequest::Method::Post); +} + +GetCommerceSettingRequest::~GetCommerceSettingRequest() {} + +std::string GetCommerceSettingRequest::getPhoneNumber() const { + return phoneNumber_; +} + +void GetCommerceSettingRequest::setPhoneNumber(const std::string &phoneNumber) { + phoneNumber_ = phoneNumber; + setParameter(std::string("PhoneNumber"), phoneNumber); +} + +std::string GetCommerceSettingRequest::getApiCode() const { + return apiCode_; +} + +void GetCommerceSettingRequest::setApiCode(const std::string &apiCode) { + apiCode_ = apiCode; + setParameter(std::string("ApiCode"), apiCode); +} + +std::string GetCommerceSettingRequest::getProdCode() const { + return prodCode_; +} + +void GetCommerceSettingRequest::setProdCode(const std::string &prodCode) { + prodCode_ = prodCode; + setParameter(std::string("ProdCode"), prodCode); +} + +std::string GetCommerceSettingRequest::getCustSpaceId() const { + return custSpaceId_; +} + +void GetCommerceSettingRequest::setCustSpaceId(const std::string &custSpaceId) { + custSpaceId_ = custSpaceId; + setParameter(std::string("CustSpaceId"), custSpaceId); +} + diff --git a/cams/src/model/GetCommerceSettingResult.cc b/cams/src/model/GetCommerceSettingResult.cc new file mode 100644 index 000000000..dcf64e09b --- /dev/null +++ b/cams/src/model/GetCommerceSettingResult.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::Cams; +using namespace AlibabaCloud::Cams::Model; + +GetCommerceSettingResult::GetCommerceSettingResult() : + ServiceResult() +{} + +GetCommerceSettingResult::GetCommerceSettingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetCommerceSettingResult::~GetCommerceSettingResult() +{} + +void GetCommerceSettingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["CartEnable"].isNull()) + data_.cartEnable = dataNode["CartEnable"].asString() == "true"; + if(!dataNode["CatalogVisible"].isNull()) + data_.catalogVisible = dataNode["CatalogVisible"].asString() == "true"; + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetCommerceSettingResult::getMessage()const +{ + return message_; +} + +GetCommerceSettingResult::Data GetCommerceSettingResult::getData()const +{ + return data_; +} + +std::string GetCommerceSettingResult::getCode()const +{ + return code_; +} + diff --git a/cams/src/model/ModifyChatappTemplateRequest.cc b/cams/src/model/ModifyChatappTemplateRequest.cc index 29bed50f5..12e75b505 100644 --- a/cams/src/model/ModifyChatappTemplateRequest.cc +++ b/cams/src/model/ModifyChatappTemplateRequest.cc @@ -48,12 +48,29 @@ void ModifyChatappTemplateRequest::setComponents(const std::vector + +using AlibabaCloud::Cams::Model::UpdateCommerceSettingRequest; + +UpdateCommerceSettingRequest::UpdateCommerceSettingRequest() + : RpcServiceRequest("cams", "2020-06-06", "UpdateCommerceSetting") { + setMethod(HttpRequest::Method::Post); +} + +UpdateCommerceSettingRequest::~UpdateCommerceSettingRequest() {} + +std::string UpdateCommerceSettingRequest::getPhoneNumber() const { + return phoneNumber_; +} + +void UpdateCommerceSettingRequest::setPhoneNumber(const std::string &phoneNumber) { + phoneNumber_ = phoneNumber; + setParameter(std::string("PhoneNumber"), phoneNumber); +} + +std::string UpdateCommerceSettingRequest::getApiCode() const { + return apiCode_; +} + +void UpdateCommerceSettingRequest::setApiCode(const std::string &apiCode) { + apiCode_ = apiCode; + setParameter(std::string("ApiCode"), apiCode); +} + +bool UpdateCommerceSettingRequest::getCatalogVisible() const { + return catalogVisible_; +} + +void UpdateCommerceSettingRequest::setCatalogVisible(bool catalogVisible) { + catalogVisible_ = catalogVisible; + setParameter(std::string("CatalogVisible"), catalogVisible ? "true" : "false"); +} + +bool UpdateCommerceSettingRequest::getCartEnable() const { + return cartEnable_; +} + +void UpdateCommerceSettingRequest::setCartEnable(bool cartEnable) { + cartEnable_ = cartEnable; + setParameter(std::string("CartEnable"), cartEnable ? "true" : "false"); +} + +std::string UpdateCommerceSettingRequest::getProdCode() const { + return prodCode_; +} + +void UpdateCommerceSettingRequest::setProdCode(const std::string &prodCode) { + prodCode_ = prodCode; + setParameter(std::string("ProdCode"), prodCode); +} + +std::string UpdateCommerceSettingRequest::getCustSpaceId() const { + return custSpaceId_; +} + +void UpdateCommerceSettingRequest::setCustSpaceId(const std::string &custSpaceId) { + custSpaceId_ = custSpaceId; + setParameter(std::string("CustSpaceId"), custSpaceId); +} + diff --git a/cams/src/model/UpdateCommerceSettingResult.cc b/cams/src/model/UpdateCommerceSettingResult.cc new file mode 100644 index 000000000..6f1563786 --- /dev/null +++ b/cams/src/model/UpdateCommerceSettingResult.cc @@ -0,0 +1,58 @@ +/* + * 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::Cams; +using namespace AlibabaCloud::Cams::Model; + +UpdateCommerceSettingResult::UpdateCommerceSettingResult() : + ServiceResult() +{} + +UpdateCommerceSettingResult::UpdateCommerceSettingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateCommerceSettingResult::~UpdateCommerceSettingResult() +{} + +void UpdateCommerceSettingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string UpdateCommerceSettingResult::getMessage()const +{ + return message_; +} + +std::string UpdateCommerceSettingResult::getCode()const +{ + return code_; +} +