From e5f1044f1245613182e2356d8770f7203acedc2e Mon Sep 17 00:00:00 2001 From: Huaweicloud-SDK Date: Thu, 7 Nov 2024 16:29:26 +0800 Subject: [PATCH] release 3.1.109 source code --- CHANGELOG.md | 72 +++++++ CHANGELOG_CN.md | 72 +++++++ VERSION | 2 +- aad/include/huaweicloud/aad/v2/AadClient.h | 26 ++- aad/include/huaweicloud/aad/v2/AadMeta.h | 2 +- .../aad/v2/model/UpgradeInstanceData.h | 22 +++ aad/src/v2/AadClient.cpp | 82 ++++---- aad/src/v2/AadMeta.cpp | 18 +- aad/src/v2/model/UpgradeInstanceData.cpp | 70 +++++++ .../v3/GaussDBforNoSQLClient.h | 11 ++ .../gaussdbfornosql/v3/GaussDBforNoSQLMeta.h | 1 + .../BatchUpgradeDatabaseVersionRequest.h | 71 +++++++ .../BatchUpgradeDatabaseVersionRequestBody.h | 65 +++++++ .../BatchUpgradeDatabaseVersionResponse.h | 68 +++++++ .../gaussdbfornosql/v3/model/UpgradeResult.h | 97 +++++++++ .../src/v3/GaussDBforNoSQLClient.cpp | 41 ++++ .../src/v3/GaussDBforNoSQLMeta.cpp | 9 + .../BatchUpgradeDatabaseVersionRequest.cpp | 78 ++++++++ ...BatchUpgradeDatabaseVersionRequestBody.cpp | 78 ++++++++ .../BatchUpgradeDatabaseVersionResponse.cpp | 78 ++++++++ .../src/v3/model/UpgradeResult.cpp | 184 ++++++++++++++++++ kvs/include/huaweicloud/kvs/v1/KvsClient.h | 13 ++ kvs/include/huaweicloud/kvs/v1/KvsMeta.h | 1 + .../kvs/v1/model/CheckHealthRequest.h | 74 +++++++ .../kvs/v1/model/CheckHealthRequestBody.h | 66 +++++++ .../kvs/v1/model/CheckHealthResponse.h | 58 ++++++ .../kvs/v1/model/CreateTableRequestBody.h | 12 ++ .../kvs/v1/model/DescribeTableResponse.h | 12 ++ .../huaweicloud/kvs/v1/model/Ttl_options.h | 89 +++++++++ kvs/src/v1/KvsClient.cpp | 43 ++++ kvs/src/v1/KvsMeta.cpp | 9 + kvs/src/v1/model/CheckHealthRequest.cpp | 84 ++++++++ kvs/src/v1/model/CheckHealthRequestBody.cpp | 85 ++++++++ kvs/src/v1/model/CheckHealthResponse.cpp | 50 +++++ kvs/src/v1/model/CreateTableRequestBody.cpp | 34 ++++ kvs/src/v1/model/DescribeTableResponse.cpp | 34 ++++ kvs/src/v1/model/Ttl_options.cpp | 155 +++++++++++++++ .../mpc/v1/model/CreateExtractTaskReq.h | 12 ++ .../mpc/v1/model/VideoParameters.h | 23 +++ mpc/src/v1/model/CreateExtractTaskReq.cpp | 34 ++++ mpc/src/v1/model/VideoParameters.cpp | 69 +++++++ 41 files changed, 2038 insertions(+), 66 deletions(-) create mode 100644 gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequest.h create mode 100644 gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequestBody.h create mode 100644 gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionResponse.h create mode 100644 gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/UpgradeResult.h create mode 100644 gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequest.cpp create mode 100644 gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequestBody.cpp create mode 100644 gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionResponse.cpp create mode 100644 gaussdbfornosql/src/v3/model/UpgradeResult.cpp create mode 100644 kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequest.h create mode 100644 kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequestBody.h create mode 100644 kvs/include/huaweicloud/kvs/v1/model/CheckHealthResponse.h create mode 100644 kvs/include/huaweicloud/kvs/v1/model/Ttl_options.h create mode 100644 kvs/src/v1/model/CheckHealthRequest.cpp create mode 100644 kvs/src/v1/model/CheckHealthRequestBody.cpp create mode 100644 kvs/src/v1/model/CheckHealthResponse.cpp create mode 100644 kvs/src/v1/model/Ttl_options.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index db82d607b..b1f1b3b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,75 @@ +# 3.1.109 2024-11-07 + +### HuaweiCloud SDK AAD + +- _API Version_ + - V2 +- _Features_ + - None +- _Bug Fix_ + - None +- _Change_ + - **UpgradeInstanceSpec** + - changes of request param + - `+ upgrade_data.elastic_service_bandwidth_type` + - `+ upgrade_data.elastic_service_bandwidth` + +### HuaweiCloud SDK GaussDBforNoSQL + +- _API Version_ + - V3 +- _Features_ + - Support the API `BatchUpgradeDatabaseVersion` +- _Bug Fix_ + - None +- _Change_ + - None + +### HuaweiCloud SDK KVS + +- _API Version_ + - V1 +- _Features_ + - Support the API `CheckHealth` +- _Bug Fix_ + - None +- _Change_ + - **CreateTable** + - changes of request param + - `+ ttl_options` + - **DescribeTable** + - changes of response param + - `+ ttl_options` + +### HuaweiCloud SDK MPC + +- _API Version_ + - V1 +- _Features_ + - None +- _Bug Fix_ + - None +- _Change_ + - **CreateExtractTask** + - changes of request param + - `+ encryption` + - **CreateTranscodingTask** + - changes of request param + - `+ av_parameters.video.crf` + - `+ av_parameters.video.max_bitrate` + - **ListTranscodingTask** + - changes of response param + - `+ task_array.av_parameters.video.crf` + - `+ task_array.av_parameters.video.max_bitrate` + - **CreateEditingJob** + - changes of request param + - `+ concats.av_parameters.video.crf` + - `+ concats.av_parameters.video.max_bitrate` + - **ListEditingJob** + - changes of response param + - `+ jobs.edit_task_req.concats.av_parameters.video.crf` + - `+ jobs.edit_task_req.concats.av_parameters.video.max_bitrate` + # 3.1.108 2024-10-31 ### HuaweiCloud SDK CFW diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index ebd66f659..b1a199b1d 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,75 @@ +# 3.1.109 2024-11-07 + +### HuaweiCloud SDK AAD + +- _接口版本_ + - V2 +- _新增特性_ + - 无 +- _解决问题_ + - 无 +- _特性变更_ + - **UpgradeInstanceSpec** + - 请求参数变更 + - `+ upgrade_data.elastic_service_bandwidth_type` + - `+ upgrade_data.elastic_service_bandwidth` + +### HuaweiCloud SDK GaussDBforNoSQL + +- _接口版本_ + - V3 +- _新增特性_ + - 支持接口`BatchUpgradeDatabaseVersion` +- _解决问题_ + - 无 +- _特性变更_ + - 无 + +### HuaweiCloud SDK KVS + +- _接口版本_ + - V1 +- _新增特性_ + - 支持接口`CheckHealth` +- _解决问题_ + - 无 +- _特性变更_ + - **CreateTable** + - 请求参数变更 + - `+ ttl_options` + - **DescribeTable** + - 响应参数变更 + - `+ ttl_options` + +### HuaweiCloud SDK MPC + +- _接口版本_ + - V1 +- _新增特性_ + - 无 +- _解决问题_ + - 无 +- _特性变更_ + - **CreateExtractTask** + - 请求参数变更 + - `+ encryption` + - **CreateTranscodingTask** + - 请求参数变更 + - `+ av_parameters.video.crf` + - `+ av_parameters.video.max_bitrate` + - **ListTranscodingTask** + - 响应参数变更 + - `+ task_array.av_parameters.video.crf` + - `+ task_array.av_parameters.video.max_bitrate` + - **CreateEditingJob** + - 请求参数变更 + - `+ concats.av_parameters.video.crf` + - `+ concats.av_parameters.video.max_bitrate` + - **ListEditingJob** + - 响应参数变更 + - `+ jobs.edit_task_req.concats.av_parameters.video.crf` + - `+ jobs.edit_task_req.concats.av_parameters.video.max_bitrate` + # 3.1.108 2024-10-31 ### HuaweiCloud SDK CFW diff --git a/VERSION b/VERSION index d904254e6..8dd544f29 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.108 +3.1.109 diff --git a/aad/include/huaweicloud/aad/v2/AadClient.h b/aad/include/huaweicloud/aad/v2/AadClient.h index 82420eb09..f9c642b57 100644 --- a/aad/include/huaweicloud/aad/v2/AadClient.h +++ b/aad/include/huaweicloud/aad/v2/AadClient.h @@ -9,6 +9,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -47,11 +51,6 @@ #include #include -#include -#include -#include -#include - #include #include #include @@ -84,6 +83,14 @@ class HUAWEICLOUD_AAD_V2_EXPORT AadClient : public Client std::shared_ptr createDomain( CreateDomainRequest &request ); + // 删除防护域名 + // + // 删除防护域名 + // + // Please refer to HUAWEI cloud API Explorer for details. + std::shared_ptr deleteDomain( + DeleteDomainRequest &request + ); // 查询DDoS攻击事件列表 // // 查询DDoS攻击事件列表 @@ -221,15 +228,6 @@ class HUAWEICLOUD_AAD_V2_EXPORT AadClient : public Client UpgradeInstanceSpecRequest &request ); - // 删除防护域名 - // - // 删除防护域名 - // - // Please refer to HUAWEI cloud API Explorer for details. - std::shared_ptr deleteDomain( - DeleteDomainRequest &request - ); - private: #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) diff --git a/aad/include/huaweicloud/aad/v2/AadMeta.h b/aad/include/huaweicloud/aad/v2/AadMeta.h index 39ff0a2c7..462cbcf5b 100644 --- a/aad/include/huaweicloud/aad/v2/AadMeta.h +++ b/aad/include/huaweicloud/aad/v2/AadMeta.h @@ -14,6 +14,7 @@ using namespace HuaweiCloud::Sdk::Core::Http; class HUAWEICLOUD_AAD_V2_EXPORT AadMeta { public: static HttpRequestDef genRequestDefForCreateDomain(); + static HttpRequestDef genRequestDefForDeleteDomain(); static HttpRequestDef genRequestDefForListDDoSAttackEvent(); static HttpRequestDef genRequestDefForListDDoSConnectionNumber(); static HttpRequestDef genRequestDefForListDDoSFlow(); @@ -31,7 +32,6 @@ class HUAWEICLOUD_AAD_V2_EXPORT AadMeta { static HttpRequestDef genRequestDefForShowWafPolicy(); static HttpRequestDef genRequestDefForShowWafQps(); static HttpRequestDef genRequestDefForUpgradeInstanceSpec(); - static HttpRequestDef genRequestDefForDeleteDomain(); }; } diff --git a/aad/include/huaweicloud/aad/v2/model/UpgradeInstanceData.h b/aad/include/huaweicloud/aad/v2/model/UpgradeInstanceData.h index 888d7a048..c752005c5 100644 --- a/aad/include/huaweicloud/aad/v2/model/UpgradeInstanceData.h +++ b/aad/include/huaweicloud/aad/v2/model/UpgradeInstanceData.h @@ -83,6 +83,24 @@ class HUAWEICLOUD_AAD_V2_EXPORT UpgradeInstanceData void unsetbindDomainNum(); void setBindDomainNum(int32_t value); + /// + /// 弹性业务带宽,0-关闭,3-月95 + /// + + int32_t getElasticServiceBandwidthType() const; + bool elasticServiceBandwidthTypeIsSet() const; + void unsetelasticServiceBandwidthType(); + void setElasticServiceBandwidthType(int32_t value); + + /// + /// 弹性业务带宽增加值 + /// + + int32_t getElasticServiceBandwidth() const; + bool elasticServiceBandwidthIsSet() const; + void unsetelasticServiceBandwidth(); + void setElasticServiceBandwidth(int32_t value); + protected: std::string basicBandwidth_; @@ -95,6 +113,10 @@ class HUAWEICLOUD_AAD_V2_EXPORT UpgradeInstanceData bool portNumIsSet_; int32_t bindDomainNum_; bool bindDomainNumIsSet_; + int32_t elasticServiceBandwidthType_; + bool elasticServiceBandwidthTypeIsSet_; + int32_t elasticServiceBandwidth_; + bool elasticServiceBandwidthIsSet_; }; diff --git a/aad/src/v2/AadClient.cpp b/aad/src/v2/AadClient.cpp index 0c5fe9846..013fb99c1 100644 --- a/aad/src/v2/AadClient.cpp +++ b/aad/src/v2/AadClient.cpp @@ -73,6 +73,47 @@ std::shared_ptr AadClient::createDomain(CreateDomainReques return localVarResult; } +std::shared_ptr AadClient::deleteDomain(DeleteDomainRequest &request) +{ + std::string localVarPath = "/v2/aad/domains"; + + std::map localVarQueryParams; + std::map localVarHeaderParams; + std::map localVarFormParams; + std::map localVarPathParams; + + + bool isJson = false; + bool isMultiPart = false; + bool isBson = false; + std::string contentType = getContentType("application/json", isJson, isMultiPart, isBson); + localVarHeaderParams["Content-Type"] = contentType; + + + std::string localVarHttpBody; + if (isJson) { + // handle json input + web::json::value localVarJson; + localVarJson = ModelBase::toJson(request.getBody()); + localVarHttpBody = utility::conversions::to_utf8string(localVarJson.serialize()); + } + + std::unique_ptr res = callApi("DELETE", localVarPath, localVarPathParams, localVarQueryParams, + localVarHeaderParams, localVarHttpBody, AadMeta::genRequestDefForDeleteDomain()); + + std::shared_ptr localVarResult = std::make_shared(); + localVarResult->setStatusCode(res->getStatusCode()); + localVarResult->setHeaderParams(res->getHeaderParams()); + localVarResult->setHttpBody(res->getHttpBody()); + if (!res->getHttpBody().empty()) { + spdlog::info("parse json format response"); + utility::string_t localVarResponse = utility::conversions::to_string_t(res->getHttpBody()); + web::json::value localVarJson = web::json::value::parse(localVarResponse); + localVarResult->fromJson(localVarJson); + } + + return localVarResult; +} std::shared_ptr AadClient::listDDoSAttackEvent(ListDDoSAttackEventRequest &request) { std::string localVarPath = "/v2/aad/instances/{instance_id}/ddos-info/attack/events"; @@ -727,47 +768,6 @@ std::shared_ptr AadClient::upgradeInstanceSpec(Upgr return localVarResult; } -std::shared_ptr AadClient::deleteDomain(DeleteDomainRequest &request) -{ - std::string localVarPath = "/v2/aad/domains"; - - std::map localVarQueryParams; - std::map localVarHeaderParams; - std::map localVarFormParams; - std::map localVarPathParams; - - - bool isJson = false; - bool isMultiPart = false; - bool isBson = false; - std::string contentType = getContentType("application/json", isJson, isMultiPart, isBson); - localVarHeaderParams["Content-Type"] = contentType; - - - std::string localVarHttpBody; - if (isJson) { - // handle json input - web::json::value localVarJson; - localVarJson = ModelBase::toJson(request.getBody()); - localVarHttpBody = utility::conversions::to_utf8string(localVarJson.serialize()); - } - - std::unique_ptr res = callApi("DELETE", localVarPath, localVarPathParams, localVarQueryParams, - localVarHeaderParams, localVarHttpBody, AadMeta::genRequestDefForDeleteDomain()); - - std::shared_ptr localVarResult = std::make_shared(); - localVarResult->setStatusCode(res->getStatusCode()); - localVarResult->setHeaderParams(res->getHeaderParams()); - localVarResult->setHttpBody(res->getHttpBody()); - if (!res->getHttpBody().empty()) { - spdlog::info("parse json format response"); - utility::string_t localVarResponse = utility::conversions::to_string_t(res->getHttpBody()); - web::json::value localVarJson = web::json::value::parse(localVarResponse); - localVarResult->fromJson(localVarJson); - } - - return localVarResult; -} #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) std::string AadClient::parameterToString(utility::string_t value) { diff --git a/aad/src/v2/AadMeta.cpp b/aad/src/v2/AadMeta.cpp index 0801fe6a4..5b39daeb2 100644 --- a/aad/src/v2/AadMeta.cpp +++ b/aad/src/v2/AadMeta.cpp @@ -17,6 +17,15 @@ HttpRequestDef AadMeta::genRequestDefForCreateDomain() { return reqDefBuilder; } +HttpRequestDef AadMeta::genRequestDefForDeleteDomain() { + HttpRequestDef reqDefBuilder; + FieldDef bodyParam; + reqDefBuilder.withRequestField(bodyParam. + withName("Body"). + withLocationType(Body_)); + return reqDefBuilder; +} + HttpRequestDef AadMeta::genRequestDefForListDDoSAttackEvent() { HttpRequestDef reqDefBuilder; FieldDef bodyParam; @@ -242,15 +251,6 @@ HttpRequestDef AadMeta::genRequestDefForUpgradeInstanceSpec() { return reqDefBuilder; } -HttpRequestDef AadMeta::genRequestDefForDeleteDomain() { - HttpRequestDef reqDefBuilder; - FieldDef bodyParam; - reqDefBuilder.withRequestField(bodyParam. - withName("Body"). - withLocationType(Body_)); - return reqDefBuilder; -} - } } diff --git a/aad/src/v2/model/UpgradeInstanceData.cpp b/aad/src/v2/model/UpgradeInstanceData.cpp index a0ce51329..5e4ef8358 100644 --- a/aad/src/v2/model/UpgradeInstanceData.cpp +++ b/aad/src/v2/model/UpgradeInstanceData.cpp @@ -22,6 +22,10 @@ UpgradeInstanceData::UpgradeInstanceData() portNumIsSet_ = false; bindDomainNum_ = 0; bindDomainNumIsSet_ = false; + elasticServiceBandwidthType_ = 0; + elasticServiceBandwidthTypeIsSet_ = false; + elasticServiceBandwidth_ = 0; + elasticServiceBandwidthIsSet_ = false; } UpgradeInstanceData::~UpgradeInstanceData() = default; @@ -49,6 +53,12 @@ web::json::value UpgradeInstanceData::toJson() const if(bindDomainNumIsSet_) { val[utility::conversions::to_string_t("bind_domain_num")] = ModelBase::toJson(bindDomainNum_); } + if(elasticServiceBandwidthTypeIsSet_) { + val[utility::conversions::to_string_t("elastic_service_bandwidth_type")] = ModelBase::toJson(elasticServiceBandwidthType_); + } + if(elasticServiceBandwidthIsSet_) { + val[utility::conversions::to_string_t("elastic_service_bandwidth")] = ModelBase::toJson(elasticServiceBandwidth_); + } return val; } @@ -101,6 +111,24 @@ bool UpgradeInstanceData::fromJson(const web::json::value& val) setBindDomainNum(refVal); } } + if(val.has_field(utility::conversions::to_string_t("elastic_service_bandwidth_type"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("elastic_service_bandwidth_type")); + if(!fieldValue.is_null()) + { + int32_t refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setElasticServiceBandwidthType(refVal); + } + } + if(val.has_field(utility::conversions::to_string_t("elastic_service_bandwidth"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("elastic_service_bandwidth")); + if(!fieldValue.is_null()) + { + int32_t refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setElasticServiceBandwidth(refVal); + } + } return ok; } @@ -210,6 +238,48 @@ void UpgradeInstanceData::unsetbindDomainNum() bindDomainNumIsSet_ = false; } +int32_t UpgradeInstanceData::getElasticServiceBandwidthType() const +{ + return elasticServiceBandwidthType_; +} + +void UpgradeInstanceData::setElasticServiceBandwidthType(int32_t value) +{ + elasticServiceBandwidthType_ = value; + elasticServiceBandwidthTypeIsSet_ = true; +} + +bool UpgradeInstanceData::elasticServiceBandwidthTypeIsSet() const +{ + return elasticServiceBandwidthTypeIsSet_; +} + +void UpgradeInstanceData::unsetelasticServiceBandwidthType() +{ + elasticServiceBandwidthTypeIsSet_ = false; +} + +int32_t UpgradeInstanceData::getElasticServiceBandwidth() const +{ + return elasticServiceBandwidth_; +} + +void UpgradeInstanceData::setElasticServiceBandwidth(int32_t value) +{ + elasticServiceBandwidth_ = value; + elasticServiceBandwidthIsSet_ = true; +} + +bool UpgradeInstanceData::elasticServiceBandwidthIsSet() const +{ + return elasticServiceBandwidthIsSet_; +} + +void UpgradeInstanceData::unsetelasticServiceBandwidth() +{ + elasticServiceBandwidthIsSet_ = false; +} + } } } diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLClient.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLClient.h index 11d4ebdd3..7bbc8f668 100644 --- a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLClient.h +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLClient.h @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -323,6 +326,14 @@ class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT GaussDBforNoSQLClient : public Clie std::shared_ptr batchTagAction( BatchTagActionRequest &request ); + // 批量数据库补丁升级 + // + // 批量升级数据库补丁版本。 + // + // Please refer to HUAWEI cloud API Explorer for details. + std::shared_ptr batchUpgradeDatabaseVersion( + BatchUpgradeDatabaseVersionRequest &request + ); // 校验实例是否可以与指定实例建立/解除容灾关系 // // 校验实例是否可以与指定实例建立/解除容灾关系。若接口返回成功,表示可以与指定实例建立/解除容灾关系。 diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLMeta.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLMeta.h index 33ca8eb19..62bf65570 100644 --- a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLMeta.h +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/GaussDBforNoSQLMeta.h @@ -15,6 +15,7 @@ class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT GaussDBforNoSQLMeta { public: static HttpRequestDef genRequestDefForApplyConfiguration(); static HttpRequestDef genRequestDefForBatchTagAction(); + static HttpRequestDef genRequestDefForBatchUpgradeDatabaseVersion(); static HttpRequestDef genRequestDefForCheckDisasterRecoveryOperation(); static HttpRequestDef genRequestDefForCheckWeekPassword(); static HttpRequestDef genRequestDefForCompareConfiguration(); diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequest.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequest.h new file mode 100644 index 000000000..c74de5866 --- /dev/null +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequest.h @@ -0,0 +1,71 @@ + +#ifndef HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequest_H_ +#define HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequest_H_ + + +#include + +#include +#include +#include + +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// Request Object +/// +class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT BatchUpgradeDatabaseVersionRequest + : public ModelBase +{ +public: + BatchUpgradeDatabaseVersionRequest(); + virtual ~BatchUpgradeDatabaseVersionRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + ///////////////////////////////////////////// + /// BatchUpgradeDatabaseVersionRequest members + + /// + /// + /// + + BatchUpgradeDatabaseVersionRequestBody getBody() const; + bool bodyIsSet() const; + void unsetbody(); + void setBody(const BatchUpgradeDatabaseVersionRequestBody& value); + + +protected: + BatchUpgradeDatabaseVersionRequestBody body_; + bool bodyIsSet_; + +#ifdef RTTR_FLAG + RTTR_ENABLE() +public: + BatchUpgradeDatabaseVersionRequest& dereference_from_shared_ptr(std::shared_ptr ptr) { + return *ptr; + } +#endif +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequest_H_ diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequestBody.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequestBody.h new file mode 100644 index 000000000..48d744e64 --- /dev/null +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequestBody.h @@ -0,0 +1,65 @@ + +#ifndef HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequestBody_H_ +#define HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequestBody_H_ + + +#include + +#include +#include +#include + +#include +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// +/// +class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT BatchUpgradeDatabaseVersionRequestBody + : public ModelBase +{ +public: + BatchUpgradeDatabaseVersionRequestBody(); + virtual ~BatchUpgradeDatabaseVersionRequestBody(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + ///////////////////////////////////////////// + /// BatchUpgradeDatabaseVersionRequestBody members + + /// + /// 指定需要升级数据库补丁版本的实例ID列表。 一次最多可传入10个实例ID,且为同一引擎的实例。 + /// + + std::vector& getInstanceIds(); + bool instanceIdsIsSet() const; + void unsetinstanceIds(); + void setInstanceIds(const std::vector& value); + + +protected: + std::vector instanceIds_; + bool instanceIdsIsSet_; + +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionRequestBody_H_ diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionResponse.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionResponse.h new file mode 100644 index 000000000..6886ba17c --- /dev/null +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionResponse.h @@ -0,0 +1,68 @@ + +#ifndef HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionResponse_H_ +#define HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionResponse_H_ + + +#include + +#include +#include +#include + +#include +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// Response Object +/// +class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT BatchUpgradeDatabaseVersionResponse + : public ModelBase, public HttpResponse +{ +public: + BatchUpgradeDatabaseVersionResponse(); + virtual ~BatchUpgradeDatabaseVersionResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + ///////////////////////////////////////////// + /// BatchUpgradeDatabaseVersionResponse members + + /// + /// 批量升级结果。 + /// + + std::vector& getUpgradeResults(); + bool upgradeResultsIsSet() const; + void unsetupgradeResults(); + void setUpgradeResults(const std::vector& value); + + +protected: + std::vector upgradeResults_; + bool upgradeResultsIsSet_; + +#ifdef RTTR_FLAG + RTTR_ENABLE() +#endif +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_BatchUpgradeDatabaseVersionResponse_H_ diff --git a/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/UpgradeResult.h b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/UpgradeResult.h new file mode 100644 index 000000000..533e12206 --- /dev/null +++ b/gaussdbfornosql/include/huaweicloud/gaussdbfornosql/v3/model/UpgradeResult.h @@ -0,0 +1,97 @@ + +#ifndef HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_UpgradeResult_H_ +#define HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_UpgradeResult_H_ + + +#include + +#include +#include +#include + +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// 数据库补丁升级结果 +/// +class HUAWEICLOUD_GAUSSDBFORNOSQL_V3_EXPORT UpgradeResult + : public ModelBase +{ +public: + UpgradeResult(); + virtual ~UpgradeResult(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + ///////////////////////////////////////////// + /// UpgradeResult members + + /// + /// 任务ID。仅当补丁版本升级任务提交成功时返回该字段。 + /// + + std::string getJobId() const; + bool jobIdIsSet() const; + void unsetjobId(); + void setJobId(const std::string& value); + + /// + /// 实例ID。 + /// + + std::string getInstanceId() const; + bool instanceIdIsSet() const; + void unsetinstanceId(); + void setInstanceId(const std::string& value); + + /// + /// 错误码。仅当补丁版本升级任务提交失败时返回该字段。 + /// + + std::string getErrorCode() const; + bool errorCodeIsSet() const; + void unseterrorCode(); + void setErrorCode(const std::string& value); + + /// + /// 失败原因。仅当补丁版本升级任务提交失败时返回该字段。 + /// + + std::string getErrorMessage() const; + bool errorMessageIsSet() const; + void unseterrorMessage(); + void setErrorMessage(const std::string& value); + + +protected: + std::string jobId_; + bool jobIdIsSet_; + std::string instanceId_; + bool instanceIdIsSet_; + std::string errorCode_; + bool errorCodeIsSet_; + std::string errorMessage_; + bool errorMessageIsSet_; + +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_GAUSSDBFORNOSQL_V3_MODEL_UpgradeResult_H_ diff --git a/gaussdbfornosql/src/v3/GaussDBforNoSQLClient.cpp b/gaussdbfornosql/src/v3/GaussDBforNoSQLClient.cpp index b6675767d..a2feffb81 100644 --- a/gaussdbfornosql/src/v3/GaussDBforNoSQLClient.cpp +++ b/gaussdbfornosql/src/v3/GaussDBforNoSQLClient.cpp @@ -116,6 +116,47 @@ std::shared_ptr GaussDBforNoSQLClient::batchTagAction(Ba return localVarResult; } +std::shared_ptr GaussDBforNoSQLClient::batchUpgradeDatabaseVersion(BatchUpgradeDatabaseVersionRequest &request) +{ + std::string localVarPath = "/v3/{project_id}/instances/db-upgrade"; + + std::map localVarQueryParams; + std::map localVarHeaderParams; + std::map localVarFormParams; + std::map localVarPathParams; + + + bool isJson = false; + bool isMultiPart = false; + bool isBson = false; + std::string contentType = getContentType("application/json", isJson, isMultiPart, isBson); + localVarHeaderParams["Content-Type"] = contentType; + + + std::string localVarHttpBody; + if (isJson) { + // handle json input + web::json::value localVarJson; + localVarJson = ModelBase::toJson(request.getBody()); + localVarHttpBody = utility::conversions::to_utf8string(localVarJson.serialize()); + } + + std::unique_ptr res = callApi("POST", localVarPath, localVarPathParams, localVarQueryParams, + localVarHeaderParams, localVarHttpBody, GaussDBforNoSQLMeta::genRequestDefForBatchUpgradeDatabaseVersion()); + + std::shared_ptr localVarResult = std::make_shared(); + localVarResult->setStatusCode(res->getStatusCode()); + localVarResult->setHeaderParams(res->getHeaderParams()); + localVarResult->setHttpBody(res->getHttpBody()); + if (!res->getHttpBody().empty()) { + spdlog::info("parse json format response"); + utility::string_t localVarResponse = utility::conversions::to_string_t(res->getHttpBody()); + web::json::value localVarJson = web::json::value::parse(localVarResponse); + localVarResult->fromJson(localVarJson); + } + + return localVarResult; +} std::shared_ptr GaussDBforNoSQLClient::checkDisasterRecoveryOperation(CheckDisasterRecoveryOperationRequest &request) { std::string localVarPath = "/v3/{project_id}/instances/{instance_id}/disaster-recovery/precheck"; diff --git a/gaussdbfornosql/src/v3/GaussDBforNoSQLMeta.cpp b/gaussdbfornosql/src/v3/GaussDBforNoSQLMeta.cpp index 41d6d3c3d..b3bcd8e8a 100644 --- a/gaussdbfornosql/src/v3/GaussDBforNoSQLMeta.cpp +++ b/gaussdbfornosql/src/v3/GaussDBforNoSQLMeta.cpp @@ -26,6 +26,15 @@ HttpRequestDef GaussDBforNoSQLMeta::genRequestDefForBatchTagAction() { return reqDefBuilder; } +HttpRequestDef GaussDBforNoSQLMeta::genRequestDefForBatchUpgradeDatabaseVersion() { + HttpRequestDef reqDefBuilder; + FieldDef bodyParam; + reqDefBuilder.withRequestField(bodyParam. + withName("Body"). + withLocationType(Body_)); + return reqDefBuilder; +} + HttpRequestDef GaussDBforNoSQLMeta::genRequestDefForCheckDisasterRecoveryOperation() { HttpRequestDef reqDefBuilder; FieldDef bodyParam; diff --git a/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequest.cpp b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequest.cpp new file mode 100644 index 000000000..6d8d1fc6d --- /dev/null +++ b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequest.cpp @@ -0,0 +1,78 @@ + + +#include "huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequest.h" +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + + + + +BatchUpgradeDatabaseVersionRequest::BatchUpgradeDatabaseVersionRequest() +{ + bodyIsSet_ = false; +} + +BatchUpgradeDatabaseVersionRequest::~BatchUpgradeDatabaseVersionRequest() = default; + +void BatchUpgradeDatabaseVersionRequest::validate() +{ +} + +web::json::value BatchUpgradeDatabaseVersionRequest::toJson() const +{ + web::json::value val = web::json::value::object(); + + if(bodyIsSet_) { + val[utility::conversions::to_string_t("body")] = ModelBase::toJson(body_); + } + + return val; +} +bool BatchUpgradeDatabaseVersionRequest::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t("body"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("body")); + if(!fieldValue.is_null()) + { + BatchUpgradeDatabaseVersionRequestBody refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setBody(refVal); + } + } + return ok; +} + + +BatchUpgradeDatabaseVersionRequestBody BatchUpgradeDatabaseVersionRequest::getBody() const +{ + return body_; +} + +void BatchUpgradeDatabaseVersionRequest::setBody(const BatchUpgradeDatabaseVersionRequestBody& value) +{ + body_ = value; + bodyIsSet_ = true; +} + +bool BatchUpgradeDatabaseVersionRequest::bodyIsSet() const +{ + return bodyIsSet_; +} + +void BatchUpgradeDatabaseVersionRequest::unsetbody() +{ + bodyIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequestBody.cpp b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequestBody.cpp new file mode 100644 index 000000000..210ca9e79 --- /dev/null +++ b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionRequestBody.cpp @@ -0,0 +1,78 @@ + + +#include "huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionRequestBody.h" +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + + + + +BatchUpgradeDatabaseVersionRequestBody::BatchUpgradeDatabaseVersionRequestBody() +{ + instanceIdsIsSet_ = false; +} + +BatchUpgradeDatabaseVersionRequestBody::~BatchUpgradeDatabaseVersionRequestBody() = default; + +void BatchUpgradeDatabaseVersionRequestBody::validate() +{ +} + +web::json::value BatchUpgradeDatabaseVersionRequestBody::toJson() const +{ + web::json::value val = web::json::value::object(); + + if(instanceIdsIsSet_) { + val[utility::conversions::to_string_t("instance_ids")] = ModelBase::toJson(instanceIds_); + } + + return val; +} +bool BatchUpgradeDatabaseVersionRequestBody::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t("instance_ids"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("instance_ids")); + if(!fieldValue.is_null()) + { + std::vector refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setInstanceIds(refVal); + } + } + return ok; +} + + +std::vector& BatchUpgradeDatabaseVersionRequestBody::getInstanceIds() +{ + return instanceIds_; +} + +void BatchUpgradeDatabaseVersionRequestBody::setInstanceIds(const std::vector& value) +{ + instanceIds_ = value; + instanceIdsIsSet_ = true; +} + +bool BatchUpgradeDatabaseVersionRequestBody::instanceIdsIsSet() const +{ + return instanceIdsIsSet_; +} + +void BatchUpgradeDatabaseVersionRequestBody::unsetinstanceIds() +{ + instanceIdsIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionResponse.cpp b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionResponse.cpp new file mode 100644 index 000000000..24ad998db --- /dev/null +++ b/gaussdbfornosql/src/v3/model/BatchUpgradeDatabaseVersionResponse.cpp @@ -0,0 +1,78 @@ + + +#include "huaweicloud/gaussdbfornosql/v3/model/BatchUpgradeDatabaseVersionResponse.h" +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + + + + +BatchUpgradeDatabaseVersionResponse::BatchUpgradeDatabaseVersionResponse() +{ + upgradeResultsIsSet_ = false; +} + +BatchUpgradeDatabaseVersionResponse::~BatchUpgradeDatabaseVersionResponse() = default; + +void BatchUpgradeDatabaseVersionResponse::validate() +{ +} + +web::json::value BatchUpgradeDatabaseVersionResponse::toJson() const +{ + web::json::value val = web::json::value::object(); + + if(upgradeResultsIsSet_) { + val[utility::conversions::to_string_t("upgrade_results")] = ModelBase::toJson(upgradeResults_); + } + + return val; +} +bool BatchUpgradeDatabaseVersionResponse::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t("upgrade_results"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("upgrade_results")); + if(!fieldValue.is_null()) + { + std::vector refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setUpgradeResults(refVal); + } + } + return ok; +} + + +std::vector& BatchUpgradeDatabaseVersionResponse::getUpgradeResults() +{ + return upgradeResults_; +} + +void BatchUpgradeDatabaseVersionResponse::setUpgradeResults(const std::vector& value) +{ + upgradeResults_ = value; + upgradeResultsIsSet_ = true; +} + +bool BatchUpgradeDatabaseVersionResponse::upgradeResultsIsSet() const +{ + return upgradeResultsIsSet_; +} + +void BatchUpgradeDatabaseVersionResponse::unsetupgradeResults() +{ + upgradeResultsIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/gaussdbfornosql/src/v3/model/UpgradeResult.cpp b/gaussdbfornosql/src/v3/model/UpgradeResult.cpp new file mode 100644 index 000000000..435fdae6a --- /dev/null +++ b/gaussdbfornosql/src/v3/model/UpgradeResult.cpp @@ -0,0 +1,184 @@ + + +#include "huaweicloud/gaussdbfornosql/v3/model/UpgradeResult.h" +namespace HuaweiCloud { +namespace Sdk { +namespace Gaussdbfornosql { +namespace V3 { +namespace Model { + + + + +UpgradeResult::UpgradeResult() +{ + jobId_ = ""; + jobIdIsSet_ = false; + instanceId_ = ""; + instanceIdIsSet_ = false; + errorCode_ = ""; + errorCodeIsSet_ = false; + errorMessage_ = ""; + errorMessageIsSet_ = false; +} + +UpgradeResult::~UpgradeResult() = default; + +void UpgradeResult::validate() +{ +} + +web::json::value UpgradeResult::toJson() const +{ + web::json::value val = web::json::value::object(); + + if(jobIdIsSet_) { + val[utility::conversions::to_string_t("job_id")] = ModelBase::toJson(jobId_); + } + if(instanceIdIsSet_) { + val[utility::conversions::to_string_t("instance_id")] = ModelBase::toJson(instanceId_); + } + if(errorCodeIsSet_) { + val[utility::conversions::to_string_t("error_code")] = ModelBase::toJson(errorCode_); + } + if(errorMessageIsSet_) { + val[utility::conversions::to_string_t("error_message")] = ModelBase::toJson(errorMessage_); + } + + return val; +} +bool UpgradeResult::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t("job_id"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("job_id")); + if(!fieldValue.is_null()) + { + std::string refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setJobId(refVal); + } + } + if(val.has_field(utility::conversions::to_string_t("instance_id"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("instance_id")); + if(!fieldValue.is_null()) + { + std::string refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setInstanceId(refVal); + } + } + if(val.has_field(utility::conversions::to_string_t("error_code"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("error_code")); + if(!fieldValue.is_null()) + { + std::string refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setErrorCode(refVal); + } + } + if(val.has_field(utility::conversions::to_string_t("error_message"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("error_message")); + if(!fieldValue.is_null()) + { + std::string refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setErrorMessage(refVal); + } + } + return ok; +} + + +std::string UpgradeResult::getJobId() const +{ + return jobId_; +} + +void UpgradeResult::setJobId(const std::string& value) +{ + jobId_ = value; + jobIdIsSet_ = true; +} + +bool UpgradeResult::jobIdIsSet() const +{ + return jobIdIsSet_; +} + +void UpgradeResult::unsetjobId() +{ + jobIdIsSet_ = false; +} + +std::string UpgradeResult::getInstanceId() const +{ + return instanceId_; +} + +void UpgradeResult::setInstanceId(const std::string& value) +{ + instanceId_ = value; + instanceIdIsSet_ = true; +} + +bool UpgradeResult::instanceIdIsSet() const +{ + return instanceIdIsSet_; +} + +void UpgradeResult::unsetinstanceId() +{ + instanceIdIsSet_ = false; +} + +std::string UpgradeResult::getErrorCode() const +{ + return errorCode_; +} + +void UpgradeResult::setErrorCode(const std::string& value) +{ + errorCode_ = value; + errorCodeIsSet_ = true; +} + +bool UpgradeResult::errorCodeIsSet() const +{ + return errorCodeIsSet_; +} + +void UpgradeResult::unseterrorCode() +{ + errorCodeIsSet_ = false; +} + +std::string UpgradeResult::getErrorMessage() const +{ + return errorMessage_; +} + +void UpgradeResult::setErrorMessage(const std::string& value) +{ + errorMessage_ = value; + errorMessageIsSet_ = true; +} + +bool UpgradeResult::errorMessageIsSet() const +{ + return errorMessageIsSet_; +} + +void UpgradeResult::unseterrorMessage() +{ + errorMessageIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/kvs/include/huaweicloud/kvs/v1/KvsClient.h b/kvs/include/huaweicloud/kvs/v1/KvsClient.h index 7921525bf..e95fbb586 100644 --- a/kvs/include/huaweicloud/kvs/v1/KvsClient.h +++ b/kvs/include/huaweicloud/kvs/v1/KvsClient.h @@ -23,6 +23,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -103,6 +107,15 @@ class HUAWEICLOUD_KVS_V1_EXPORT KvsClient : public Client ListTableRequest &request ); + // 网络信道健康检查 + // + // 网络信道健康检查,返回response未抛出网络异常即为成功 + // + // Please refer to HUAWEI cloud API Explorer for details. + std::shared_ptr checkHealth( + CheckHealthRequest &request + ); + // 批量写请求 // // 批量写请求,其中可以携带一或多个表的不同kv的写操作,上传kv/删除kv。 diff --git a/kvs/include/huaweicloud/kvs/v1/KvsMeta.h b/kvs/include/huaweicloud/kvs/v1/KvsMeta.h index d620e7170..9857a5073 100644 --- a/kvs/include/huaweicloud/kvs/v1/KvsMeta.h +++ b/kvs/include/huaweicloud/kvs/v1/KvsMeta.h @@ -17,6 +17,7 @@ class HUAWEICLOUD_KVS_V1_EXPORT KvsMeta { static HttpRequestDef genRequestDefForDescribeTable(); static HttpRequestDef genRequestDefForListStore(); static HttpRequestDef genRequestDefForListTable(); + static HttpRequestDef genRequestDefForCheckHealth(); static HttpRequestDef genRequestDefForBatchWriteKv(); static HttpRequestDef genRequestDefForDeleteKv(); static HttpRequestDef genRequestDefForGetKv(); diff --git a/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequest.h b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequest.h new file mode 100644 index 000000000..2bba9f211 --- /dev/null +++ b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequest.h @@ -0,0 +1,74 @@ + +#ifndef HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequest_H_ +#define HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequest_H_ + +#include +#include +#include + +#include + +#include +#include +#include + +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// Request Object +/// +class HUAWEICLOUD_KVS_V1_EXPORT CheckHealthRequest + : public ModelBase +{ +public: + CheckHealthRequest(); + virtual ~CheckHealthRequest(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + bool fromBson(const Viewer &viewer) override; + bool toBson(Builder &builder) const override; + ///////////////////////////////////////////// + /// CheckHealthRequest members + + /// + /// + /// + + CheckHealthRequestBody getBody() const; + bool bodyIsSet() const; + void unsetbody(); + void setBody(const CheckHealthRequestBody& value); + + +protected: + CheckHealthRequestBody body_; + bool bodyIsSet_; + +#ifdef RTTR_FLAG + RTTR_ENABLE() +public: + CheckHealthRequest& dereference_from_shared_ptr(std::shared_ptr ptr) { + return *ptr; + } +#endif +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequest_H_ diff --git a/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequestBody.h b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequestBody.h new file mode 100644 index 000000000..8a105f90d --- /dev/null +++ b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthRequestBody.h @@ -0,0 +1,66 @@ + +#ifndef HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequestBody_H_ +#define HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequestBody_H_ + +#include +#include +#include + +#include + +#include +#include +#include + + +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// +/// +class HUAWEICLOUD_KVS_V1_EXPORT CheckHealthRequestBody + : public ModelBase +{ +public: + CheckHealthRequestBody(); + virtual ~CheckHealthRequestBody(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + bool fromBson(const Viewer &viewer) override; + bool toBson(Builder &builder) const override; + ///////////////////////////////////////////// + /// CheckHealthRequestBody members + + /// + /// version + /// + + int32_t getVersion() const; + bool versionIsSet() const; + void unsetversion(); + void setVersion(int32_t value); + + +protected: + int32_t version_; + bool versionIsSet_; + +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthRequestBody_H_ diff --git a/kvs/include/huaweicloud/kvs/v1/model/CheckHealthResponse.h b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthResponse.h new file mode 100644 index 000000000..83378216d --- /dev/null +++ b/kvs/include/huaweicloud/kvs/v1/model/CheckHealthResponse.h @@ -0,0 +1,58 @@ + +#ifndef HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthResponse_H_ +#define HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthResponse_H_ + +#include +#include +#include + +#include + +#include +#include +#include + + +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// Response Object +/// +class HUAWEICLOUD_KVS_V1_EXPORT CheckHealthResponse + : public ModelBase, public HttpResponse +{ +public: + CheckHealthResponse(); + virtual ~CheckHealthResponse(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + bool fromBson(const Viewer &viewer) override; + bool toBson(Builder &builder) const override; + ///////////////////////////////////////////// + /// CheckHealthResponse members + + +protected: + +#ifdef RTTR_FLAG + RTTR_ENABLE() +#endif +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_KVS_V1_MODEL_CheckHealthResponse_H_ diff --git a/kvs/include/huaweicloud/kvs/v1/model/CreateTableRequestBody.h b/kvs/include/huaweicloud/kvs/v1/model/CreateTableRequestBody.h index 7c2c49056..d0379d0a7 100644 --- a/kvs/include/huaweicloud/kvs/v1/model/CreateTableRequestBody.h +++ b/kvs/include/huaweicloud/kvs/v1/model/CreateTableRequestBody.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,15 @@ class HUAWEICLOUD_KVS_V1_EXPORT CreateTableRequestBody void unsetpreSplitKeyOptions(); void setPreSplitKeyOptions(const Pre_split_key_options& value); + /// + /// + /// + + Ttl_options getTtlOptions() const; + bool ttlOptionsIsSet() const; + void unsetttlOptions(); + void setTtlOptions(const Ttl_options& value); + protected: std::string tableName_; @@ -126,6 +136,8 @@ class HUAWEICLOUD_KVS_V1_EXPORT CreateTableRequestBody bool globalSecondaryIndexSchemaIsSet_; Pre_split_key_options preSplitKeyOptions_; bool preSplitKeyOptionsIsSet_; + Ttl_options ttlOptions_; + bool ttlOptionsIsSet_; }; diff --git a/kvs/include/huaweicloud/kvs/v1/model/DescribeTableResponse.h b/kvs/include/huaweicloud/kvs/v1/model/DescribeTableResponse.h index 41f60f66b..b945541be 100644 --- a/kvs/include/huaweicloud/kvs/v1/model/DescribeTableResponse.h +++ b/kvs/include/huaweicloud/kvs/v1/model/DescribeTableResponse.h @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -91,6 +92,15 @@ class HUAWEICLOUD_KVS_V1_EXPORT DescribeTableResponse void unsetrunTimeInfo(); void setRunTimeInfo(const Run_time_info& value); + /// + /// + /// + + Ttl_options getTtlOptions() const; + bool ttlOptionsIsSet() const; + void unsetttlOptions(); + void setTtlOptions(const Ttl_options& value); + protected: std::string tableName_; @@ -103,6 +113,8 @@ class HUAWEICLOUD_KVS_V1_EXPORT DescribeTableResponse bool globalSecondaryIndexSchemaIsSet_; Run_time_info runTimeInfo_; bool runTimeInfoIsSet_; + Ttl_options ttlOptions_; + bool ttlOptionsIsSet_; #ifdef RTTR_FLAG RTTR_ENABLE() diff --git a/kvs/include/huaweicloud/kvs/v1/model/Ttl_options.h b/kvs/include/huaweicloud/kvs/v1/model/Ttl_options.h new file mode 100644 index 000000000..beca470cb --- /dev/null +++ b/kvs/include/huaweicloud/kvs/v1/model/Ttl_options.h @@ -0,0 +1,89 @@ + +#ifndef HUAWEICLOUD_SDK_KVS_V1_MODEL_Ttl_options_H_ +#define HUAWEICLOUD_SDK_KVS_V1_MODEL_Ttl_options_H_ + +#include +#include +#include + +#include + +#include +#include +#include + +#include + +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + +using namespace HuaweiCloud::Sdk::Core::Utils; +using namespace HuaweiCloud::Sdk::Core::Http; +/// +/// +/// +class HUAWEICLOUD_KVS_V1_EXPORT Ttl_options + : public ModelBase +{ +public: + Ttl_options(); + virtual ~Ttl_options(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + bool fromBson(const Viewer &viewer) override; + bool toBson(Builder &builder) const override; + ///////////////////////////////////////////// + /// Ttl_options members + + /// + /// TTL开关 + /// + + bool isTtlSwitch() const; + bool ttlSwitchIsSet() const; + void unsetttlSwitch(); + void setTtlSwitch(bool value); + + /// + /// 生存时间,以秒为单位 + /// + + int32_t getExpireAfterSeconds() const; + bool expireAfterSecondsIsSet() const; + void unsetexpireAfterSeconds(); + void setExpireAfterSeconds(int32_t value); + + /// + /// 文档中记录TTL过期时间的字段名,字段值为UTC时间,单位秒 + /// + + std::string getTtlFieldName() const; + bool ttlFieldNameIsSet() const; + void unsetttlFieldName(); + void setTtlFieldName(const std::string& value); + + +protected: + bool ttlSwitch_; + bool ttlSwitchIsSet_; + int32_t expireAfterSeconds_; + bool expireAfterSecondsIsSet_; + std::string ttlFieldName_; + bool ttlFieldNameIsSet_; + +}; + + +} +} +} +} +} + +#endif // HUAWEICLOUD_SDK_KVS_V1_MODEL_Ttl_options_H_ diff --git a/kvs/src/v1/KvsClient.cpp b/kvs/src/v1/KvsClient.cpp index af16dfe1c..a28ca4009 100644 --- a/kvs/src/v1/KvsClient.cpp +++ b/kvs/src/v1/KvsClient.cpp @@ -213,6 +213,49 @@ std::shared_ptr KvsClient::listTable(ListTableRequest &reques return localVarResult; } +std::shared_ptr KvsClient::checkHealth(CheckHealthRequest &request) +{ + std::string localVarPath = "/v1/check-health"; + + std::map localVarQueryParams; + std::map localVarHeaderParams; + std::map localVarFormParams; + std::map localVarPathParams; + + + bool isJson = false; + bool isMultiPart = false; + bool isBson = false; + std::string contentType = getContentType("application/bson", isJson, isMultiPart, isBson); + localVarHeaderParams["Content-Type"] = contentType; + + + std::string localVarHttpBody; + if (isBson) { + spdlog::info("parse bson format request"); + Builder builder = Builder::document(); + request.getBody().toBson(builder); + Document doc = builder << Builder::DocumentEnd; + localVarHttpBody.assign((const char *)doc.data(), doc.length()); + } + + std::unique_ptr res = callApi("POST", localVarPath, localVarPathParams, localVarQueryParams, + localVarHeaderParams, localVarHttpBody, KvsMeta::genRequestDefForCheckHealth()); + + std::shared_ptr localVarResult = std::make_shared(); + localVarResult->setStatusCode(res->getStatusCode()); + localVarResult->setHeaderParams(res->getHeaderParams()); + localVarResult->setHttpBody(res->getHttpBody()); + if (!res->getHttpBody().empty()) { + spdlog::info("parse bson format response"); + const std::string &body = localVarResult->getHttpBodyRef(); + Document doc((const uint8_t *)body.data(), body.length()); + Viewer viewer(doc); + localVarResult->fromBson(viewer); + } + + return localVarResult; +} std::shared_ptr KvsClient::batchWriteKv(BatchWriteKvRequest &request) { std::string localVarPath = "/v1/batch-write-kv"; diff --git a/kvs/src/v1/KvsMeta.cpp b/kvs/src/v1/KvsMeta.cpp index b166f8578..d53862ca9 100644 --- a/kvs/src/v1/KvsMeta.cpp +++ b/kvs/src/v1/KvsMeta.cpp @@ -53,6 +53,15 @@ HttpRequestDef KvsMeta::genRequestDefForListTable() { return reqDefBuilder; } +HttpRequestDef KvsMeta::genRequestDefForCheckHealth() { + HttpRequestDef reqDefBuilder; + FieldDef bodyParam; + reqDefBuilder.withRequestField(bodyParam. + withName("Body"). + withLocationType(Body_)); + return reqDefBuilder; +} + HttpRequestDef KvsMeta::genRequestDefForBatchWriteKv() { HttpRequestDef reqDefBuilder; reqDefBuilder.withRequestField(FieldDef().withName("StoreName") diff --git a/kvs/src/v1/model/CheckHealthRequest.cpp b/kvs/src/v1/model/CheckHealthRequest.cpp new file mode 100644 index 000000000..d5040f75e --- /dev/null +++ b/kvs/src/v1/model/CheckHealthRequest.cpp @@ -0,0 +1,84 @@ + + +#include "huaweicloud/kvs/v1/model/CheckHealthRequest.h" +#include +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + + + + +CheckHealthRequest::CheckHealthRequest() +{ + bodyIsSet_ = false; +} + +CheckHealthRequest::~CheckHealthRequest() = default; + +void CheckHealthRequest::validate() +{ +} + +bool CheckHealthRequest::toBson(Builder &builder) const +{ + + if (bodyIsSet_ && !bson_append(builder, "body", body_)) { + return false; + } + + return true; +} + +bool CheckHealthRequest::fromBson(const Viewer &viewer) +{ + + Viewer::Iterator it = viewer.begin(); + while (it != viewer.end()) { + const std::string &key = it->key(); + + if (key == "body") { + if (!bson_get(it, body_)) { + return false; + } + bodyIsSet_ = true; + ++it; + continue; + } + + ++it; + } + + return true; +} + +CheckHealthRequestBody CheckHealthRequest::getBody() const +{ + return body_; +} + +void CheckHealthRequest::setBody(const CheckHealthRequestBody& value) +{ + body_ = value; + bodyIsSet_ = true; +} + +bool CheckHealthRequest::bodyIsSet() const +{ + return bodyIsSet_; +} + +void CheckHealthRequest::unsetbody() +{ + bodyIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/kvs/src/v1/model/CheckHealthRequestBody.cpp b/kvs/src/v1/model/CheckHealthRequestBody.cpp new file mode 100644 index 000000000..e01e8dcb1 --- /dev/null +++ b/kvs/src/v1/model/CheckHealthRequestBody.cpp @@ -0,0 +1,85 @@ + + +#include "huaweicloud/kvs/v1/model/CheckHealthRequestBody.h" +#include +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + + + + +CheckHealthRequestBody::CheckHealthRequestBody() +{ + version_ = 0; + versionIsSet_ = false; +} + +CheckHealthRequestBody::~CheckHealthRequestBody() = default; + +void CheckHealthRequestBody::validate() +{ +} + +bool CheckHealthRequestBody::toBson(Builder &builder) const +{ + + if (versionIsSet_ && !bson_append(builder, "version", version_)) { + return false; + } + + return true; +} + +bool CheckHealthRequestBody::fromBson(const Viewer &viewer) +{ + + Viewer::Iterator it = viewer.begin(); + while (it != viewer.end()) { + const std::string &key = it->key(); + + if (key == "version") { + if (!bson_get(it, version_)) { + return false; + } + versionIsSet_ = true; + ++it; + continue; + } + + ++it; + } + + return true; +} + +int32_t CheckHealthRequestBody::getVersion() const +{ + return version_; +} + +void CheckHealthRequestBody::setVersion(int32_t value) +{ + version_ = value; + versionIsSet_ = true; +} + +bool CheckHealthRequestBody::versionIsSet() const +{ + return versionIsSet_; +} + +void CheckHealthRequestBody::unsetversion() +{ + versionIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/kvs/src/v1/model/CheckHealthResponse.cpp b/kvs/src/v1/model/CheckHealthResponse.cpp new file mode 100644 index 000000000..e5c7aa5b8 --- /dev/null +++ b/kvs/src/v1/model/CheckHealthResponse.cpp @@ -0,0 +1,50 @@ + + +#include "huaweicloud/kvs/v1/model/CheckHealthResponse.h" +#include +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + + + + +CheckHealthResponse::CheckHealthResponse() +{ +} + +CheckHealthResponse::~CheckHealthResponse() = default; + +void CheckHealthResponse::validate() +{ +} + +bool CheckHealthResponse::toBson(Builder &builder) const +{ + + + return true; +} + +bool CheckHealthResponse::fromBson(const Viewer &viewer) +{ + + Viewer::Iterator it = viewer.begin(); + while (it != viewer.end()) { + const std::string &key = it->key(); + + ++it; + } + + return true; +} + +} +} +} +} +} + + diff --git a/kvs/src/v1/model/CreateTableRequestBody.cpp b/kvs/src/v1/model/CreateTableRequestBody.cpp index e8b223956..5e66721a2 100644 --- a/kvs/src/v1/model/CreateTableRequestBody.cpp +++ b/kvs/src/v1/model/CreateTableRequestBody.cpp @@ -22,6 +22,7 @@ CreateTableRequestBody::CreateTableRequestBody() localSecondaryIndexSchemaIsSet_ = false; globalSecondaryIndexSchemaIsSet_ = false; preSplitKeyOptionsIsSet_ = false; + ttlOptionsIsSet_ = false; } CreateTableRequestBody::~CreateTableRequestBody() = default; @@ -54,6 +55,9 @@ bool CreateTableRequestBody::toBson(Builder &builder) const if (preSplitKeyOptionsIsSet_ && !bson_append(builder, "pre_split_key_options", preSplitKeyOptions_)) { return false; } + if (ttlOptionsIsSet_ && !bson_append(builder, "ttl_options", ttlOptions_)) { + return false; + } return true; } @@ -128,6 +132,15 @@ bool CreateTableRequestBody::fromBson(const Viewer &viewer) continue; } + if (key == "ttl_options") { + if (!bson_get(it, ttlOptions_)) { + return false; + } + ttlOptionsIsSet_ = true; + ++it; + continue; + } + ++it; } @@ -281,6 +294,27 @@ void CreateTableRequestBody::unsetpreSplitKeyOptions() preSplitKeyOptionsIsSet_ = false; } +Ttl_options CreateTableRequestBody::getTtlOptions() const +{ + return ttlOptions_; +} + +void CreateTableRequestBody::setTtlOptions(const Ttl_options& value) +{ + ttlOptions_ = value; + ttlOptionsIsSet_ = true; +} + +bool CreateTableRequestBody::ttlOptionsIsSet() const +{ + return ttlOptionsIsSet_; +} + +void CreateTableRequestBody::unsetttlOptions() +{ + ttlOptionsIsSet_ = false; +} + } } } diff --git a/kvs/src/v1/model/DescribeTableResponse.cpp b/kvs/src/v1/model/DescribeTableResponse.cpp index d2c3fa39e..10998ffbe 100644 --- a/kvs/src/v1/model/DescribeTableResponse.cpp +++ b/kvs/src/v1/model/DescribeTableResponse.cpp @@ -19,6 +19,7 @@ DescribeTableResponse::DescribeTableResponse() localSecondaryIndexSchemaIsSet_ = false; globalSecondaryIndexSchemaIsSet_ = false; runTimeInfoIsSet_ = false; + ttlOptionsIsSet_ = false; } DescribeTableResponse::~DescribeTableResponse() = default; @@ -45,6 +46,9 @@ bool DescribeTableResponse::toBson(Builder &builder) const if (runTimeInfoIsSet_ && !bson_append(builder, "run_time_info", runTimeInfo_)) { return false; } + if (ttlOptionsIsSet_ && !bson_append(builder, "ttl_options", ttlOptions_)) { + return false; + } return true; } @@ -101,6 +105,15 @@ bool DescribeTableResponse::fromBson(const Viewer &viewer) continue; } + if (key == "ttl_options") { + if (!bson_get(it, ttlOptions_)) { + return false; + } + ttlOptionsIsSet_ = true; + ++it; + continue; + } + ++it; } @@ -212,6 +225,27 @@ void DescribeTableResponse::unsetrunTimeInfo() runTimeInfoIsSet_ = false; } +Ttl_options DescribeTableResponse::getTtlOptions() const +{ + return ttlOptions_; +} + +void DescribeTableResponse::setTtlOptions(const Ttl_options& value) +{ + ttlOptions_ = value; + ttlOptionsIsSet_ = true; +} + +bool DescribeTableResponse::ttlOptionsIsSet() const +{ + return ttlOptionsIsSet_; +} + +void DescribeTableResponse::unsetttlOptions() +{ + ttlOptionsIsSet_ = false; +} + } } } diff --git a/kvs/src/v1/model/Ttl_options.cpp b/kvs/src/v1/model/Ttl_options.cpp new file mode 100644 index 000000000..d1219099c --- /dev/null +++ b/kvs/src/v1/model/Ttl_options.cpp @@ -0,0 +1,155 @@ + + +#include "huaweicloud/kvs/v1/model/Ttl_options.h" +#include +namespace HuaweiCloud { +namespace Sdk { +namespace Kvs { +namespace V1 { +namespace Model { + + + + +Ttl_options::Ttl_options() +{ + ttlSwitch_ = false; + ttlSwitchIsSet_ = false; + expireAfterSeconds_ = 0; + expireAfterSecondsIsSet_ = false; + ttlFieldName_ = ""; + ttlFieldNameIsSet_ = false; +} + +Ttl_options::~Ttl_options() = default; + +void Ttl_options::validate() +{ +} + +bool Ttl_options::toBson(Builder &builder) const +{ + + if (ttlSwitchIsSet_ && !bson_append(builder, "ttl_switch", ttlSwitch_)) { + return false; + } + if (expireAfterSecondsIsSet_ && !bson_append(builder, "expire_after_seconds", expireAfterSeconds_)) { + return false; + } + if (ttlFieldNameIsSet_ && !bson_append(builder, "ttl_field_name", ttlFieldName_)) { + return false; + } + + return true; +} + +bool Ttl_options::fromBson(const Viewer &viewer) +{ + + Viewer::Iterator it = viewer.begin(); + while (it != viewer.end()) { + const std::string &key = it->key(); + + if (key == "ttl_switch") { + if (!bson_get(it, ttlSwitch_)) { + return false; + } + ttlSwitchIsSet_ = true; + ++it; + continue; + } + + if (key == "expire_after_seconds") { + if (!bson_get(it, expireAfterSeconds_)) { + return false; + } + expireAfterSecondsIsSet_ = true; + ++it; + continue; + } + + if (key == "ttl_field_name") { + if (!bson_get(it, ttlFieldName_)) { + return false; + } + ttlFieldNameIsSet_ = true; + ++it; + continue; + } + + ++it; + } + + return true; +} + +bool Ttl_options::isTtlSwitch() const +{ + return ttlSwitch_; +} + +void Ttl_options::setTtlSwitch(bool value) +{ + ttlSwitch_ = value; + ttlSwitchIsSet_ = true; +} + +bool Ttl_options::ttlSwitchIsSet() const +{ + return ttlSwitchIsSet_; +} + +void Ttl_options::unsetttlSwitch() +{ + ttlSwitchIsSet_ = false; +} + +int32_t Ttl_options::getExpireAfterSeconds() const +{ + return expireAfterSeconds_; +} + +void Ttl_options::setExpireAfterSeconds(int32_t value) +{ + expireAfterSeconds_ = value; + expireAfterSecondsIsSet_ = true; +} + +bool Ttl_options::expireAfterSecondsIsSet() const +{ + return expireAfterSecondsIsSet_; +} + +void Ttl_options::unsetexpireAfterSeconds() +{ + expireAfterSecondsIsSet_ = false; +} + +std::string Ttl_options::getTtlFieldName() const +{ + return ttlFieldName_; +} + +void Ttl_options::setTtlFieldName(const std::string& value) +{ + ttlFieldName_ = value; + ttlFieldNameIsSet_ = true; +} + +bool Ttl_options::ttlFieldNameIsSet() const +{ + return ttlFieldNameIsSet_; +} + +void Ttl_options::unsetttlFieldName() +{ + ttlFieldNameIsSet_ = false; +} + +} +} +} +} +} + + diff --git a/mpc/include/huaweicloud/mpc/v1/model/CreateExtractTaskReq.h b/mpc/include/huaweicloud/mpc/v1/model/CreateExtractTaskReq.h index 4c0d54f73..fbcb96e05 100644 --- a/mpc/include/huaweicloud/mpc/v1/model/CreateExtractTaskReq.h +++ b/mpc/include/huaweicloud/mpc/v1/model/CreateExtractTaskReq.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace HuaweiCloud { namespace Sdk { @@ -76,6 +77,15 @@ class HUAWEICLOUD_MPC_V1_EXPORT CreateExtractTaskReq void unsetsync(); void setSync(int32_t value); + /// + /// + /// + + Encryption getEncryption() const; + bool encryptionIsSet() const; + void unsetencryption(); + void setEncryption(const Encryption& value); + protected: ObsObjInfo input_; @@ -86,6 +96,8 @@ class HUAWEICLOUD_MPC_V1_EXPORT CreateExtractTaskReq bool userDataIsSet_; int32_t sync_; bool syncIsSet_; + Encryption encryption_; + bool encryptionIsSet_; }; diff --git a/mpc/include/huaweicloud/mpc/v1/model/VideoParameters.h b/mpc/include/huaweicloud/mpc/v1/model/VideoParameters.h index 35531041d..f8e9b92ab 100644 --- a/mpc/include/huaweicloud/mpc/v1/model/VideoParameters.h +++ b/mpc/include/huaweicloud/mpc/v1/model/VideoParameters.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -57,6 +58,24 @@ class HUAWEICLOUD_MPC_V1_EXPORT VideoParameters void unsetcodec(); void setCodec(int32_t value); + /// + /// 视频恒定码率控制因子。 取值范围为[0, 51] + /// + + Object getCrf() const; + bool crfIsSet() const; + void unsetcrf(); + void setCrf(const Object& value); + + /// + /// 输出最大码率 单位:kbit/s 带crf时使用,参考原片的平均码率进行设置(一般为1.5倍) + /// + + int32_t getMaxBitrate() const; + bool maxBitrateIsSet() const; + void unsetmaxBitrate(); + void setMaxBitrate(int32_t value); + /// /// 输出平均码率。 取值范围:0或[40,30000]之间的整数。 单位:kbit/s 若设置为0,则输出平均码率为自适应值。 /// @@ -153,6 +172,10 @@ class HUAWEICLOUD_MPC_V1_EXPORT VideoParameters bool outputPolicyIsSet_; int32_t codec_; bool codecIsSet_; + Object crf_; + bool crfIsSet_; + int32_t maxBitrate_; + bool maxBitrateIsSet_; int32_t bitrate_; bool bitrateIsSet_; int32_t profile_; diff --git a/mpc/src/v1/model/CreateExtractTaskReq.cpp b/mpc/src/v1/model/CreateExtractTaskReq.cpp index bded0dfac..bbde8d84f 100644 --- a/mpc/src/v1/model/CreateExtractTaskReq.cpp +++ b/mpc/src/v1/model/CreateExtractTaskReq.cpp @@ -18,6 +18,7 @@ CreateExtractTaskReq::CreateExtractTaskReq() userDataIsSet_ = false; sync_ = 0; syncIsSet_ = false; + encryptionIsSet_ = false; } CreateExtractTaskReq::~CreateExtractTaskReq() = default; @@ -42,6 +43,9 @@ web::json::value CreateExtractTaskReq::toJson() const if(syncIsSet_) { val[utility::conversions::to_string_t("sync")] = ModelBase::toJson(sync_); } + if(encryptionIsSet_) { + val[utility::conversions::to_string_t("encryption")] = ModelBase::toJson(encryption_); + } return val; } @@ -85,6 +89,15 @@ bool CreateExtractTaskReq::fromJson(const web::json::value& val) setSync(refVal); } } + if(val.has_field(utility::conversions::to_string_t("encryption"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("encryption")); + if(!fieldValue.is_null()) + { + Encryption refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setEncryption(refVal); + } + } return ok; } @@ -173,6 +186,27 @@ void CreateExtractTaskReq::unsetsync() syncIsSet_ = false; } +Encryption CreateExtractTaskReq::getEncryption() const +{ + return encryption_; +} + +void CreateExtractTaskReq::setEncryption(const Encryption& value) +{ + encryption_ = value; + encryptionIsSet_ = true; +} + +bool CreateExtractTaskReq::encryptionIsSet() const +{ + return encryptionIsSet_; +} + +void CreateExtractTaskReq::unsetencryption() +{ + encryptionIsSet_ = false; +} + } } } diff --git a/mpc/src/v1/model/VideoParameters.cpp b/mpc/src/v1/model/VideoParameters.cpp index cc58bea86..f18186d31 100644 --- a/mpc/src/v1/model/VideoParameters.cpp +++ b/mpc/src/v1/model/VideoParameters.cpp @@ -16,6 +16,9 @@ VideoParameters::VideoParameters() outputPolicyIsSet_ = false; codec_ = 0; codecIsSet_ = false; + crfIsSet_ = false; + maxBitrate_ = 0; + maxBitrateIsSet_ = false; bitrate_ = 0; bitrateIsSet_ = false; profile_ = 0; @@ -54,6 +57,12 @@ web::json::value VideoParameters::toJson() const if(codecIsSet_) { val[utility::conversions::to_string_t("codec")] = ModelBase::toJson(codec_); } + if(crfIsSet_) { + val[utility::conversions::to_string_t("crf")] = ModelBase::toJson(crf_); + } + if(maxBitrateIsSet_) { + val[utility::conversions::to_string_t("max_bitrate")] = ModelBase::toJson(maxBitrate_); + } if(bitrateIsSet_) { val[utility::conversions::to_string_t("bitrate")] = ModelBase::toJson(bitrate_); } @@ -109,6 +118,24 @@ bool VideoParameters::fromJson(const web::json::value& val) setCodec(refVal); } } + if(val.has_field(utility::conversions::to_string_t("crf"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("crf")); + if(!fieldValue.is_null()) + { + Object refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setCrf(refVal); + } + } + if(val.has_field(utility::conversions::to_string_t("max_bitrate"))) { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("max_bitrate")); + if(!fieldValue.is_null()) + { + int32_t refVal; + ok &= ModelBase::fromJson(fieldValue, refVal); + setMaxBitrate(refVal); + } + } if(val.has_field(utility::conversions::to_string_t("bitrate"))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("bitrate")); if(!fieldValue.is_null()) @@ -245,6 +272,48 @@ void VideoParameters::unsetcodec() codecIsSet_ = false; } +Object VideoParameters::getCrf() const +{ + return crf_; +} + +void VideoParameters::setCrf(const Object& value) +{ + crf_ = value; + crfIsSet_ = true; +} + +bool VideoParameters::crfIsSet() const +{ + return crfIsSet_; +} + +void VideoParameters::unsetcrf() +{ + crfIsSet_ = false; +} + +int32_t VideoParameters::getMaxBitrate() const +{ + return maxBitrate_; +} + +void VideoParameters::setMaxBitrate(int32_t value) +{ + maxBitrate_ = value; + maxBitrateIsSet_ = true; +} + +bool VideoParameters::maxBitrateIsSet() const +{ + return maxBitrateIsSet_; +} + +void VideoParameters::unsetmaxBitrate() +{ + maxBitrateIsSet_ = false; +} + int32_t VideoParameters::getBitrate() const { return bitrate_;