diff --git a/VERSION b/VERSION index c4c6434c5..7d349948e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1261 \ No newline at end of file +1.36.1262 \ No newline at end of file diff --git a/antiddos-public/CMakeLists.txt b/antiddos-public/CMakeLists.txt index ba7880ca5..b86c3d9cf 100644 --- a/antiddos-public/CMakeLists.txt +++ b/antiddos-public/CMakeLists.txt @@ -46,7 +46,9 @@ set(antiddos-public_public_header_model include/alibabacloud/antiddos-public/model/ModifyDdosStatusRequest.h include/alibabacloud/antiddos-public/model/ModifyDdosStatusResult.h include/alibabacloud/antiddos-public/model/ModifyDefenseThresholdRequest.h - include/alibabacloud/antiddos-public/model/ModifyDefenseThresholdResult.h ) + include/alibabacloud/antiddos-public/model/ModifyDefenseThresholdResult.h + include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdRequest.h + include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdResult.h ) set(antiddos-public_src src/Antiddos-publicClient.cc @@ -75,7 +77,9 @@ set(antiddos-public_src src/model/ModifyDdosStatusRequest.cc src/model/ModifyDdosStatusResult.cc src/model/ModifyDefenseThresholdRequest.cc - src/model/ModifyDefenseThresholdResult.cc ) + src/model/ModifyDefenseThresholdResult.cc + src/model/ModifyIpDefenseThresholdRequest.cc + src/model/ModifyIpDefenseThresholdResult.cc ) add_library(antiddos-public ${LIB_TYPE} ${antiddos-public_public_header} diff --git a/antiddos-public/include/alibabacloud/antiddos-public/Antiddos_publicClient.h b/antiddos-public/include/alibabacloud/antiddos-public/Antiddos_publicClient.h index 94957b8b2..17ee7da40 100644 --- a/antiddos-public/include/alibabacloud/antiddos-public/Antiddos_publicClient.h +++ b/antiddos-public/include/alibabacloud/antiddos-public/Antiddos_publicClient.h @@ -48,6 +48,8 @@ #include "model/ModifyDdosStatusResult.h" #include "model/ModifyDefenseThresholdRequest.h" #include "model/ModifyDefenseThresholdResult.h" +#include "model/ModifyIpDefenseThresholdRequest.h" +#include "model/ModifyIpDefenseThresholdResult.h" namespace AlibabaCloud @@ -96,6 +98,9 @@ namespace AlibabaCloud typedef Outcome ModifyDefenseThresholdOutcome; typedef std::future ModifyDefenseThresholdOutcomeCallable; typedef std::function&)> ModifyDefenseThresholdAsyncHandler; + typedef Outcome ModifyIpDefenseThresholdOutcome; + typedef std::future ModifyIpDefenseThresholdOutcomeCallable; + typedef std::function&)> ModifyIpDefenseThresholdAsyncHandler; Antiddos_publicClient(const Credentials &credentials, const ClientConfiguration &configuration); Antiddos_publicClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -140,6 +145,9 @@ namespace AlibabaCloud ModifyDefenseThresholdOutcome modifyDefenseThreshold(const Model::ModifyDefenseThresholdRequest &request)const; void modifyDefenseThresholdAsync(const Model::ModifyDefenseThresholdRequest& request, const ModifyDefenseThresholdAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ModifyDefenseThresholdOutcomeCallable modifyDefenseThresholdCallable(const Model::ModifyDefenseThresholdRequest& request) const; + ModifyIpDefenseThresholdOutcome modifyIpDefenseThreshold(const Model::ModifyIpDefenseThresholdRequest &request)const; + void modifyIpDefenseThresholdAsync(const Model::ModifyIpDefenseThresholdRequest& request, const ModifyIpDefenseThresholdAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ModifyIpDefenseThresholdOutcomeCallable modifyIpDefenseThresholdCallable(const Model::ModifyIpDefenseThresholdRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdRequest.h b/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdRequest.h new file mode 100644 index 000000000..85d121fc1 --- /dev/null +++ b/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdRequest.h @@ -0,0 +1,66 @@ +/* + * 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_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDREQUEST_H_ +#define ALIBABACLOUD_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Antiddos_public { +namespace Model { +class ALIBABACLOUD_ANTIDDOS_PUBLIC_EXPORT ModifyIpDefenseThresholdRequest : public RpcServiceRequest { +public: + ModifyIpDefenseThresholdRequest(); + ~ModifyIpDefenseThresholdRequest(); + std::string getInternetIp() const; + void setInternetIp(const std::string &internetIp); + std::string getSourceIp() const; + void setSourceIp(const std::string &sourceIp); + std::string getDdosRegionId() const; + void setDdosRegionId(const std::string &ddosRegionId); + std::string getInstanceType() const; + void setInstanceType(const std::string &instanceType); + std::string getLang() const; + void setLang(const std::string &lang); + int getBps() const; + void setBps(int bps); + int getPps() const; + void setPps(int pps); + std::string getInstanceId() const; + void setInstanceId(const std::string &instanceId); + bool getIsAuto() const; + void setIsAuto(bool isAuto); + +private: + std::string internetIp_; + std::string sourceIp_; + std::string ddosRegionId_; + std::string instanceType_; + std::string lang_; + int bps_; + int pps_; + std::string instanceId_; + bool isAuto_; +}; +} // namespace Model +} // namespace Antiddos_public +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDREQUEST_H_ diff --git a/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdResult.h b/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdResult.h new file mode 100644 index 000000000..bf0d60797 --- /dev/null +++ b/antiddos-public/include/alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdResult.h @@ -0,0 +1,49 @@ +/* + * 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_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDRESULT_H_ +#define ALIBABACLOUD_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Antiddos_public + { + namespace Model + { + class ALIBABACLOUD_ANTIDDOS_PUBLIC_EXPORT ModifyIpDefenseThresholdResult : public ServiceResult + { + public: + + + ModifyIpDefenseThresholdResult(); + explicit ModifyIpDefenseThresholdResult(const std::string &payload); + ~ModifyIpDefenseThresholdResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ANTIDDOS_PUBLIC_MODEL_MODIFYIPDEFENSETHRESHOLDRESULT_H_ \ No newline at end of file diff --git a/antiddos-public/src/Antiddos-publicClient.cc b/antiddos-public/src/Antiddos-publicClient.cc index 3b10c6d2c..a2f38bd87 100644 --- a/antiddos-public/src/Antiddos-publicClient.cc +++ b/antiddos-public/src/Antiddos-publicClient.cc @@ -519,3 +519,39 @@ Antiddos_publicClient::ModifyDefenseThresholdOutcomeCallable Antiddos_publicClie return task->get_future(); } +Antiddos_publicClient::ModifyIpDefenseThresholdOutcome Antiddos_publicClient::modifyIpDefenseThreshold(const ModifyIpDefenseThresholdRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ModifyIpDefenseThresholdOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ModifyIpDefenseThresholdOutcome(ModifyIpDefenseThresholdResult(outcome.result())); + else + return ModifyIpDefenseThresholdOutcome(outcome.error()); +} + +void Antiddos_publicClient::modifyIpDefenseThresholdAsync(const ModifyIpDefenseThresholdRequest& request, const ModifyIpDefenseThresholdAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, modifyIpDefenseThreshold(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Antiddos_publicClient::ModifyIpDefenseThresholdOutcomeCallable Antiddos_publicClient::modifyIpDefenseThresholdCallable(const ModifyIpDefenseThresholdRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->modifyIpDefenseThreshold(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/antiddos-public/src/model/ModifyIpDefenseThresholdRequest.cc b/antiddos-public/src/model/ModifyIpDefenseThresholdRequest.cc new file mode 100644 index 000000000..fb26f8a34 --- /dev/null +++ b/antiddos-public/src/model/ModifyIpDefenseThresholdRequest.cc @@ -0,0 +1,108 @@ +/* + * 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::Antiddos_public::Model::ModifyIpDefenseThresholdRequest; + +ModifyIpDefenseThresholdRequest::ModifyIpDefenseThresholdRequest() + : RpcServiceRequest("antiddos-public", "2017-05-18", "ModifyIpDefenseThreshold") { + setMethod(HttpRequest::Method::Post); +} + +ModifyIpDefenseThresholdRequest::~ModifyIpDefenseThresholdRequest() {} + +std::string ModifyIpDefenseThresholdRequest::getInternetIp() const { + return internetIp_; +} + +void ModifyIpDefenseThresholdRequest::setInternetIp(const std::string &internetIp) { + internetIp_ = internetIp; + setParameter(std::string("InternetIp"), internetIp); +} + +std::string ModifyIpDefenseThresholdRequest::getSourceIp() const { + return sourceIp_; +} + +void ModifyIpDefenseThresholdRequest::setSourceIp(const std::string &sourceIp) { + sourceIp_ = sourceIp; + setParameter(std::string("SourceIp"), sourceIp); +} + +std::string ModifyIpDefenseThresholdRequest::getDdosRegionId() const { + return ddosRegionId_; +} + +void ModifyIpDefenseThresholdRequest::setDdosRegionId(const std::string &ddosRegionId) { + ddosRegionId_ = ddosRegionId; + setParameter(std::string("DdosRegionId"), ddosRegionId); +} + +std::string ModifyIpDefenseThresholdRequest::getInstanceType() const { + return instanceType_; +} + +void ModifyIpDefenseThresholdRequest::setInstanceType(const std::string &instanceType) { + instanceType_ = instanceType; + setParameter(std::string("InstanceType"), instanceType); +} + +std::string ModifyIpDefenseThresholdRequest::getLang() const { + return lang_; +} + +void ModifyIpDefenseThresholdRequest::setLang(const std::string &lang) { + lang_ = lang; + setParameter(std::string("Lang"), lang); +} + +int ModifyIpDefenseThresholdRequest::getBps() const { + return bps_; +} + +void ModifyIpDefenseThresholdRequest::setBps(int bps) { + bps_ = bps; + setParameter(std::string("Bps"), std::to_string(bps)); +} + +int ModifyIpDefenseThresholdRequest::getPps() const { + return pps_; +} + +void ModifyIpDefenseThresholdRequest::setPps(int pps) { + pps_ = pps; + setParameter(std::string("Pps"), std::to_string(pps)); +} + +std::string ModifyIpDefenseThresholdRequest::getInstanceId() const { + return instanceId_; +} + +void ModifyIpDefenseThresholdRequest::setInstanceId(const std::string &instanceId) { + instanceId_ = instanceId; + setParameter(std::string("InstanceId"), instanceId); +} + +bool ModifyIpDefenseThresholdRequest::getIsAuto() const { + return isAuto_; +} + +void ModifyIpDefenseThresholdRequest::setIsAuto(bool isAuto) { + isAuto_ = isAuto; + setParameter(std::string("IsAuto"), isAuto ? "true" : "false"); +} + diff --git a/antiddos-public/src/model/ModifyIpDefenseThresholdResult.cc b/antiddos-public/src/model/ModifyIpDefenseThresholdResult.cc new file mode 100644 index 000000000..f873bd6ec --- /dev/null +++ b/antiddos-public/src/model/ModifyIpDefenseThresholdResult.cc @@ -0,0 +1,44 @@ +/* + * 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::Antiddos_public; +using namespace AlibabaCloud::Antiddos_public::Model; + +ModifyIpDefenseThresholdResult::ModifyIpDefenseThresholdResult() : + ServiceResult() +{} + +ModifyIpDefenseThresholdResult::ModifyIpDefenseThresholdResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ModifyIpDefenseThresholdResult::~ModifyIpDefenseThresholdResult() +{} + +void ModifyIpDefenseThresholdResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +