Browse Source

Init amp.

sdk-team 4 years ago
parent
commit
0363b94b0d

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1261
+1.36.1262

+ 6 - 2
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}

+ 8 - 0
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<Error, Model::ModifyDefenseThresholdResult> ModifyDefenseThresholdOutcome;
 			typedef std::future<ModifyDefenseThresholdOutcome> ModifyDefenseThresholdOutcomeCallable;
 			typedef std::function<void(const Antiddos_publicClient*, const Model::ModifyDefenseThresholdRequest&, const ModifyDefenseThresholdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyDefenseThresholdAsyncHandler;
+			typedef Outcome<Error, Model::ModifyIpDefenseThresholdResult> ModifyIpDefenseThresholdOutcome;
+			typedef std::future<ModifyIpDefenseThresholdOutcome> ModifyIpDefenseThresholdOutcomeCallable;
+			typedef std::function<void(const Antiddos_publicClient*, const Model::ModifyIpDefenseThresholdRequest&, const ModifyIpDefenseThresholdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyIpDefenseThresholdAsyncHandler;
 
 			Antiddos_publicClient(const Credentials &credentials, const ClientConfiguration &configuration);
 			Antiddos_publicClient(const std::shared_ptr<CredentialsProvider> &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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
+			ModifyIpDefenseThresholdOutcomeCallable modifyIpDefenseThresholdCallable(const Model::ModifyIpDefenseThresholdRequest& request) const;
 	
 		private:
 			std::shared_ptr<EndpointProvider> endpointProvider_;

+ 66 - 0
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 <alibabacloud/antiddos-public/Antiddos_publicExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+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_

+ 49 - 0
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 <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/antiddos-public/Antiddos_publicExport.h>
+
+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_

+ 36 - 0
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<const AsyncCallerContext>& 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<std::packaged_task<ModifyIpDefenseThresholdOutcome()>>(
+			[this, request]()
+			{
+			return this->modifyIpDefenseThreshold(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+

+ 108 - 0
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 <alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdRequest.h>
+
+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");
+}
+

+ 44 - 0
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 <alibabacloud/antiddos-public/model/ModifyIpDefenseThresholdResult.h>
+#include <json/json.h>
+
+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());
+
+}
+