From 357519c7f62740d0eee328747dc109f5cd3d2c74 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 2 Dec 2020 09:17:21 +0000 Subject: [PATCH] Support TemplateContent. --- CHANGELOG | 3 + oos/CMakeLists.txt | 8 ++ oos/include/alibabacloud/oos/OosClient.h | 16 ++++ .../oos/model/GetServiceSettingsRequest.h | 45 ++++++++++ .../oos/model/GetServiceSettingsResult.h | 59 +++++++++++++ .../oos/model/SetServiceSettingsRequest.h | 60 +++++++++++++ .../oos/model/SetServiceSettingsResult.h | 59 +++++++++++++ .../oos/model/StartExecutionRequest.h | 3 + oos/src/OosClient.cc | 72 ++++++++++++++++ oos/src/model/GetInventorySchemaResult.cc | 12 +-- oos/src/model/GetServiceSettingsRequest.cc | 29 +++++++ oos/src/model/GetServiceSettingsResult.cc | 65 ++++++++++++++ oos/src/model/ListExecutionsResult.cc | 16 ++-- oos/src/model/SetServiceSettingsRequest.cc | 84 +++++++++++++++++++ oos/src/model/SetServiceSettingsResult.cc | 65 ++++++++++++++ oos/src/model/StartExecutionRequest.cc | 11 +++ 16 files changed, 593 insertions(+), 14 deletions(-) create mode 100644 oos/include/alibabacloud/oos/model/GetServiceSettingsRequest.h create mode 100644 oos/include/alibabacloud/oos/model/GetServiceSettingsResult.h create mode 100644 oos/include/alibabacloud/oos/model/SetServiceSettingsRequest.h create mode 100644 oos/include/alibabacloud/oos/model/SetServiceSettingsResult.h create mode 100644 oos/src/model/GetServiceSettingsRequest.cc create mode 100644 oos/src/model/GetServiceSettingsResult.cc create mode 100644 oos/src/model/SetServiceSettingsRequest.cc create mode 100644 oos/src/model/SetServiceSettingsResult.cc diff --git a/CHANGELOG b/CHANGELOG index 632a1b842..5ff003784 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-12-02 Version: patch +- Support TemplateContent. + 2020-12-02 Version: patch - Supported OpenAPI for SDK. diff --git a/oos/CMakeLists.txt b/oos/CMakeLists.txt index fda65d820..d31269404 100644 --- a/oos/CMakeLists.txt +++ b/oos/CMakeLists.txt @@ -59,6 +59,8 @@ set(oos_public_header_model include/alibabacloud/oos/model/GetSecretParametersResult.h include/alibabacloud/oos/model/GetSecretParametersByPathRequest.h include/alibabacloud/oos/model/GetSecretParametersByPathResult.h + include/alibabacloud/oos/model/GetServiceSettingsRequest.h + include/alibabacloud/oos/model/GetServiceSettingsResult.h include/alibabacloud/oos/model/GetTemplateRequest.h include/alibabacloud/oos/model/GetTemplateResult.h include/alibabacloud/oos/model/ListActionsRequest.h @@ -97,6 +99,8 @@ set(oos_public_header_model include/alibabacloud/oos/model/NotifyExecutionResult.h include/alibabacloud/oos/model/SearchInventoryRequest.h include/alibabacloud/oos/model/SearchInventoryResult.h + include/alibabacloud/oos/model/SetServiceSettingsRequest.h + include/alibabacloud/oos/model/SetServiceSettingsResult.h include/alibabacloud/oos/model/StartExecutionRequest.h include/alibabacloud/oos/model/StartExecutionResult.h include/alibabacloud/oos/model/TagResourcesRequest.h @@ -158,6 +162,8 @@ set(oos_src src/model/GetSecretParametersResult.cc src/model/GetSecretParametersByPathRequest.cc src/model/GetSecretParametersByPathResult.cc + src/model/GetServiceSettingsRequest.cc + src/model/GetServiceSettingsResult.cc src/model/GetTemplateRequest.cc src/model/GetTemplateResult.cc src/model/ListActionsRequest.cc @@ -196,6 +202,8 @@ set(oos_src src/model/NotifyExecutionResult.cc src/model/SearchInventoryRequest.cc src/model/SearchInventoryResult.cc + src/model/SetServiceSettingsRequest.cc + src/model/SetServiceSettingsResult.cc src/model/StartExecutionRequest.cc src/model/StartExecutionResult.cc src/model/TagResourcesRequest.cc diff --git a/oos/include/alibabacloud/oos/OosClient.h b/oos/include/alibabacloud/oos/OosClient.h index f84b638d0..bbf4a58ad 100644 --- a/oos/include/alibabacloud/oos/OosClient.h +++ b/oos/include/alibabacloud/oos/OosClient.h @@ -60,6 +60,8 @@ #include "model/GetSecretParametersResult.h" #include "model/GetSecretParametersByPathRequest.h" #include "model/GetSecretParametersByPathResult.h" +#include "model/GetServiceSettingsRequest.h" +#include "model/GetServiceSettingsResult.h" #include "model/GetTemplateRequest.h" #include "model/GetTemplateResult.h" #include "model/ListActionsRequest.h" @@ -98,6 +100,8 @@ #include "model/NotifyExecutionResult.h" #include "model/SearchInventoryRequest.h" #include "model/SearchInventoryResult.h" +#include "model/SetServiceSettingsRequest.h" +#include "model/SetServiceSettingsResult.h" #include "model/StartExecutionRequest.h" #include "model/StartExecutionResult.h" #include "model/TagResourcesRequest.h" @@ -184,6 +188,9 @@ namespace AlibabaCloud typedef Outcome GetSecretParametersByPathOutcome; typedef std::future GetSecretParametersByPathOutcomeCallable; typedef std::function&)> GetSecretParametersByPathAsyncHandler; + typedef Outcome GetServiceSettingsOutcome; + typedef std::future GetServiceSettingsOutcomeCallable; + typedef std::function&)> GetServiceSettingsAsyncHandler; typedef Outcome GetTemplateOutcome; typedef std::future GetTemplateOutcomeCallable; typedef std::function&)> GetTemplateAsyncHandler; @@ -241,6 +248,9 @@ namespace AlibabaCloud typedef Outcome SearchInventoryOutcome; typedef std::future SearchInventoryOutcomeCallable; typedef std::function&)> SearchInventoryAsyncHandler; + typedef Outcome SetServiceSettingsOutcome; + typedef std::future SetServiceSettingsOutcomeCallable; + typedef std::function&)> SetServiceSettingsAsyncHandler; typedef Outcome StartExecutionOutcome; typedef std::future StartExecutionOutcomeCallable; typedef std::function&)> StartExecutionAsyncHandler; @@ -333,6 +343,9 @@ namespace AlibabaCloud GetSecretParametersByPathOutcome getSecretParametersByPath(const Model::GetSecretParametersByPathRequest &request)const; void getSecretParametersByPathAsync(const Model::GetSecretParametersByPathRequest& request, const GetSecretParametersByPathAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetSecretParametersByPathOutcomeCallable getSecretParametersByPathCallable(const Model::GetSecretParametersByPathRequest& request) const; + GetServiceSettingsOutcome getServiceSettings(const Model::GetServiceSettingsRequest &request)const; + void getServiceSettingsAsync(const Model::GetServiceSettingsRequest& request, const GetServiceSettingsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetServiceSettingsOutcomeCallable getServiceSettingsCallable(const Model::GetServiceSettingsRequest& request) const; GetTemplateOutcome getTemplate(const Model::GetTemplateRequest &request)const; void getTemplateAsync(const Model::GetTemplateRequest& request, const GetTemplateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetTemplateOutcomeCallable getTemplateCallable(const Model::GetTemplateRequest& request) const; @@ -390,6 +403,9 @@ namespace AlibabaCloud SearchInventoryOutcome searchInventory(const Model::SearchInventoryRequest &request)const; void searchInventoryAsync(const Model::SearchInventoryRequest& request, const SearchInventoryAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchInventoryOutcomeCallable searchInventoryCallable(const Model::SearchInventoryRequest& request) const; + SetServiceSettingsOutcome setServiceSettings(const Model::SetServiceSettingsRequest &request)const; + void setServiceSettingsAsync(const Model::SetServiceSettingsRequest& request, const SetServiceSettingsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SetServiceSettingsOutcomeCallable setServiceSettingsCallable(const Model::SetServiceSettingsRequest& request) const; StartExecutionOutcome startExecution(const Model::StartExecutionRequest &request)const; void startExecutionAsync(const Model::StartExecutionRequest& request, const StartExecutionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; StartExecutionOutcomeCallable startExecutionCallable(const Model::StartExecutionRequest& request) const; diff --git a/oos/include/alibabacloud/oos/model/GetServiceSettingsRequest.h b/oos/include/alibabacloud/oos/model/GetServiceSettingsRequest.h new file mode 100644 index 000000000..4cf6002c5 --- /dev/null +++ b/oos/include/alibabacloud/oos/model/GetServiceSettingsRequest.h @@ -0,0 +1,45 @@ +/* + * 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_OOS_MODEL_GETSERVICESETTINGSREQUEST_H_ +#define ALIBABACLOUD_OOS_MODEL_GETSERVICESETTINGSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Oos + { + namespace Model + { + class ALIBABACLOUD_OOS_EXPORT GetServiceSettingsRequest : public RpcServiceRequest + { + + public: + GetServiceSettingsRequest(); + ~GetServiceSettingsRequest(); + + + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_OOS_MODEL_GETSERVICESETTINGSREQUEST_H_ \ No newline at end of file diff --git a/oos/include/alibabacloud/oos/model/GetServiceSettingsResult.h b/oos/include/alibabacloud/oos/model/GetServiceSettingsResult.h new file mode 100644 index 000000000..3ba97bb30 --- /dev/null +++ b/oos/include/alibabacloud/oos/model/GetServiceSettingsResult.h @@ -0,0 +1,59 @@ +/* + * 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_OOS_MODEL_GETSERVICESETTINGSRESULT_H_ +#define ALIBABACLOUD_OOS_MODEL_GETSERVICESETTINGSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Oos + { + namespace Model + { + class ALIBABACLOUD_OOS_EXPORT GetServiceSettingsResult : public ServiceResult + { + public: + struct ServiceSetting + { + bool deliverySlsEnabled; + std::string deliveryOssKeyPrefix; + bool deliveryOssEnabled; + std::string deliveryOssBucketName; + std::string deliverySlsProjectName; + }; + + + GetServiceSettingsResult(); + explicit GetServiceSettingsResult(const std::string &payload); + ~GetServiceSettingsResult(); + std::vector getServiceSettings()const; + + protected: + void parse(const std::string &payload); + private: + std::vector serviceSettings_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OOS_MODEL_GETSERVICESETTINGSRESULT_H_ \ No newline at end of file diff --git a/oos/include/alibabacloud/oos/model/SetServiceSettingsRequest.h b/oos/include/alibabacloud/oos/model/SetServiceSettingsRequest.h new file mode 100644 index 000000000..17454c16f --- /dev/null +++ b/oos/include/alibabacloud/oos/model/SetServiceSettingsRequest.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_OOS_MODEL_SETSERVICESETTINGSREQUEST_H_ +#define ALIBABACLOUD_OOS_MODEL_SETSERVICESETTINGSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Oos + { + namespace Model + { + class ALIBABACLOUD_OOS_EXPORT SetServiceSettingsRequest : public RpcServiceRequest + { + + public: + SetServiceSettingsRequest(); + ~SetServiceSettingsRequest(); + + bool getDeliverySlsEnabled()const; + void setDeliverySlsEnabled(bool deliverySlsEnabled); + std::string getDeliveryOssKeyPrefix()const; + void setDeliveryOssKeyPrefix(const std::string& deliveryOssKeyPrefix); + bool getDeliveryOssEnabled()const; + void setDeliveryOssEnabled(bool deliveryOssEnabled); + std::string getDeliverySlsProjectName()const; + void setDeliverySlsProjectName(const std::string& deliverySlsProjectName); + std::string getDeliveryOssBucketName()const; + void setDeliveryOssBucketName(const std::string& deliveryOssBucketName); + + private: + bool deliverySlsEnabled_; + std::string deliveryOssKeyPrefix_; + bool deliveryOssEnabled_; + std::string deliverySlsProjectName_; + std::string deliveryOssBucketName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OOS_MODEL_SETSERVICESETTINGSREQUEST_H_ \ No newline at end of file diff --git a/oos/include/alibabacloud/oos/model/SetServiceSettingsResult.h b/oos/include/alibabacloud/oos/model/SetServiceSettingsResult.h new file mode 100644 index 000000000..227d0de0f --- /dev/null +++ b/oos/include/alibabacloud/oos/model/SetServiceSettingsResult.h @@ -0,0 +1,59 @@ +/* + * 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_OOS_MODEL_SETSERVICESETTINGSRESULT_H_ +#define ALIBABACLOUD_OOS_MODEL_SETSERVICESETTINGSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Oos + { + namespace Model + { + class ALIBABACLOUD_OOS_EXPORT SetServiceSettingsResult : public ServiceResult + { + public: + struct ServiceSetting + { + bool deliverySlsEnabled; + std::string deliveryOssKeyPrefix; + bool deliveryOssEnabled; + std::string deliveryOssBucketName; + std::string deliverySlsProjectName; + }; + + + SetServiceSettingsResult(); + explicit SetServiceSettingsResult(const std::string &payload); + ~SetServiceSettingsResult(); + std::vector getServiceSettings()const; + + protected: + void parse(const std::string &payload); + private: + std::vector serviceSettings_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OOS_MODEL_SETSERVICESETTINGSRESULT_H_ \ No newline at end of file diff --git a/oos/include/alibabacloud/oos/model/StartExecutionRequest.h b/oos/include/alibabacloud/oos/model/StartExecutionRequest.h index e9205c18f..75614fc0a 100644 --- a/oos/include/alibabacloud/oos/model/StartExecutionRequest.h +++ b/oos/include/alibabacloud/oos/model/StartExecutionRequest.h @@ -53,6 +53,8 @@ namespace AlibabaCloud void setSafetyCheck(const std::string& safetyCheck); std::map getTags()const; void setTags(const std::map& tags); + std::string getTemplateContent()const; + void setTemplateContent(const std::string& templateContent); std::string getParentExecutionId()const; void setParentExecutionId(const std::string& parentExecutionId); std::string getParameters()const; @@ -68,6 +70,7 @@ namespace AlibabaCloud std::string loopMode_; std::string safetyCheck_; std::map tags_; + std::string templateContent_; std::string parentExecutionId_; std::string parameters_; diff --git a/oos/src/OosClient.cc b/oos/src/OosClient.cc index 5b34ab932..7768608fd 100644 --- a/oos/src/OosClient.cc +++ b/oos/src/OosClient.cc @@ -735,6 +735,42 @@ OosClient::GetSecretParametersByPathOutcomeCallable OosClient::getSecretParamete return task->get_future(); } +OosClient::GetServiceSettingsOutcome OosClient::getServiceSettings(const GetServiceSettingsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetServiceSettingsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetServiceSettingsOutcome(GetServiceSettingsResult(outcome.result())); + else + return GetServiceSettingsOutcome(outcome.error()); +} + +void OosClient::getServiceSettingsAsync(const GetServiceSettingsRequest& request, const GetServiceSettingsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getServiceSettings(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OosClient::GetServiceSettingsOutcomeCallable OosClient::getServiceSettingsCallable(const GetServiceSettingsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getServiceSettings(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OosClient::GetTemplateOutcome OosClient::getTemplate(const GetTemplateRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1419,6 +1455,42 @@ OosClient::SearchInventoryOutcomeCallable OosClient::searchInventoryCallable(con return task->get_future(); } +OosClient::SetServiceSettingsOutcome OosClient::setServiceSettings(const SetServiceSettingsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SetServiceSettingsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SetServiceSettingsOutcome(SetServiceSettingsResult(outcome.result())); + else + return SetServiceSettingsOutcome(outcome.error()); +} + +void OosClient::setServiceSettingsAsync(const SetServiceSettingsRequest& request, const SetServiceSettingsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, setServiceSettings(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OosClient::SetServiceSettingsOutcomeCallable OosClient::setServiceSettingsCallable(const SetServiceSettingsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->setServiceSettings(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OosClient::StartExecutionOutcome OosClient::startExecution(const StartExecutionRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/oos/src/model/GetInventorySchemaResult.cc b/oos/src/model/GetInventorySchemaResult.cc index 2cb37370e..cf30619f4 100644 --- a/oos/src/model/GetInventorySchemaResult.cc +++ b/oos/src/model/GetInventorySchemaResult.cc @@ -47,14 +47,14 @@ void GetInventorySchemaResult::parse(const std::string &payload) schemasObject.typeName = valueSchemasSchema["TypeName"].asString(); if(!valueSchemasSchema["Version"].isNull()) schemasObject.version = valueSchemasSchema["Version"].asString(); - auto allAttributesNode = allSchemasNode["Attributes"]["Attribute"]; - for (auto allSchemasNodeAttributesAttribute : allAttributesNode) + auto allAttributesNode = valueSchemasSchema["Attributes"]["Attribute"]; + for (auto valueSchemasSchemaAttributesAttribute : allAttributesNode) { Schema::Attribute attributesObject; - if(!allSchemasNodeAttributesAttribute["Name"].isNull()) - attributesObject.name = allSchemasNodeAttributesAttribute["Name"].asString(); - if(!allSchemasNodeAttributesAttribute["DataType"].isNull()) - attributesObject.dataType = allSchemasNodeAttributesAttribute["DataType"].asString(); + if(!valueSchemasSchemaAttributesAttribute["Name"].isNull()) + attributesObject.name = valueSchemasSchemaAttributesAttribute["Name"].asString(); + if(!valueSchemasSchemaAttributesAttribute["DataType"].isNull()) + attributesObject.dataType = valueSchemasSchemaAttributesAttribute["DataType"].asString(); schemasObject.attributes.push_back(attributesObject); } schemas_.push_back(schemasObject); diff --git a/oos/src/model/GetServiceSettingsRequest.cc b/oos/src/model/GetServiceSettingsRequest.cc new file mode 100644 index 000000000..6c9c2ecf9 --- /dev/null +++ b/oos/src/model/GetServiceSettingsRequest.cc @@ -0,0 +1,29 @@ +/* + * 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::Oos::Model::GetServiceSettingsRequest; + +GetServiceSettingsRequest::GetServiceSettingsRequest() : + RpcServiceRequest("oos", "2019-06-01", "GetServiceSettings") +{ + setMethod(HttpRequest::Method::Post); +} + +GetServiceSettingsRequest::~GetServiceSettingsRequest() +{} + diff --git a/oos/src/model/GetServiceSettingsResult.cc b/oos/src/model/GetServiceSettingsResult.cc new file mode 100644 index 000000000..32deb91a4 --- /dev/null +++ b/oos/src/model/GetServiceSettingsResult.cc @@ -0,0 +1,65 @@ +/* + * 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::Oos; +using namespace AlibabaCloud::Oos::Model; + +GetServiceSettingsResult::GetServiceSettingsResult() : + ServiceResult() +{} + +GetServiceSettingsResult::GetServiceSettingsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetServiceSettingsResult::~GetServiceSettingsResult() +{} + +void GetServiceSettingsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allServiceSettingsNode = value["ServiceSettings"]["ServiceSetting"]; + for (auto valueServiceSettingsServiceSetting : allServiceSettingsNode) + { + ServiceSetting serviceSettingsObject; + if(!valueServiceSettingsServiceSetting["DeliveryOssEnabled"].isNull()) + serviceSettingsObject.deliveryOssEnabled = valueServiceSettingsServiceSetting["DeliveryOssEnabled"].asString() == "true"; + if(!valueServiceSettingsServiceSetting["DeliveryOssBucketName"].isNull()) + serviceSettingsObject.deliveryOssBucketName = valueServiceSettingsServiceSetting["DeliveryOssBucketName"].asString(); + if(!valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].isNull()) + serviceSettingsObject.deliveryOssKeyPrefix = valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].asString(); + if(!valueServiceSettingsServiceSetting["DeliverySlsEnabled"].isNull()) + serviceSettingsObject.deliverySlsEnabled = valueServiceSettingsServiceSetting["DeliverySlsEnabled"].asString() == "true"; + if(!valueServiceSettingsServiceSetting["DeliverySlsProjectName"].isNull()) + serviceSettingsObject.deliverySlsProjectName = valueServiceSettingsServiceSetting["DeliverySlsProjectName"].asString(); + serviceSettings_.push_back(serviceSettingsObject); + } + +} + +std::vector GetServiceSettingsResult::getServiceSettings()const +{ + return serviceSettings_; +} + diff --git a/oos/src/model/ListExecutionsResult.cc b/oos/src/model/ListExecutionsResult.cc index 78518d065..1f87f2c64 100644 --- a/oos/src/model/ListExecutionsResult.cc +++ b/oos/src/model/ListExecutionsResult.cc @@ -101,16 +101,16 @@ void ListExecutionsResult::parse(const std::string &payload) executionsObject.lastSuccessfulTriggerTime = valueExecutionsExecution["LastSuccessfulTriggerTime"].asString(); if(!valueExecutionsExecution["ResourceStatus"].isNull()) executionsObject.resourceStatus = valueExecutionsExecution["ResourceStatus"].asString(); - auto allCurrentTasksNode = allExecutionsNode["CurrentTasks"]["CurrentTask"]; - for (auto allExecutionsNodeCurrentTasksCurrentTask : allCurrentTasksNode) + auto allCurrentTasksNode = valueExecutionsExecution["CurrentTasks"]["CurrentTask"]; + for (auto valueExecutionsExecutionCurrentTasksCurrentTask : allCurrentTasksNode) { Execution::CurrentTask currentTasksObject; - if(!allExecutionsNodeCurrentTasksCurrentTask["TaskExecutionId"].isNull()) - currentTasksObject.taskExecutionId = allExecutionsNodeCurrentTasksCurrentTask["TaskExecutionId"].asString(); - if(!allExecutionsNodeCurrentTasksCurrentTask["TaskName"].isNull()) - currentTasksObject.taskName = allExecutionsNodeCurrentTasksCurrentTask["TaskName"].asString(); - if(!allExecutionsNodeCurrentTasksCurrentTask["TaskAction"].isNull()) - currentTasksObject.taskAction = allExecutionsNodeCurrentTasksCurrentTask["TaskAction"].asString(); + if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskExecutionId"].isNull()) + currentTasksObject.taskExecutionId = valueExecutionsExecutionCurrentTasksCurrentTask["TaskExecutionId"].asString(); + if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskName"].isNull()) + currentTasksObject.taskName = valueExecutionsExecutionCurrentTasksCurrentTask["TaskName"].asString(); + if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskAction"].isNull()) + currentTasksObject.taskAction = valueExecutionsExecutionCurrentTasksCurrentTask["TaskAction"].asString(); executionsObject.currentTasks.push_back(currentTasksObject); } executions_.push_back(executionsObject); diff --git a/oos/src/model/SetServiceSettingsRequest.cc b/oos/src/model/SetServiceSettingsRequest.cc new file mode 100644 index 000000000..98da1e916 --- /dev/null +++ b/oos/src/model/SetServiceSettingsRequest.cc @@ -0,0 +1,84 @@ +/* + * 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::Oos::Model::SetServiceSettingsRequest; + +SetServiceSettingsRequest::SetServiceSettingsRequest() : + RpcServiceRequest("oos", "2019-06-01", "SetServiceSettings") +{ + setMethod(HttpRequest::Method::Post); +} + +SetServiceSettingsRequest::~SetServiceSettingsRequest() +{} + +bool SetServiceSettingsRequest::getDeliverySlsEnabled()const +{ + return deliverySlsEnabled_; +} + +void SetServiceSettingsRequest::setDeliverySlsEnabled(bool deliverySlsEnabled) +{ + deliverySlsEnabled_ = deliverySlsEnabled; + setParameter("DeliverySlsEnabled", deliverySlsEnabled ? "true" : "false"); +} + +std::string SetServiceSettingsRequest::getDeliveryOssKeyPrefix()const +{ + return deliveryOssKeyPrefix_; +} + +void SetServiceSettingsRequest::setDeliveryOssKeyPrefix(const std::string& deliveryOssKeyPrefix) +{ + deliveryOssKeyPrefix_ = deliveryOssKeyPrefix; + setParameter("DeliveryOssKeyPrefix", deliveryOssKeyPrefix); +} + +bool SetServiceSettingsRequest::getDeliveryOssEnabled()const +{ + return deliveryOssEnabled_; +} + +void SetServiceSettingsRequest::setDeliveryOssEnabled(bool deliveryOssEnabled) +{ + deliveryOssEnabled_ = deliveryOssEnabled; + setParameter("DeliveryOssEnabled", deliveryOssEnabled ? "true" : "false"); +} + +std::string SetServiceSettingsRequest::getDeliverySlsProjectName()const +{ + return deliverySlsProjectName_; +} + +void SetServiceSettingsRequest::setDeliverySlsProjectName(const std::string& deliverySlsProjectName) +{ + deliverySlsProjectName_ = deliverySlsProjectName; + setParameter("DeliverySlsProjectName", deliverySlsProjectName); +} + +std::string SetServiceSettingsRequest::getDeliveryOssBucketName()const +{ + return deliveryOssBucketName_; +} + +void SetServiceSettingsRequest::setDeliveryOssBucketName(const std::string& deliveryOssBucketName) +{ + deliveryOssBucketName_ = deliveryOssBucketName; + setParameter("DeliveryOssBucketName", deliveryOssBucketName); +} + diff --git a/oos/src/model/SetServiceSettingsResult.cc b/oos/src/model/SetServiceSettingsResult.cc new file mode 100644 index 000000000..5ba865261 --- /dev/null +++ b/oos/src/model/SetServiceSettingsResult.cc @@ -0,0 +1,65 @@ +/* + * 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::Oos; +using namespace AlibabaCloud::Oos::Model; + +SetServiceSettingsResult::SetServiceSettingsResult() : + ServiceResult() +{} + +SetServiceSettingsResult::SetServiceSettingsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SetServiceSettingsResult::~SetServiceSettingsResult() +{} + +void SetServiceSettingsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allServiceSettingsNode = value["ServiceSettings"]["ServiceSetting"]; + for (auto valueServiceSettingsServiceSetting : allServiceSettingsNode) + { + ServiceSetting serviceSettingsObject; + if(!valueServiceSettingsServiceSetting["DeliveryOssEnabled"].isNull()) + serviceSettingsObject.deliveryOssEnabled = valueServiceSettingsServiceSetting["DeliveryOssEnabled"].asString() == "true"; + if(!valueServiceSettingsServiceSetting["DeliveryOssBucketName"].isNull()) + serviceSettingsObject.deliveryOssBucketName = valueServiceSettingsServiceSetting["DeliveryOssBucketName"].asString(); + if(!valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].isNull()) + serviceSettingsObject.deliveryOssKeyPrefix = valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].asString(); + if(!valueServiceSettingsServiceSetting["DeliverySlsEnabled"].isNull()) + serviceSettingsObject.deliverySlsEnabled = valueServiceSettingsServiceSetting["DeliverySlsEnabled"].asString() == "true"; + if(!valueServiceSettingsServiceSetting["DeliverySlsProjectName"].isNull()) + serviceSettingsObject.deliverySlsProjectName = valueServiceSettingsServiceSetting["DeliverySlsProjectName"].asString(); + serviceSettings_.push_back(serviceSettingsObject); + } + +} + +std::vector SetServiceSettingsResult::getServiceSettings()const +{ + return serviceSettings_; +} + diff --git a/oos/src/model/StartExecutionRequest.cc b/oos/src/model/StartExecutionRequest.cc index d80152a2b..c74fbe951 100644 --- a/oos/src/model/StartExecutionRequest.cc +++ b/oos/src/model/StartExecutionRequest.cc @@ -126,6 +126,17 @@ void StartExecutionRequest::setTags(const std::map& ta setJsonParameters("Tags", tags); } +std::string StartExecutionRequest::getTemplateContent()const +{ + return templateContent_; +} + +void StartExecutionRequest::setTemplateContent(const std::string& templateContent) +{ + templateContent_ = templateContent; + setParameter("TemplateContent", templateContent); +} + std::string StartExecutionRequest::getParentExecutionId()const { return parentExecutionId_;