Compare commits
3 Commits
Metering-p
...
emap-patch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7a89ac3dc | ||
|
|
b98f01cab4 | ||
|
|
675ab8f60f |
@@ -1,3 +1,12 @@
|
||||
2020-10-20 Version: patch
|
||||
- Add isv interface.
|
||||
|
||||
2020-10-20 Version: patch
|
||||
- Generated 2016-11-01 for `live`.
|
||||
|
||||
2020-10-19 Version: patch
|
||||
- Add a new interface for asynchronous image translation.
|
||||
|
||||
2020-10-19 Version: patch
|
||||
- Metering 1019.
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ set(alimt_public_header
|
||||
set(alimt_public_header_model
|
||||
include/alibabacloud/alimt/model/CreateDocTranslateTaskRequest.h
|
||||
include/alibabacloud/alimt/model/CreateDocTranslateTaskResult.h
|
||||
include/alibabacloud/alimt/model/CreateImageTranslateTaskRequest.h
|
||||
include/alibabacloud/alimt/model/CreateImageTranslateTaskResult.h
|
||||
include/alibabacloud/alimt/model/GetDetectLanguageRequest.h
|
||||
include/alibabacloud/alimt/model/GetDetectLanguageResult.h
|
||||
include/alibabacloud/alimt/model/GetDocTranslateTaskRequest.h
|
||||
@@ -31,6 +33,8 @@ set(alimt_public_header_model
|
||||
include/alibabacloud/alimt/model/GetImageDiagnoseResult.h
|
||||
include/alibabacloud/alimt/model/GetImageTranslateRequest.h
|
||||
include/alibabacloud/alimt/model/GetImageTranslateResult.h
|
||||
include/alibabacloud/alimt/model/GetImageTranslateTaskRequest.h
|
||||
include/alibabacloud/alimt/model/GetImageTranslateTaskResult.h
|
||||
include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h
|
||||
include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h
|
||||
include/alibabacloud/alimt/model/GetTitleGenerateRequest.h
|
||||
@@ -50,6 +54,8 @@ set(alimt_src
|
||||
src/AlimtClient.cc
|
||||
src/model/CreateDocTranslateTaskRequest.cc
|
||||
src/model/CreateDocTranslateTaskResult.cc
|
||||
src/model/CreateImageTranslateTaskRequest.cc
|
||||
src/model/CreateImageTranslateTaskResult.cc
|
||||
src/model/GetDetectLanguageRequest.cc
|
||||
src/model/GetDetectLanguageResult.cc
|
||||
src/model/GetDocTranslateTaskRequest.cc
|
||||
@@ -58,6 +64,8 @@ set(alimt_src
|
||||
src/model/GetImageDiagnoseResult.cc
|
||||
src/model/GetImageTranslateRequest.cc
|
||||
src/model/GetImageTranslateResult.cc
|
||||
src/model/GetImageTranslateTaskRequest.cc
|
||||
src/model/GetImageTranslateTaskResult.cc
|
||||
src/model/GetTitleDiagnoseRequest.cc
|
||||
src/model/GetTitleDiagnoseResult.cc
|
||||
src/model/GetTitleGenerateRequest.cc
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "AlimtExport.h"
|
||||
#include "model/CreateDocTranslateTaskRequest.h"
|
||||
#include "model/CreateDocTranslateTaskResult.h"
|
||||
#include "model/CreateImageTranslateTaskRequest.h"
|
||||
#include "model/CreateImageTranslateTaskResult.h"
|
||||
#include "model/GetDetectLanguageRequest.h"
|
||||
#include "model/GetDetectLanguageResult.h"
|
||||
#include "model/GetDocTranslateTaskRequest.h"
|
||||
@@ -32,6 +34,8 @@
|
||||
#include "model/GetImageDiagnoseResult.h"
|
||||
#include "model/GetImageTranslateRequest.h"
|
||||
#include "model/GetImageTranslateResult.h"
|
||||
#include "model/GetImageTranslateTaskRequest.h"
|
||||
#include "model/GetImageTranslateTaskResult.h"
|
||||
#include "model/GetTitleDiagnoseRequest.h"
|
||||
#include "model/GetTitleDiagnoseResult.h"
|
||||
#include "model/GetTitleGenerateRequest.h"
|
||||
@@ -58,6 +62,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::CreateDocTranslateTaskResult> CreateDocTranslateTaskOutcome;
|
||||
typedef std::future<CreateDocTranslateTaskOutcome> CreateDocTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::CreateDocTranslateTaskRequest&, const CreateDocTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateDocTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::CreateImageTranslateTaskResult> CreateImageTranslateTaskOutcome;
|
||||
typedef std::future<CreateImageTranslateTaskOutcome> CreateImageTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::CreateImageTranslateTaskRequest&, const CreateImageTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateImageTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetDetectLanguageResult> GetDetectLanguageOutcome;
|
||||
typedef std::future<GetDetectLanguageOutcome> GetDetectLanguageOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::GetDetectLanguageRequest&, const GetDetectLanguageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDetectLanguageAsyncHandler;
|
||||
@@ -70,6 +77,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::GetImageTranslateResult> GetImageTranslateOutcome;
|
||||
typedef std::future<GetImageTranslateOutcome> GetImageTranslateOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::GetImageTranslateRequest&, const GetImageTranslateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetImageTranslateAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetImageTranslateTaskResult> GetImageTranslateTaskOutcome;
|
||||
typedef std::future<GetImageTranslateTaskOutcome> GetImageTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::GetImageTranslateTaskRequest&, const GetImageTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetImageTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetTitleDiagnoseResult> GetTitleDiagnoseOutcome;
|
||||
typedef std::future<GetTitleDiagnoseOutcome> GetTitleDiagnoseOutcomeCallable;
|
||||
typedef std::function<void(const AlimtClient*, const Model::GetTitleDiagnoseRequest&, const GetTitleDiagnoseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetTitleDiagnoseAsyncHandler;
|
||||
@@ -99,6 +109,9 @@ namespace AlibabaCloud
|
||||
CreateDocTranslateTaskOutcome createDocTranslateTask(const Model::CreateDocTranslateTaskRequest &request)const;
|
||||
void createDocTranslateTaskAsync(const Model::CreateDocTranslateTaskRequest& request, const CreateDocTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateDocTranslateTaskOutcomeCallable createDocTranslateTaskCallable(const Model::CreateDocTranslateTaskRequest& request) const;
|
||||
CreateImageTranslateTaskOutcome createImageTranslateTask(const Model::CreateImageTranslateTaskRequest &request)const;
|
||||
void createImageTranslateTaskAsync(const Model::CreateImageTranslateTaskRequest& request, const CreateImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateImageTranslateTaskOutcomeCallable createImageTranslateTaskCallable(const Model::CreateImageTranslateTaskRequest& request) const;
|
||||
GetDetectLanguageOutcome getDetectLanguage(const Model::GetDetectLanguageRequest &request)const;
|
||||
void getDetectLanguageAsync(const Model::GetDetectLanguageRequest& request, const GetDetectLanguageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetDetectLanguageOutcomeCallable getDetectLanguageCallable(const Model::GetDetectLanguageRequest& request) const;
|
||||
@@ -111,6 +124,9 @@ namespace AlibabaCloud
|
||||
GetImageTranslateOutcome getImageTranslate(const Model::GetImageTranslateRequest &request)const;
|
||||
void getImageTranslateAsync(const Model::GetImageTranslateRequest& request, const GetImageTranslateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetImageTranslateOutcomeCallable getImageTranslateCallable(const Model::GetImageTranslateRequest& request) const;
|
||||
GetImageTranslateTaskOutcome getImageTranslateTask(const Model::GetImageTranslateTaskRequest &request)const;
|
||||
void getImageTranslateTaskAsync(const Model::GetImageTranslateTaskRequest& request, const GetImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetImageTranslateTaskOutcomeCallable getImageTranslateTaskCallable(const Model::GetImageTranslateTaskRequest& request) const;
|
||||
GetTitleDiagnoseOutcome getTitleDiagnose(const Model::GetTitleDiagnoseRequest &request)const;
|
||||
void getTitleDiagnoseAsync(const Model::GetTitleDiagnoseRequest& request, const GetTitleDiagnoseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetTitleDiagnoseOutcomeCallable getTitleDiagnoseCallable(const Model::GetTitleDiagnoseRequest& request) const;
|
||||
|
||||
@@ -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_ALIMT_MODEL_CREATEIMAGETRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIMT_MODEL_CREATEIMAGETRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/alimt/AlimtExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Alimt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIMT_EXPORT CreateImageTranslateTaskRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
CreateImageTranslateTaskRequest();
|
||||
~CreateImageTranslateTaskRequest();
|
||||
|
||||
std::string getSourceLanguage()const;
|
||||
void setSourceLanguage(const std::string& sourceLanguage);
|
||||
std::string getClientToken()const;
|
||||
void setClientToken(const std::string& clientToken);
|
||||
std::string getUrlList()const;
|
||||
void setUrlList(const std::string& urlList);
|
||||
std::string getExtra()const;
|
||||
void setExtra(const std::string& extra);
|
||||
std::string getTargetLanguage()const;
|
||||
void setTargetLanguage(const std::string& targetLanguage);
|
||||
|
||||
private:
|
||||
std::string sourceLanguage_;
|
||||
std::string clientToken_;
|
||||
std::string urlList_;
|
||||
std::string extra_;
|
||||
std::string targetLanguage_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIMT_MODEL_CREATEIMAGETRANSLATETASKREQUEST_H_
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIMT_MODEL_CREATEIMAGETRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ALIMT_MODEL_CREATEIMAGETRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/alimt/AlimtExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Alimt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIMT_EXPORT CreateImageTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string taskId;
|
||||
};
|
||||
|
||||
|
||||
CreateImageTranslateTaskResult();
|
||||
explicit CreateImageTranslateTaskResult(const std::string &payload);
|
||||
~CreateImageTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIMT_MODEL_CREATEIMAGETRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_ALIMT_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/alimt/AlimtExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Alimt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIMT_EXPORT GetImageTranslateTaskRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetImageTranslateTaskRequest();
|
||||
~GetImageTranslateTaskRequest();
|
||||
|
||||
std::string getTaskId()const;
|
||||
void setTaskId(const std::string& taskId);
|
||||
|
||||
private:
|
||||
std::string taskId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/alimt/AlimtExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Alimt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ALIMT_EXPORT GetImageTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string imageData;
|
||||
};
|
||||
|
||||
|
||||
GetImageTranslateTaskResult();
|
||||
explicit GetImageTranslateTaskResult(const std::string &payload);
|
||||
~GetImageTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
@@ -87,6 +87,42 @@ AlimtClient::CreateDocTranslateTaskOutcomeCallable AlimtClient::createDocTransla
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AlimtClient::CreateImageTranslateTaskOutcome AlimtClient::createImageTranslateTask(const CreateImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateImageTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateImageTranslateTaskOutcome(CreateImageTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return CreateImageTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AlimtClient::createImageTranslateTaskAsync(const CreateImageTranslateTaskRequest& request, const CreateImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createImageTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AlimtClient::CreateImageTranslateTaskOutcomeCallable AlimtClient::createImageTranslateTaskCallable(const CreateImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateImageTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createImageTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AlimtClient::GetDetectLanguageOutcome AlimtClient::getDetectLanguage(const GetDetectLanguageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -231,6 +267,42 @@ AlimtClient::GetImageTranslateOutcomeCallable AlimtClient::getImageTranslateCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AlimtClient::GetImageTranslateTaskOutcome AlimtClient::getImageTranslateTask(const GetImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetImageTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetImageTranslateTaskOutcome(GetImageTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return GetImageTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AlimtClient::getImageTranslateTaskAsync(const GetImageTranslateTaskRequest& request, const GetImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getImageTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AlimtClient::GetImageTranslateTaskOutcomeCallable AlimtClient::getImageTranslateTaskCallable(const GetImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetImageTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getImageTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AlimtClient::GetTitleDiagnoseOutcome AlimtClient::getTitleDiagnose(const GetTitleDiagnoseRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
84
alimt/src/model/CreateImageTranslateTaskRequest.cc
Normal file
84
alimt/src/model/CreateImageTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/alimt/model/CreateImageTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::Alimt::Model::CreateImageTranslateTaskRequest;
|
||||
|
||||
CreateImageTranslateTaskRequest::CreateImageTranslateTaskRequest() :
|
||||
RpcServiceRequest("alimt", "2018-10-12", "CreateImageTranslateTask")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateImageTranslateTaskRequest::~CreateImageTranslateTaskRequest()
|
||||
{}
|
||||
|
||||
std::string CreateImageTranslateTaskRequest::getSourceLanguage()const
|
||||
{
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void CreateImageTranslateTaskRequest::setSourceLanguage(const std::string& sourceLanguage)
|
||||
{
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter("SourceLanguage", sourceLanguage);
|
||||
}
|
||||
|
||||
std::string CreateImageTranslateTaskRequest::getClientToken()const
|
||||
{
|
||||
return clientToken_;
|
||||
}
|
||||
|
||||
void CreateImageTranslateTaskRequest::setClientToken(const std::string& clientToken)
|
||||
{
|
||||
clientToken_ = clientToken;
|
||||
setBodyParameter("ClientToken", clientToken);
|
||||
}
|
||||
|
||||
std::string CreateImageTranslateTaskRequest::getUrlList()const
|
||||
{
|
||||
return urlList_;
|
||||
}
|
||||
|
||||
void CreateImageTranslateTaskRequest::setUrlList(const std::string& urlList)
|
||||
{
|
||||
urlList_ = urlList;
|
||||
setBodyParameter("UrlList", urlList);
|
||||
}
|
||||
|
||||
std::string CreateImageTranslateTaskRequest::getExtra()const
|
||||
{
|
||||
return extra_;
|
||||
}
|
||||
|
||||
void CreateImageTranslateTaskRequest::setExtra(const std::string& extra)
|
||||
{
|
||||
extra_ = extra;
|
||||
setBodyParameter("Extra", extra);
|
||||
}
|
||||
|
||||
std::string CreateImageTranslateTaskRequest::getTargetLanguage()const
|
||||
{
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void CreateImageTranslateTaskRequest::setTargetLanguage(const std::string& targetLanguage)
|
||||
{
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter("TargetLanguage", targetLanguage);
|
||||
}
|
||||
|
||||
66
alimt/src/model/CreateImageTranslateTaskResult.cc
Normal file
66
alimt/src/model/CreateImageTranslateTaskResult.cc
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/alimt/model/CreateImageTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Alimt;
|
||||
using namespace AlibabaCloud::Alimt::Model;
|
||||
|
||||
CreateImageTranslateTaskResult::CreateImageTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateImageTranslateTaskResult::CreateImageTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateImageTranslateTaskResult::~CreateImageTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void CreateImageTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["TaskId"].isNull())
|
||||
data_.taskId = dataNode["TaskId"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateImageTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
CreateImageTranslateTaskResult::Data CreateImageTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int CreateImageTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
40
alimt/src/model/GetImageTranslateTaskRequest.cc
Normal file
40
alimt/src/model/GetImageTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/alimt/model/GetImageTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::Alimt::Model::GetImageTranslateTaskRequest;
|
||||
|
||||
GetImageTranslateTaskRequest::GetImageTranslateTaskRequest() :
|
||||
RpcServiceRequest("alimt", "2018-10-12", "GetImageTranslateTask")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetImageTranslateTaskRequest::~GetImageTranslateTaskRequest()
|
||||
{}
|
||||
|
||||
std::string GetImageTranslateTaskRequest::getTaskId()const
|
||||
{
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetImageTranslateTaskRequest::setTaskId(const std::string& taskId)
|
||||
{
|
||||
taskId_ = taskId;
|
||||
setBodyParameter("TaskId", taskId);
|
||||
}
|
||||
|
||||
66
alimt/src/model/GetImageTranslateTaskResult.cc
Normal file
66
alimt/src/model/GetImageTranslateTaskResult.cc
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/alimt/model/GetImageTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Alimt;
|
||||
using namespace AlibabaCloud::Alimt::Model;
|
||||
|
||||
GetImageTranslateTaskResult::GetImageTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetImageTranslateTaskResult::GetImageTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetImageTranslateTaskResult::~GetImageTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void GetImageTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["ImageData"].isNull())
|
||||
data_.imageData = dataNode["ImageData"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
GetImageTranslateTaskResult::Data GetImageTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetImageTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
86
emap/CMakeLists.txt
Normal file
86
emap/CMakeLists.txt
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(emap_public_header
|
||||
include/alibabacloud/emap/EmapClient.h
|
||||
include/alibabacloud/emap/EmapExport.h )
|
||||
|
||||
set(emap_public_header_model
|
||||
include/alibabacloud/emap/model/QueryMapInfoOpenRequest.h
|
||||
include/alibabacloud/emap/model/QueryMapInfoOpenResult.h )
|
||||
|
||||
set(emap_src
|
||||
src/EmapClient.cc
|
||||
src/model/QueryMapInfoOpenRequest.cc
|
||||
src/model/QueryMapInfoOpenResult.cc )
|
||||
|
||||
add_library(emap ${LIB_TYPE}
|
||||
${emap_public_header}
|
||||
${emap_public_header_model}
|
||||
${emap_src})
|
||||
|
||||
set_target_properties(emap
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}emap
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(emap
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_EMAP_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(emap
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(emap
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(emap
|
||||
jsoncpp)
|
||||
target_include_directories(emap
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(emap
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(emap
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(emap
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(emap
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${emap_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/emap)
|
||||
install(FILES ${emap_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/emap/model)
|
||||
install(TARGETS emap
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
54
emap/include/alibabacloud/emap/EmapClient.h
Normal file
54
emap/include/alibabacloud/emap/EmapClient.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_EMAP_EMAPCLIENT_H_
|
||||
#define ALIBABACLOUD_EMAP_EMAPCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "EmapExport.h"
|
||||
#include "model/QueryMapInfoOpenRequest.h"
|
||||
#include "model/QueryMapInfoOpenResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Emap
|
||||
{
|
||||
class ALIBABACLOUD_EMAP_EXPORT EmapClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::QueryMapInfoOpenResult> QueryMapInfoOpenOutcome;
|
||||
typedef std::future<QueryMapInfoOpenOutcome> QueryMapInfoOpenOutcomeCallable;
|
||||
typedef std::function<void(const EmapClient*, const Model::QueryMapInfoOpenRequest&, const QueryMapInfoOpenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryMapInfoOpenAsyncHandler;
|
||||
|
||||
EmapClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
EmapClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
EmapClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~EmapClient();
|
||||
QueryMapInfoOpenOutcome queryMapInfoOpen(const Model::QueryMapInfoOpenRequest &request)const;
|
||||
void queryMapInfoOpenAsync(const Model::QueryMapInfoOpenRequest& request, const QueryMapInfoOpenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryMapInfoOpenOutcomeCallable queryMapInfoOpenCallable(const Model::QueryMapInfoOpenRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_EMAP_EMAPCLIENT_H_
|
||||
32
emap/include/alibabacloud/emap/EmapExport.h
Normal file
32
emap/include/alibabacloud/emap/EmapExport.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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_EMAP_EMAPEXPORT_H_
|
||||
#define ALIBABACLOUD_EMAP_EMAPEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_EMAP_LIBRARY)
|
||||
# define ALIBABACLOUD_EMAP_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_EMAP_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_EMAP_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_EMAP_EMAPEXPORT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_EMAP_MODEL_QUERYMAPINFOOPENREQUEST_H_
|
||||
#define ALIBABACLOUD_EMAP_MODEL_QUERYMAPINFOOPENREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/emap/EmapExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Emap
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_EMAP_EXPORT QueryMapInfoOpenRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryMapInfoOpenRequest();
|
||||
~QueryMapInfoOpenRequest();
|
||||
|
||||
long getStoreId()const;
|
||||
void setStoreId(long storeId);
|
||||
|
||||
private:
|
||||
long storeId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_EMAP_MODEL_QUERYMAPINFOOPENREQUEST_H_
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_EMAP_MODEL_QUERYMAPINFOOPENRESULT_H_
|
||||
#define ALIBABACLOUD_EMAP_MODEL_QUERYMAPINFOOPENRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/emap/EmapExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Emap
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_EMAP_EXPORT QueryMapInfoOpenResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
QueryMapInfoOpenResult();
|
||||
explicit QueryMapInfoOpenResult(const std::string &payload);
|
||||
~QueryMapInfoOpenResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRenderData()const;
|
||||
std::string getDynamicCode()const;
|
||||
std::string getErrorCode()const;
|
||||
std::string getDynamicMessage()const;
|
||||
std::string getErrorMessage()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string renderData_;
|
||||
std::string dynamicCode_;
|
||||
std::string errorCode_;
|
||||
std::string dynamicMessage_;
|
||||
std::string errorMessage_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_EMAP_MODEL_QUERYMAPINFOOPENRESULT_H_
|
||||
89
emap/src/EmapClient.cc
Normal file
89
emap/src/EmapClient.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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/emap/EmapClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Emap;
|
||||
using namespace AlibabaCloud::Emap::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "emap";
|
||||
}
|
||||
|
||||
EmapClient::EmapClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
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, "");
|
||||
}
|
||||
|
||||
EmapClient::EmapClient(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, "");
|
||||
}
|
||||
|
||||
EmapClient::EmapClient(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, "");
|
||||
}
|
||||
|
||||
EmapClient::~EmapClient()
|
||||
{}
|
||||
|
||||
EmapClient::QueryMapInfoOpenOutcome EmapClient::queryMapInfoOpen(const QueryMapInfoOpenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryMapInfoOpenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryMapInfoOpenOutcome(QueryMapInfoOpenResult(outcome.result()));
|
||||
else
|
||||
return QueryMapInfoOpenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void EmapClient::queryMapInfoOpenAsync(const QueryMapInfoOpenRequest& request, const QueryMapInfoOpenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryMapInfoOpen(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
EmapClient::QueryMapInfoOpenOutcomeCallable EmapClient::queryMapInfoOpenCallable(const QueryMapInfoOpenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryMapInfoOpenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryMapInfoOpen(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
40
emap/src/model/QueryMapInfoOpenRequest.cc
Normal file
40
emap/src/model/QueryMapInfoOpenRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/emap/model/QueryMapInfoOpenRequest.h>
|
||||
|
||||
using AlibabaCloud::Emap::Model::QueryMapInfoOpenRequest;
|
||||
|
||||
QueryMapInfoOpenRequest::QueryMapInfoOpenRequest() :
|
||||
RpcServiceRequest("emap", "2020-10-10", "QueryMapInfoOpen")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QueryMapInfoOpenRequest::~QueryMapInfoOpenRequest()
|
||||
{}
|
||||
|
||||
long QueryMapInfoOpenRequest::getStoreId()const
|
||||
{
|
||||
return storeId_;
|
||||
}
|
||||
|
||||
void QueryMapInfoOpenRequest::setStoreId(long storeId)
|
||||
{
|
||||
storeId_ = storeId;
|
||||
setBodyParameter("StoreId", std::to_string(storeId));
|
||||
}
|
||||
|
||||
100
emap/src/model/QueryMapInfoOpenResult.cc
Normal file
100
emap/src/model/QueryMapInfoOpenResult.cc
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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/emap/model/QueryMapInfoOpenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Emap;
|
||||
using namespace AlibabaCloud::Emap::Model;
|
||||
|
||||
QueryMapInfoOpenResult::QueryMapInfoOpenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryMapInfoOpenResult::QueryMapInfoOpenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryMapInfoOpenResult::~QueryMapInfoOpenResult()
|
||||
{}
|
||||
|
||||
void QueryMapInfoOpenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["RenderData"].isNull())
|
||||
renderData_ = value["RenderData"].asString();
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = value["ErrorCode"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["DynamicMessage"].isNull())
|
||||
dynamicMessage_ = value["DynamicMessage"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["DynamicCode"].isNull())
|
||||
dynamicCode_ = value["DynamicCode"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getRenderData()const
|
||||
{
|
||||
return renderData_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getDynamicCode()const
|
||||
{
|
||||
return dynamicCode_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getDynamicMessage()const
|
||||
{
|
||||
return dynamicMessage_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string QueryMapInfoOpenResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryMapInfoOpenResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user