Browse Source

Generated 2017-05-25 for Dypnsapi.

sdk-team 6 năm trước cách đây
mục cha
commit
1c5ad6a48c

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2020-04-10 Version: 1.36.352
+- Generated 2017-05-25 for `Dypnsapi`.
+
 2020-04-10 Version: 1.36.351
 - Support GetOfficeEditURL.
 - Support RefreshOfficeEditToken.

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.351
+1.36.352

+ 6 - 2
dypnsapi/CMakeLists.txt

@@ -32,7 +32,9 @@ set(dypnsapi_public_header_model
 	include/alibabacloud/dypnsapi/model/TwiceTelVerifyRequest.h
 	include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h
 	include/alibabacloud/dypnsapi/model/VerifyMobileRequest.h
-	include/alibabacloud/dypnsapi/model/VerifyMobileResult.h )
+	include/alibabacloud/dypnsapi/model/VerifyMobileResult.h
+	include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h
+	include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h )
 
 set(dypnsapi_src 
 	src/DypnsapiClient.cc
@@ -47,7 +49,9 @@ set(dypnsapi_src
 	src/model/TwiceTelVerifyRequest.cc
 	src/model/TwiceTelVerifyResult.cc
 	src/model/VerifyMobileRequest.cc
-	src/model/VerifyMobileResult.cc )
+	src/model/VerifyMobileResult.cc
+	src/model/VerifyPhoneWithTokenRequest.cc
+	src/model/VerifyPhoneWithTokenResult.cc )
 
 add_library(dypnsapi ${LIB_TYPE}
 	${dypnsapi_public_header}

+ 8 - 0
dypnsapi/include/alibabacloud/dypnsapi/DypnsapiClient.h

@@ -34,6 +34,8 @@
 #include "model/TwiceTelVerifyResult.h"
 #include "model/VerifyMobileRequest.h"
 #include "model/VerifyMobileResult.h"
+#include "model/VerifyPhoneWithTokenRequest.h"
+#include "model/VerifyPhoneWithTokenResult.h"
 
 
 namespace AlibabaCloud
@@ -61,6 +63,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::VerifyMobileResult> VerifyMobileOutcome;
 			typedef std::future<VerifyMobileOutcome> VerifyMobileOutcomeCallable;
 			typedef std::function<void(const DypnsapiClient*, const Model::VerifyMobileRequest&, const VerifyMobileOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> VerifyMobileAsyncHandler;
+			typedef Outcome<Error, Model::VerifyPhoneWithTokenResult> VerifyPhoneWithTokenOutcome;
+			typedef std::future<VerifyPhoneWithTokenOutcome> VerifyPhoneWithTokenOutcomeCallable;
+			typedef std::function<void(const DypnsapiClient*, const Model::VerifyPhoneWithTokenRequest&, const VerifyPhoneWithTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> VerifyPhoneWithTokenAsyncHandler;
 
 			DypnsapiClient(const Credentials &credentials, const ClientConfiguration &configuration);
 			DypnsapiClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -84,6 +89,9 @@ namespace AlibabaCloud
 			VerifyMobileOutcome verifyMobile(const Model::VerifyMobileRequest &request)const;
 			void verifyMobileAsync(const Model::VerifyMobileRequest& request, const VerifyMobileAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			VerifyMobileOutcomeCallable verifyMobileCallable(const Model::VerifyMobileRequest& request) const;
+			VerifyPhoneWithTokenOutcome verifyPhoneWithToken(const Model::VerifyPhoneWithTokenRequest &request)const;
+			void verifyPhoneWithTokenAsync(const Model::VerifyPhoneWithTokenRequest& request, const VerifyPhoneWithTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			VerifyPhoneWithTokenOutcomeCallable verifyPhoneWithTokenCallable(const Model::VerifyPhoneWithTokenRequest& request) const;
 	
 		private:
 			std::shared_ptr<EndpointProvider> endpointProvider_;

+ 2 - 2
dypnsapi/include/alibabacloud/dypnsapi/model/TwiceTelVerifyResult.h

@@ -43,14 +43,14 @@ namespace AlibabaCloud
 				explicit TwiceTelVerifyResult(const std::string &payload);
 				~TwiceTelVerifyResult();
 				std::string getMessage()const;
-				TwiceTelVerifyResult getTwiceTelVerifyResult()const;
+				Result getTwiceTelVerifyResult()const;
 				std::string getCode()const;
 
 			protected:
 				void parse(const std::string &payload);
 			private:
 				std::string message_;
-				TwiceTelVerifyResult twiceTelVerifyResult_;
+				Result twiceTelVerifyResult_;
 				std::string code_;
 
 			};

+ 63 - 0
dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenRequest.h

@@ -0,0 +1,63 @@
+/*
+ * 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_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_
+#define ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/dypnsapi/DypnsapiExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dypnsapi
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DYPNSAPI_EXPORT VerifyPhoneWithTokenRequest : public RpcServiceRequest
+			{
+
+			public:
+				VerifyPhoneWithTokenRequest();
+				~VerifyPhoneWithTokenRequest();
+
+				long getResourceOwnerId()const;
+				void setResourceOwnerId(long resourceOwnerId);
+				std::string getResourceOwnerAccount()const;
+				void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
+				std::string getPhoneNumber()const;
+				void setPhoneNumber(const std::string& phoneNumber);
+				long getOwnerId()const;
+				void setOwnerId(long ownerId);
+				std::string getAccessKeyId()const;
+				void setAccessKeyId(const std::string& accessKeyId);
+				std::string getSpToken()const;
+				void setSpToken(const std::string& spToken);
+
+            private:
+				long resourceOwnerId_;
+				std::string resourceOwnerAccount_;
+				std::string phoneNumber_;
+				long ownerId_;
+				std::string accessKeyId_;
+				std::string spToken_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENREQUEST_H_

+ 60 - 0
dypnsapi/include/alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h

@@ -0,0 +1,60 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_
+#define ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dypnsapi/DypnsapiExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dypnsapi
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DYPNSAPI_EXPORT VerifyPhoneWithTokenResult : public ServiceResult
+			{
+			public:
+				struct GateVerify
+				{
+					std::string verifyResult;
+					std::string verifyId;
+				};
+
+
+				VerifyPhoneWithTokenResult();
+				explicit VerifyPhoneWithTokenResult(const std::string &payload);
+				~VerifyPhoneWithTokenResult();
+				std::string getMessage()const;
+				GateVerify getGateVerify()const;
+				std::string getCode()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string message_;
+				GateVerify gateVerify_;
+				std::string code_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DYPNSAPI_MODEL_VERIFYPHONEWITHTOKENRESULT_H_

+ 39 - 3
dypnsapi/src/DypnsapiClient.cc

@@ -31,21 +31,21 @@ DypnsapiClient::DypnsapiClient(const Credentials &credentials, const ClientConfi
 	RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dypns");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
 }
 
 DypnsapiClient::DypnsapiClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
 	RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dypns");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
 }
 
 DypnsapiClient::DypnsapiClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
 	RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dypns");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
 }
 
 DypnsapiClient::~DypnsapiClient()
@@ -267,3 +267,39 @@ DypnsapiClient::VerifyMobileOutcomeCallable DypnsapiClient::verifyMobileCallable
 	return task->get_future();
 }
 
+DypnsapiClient::VerifyPhoneWithTokenOutcome DypnsapiClient::verifyPhoneWithToken(const VerifyPhoneWithTokenRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return VerifyPhoneWithTokenOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return VerifyPhoneWithTokenOutcome(VerifyPhoneWithTokenResult(outcome.result()));
+	else
+		return VerifyPhoneWithTokenOutcome(outcome.error());
+}
+
+void DypnsapiClient::verifyPhoneWithTokenAsync(const VerifyPhoneWithTokenRequest& request, const VerifyPhoneWithTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, verifyPhoneWithToken(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+DypnsapiClient::VerifyPhoneWithTokenOutcomeCallable DypnsapiClient::verifyPhoneWithTokenCallable(const VerifyPhoneWithTokenRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<VerifyPhoneWithTokenOutcome()>>(
+			[this, request]()
+			{
+			return this->verifyPhoneWithToken(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+

+ 95 - 0
dypnsapi/src/model/VerifyPhoneWithTokenRequest.cc

@@ -0,0 +1,95 @@
+/*
+ * 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/dypnsapi/model/VerifyPhoneWithTokenRequest.h>
+
+using AlibabaCloud::Dypnsapi::Model::VerifyPhoneWithTokenRequest;
+
+VerifyPhoneWithTokenRequest::VerifyPhoneWithTokenRequest() :
+	RpcServiceRequest("dypnsapi", "2017-05-25", "VerifyPhoneWithToken")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+VerifyPhoneWithTokenRequest::~VerifyPhoneWithTokenRequest()
+{}
+
+long VerifyPhoneWithTokenRequest::getResourceOwnerId()const
+{
+	return resourceOwnerId_;
+}
+
+void VerifyPhoneWithTokenRequest::setResourceOwnerId(long resourceOwnerId)
+{
+	resourceOwnerId_ = resourceOwnerId;
+	setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
+}
+
+std::string VerifyPhoneWithTokenRequest::getResourceOwnerAccount()const
+{
+	return resourceOwnerAccount_;
+}
+
+void VerifyPhoneWithTokenRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
+{
+	resourceOwnerAccount_ = resourceOwnerAccount;
+	setParameter("ResourceOwnerAccount", resourceOwnerAccount);
+}
+
+std::string VerifyPhoneWithTokenRequest::getPhoneNumber()const
+{
+	return phoneNumber_;
+}
+
+void VerifyPhoneWithTokenRequest::setPhoneNumber(const std::string& phoneNumber)
+{
+	phoneNumber_ = phoneNumber;
+	setParameter("PhoneNumber", phoneNumber);
+}
+
+long VerifyPhoneWithTokenRequest::getOwnerId()const
+{
+	return ownerId_;
+}
+
+void VerifyPhoneWithTokenRequest::setOwnerId(long ownerId)
+{
+	ownerId_ = ownerId;
+	setParameter("OwnerId", std::to_string(ownerId));
+}
+
+std::string VerifyPhoneWithTokenRequest::getAccessKeyId()const
+{
+	return accessKeyId_;
+}
+
+void VerifyPhoneWithTokenRequest::setAccessKeyId(const std::string& accessKeyId)
+{
+	accessKeyId_ = accessKeyId;
+	setParameter("AccessKeyId", accessKeyId);
+}
+
+std::string VerifyPhoneWithTokenRequest::getSpToken()const
+{
+	return spToken_;
+}
+
+void VerifyPhoneWithTokenRequest::setSpToken(const std::string& spToken)
+{
+	spToken_ = spToken;
+	setParameter("SpToken", spToken);
+}
+

+ 68 - 0
dypnsapi/src/model/VerifyPhoneWithTokenResult.cc

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <alibabacloud/dypnsapi/model/VerifyPhoneWithTokenResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Dypnsapi;
+using namespace AlibabaCloud::Dypnsapi::Model;
+
+VerifyPhoneWithTokenResult::VerifyPhoneWithTokenResult() :
+	ServiceResult()
+{}
+
+VerifyPhoneWithTokenResult::VerifyPhoneWithTokenResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+VerifyPhoneWithTokenResult::~VerifyPhoneWithTokenResult()
+{}
+
+void VerifyPhoneWithTokenResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto gateVerifyNode = value["GateVerify"];
+	if(!gateVerifyNode["VerifyId"].isNull())
+		gateVerify_.verifyId = gateVerifyNode["VerifyId"].asString();
+	if(!gateVerifyNode["VerifyResult"].isNull())
+		gateVerify_.verifyResult = gateVerifyNode["VerifyResult"].asString();
+	if(!value["Code"].isNull())
+		code_ = value["Code"].asString();
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+
+}
+
+std::string VerifyPhoneWithTokenResult::getMessage()const
+{
+	return message_;
+}
+
+VerifyPhoneWithTokenResult::GateVerify VerifyPhoneWithTokenResult::getGateVerify()const
+{
+	return gateVerify_;
+}
+
+std::string VerifyPhoneWithTokenResult::getCode()const
+{
+	return code_;
+}
+