Fix build failed on windows

This commit is contained in:
fenglc
2018-03-14 15:43:03 +08:00
parent 89523ed659
commit 7be1f34dae
32 changed files with 2116 additions and 2251 deletions

View File

@@ -230,7 +230,6 @@ namespace AlibabaCloud
QueryCrackEventOutcomeCallable queryCrackEventCallable(const Model::QueryCrackEventRequest& request) const; QueryCrackEventOutcomeCallable queryCrackEventCallable(const Model::QueryCrackEventRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Aegis; using namespace AlibabaCloud::Aegis;
using namespace AlibabaCloud::Aegis::Model; using namespace AlibabaCloud::Aegis::Model;
namespace
{
const std::string SERVICE_NAME = "aegis";
}
AegisClient::AegisClient(const Credentials &credentials, const ClientConfiguration &configuration) : AegisClient::AegisClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "vipaegis"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vipaegis");
} }
AegisClient::AegisClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : AegisClient::AegisClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "vipaegis"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vipaegis");
} }
AegisClient::AegisClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : AegisClient::AegisClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "vipaegis"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "vipaegis");
} }
AegisClient::~AegisClient() AegisClient::~AegisClient()
{} {}
CoreClient::EndpointOutcome AegisClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
AegisClient::GetEntityListOutcome AegisClient::getEntityList(const GetEntityListRequest &request) const AegisClient::GetEntityListOutcome AegisClient::getEntityList(const GetEntityListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetEntityListOutcome(endpointOutcome.error()); return GetEntityListOutcome(endpointOutcome.error());
@@ -97,7 +89,7 @@ AegisClient::GetEntityListOutcomeCallable AegisClient::getEntityListCallable(con
AegisClient::GetStatisticsByUuidOutcome AegisClient::getStatisticsByUuid(const GetStatisticsByUuidRequest &request) const AegisClient::GetStatisticsByUuidOutcome AegisClient::getStatisticsByUuid(const GetStatisticsByUuidRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetStatisticsByUuidOutcome(endpointOutcome.error()); return GetStatisticsByUuidOutcome(endpointOutcome.error());
@@ -133,7 +125,7 @@ AegisClient::GetStatisticsByUuidOutcomeCallable AegisClient::getStatisticsByUuid
AegisClient::GetStatisticsOutcome AegisClient::getStatistics(const GetStatisticsRequest &request) const AegisClient::GetStatisticsOutcome AegisClient::getStatistics(const GetStatisticsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetStatisticsOutcome(endpointOutcome.error()); return GetStatisticsOutcome(endpointOutcome.error());
@@ -169,7 +161,7 @@ AegisClient::GetStatisticsOutcomeCallable AegisClient::getStatisticsCallable(con
AegisClient::DescribeVulDetailsOutcome AegisClient::describeVulDetails(const DescribeVulDetailsRequest &request) const AegisClient::DescribeVulDetailsOutcome AegisClient::describeVulDetails(const DescribeVulDetailsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeVulDetailsOutcome(endpointOutcome.error()); return DescribeVulDetailsOutcome(endpointOutcome.error());
@@ -205,7 +197,7 @@ AegisClient::DescribeVulDetailsOutcomeCallable AegisClient::describeVulDetailsCa
AegisClient::DeleteStrategyOutcome AegisClient::deleteStrategy(const DeleteStrategyRequest &request) const AegisClient::DeleteStrategyOutcome AegisClient::deleteStrategy(const DeleteStrategyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteStrategyOutcome(endpointOutcome.error()); return DeleteStrategyOutcome(endpointOutcome.error());
@@ -241,7 +233,7 @@ AegisClient::DeleteStrategyOutcomeCallable AegisClient::deleteStrategyCallable(c
AegisClient::GetCrackStatisticsOutcome AegisClient::getCrackStatistics(const GetCrackStatisticsRequest &request) const AegisClient::GetCrackStatisticsOutcome AegisClient::getCrackStatistics(const GetCrackStatisticsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetCrackStatisticsOutcome(endpointOutcome.error()); return GetCrackStatisticsOutcome(endpointOutcome.error());
@@ -277,7 +269,7 @@ AegisClient::GetCrackStatisticsOutcomeCallable AegisClient::getCrackStatisticsCa
AegisClient::DescribeWarningOutcome AegisClient::describeWarning(const DescribeWarningRequest &request) const AegisClient::DescribeWarningOutcome AegisClient::describeWarning(const DescribeWarningRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeWarningOutcome(endpointOutcome.error()); return DescribeWarningOutcome(endpointOutcome.error());
@@ -313,7 +305,7 @@ AegisClient::DescribeWarningOutcomeCallable AegisClient::describeWarningCallable
AegisClient::ReleaseInstanceOutcome AegisClient::releaseInstance(const ReleaseInstanceRequest &request) const AegisClient::ReleaseInstanceOutcome AegisClient::releaseInstance(const ReleaseInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ReleaseInstanceOutcome(endpointOutcome.error()); return ReleaseInstanceOutcome(endpointOutcome.error());
@@ -349,7 +341,7 @@ AegisClient::ReleaseInstanceOutcomeCallable AegisClient::releaseInstanceCallable
AegisClient::DescribeSuspiciousEventsOutcome AegisClient::describeSuspiciousEvents(const DescribeSuspiciousEventsRequest &request) const AegisClient::DescribeSuspiciousEventsOutcome AegisClient::describeSuspiciousEvents(const DescribeSuspiciousEventsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeSuspiciousEventsOutcome(endpointOutcome.error()); return DescribeSuspiciousEventsOutcome(endpointOutcome.error());
@@ -385,7 +377,7 @@ AegisClient::DescribeSuspiciousEventsOutcomeCallable AegisClient::describeSuspic
AegisClient::CreateInstanceOutcome AegisClient::createInstance(const CreateInstanceRequest &request) const AegisClient::CreateInstanceOutcome AegisClient::createInstance(const CreateInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateInstanceOutcome(endpointOutcome.error()); return CreateInstanceOutcome(endpointOutcome.error());
@@ -421,7 +413,7 @@ AegisClient::CreateInstanceOutcomeCallable AegisClient::createInstanceCallable(c
AegisClient::DescribeVulListOutcome AegisClient::describeVulList(const DescribeVulListRequest &request) const AegisClient::DescribeVulListOutcome AegisClient::describeVulList(const DescribeVulListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeVulListOutcome(endpointOutcome.error()); return DescribeVulListOutcome(endpointOutcome.error());
@@ -457,7 +449,7 @@ AegisClient::DescribeVulListOutcomeCallable AegisClient::describeVulListCallable
AegisClient::UpgradeInstanceOutcome AegisClient::upgradeInstance(const UpgradeInstanceRequest &request) const AegisClient::UpgradeInstanceOutcome AegisClient::upgradeInstance(const UpgradeInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpgradeInstanceOutcome(endpointOutcome.error()); return UpgradeInstanceOutcome(endpointOutcome.error());
@@ -493,7 +485,7 @@ AegisClient::UpgradeInstanceOutcomeCallable AegisClient::upgradeInstanceCallable
AegisClient::RenewInstanceOutcome AegisClient::renewInstance(const RenewInstanceRequest &request) const AegisClient::RenewInstanceOutcome AegisClient::renewInstance(const RenewInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RenewInstanceOutcome(endpointOutcome.error()); return RenewInstanceOutcome(endpointOutcome.error());
@@ -529,7 +521,7 @@ AegisClient::RenewInstanceOutcomeCallable AegisClient::renewInstanceCallable(con
AegisClient::DescribeStrategyTargetOutcome AegisClient::describeStrategyTarget(const DescribeStrategyTargetRequest &request) const AegisClient::DescribeStrategyTargetOutcome AegisClient::describeStrategyTarget(const DescribeStrategyTargetRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeStrategyTargetOutcome(endpointOutcome.error()); return DescribeStrategyTargetOutcome(endpointOutcome.error());
@@ -565,7 +557,7 @@ AegisClient::DescribeStrategyTargetOutcomeCallable AegisClient::describeStrategy
AegisClient::QueryLoginEventOutcome AegisClient::queryLoginEvent(const QueryLoginEventRequest &request) const AegisClient::QueryLoginEventOutcome AegisClient::queryLoginEvent(const QueryLoginEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryLoginEventOutcome(endpointOutcome.error()); return QueryLoginEventOutcome(endpointOutcome.error());
@@ -601,7 +593,7 @@ AegisClient::QueryLoginEventOutcomeCallable AegisClient::queryLoginEventCallable
AegisClient::GetAccountStatisticsOutcome AegisClient::getAccountStatistics(const GetAccountStatisticsRequest &request) const AegisClient::GetAccountStatisticsOutcome AegisClient::getAccountStatistics(const GetAccountStatisticsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetAccountStatisticsOutcome(endpointOutcome.error()); return GetAccountStatisticsOutcome(endpointOutcome.error());
@@ -637,7 +629,7 @@ AegisClient::GetAccountStatisticsOutcomeCallable AegisClient::getAccountStatisti
AegisClient::ModifyStrategyOutcome AegisClient::modifyStrategy(const ModifyStrategyRequest &request) const AegisClient::ModifyStrategyOutcome AegisClient::modifyStrategy(const ModifyStrategyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyStrategyOutcome(endpointOutcome.error()); return ModifyStrategyOutcome(endpointOutcome.error());
@@ -673,7 +665,7 @@ AegisClient::ModifyStrategyOutcomeCallable AegisClient::modifyStrategyCallable(c
AegisClient::ModifyStrategyTargetOutcome AegisClient::modifyStrategyTarget(const ModifyStrategyTargetRequest &request) const AegisClient::ModifyStrategyTargetOutcome AegisClient::modifyStrategyTarget(const ModifyStrategyTargetRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyStrategyTargetOutcome(endpointOutcome.error()); return ModifyStrategyTargetOutcome(endpointOutcome.error());
@@ -709,7 +701,7 @@ AegisClient::ModifyStrategyTargetOutcomeCallable AegisClient::modifyStrategyTarg
AegisClient::ModifyBatchIgnoreVulOutcome AegisClient::modifyBatchIgnoreVul(const ModifyBatchIgnoreVulRequest &request) const AegisClient::ModifyBatchIgnoreVulOutcome AegisClient::modifyBatchIgnoreVul(const ModifyBatchIgnoreVulRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyBatchIgnoreVulOutcome(endpointOutcome.error()); return ModifyBatchIgnoreVulOutcome(endpointOutcome.error());
@@ -745,7 +737,7 @@ AegisClient::ModifyBatchIgnoreVulOutcomeCallable AegisClient::modifyBatchIgnoreV
AegisClient::DescribeWebshellOutcome AegisClient::describeWebshell(const DescribeWebshellRequest &request) const AegisClient::DescribeWebshellOutcome AegisClient::describeWebshell(const DescribeWebshellRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeWebshellOutcome(endpointOutcome.error()); return DescribeWebshellOutcome(endpointOutcome.error());
@@ -781,7 +773,7 @@ AegisClient::DescribeWebshellOutcomeCallable AegisClient::describeWebshellCallab
AegisClient::DescribeStratetyDetailOutcome AegisClient::describeStratetyDetail(const DescribeStratetyDetailRequest &request) const AegisClient::DescribeStratetyDetailOutcome AegisClient::describeStratetyDetail(const DescribeStratetyDetailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeStratetyDetailOutcome(endpointOutcome.error()); return DescribeStratetyDetailOutcome(endpointOutcome.error());
@@ -817,7 +809,7 @@ AegisClient::DescribeStratetyDetailOutcomeCallable AegisClient::describeStratety
AegisClient::DescribeStratetyOutcome AegisClient::describeStratety(const DescribeStratetyRequest &request) const AegisClient::DescribeStratetyOutcome AegisClient::describeStratety(const DescribeStratetyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeStratetyOutcome(endpointOutcome.error()); return DescribeStratetyOutcome(endpointOutcome.error());
@@ -853,7 +845,7 @@ AegisClient::DescribeStratetyOutcomeCallable AegisClient::describeStratetyCallab
AegisClient::DescribeLoginLogsOutcome AegisClient::describeLoginLogs(const DescribeLoginLogsRequest &request) const AegisClient::DescribeLoginLogsOutcome AegisClient::describeLoginLogs(const DescribeLoginLogsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoginLogsOutcome(endpointOutcome.error()); return DescribeLoginLogsOutcome(endpointOutcome.error());
@@ -889,7 +881,7 @@ AegisClient::DescribeLoginLogsOutcomeCallable AegisClient::describeLoginLogsCall
AegisClient::QueryCrackEventOutcome AegisClient::queryCrackEvent(const QueryCrackEventRequest &request) const AegisClient::QueryCrackEventOutcome AegisClient::queryCrackEvent(const QueryCrackEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryCrackEventOutcome(endpointOutcome.error()); return QueryCrackEventOutcome(endpointOutcome.error());

View File

@@ -134,7 +134,6 @@ namespace AlibabaCloud
AnalyzeNvcOutcomeCallable analyzeNvcCallable(const Model::AnalyzeNvcRequest& request) const; AnalyzeNvcOutcomeCallable analyzeNvcCallable(const Model::AnalyzeNvcRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Afs; using namespace AlibabaCloud::Afs;
using namespace AlibabaCloud::Afs::Model; using namespace AlibabaCloud::Afs::Model;
namespace
{
const std::string SERVICE_NAME = "afs";
}
AfsClient::AfsClient(const Credentials &credentials, const ClientConfiguration &configuration) : AfsClient::AfsClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
AfsClient::AfsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : AfsClient::AfsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
AfsClient::AfsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : AfsClient::AfsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
AfsClient::~AfsClient() AfsClient::~AfsClient()
{} {}
CoreClient::EndpointOutcome AfsClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
AfsClient::DescribeEarlyWarningOutcome AfsClient::describeEarlyWarning(const DescribeEarlyWarningRequest &request) const AfsClient::DescribeEarlyWarningOutcome AfsClient::describeEarlyWarning(const DescribeEarlyWarningRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeEarlyWarningOutcome(endpointOutcome.error()); return DescribeEarlyWarningOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ AfsClient::DescribeEarlyWarningOutcomeCallable AfsClient::describeEarlyWarningCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::SetEarlyWarningOutcome AfsClient::setEarlyWarning(const SetEarlyWarningRequest &request) const AfsClient::SetEarlyWarningOutcome AfsClient::setEarlyWarning(const SetEarlyWarningRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetEarlyWarningOutcome(endpointOutcome.error()); return SetEarlyWarningOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ AfsClient::SetEarlyWarningOutcomeCallable AfsClient::setEarlyWarningCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribeCaptchaIpCityOutcome AfsClient::describeCaptchaIpCity(const DescribeCaptchaIpCityRequest &request) const AfsClient::DescribeCaptchaIpCityOutcome AfsClient::describeCaptchaIpCity(const DescribeCaptchaIpCityRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCaptchaIpCityOutcome(endpointOutcome.error()); return DescribeCaptchaIpCityOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ AfsClient::DescribeCaptchaIpCityOutcomeCallable AfsClient::describeCaptchaIpCity
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::ConfigurationStyleOutcome AfsClient::configurationStyle(const ConfigurationStyleRequest &request) const AfsClient::ConfigurationStyleOutcome AfsClient::configurationStyle(const ConfigurationStyleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ConfigurationStyleOutcome(endpointOutcome.error()); return ConfigurationStyleOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ AfsClient::ConfigurationStyleOutcomeCallable AfsClient::configurationStyleCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribeCaptchaMinOutcome AfsClient::describeCaptchaMin(const DescribeCaptchaMinRequest &request) const AfsClient::DescribeCaptchaMinOutcome AfsClient::describeCaptchaMin(const DescribeCaptchaMinRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCaptchaMinOutcome(endpointOutcome.error()); return DescribeCaptchaMinOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ AfsClient::DescribeCaptchaMinOutcomeCallable AfsClient::describeCaptchaMinCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribeCaptchaRiskOutcome AfsClient::describeCaptchaRisk(const DescribeCaptchaRiskRequest &request) const AfsClient::DescribeCaptchaRiskOutcome AfsClient::describeCaptchaRisk(const DescribeCaptchaRiskRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCaptchaRiskOutcome(endpointOutcome.error()); return DescribeCaptchaRiskOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ AfsClient::DescribeCaptchaRiskOutcomeCallable AfsClient::describeCaptchaRiskCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::AuthenticateSigOutcome AfsClient::authenticateSig(const AuthenticateSigRequest &request) const AfsClient::AuthenticateSigOutcome AfsClient::authenticateSig(const AuthenticateSigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AuthenticateSigOutcome(endpointOutcome.error()); return AuthenticateSigOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ AfsClient::AuthenticateSigOutcomeCallable AfsClient::authenticateSigCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribeConfigNameOutcome AfsClient::describeConfigName(const DescribeConfigNameRequest &request) const AfsClient::DescribeConfigNameOutcome AfsClient::describeConfigName(const DescribeConfigNameRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeConfigNameOutcome(endpointOutcome.error()); return DescribeConfigNameOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ AfsClient::DescribeConfigNameOutcomeCallable AfsClient::describeConfigNameCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribeCaptchaDayOutcome AfsClient::describeCaptchaDay(const DescribeCaptchaDayRequest &request) const AfsClient::DescribeCaptchaDayOutcome AfsClient::describeCaptchaDay(const DescribeCaptchaDayRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCaptchaDayOutcome(endpointOutcome.error()); return DescribeCaptchaDayOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ AfsClient::DescribeCaptchaDayOutcomeCallable AfsClient::describeCaptchaDayCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::DescribePersonMachineListOutcome AfsClient::describePersonMachineList(const DescribePersonMachineListRequest &request) const AfsClient::DescribePersonMachineListOutcome AfsClient::describePersonMachineList(const DescribePersonMachineListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribePersonMachineListOutcome(endpointOutcome.error()); return DescribePersonMachineListOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ AfsClient::DescribePersonMachineListOutcomeCallable AfsClient::describePersonMac
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::CreateConfigurationOutcome AfsClient::createConfiguration(const CreateConfigurationRequest &request) const AfsClient::CreateConfigurationOutcome AfsClient::createConfiguration(const CreateConfigurationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateConfigurationOutcome(endpointOutcome.error()); return CreateConfigurationOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ AfsClient::CreateConfigurationOutcomeCallable AfsClient::createConfigurationCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
AfsClient::AnalyzeNvcOutcome AfsClient::analyzeNvc(const AnalyzeNvcRequest &request) const AfsClient::AnalyzeNvcOutcome AfsClient::analyzeNvc(const AnalyzeNvcRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AnalyzeNvcOutcome(endpointOutcome.error()); return AnalyzeNvcOutcome(endpointOutcome.error());
@@ -490,4 +482,4 @@ AfsClient::AnalyzeNvcOutcomeCallable AfsClient::analyzeNvcCallable(const Analyze
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -198,7 +198,6 @@ namespace AlibabaCloud
GetUserOutcomeCallable getUserCallable(const Model::GetUserRequest& request) const; GetUserOutcomeCallable getUserCallable(const Model::GetUserRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::CCC; using namespace AlibabaCloud::CCC;
using namespace AlibabaCloud::CCC::Model; using namespace AlibabaCloud::CCC::Model;
namespace
{
const std::string SERVICE_NAME = "CCC";
}
CCCClient::CCCClient(const Credentials &credentials, const ClientConfiguration &configuration) : CCCClient::CCCClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "CCC"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "CCC");
} }
CCCClient::CCCClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : CCCClient::CCCClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "CCC"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "CCC");
} }
CCCClient::CCCClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : CCCClient::CCCClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "CCC"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "CCC");
} }
CCCClient::~CCCClient() CCCClient::~CCCClient()
{} {}
CoreClient::EndpointOutcome CCCClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
CCCClient::ListRecordingsByContactIdOutcome CCCClient::listRecordingsByContactId(const ListRecordingsByContactIdRequest &request) const CCCClient::ListRecordingsByContactIdOutcome CCCClient::listRecordingsByContactId(const ListRecordingsByContactIdRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListRecordingsByContactIdOutcome(endpointOutcome.error()); return ListRecordingsByContactIdOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ CCCClient::ListRecordingsByContactIdOutcomeCallable CCCClient::listRecordingsByC
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListUsersOfSkillGroupOutcome CCCClient::listUsersOfSkillGroup(const ListUsersOfSkillGroupRequest &request) const CCCClient::ListUsersOfSkillGroupOutcome CCCClient::listUsersOfSkillGroup(const ListUsersOfSkillGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListUsersOfSkillGroupOutcome(endpointOutcome.error()); return ListUsersOfSkillGroupOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ CCCClient::ListUsersOfSkillGroupOutcomeCallable CCCClient::listUsersOfSkillGroup
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::DeleteSkillGroupOutcome CCCClient::deleteSkillGroup(const DeleteSkillGroupRequest &request) const CCCClient::DeleteSkillGroupOutcome CCCClient::deleteSkillGroup(const DeleteSkillGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteSkillGroupOutcome(endpointOutcome.error()); return DeleteSkillGroupOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ CCCClient::DeleteSkillGroupOutcomeCallable CCCClient::deleteSkillGroupCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ModifyPhoneNumberOutcome CCCClient::modifyPhoneNumber(const ModifyPhoneNumberRequest &request) const CCCClient::ModifyPhoneNumberOutcome CCCClient::modifyPhoneNumber(const ModifyPhoneNumberRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyPhoneNumberOutcome(endpointOutcome.error()); return ModifyPhoneNumberOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ CCCClient::ModifyPhoneNumberOutcomeCallable CCCClient::modifyPhoneNumberCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListUsersOutcome CCCClient::listUsers(const ListUsersRequest &request) const CCCClient::ListUsersOutcome CCCClient::listUsers(const ListUsersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListUsersOutcome(endpointOutcome.error()); return ListUsersOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ CCCClient::ListUsersOutcomeCallable CCCClient::listUsersCallable(const ListUsers
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListSkillGroupsOutcome CCCClient::listSkillGroups(const ListSkillGroupsRequest &request) const CCCClient::ListSkillGroupsOutcome CCCClient::listSkillGroups(const ListSkillGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListSkillGroupsOutcome(endpointOutcome.error()); return ListSkillGroupsOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ CCCClient::ListSkillGroupsOutcomeCallable CCCClient::listSkillGroupsCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListSkillGroupsOfUserOutcome CCCClient::listSkillGroupsOfUser(const ListSkillGroupsOfUserRequest &request) const CCCClient::ListSkillGroupsOfUserOutcome CCCClient::listSkillGroupsOfUser(const ListSkillGroupsOfUserRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListSkillGroupsOfUserOutcome(endpointOutcome.error()); return ListSkillGroupsOfUserOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ CCCClient::ListSkillGroupsOfUserOutcomeCallable CCCClient::listSkillGroupsOfUser
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::RemovePhoneNumberOutcome CCCClient::removePhoneNumber(const RemovePhoneNumberRequest &request) const CCCClient::RemovePhoneNumberOutcome CCCClient::removePhoneNumber(const RemovePhoneNumberRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemovePhoneNumberOutcome(endpointOutcome.error()); return RemovePhoneNumberOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ CCCClient::RemovePhoneNumberOutcomeCallable CCCClient::removePhoneNumberCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListCallDetailRecordsOutcome CCCClient::listCallDetailRecords(const ListCallDetailRecordsRequest &request) const CCCClient::ListCallDetailRecordsOutcome CCCClient::listCallDetailRecords(const ListCallDetailRecordsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListCallDetailRecordsOutcome(endpointOutcome.error()); return ListCallDetailRecordsOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ CCCClient::ListCallDetailRecordsOutcomeCallable CCCClient::listCallDetailRecords
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::AddPhoneNumberOutcome CCCClient::addPhoneNumber(const AddPhoneNumberRequest &request) const CCCClient::AddPhoneNumberOutcome CCCClient::addPhoneNumber(const AddPhoneNumberRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddPhoneNumberOutcome(endpointOutcome.error()); return AddPhoneNumberOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ CCCClient::AddPhoneNumberOutcomeCallable CCCClient::addPhoneNumberCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListRecordingsOutcome CCCClient::listRecordings(const ListRecordingsRequest &request) const CCCClient::ListRecordingsOutcome CCCClient::listRecordings(const ListRecordingsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListRecordingsOutcome(endpointOutcome.error()); return ListRecordingsOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ CCCClient::ListRecordingsOutcomeCallable CCCClient::listRecordingsCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::GetConfigOutcome CCCClient::getConfig(const GetConfigRequest &request) const CCCClient::GetConfigOutcome CCCClient::getConfig(const GetConfigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetConfigOutcome(endpointOutcome.error()); return GetConfigOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ CCCClient::GetConfigOutcomeCallable CCCClient::getConfigCallable(const GetConfig
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::DownloadRecordingOutcome CCCClient::downloadRecording(const DownloadRecordingRequest &request) const CCCClient::DownloadRecordingOutcome CCCClient::downloadRecording(const DownloadRecordingRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DownloadRecordingOutcome(endpointOutcome.error()); return DownloadRecordingOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ CCCClient::DownloadRecordingOutcomeCallable CCCClient::downloadRecordingCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListPhoneNumbersOutcome CCCClient::listPhoneNumbers(const ListPhoneNumbersRequest &request) const CCCClient::ListPhoneNumbersOutcome CCCClient::listPhoneNumbers(const ListPhoneNumbersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPhoneNumbersOutcome(endpointOutcome.error()); return ListPhoneNumbersOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ CCCClient::ListPhoneNumbersOutcomeCallable CCCClient::listPhoneNumbersCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::RefreshTokenOutcome CCCClient::refreshToken(const RefreshTokenRequest &request) const CCCClient::RefreshTokenOutcome CCCClient::refreshToken(const RefreshTokenRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RefreshTokenOutcome(endpointOutcome.error()); return RefreshTokenOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ CCCClient::RefreshTokenOutcomeCallable CCCClient::refreshTokenCallable(const Ref
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::RequestLoginInfoOutcome CCCClient::requestLoginInfo(const RequestLoginInfoRequest &request) const CCCClient::RequestLoginInfoOutcome CCCClient::requestLoginInfo(const RequestLoginInfoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RequestLoginInfoOutcome(endpointOutcome.error()); return RequestLoginInfoOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ CCCClient::RequestLoginInfoOutcomeCallable CCCClient::requestLoginInfoCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::GetServiceExtensionsOutcome CCCClient::getServiceExtensions(const GetServiceExtensionsRequest &request) const CCCClient::GetServiceExtensionsOutcome CCCClient::getServiceExtensions(const GetServiceExtensionsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetServiceExtensionsOutcome(endpointOutcome.error()); return GetServiceExtensionsOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ CCCClient::GetServiceExtensionsOutcomeCallable CCCClient::getServiceExtensionsCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListContactFlowsOutcome CCCClient::listContactFlows(const ListContactFlowsRequest &request) const CCCClient::ListContactFlowsOutcome CCCClient::listContactFlows(const ListContactFlowsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListContactFlowsOutcome(endpointOutcome.error()); return ListContactFlowsOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ CCCClient::ListContactFlowsOutcomeCallable CCCClient::listContactFlowsCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::ListRolesOutcome CCCClient::listRoles(const ListRolesRequest &request) const CCCClient::ListRolesOutcome CCCClient::listRoles(const ListRolesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListRolesOutcome(endpointOutcome.error()); return ListRolesOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ CCCClient::ListRolesOutcomeCallable CCCClient::listRolesCallable(const ListRoles
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CCCClient::GetUserOutcome CCCClient::getUser(const GetUserRequest &request) const CCCClient::GetUserOutcome CCCClient::getUser(const GetUserRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetUserOutcome(endpointOutcome.error()); return GetUserOutcome(endpointOutcome.error());
@@ -778,4 +770,4 @@ CCCClient::GetUserOutcomeCallable CCCClient::getUserCallable(const GetUserReques
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -1382,7 +1382,6 @@ namespace AlibabaCloud
DescribeDomainHttpCodeDataOutcomeCallable describeDomainHttpCodeDataCallable(const Model::DescribeDomainHttpCodeDataRequest& request) const; DescribeDomainHttpCodeDataOutcomeCallable describeDomainHttpCodeDataCallable(const Model::DescribeDomainHttpCodeDataRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -566,7 +566,6 @@ namespace AlibabaCloud
ListFacePhotosOutcomeCallable listFacePhotosCallable(const Model::ListFacePhotosRequest& request) const; ListFacePhotosOutcomeCallable listFacePhotosCallable(const Model::ListFacePhotosRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::CloudPhoto; using namespace AlibabaCloud::CloudPhoto;
using namespace AlibabaCloud::CloudPhoto::Model; using namespace AlibabaCloud::CloudPhoto::Model;
namespace
{
const std::string SERVICE_NAME = "CloudPhoto";
}
CloudPhotoClient::CloudPhotoClient(const Credentials &credentials, const ClientConfiguration &configuration) : CloudPhotoClient::CloudPhotoClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cloudphoto"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloudphoto");
} }
CloudPhotoClient::CloudPhotoClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : CloudPhotoClient::CloudPhotoClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cloudphoto"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloudphoto");
} }
CloudPhotoClient::CloudPhotoClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : CloudPhotoClient::CloudPhotoClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cloudphoto"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloudphoto");
} }
CloudPhotoClient::~CloudPhotoClient() CloudPhotoClient::~CloudPhotoClient()
{} {}
CoreClient::EndpointOutcome CloudPhotoClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
CloudPhotoClient::RemoveFacePhotosOutcome CloudPhotoClient::removeFacePhotos(const RemoveFacePhotosRequest &request) const CloudPhotoClient::RemoveFacePhotosOutcome CloudPhotoClient::removeFacePhotos(const RemoveFacePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveFacePhotosOutcome(endpointOutcome.error()); return RemoveFacePhotosOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ CloudPhotoClient::RemoveFacePhotosOutcomeCallable CloudPhotoClient::removeFacePh
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ReactivatePhotosOutcome CloudPhotoClient::reactivatePhotos(const ReactivatePhotosRequest &request) const CloudPhotoClient::ReactivatePhotosOutcome CloudPhotoClient::reactivatePhotos(const ReactivatePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ReactivatePhotosOutcome(endpointOutcome.error()); return ReactivatePhotosOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ CloudPhotoClient::ReactivatePhotosOutcomeCallable CloudPhotoClient::reactivatePh
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetQuotaOutcome CloudPhotoClient::getQuota(const GetQuotaRequest &request) const CloudPhotoClient::GetQuotaOutcome CloudPhotoClient::getQuota(const GetQuotaRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetQuotaOutcome(endpointOutcome.error()); return GetQuotaOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ CloudPhotoClient::GetQuotaOutcomeCallable CloudPhotoClient::getQuotaCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetThumbnailsOutcome CloudPhotoClient::getThumbnails(const GetThumbnailsRequest &request) const CloudPhotoClient::GetThumbnailsOutcome CloudPhotoClient::getThumbnails(const GetThumbnailsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetThumbnailsOutcome(endpointOutcome.error()); return GetThumbnailsOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ CloudPhotoClient::GetThumbnailsOutcomeCallable CloudPhotoClient::getThumbnailsCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::DeleteFacesOutcome CloudPhotoClient::deleteFaces(const DeleteFacesRequest &request) const CloudPhotoClient::DeleteFacesOutcome CloudPhotoClient::deleteFaces(const DeleteFacesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteFacesOutcome(endpointOutcome.error()); return DeleteFacesOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ CloudPhotoClient::DeleteFacesOutcomeCallable CloudPhotoClient::deleteFacesCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::AddAlbumPhotosOutcome CloudPhotoClient::addAlbumPhotos(const AddAlbumPhotosRequest &request) const CloudPhotoClient::AddAlbumPhotosOutcome CloudPhotoClient::addAlbumPhotos(const AddAlbumPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddAlbumPhotosOutcome(endpointOutcome.error()); return AddAlbumPhotosOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ CloudPhotoClient::AddAlbumPhotosOutcomeCallable CloudPhotoClient::addAlbumPhotos
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListFacesOutcome CloudPhotoClient::listFaces(const ListFacesRequest &request) const CloudPhotoClient::ListFacesOutcome CloudPhotoClient::listFaces(const ListFacesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListFacesOutcome(endpointOutcome.error()); return ListFacesOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ CloudPhotoClient::ListFacesOutcomeCallable CloudPhotoClient::listFacesCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::MoveFacePhotosOutcome CloudPhotoClient::moveFacePhotos(const MoveFacePhotosRequest &request) const CloudPhotoClient::MoveFacePhotosOutcome CloudPhotoClient::moveFacePhotos(const MoveFacePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return MoveFacePhotosOutcome(endpointOutcome.error()); return MoveFacePhotosOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ CloudPhotoClient::MoveFacePhotosOutcomeCallable CloudPhotoClient::moveFacePhotos
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::DeleteEventOutcome CloudPhotoClient::deleteEvent(const DeleteEventRequest &request) const CloudPhotoClient::DeleteEventOutcome CloudPhotoClient::deleteEvent(const DeleteEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteEventOutcome(endpointOutcome.error()); return DeleteEventOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ CloudPhotoClient::DeleteEventOutcomeCallable CloudPhotoClient::deleteEventCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListPhotosOutcome CloudPhotoClient::listPhotos(const ListPhotosRequest &request) const CloudPhotoClient::ListPhotosOutcome CloudPhotoClient::listPhotos(const ListPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPhotosOutcome(endpointOutcome.error()); return ListPhotosOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ CloudPhotoClient::ListPhotosOutcomeCallable CloudPhotoClient::listPhotosCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::RegisterTagOutcome CloudPhotoClient::registerTag(const RegisterTagRequest &request) const CloudPhotoClient::RegisterTagOutcome CloudPhotoClient::registerTag(const RegisterTagRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RegisterTagOutcome(endpointOutcome.error()); return RegisterTagOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ CloudPhotoClient::RegisterTagOutcomeCallable CloudPhotoClient::registerTagCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListTimeLinePhotosOutcome CloudPhotoClient::listTimeLinePhotos(const ListTimeLinePhotosRequest &request) const CloudPhotoClient::ListTimeLinePhotosOutcome CloudPhotoClient::listTimeLinePhotos(const ListTimeLinePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListTimeLinePhotosOutcome(endpointOutcome.error()); return ListTimeLinePhotosOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ CloudPhotoClient::ListTimeLinePhotosOutcomeCallable CloudPhotoClient::listTimeLi
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::DeletePhotosOutcome CloudPhotoClient::deletePhotos(const DeletePhotosRequest &request) const CloudPhotoClient::DeletePhotosOutcome CloudPhotoClient::deletePhotos(const DeletePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeletePhotosOutcome(endpointOutcome.error()); return DeletePhotosOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ CloudPhotoClient::DeletePhotosOutcomeCallable CloudPhotoClient::deletePhotosCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::MergeFacesOutcome CloudPhotoClient::mergeFaces(const MergeFacesRequest &request) const CloudPhotoClient::MergeFacesOutcome CloudPhotoClient::mergeFaces(const MergeFacesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return MergeFacesOutcome(endpointOutcome.error()); return MergeFacesOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ CloudPhotoClient::MergeFacesOutcomeCallable CloudPhotoClient::mergeFacesCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetPhotosByMd5sOutcome CloudPhotoClient::getPhotosByMd5s(const GetPhotosByMd5sRequest &request) const CloudPhotoClient::GetPhotosByMd5sOutcome CloudPhotoClient::getPhotosByMd5s(const GetPhotosByMd5sRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetPhotosByMd5sOutcome(endpointOutcome.error()); return GetPhotosByMd5sOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ CloudPhotoClient::GetPhotosByMd5sOutcomeCallable CloudPhotoClient::getPhotosByMd
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::CreateTransactionOutcome CloudPhotoClient::createTransaction(const CreateTransactionRequest &request) const CloudPhotoClient::CreateTransactionOutcome CloudPhotoClient::createTransaction(const CreateTransactionRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateTransactionOutcome(endpointOutcome.error()); return CreateTransactionOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ CloudPhotoClient::CreateTransactionOutcomeCallable CloudPhotoClient::createTrans
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::InactivatePhotosOutcome CloudPhotoClient::inactivatePhotos(const InactivatePhotosRequest &request) const CloudPhotoClient::InactivatePhotosOutcome CloudPhotoClient::inactivatePhotos(const InactivatePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return InactivatePhotosOutcome(endpointOutcome.error()); return InactivatePhotosOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ CloudPhotoClient::InactivatePhotosOutcomeCallable CloudPhotoClient::inactivatePh
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::CreatePhotoStoreOutcome CloudPhotoClient::createPhotoStore(const CreatePhotoStoreRequest &request) const CloudPhotoClient::CreatePhotoStoreOutcome CloudPhotoClient::createPhotoStore(const CreatePhotoStoreRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreatePhotoStoreOutcome(endpointOutcome.error()); return CreatePhotoStoreOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ CloudPhotoClient::CreatePhotoStoreOutcomeCallable CloudPhotoClient::createPhotoS
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::TagPhotoOutcome CloudPhotoClient::tagPhoto(const TagPhotoRequest &request) const CloudPhotoClient::TagPhotoOutcome CloudPhotoClient::tagPhoto(const TagPhotoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return TagPhotoOutcome(endpointOutcome.error()); return TagPhotoOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ CloudPhotoClient::TagPhotoOutcomeCallable CloudPhotoClient::tagPhotoCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetLibraryOutcome CloudPhotoClient::getLibrary(const GetLibraryRequest &request) const CloudPhotoClient::GetLibraryOutcome CloudPhotoClient::getLibrary(const GetLibraryRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetLibraryOutcome(endpointOutcome.error()); return GetLibraryOutcome(endpointOutcome.error());
@@ -778,10 +770,10 @@ CloudPhotoClient::GetLibraryOutcomeCallable CloudPhotoClient::getLibraryCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::SetQuotaOutcome CloudPhotoClient::setQuota(const SetQuotaRequest &request) const CloudPhotoClient::SetQuotaOutcome CloudPhotoClient::setQuota(const SetQuotaRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetQuotaOutcome(endpointOutcome.error()); return SetQuotaOutcome(endpointOutcome.error());
@@ -814,10 +806,10 @@ CloudPhotoClient::SetQuotaOutcomeCallable CloudPhotoClient::setQuotaCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListAlbumPhotosOutcome CloudPhotoClient::listAlbumPhotos(const ListAlbumPhotosRequest &request) const CloudPhotoClient::ListAlbumPhotosOutcome CloudPhotoClient::listAlbumPhotos(const ListAlbumPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListAlbumPhotosOutcome(endpointOutcome.error()); return ListAlbumPhotosOutcome(endpointOutcome.error());
@@ -850,10 +842,10 @@ CloudPhotoClient::ListAlbumPhotosOutcomeCallable CloudPhotoClient::listAlbumPhot
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::RemoveAlbumPhotosOutcome CloudPhotoClient::removeAlbumPhotos(const RemoveAlbumPhotosRequest &request) const CloudPhotoClient::RemoveAlbumPhotosOutcome CloudPhotoClient::removeAlbumPhotos(const RemoveAlbumPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveAlbumPhotosOutcome(endpointOutcome.error()); return RemoveAlbumPhotosOutcome(endpointOutcome.error());
@@ -886,10 +878,10 @@ CloudPhotoClient::RemoveAlbumPhotosOutcomeCallable CloudPhotoClient::removeAlbum
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListAlbumsOutcome CloudPhotoClient::listAlbums(const ListAlbumsRequest &request) const CloudPhotoClient::ListAlbumsOutcome CloudPhotoClient::listAlbums(const ListAlbumsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListAlbumsOutcome(endpointOutcome.error()); return ListAlbumsOutcome(endpointOutcome.error());
@@ -922,10 +914,10 @@ CloudPhotoClient::ListAlbumsOutcomeCallable CloudPhotoClient::listAlbumsCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListPhotoFacesOutcome CloudPhotoClient::listPhotoFaces(const ListPhotoFacesRequest &request) const CloudPhotoClient::ListPhotoFacesOutcome CloudPhotoClient::listPhotoFaces(const ListPhotoFacesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPhotoFacesOutcome(endpointOutcome.error()); return ListPhotoFacesOutcome(endpointOutcome.error());
@@ -958,10 +950,10 @@ CloudPhotoClient::ListPhotoFacesOutcomeCallable CloudPhotoClient::listPhotoFaces
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::RenameAlbumOutcome CloudPhotoClient::renameAlbum(const RenameAlbumRequest &request) const CloudPhotoClient::RenameAlbumOutcome CloudPhotoClient::renameAlbum(const RenameAlbumRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RenameAlbumOutcome(endpointOutcome.error()); return RenameAlbumOutcome(endpointOutcome.error());
@@ -994,10 +986,10 @@ CloudPhotoClient::RenameAlbumOutcomeCallable CloudPhotoClient::renameAlbumCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ActivatePhotosOutcome CloudPhotoClient::activatePhotos(const ActivatePhotosRequest &request) const CloudPhotoClient::ActivatePhotosOutcome CloudPhotoClient::activatePhotos(const ActivatePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ActivatePhotosOutcome(endpointOutcome.error()); return ActivatePhotosOutcome(endpointOutcome.error());
@@ -1030,10 +1022,10 @@ CloudPhotoClient::ActivatePhotosOutcomeCallable CloudPhotoClient::activatePhotos
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetPrivateAccessUrlsOutcome CloudPhotoClient::getPrivateAccessUrls(const GetPrivateAccessUrlsRequest &request) const CloudPhotoClient::GetPrivateAccessUrlsOutcome CloudPhotoClient::getPrivateAccessUrls(const GetPrivateAccessUrlsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetPrivateAccessUrlsOutcome(endpointOutcome.error()); return GetPrivateAccessUrlsOutcome(endpointOutcome.error());
@@ -1066,10 +1058,10 @@ CloudPhotoClient::GetPrivateAccessUrlsOutcomeCallable CloudPhotoClient::getPriva
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetSimilarPhotosOutcome CloudPhotoClient::getSimilarPhotos(const GetSimilarPhotosRequest &request) const CloudPhotoClient::GetSimilarPhotosOutcome CloudPhotoClient::getSimilarPhotos(const GetSimilarPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetSimilarPhotosOutcome(endpointOutcome.error()); return GetSimilarPhotosOutcome(endpointOutcome.error());
@@ -1102,10 +1094,10 @@ CloudPhotoClient::GetSimilarPhotosOutcomeCallable CloudPhotoClient::getSimilarPh
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListEventsOutcome CloudPhotoClient::listEvents(const ListEventsRequest &request) const CloudPhotoClient::ListEventsOutcome CloudPhotoClient::listEvents(const ListEventsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListEventsOutcome(endpointOutcome.error()); return ListEventsOutcome(endpointOutcome.error());
@@ -1138,10 +1130,10 @@ CloudPhotoClient::ListEventsOutcomeCallable CloudPhotoClient::listEventsCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetVideoCoverOutcome CloudPhotoClient::getVideoCover(const GetVideoCoverRequest &request) const CloudPhotoClient::GetVideoCoverOutcome CloudPhotoClient::getVideoCover(const GetVideoCoverRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetVideoCoverOutcome(endpointOutcome.error()); return GetVideoCoverOutcome(endpointOutcome.error());
@@ -1174,10 +1166,10 @@ CloudPhotoClient::GetVideoCoverOutcomeCallable CloudPhotoClient::getVideoCoverCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetFramedPhotoUrlsOutcome CloudPhotoClient::getFramedPhotoUrls(const GetFramedPhotoUrlsRequest &request) const CloudPhotoClient::GetFramedPhotoUrlsOutcome CloudPhotoClient::getFramedPhotoUrls(const GetFramedPhotoUrlsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetFramedPhotoUrlsOutcome(endpointOutcome.error()); return GetFramedPhotoUrlsOutcome(endpointOutcome.error());
@@ -1210,10 +1202,10 @@ CloudPhotoClient::GetFramedPhotoUrlsOutcomeCallable CloudPhotoClient::getFramedP
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetEventOutcome CloudPhotoClient::getEvent(const GetEventRequest &request) const CloudPhotoClient::GetEventOutcome CloudPhotoClient::getEvent(const GetEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetEventOutcome(endpointOutcome.error()); return GetEventOutcome(endpointOutcome.error());
@@ -1246,10 +1238,10 @@ CloudPhotoClient::GetEventOutcomeCallable CloudPhotoClient::getEventCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::SetMeOutcome CloudPhotoClient::setMe(const SetMeRequest &request) const CloudPhotoClient::SetMeOutcome CloudPhotoClient::setMe(const SetMeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetMeOutcome(endpointOutcome.error()); return SetMeOutcome(endpointOutcome.error());
@@ -1282,10 +1274,10 @@ CloudPhotoClient::SetMeOutcomeCallable CloudPhotoClient::setMeCallable(const Set
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListTagPhotosOutcome CloudPhotoClient::listTagPhotos(const ListTagPhotosRequest &request) const CloudPhotoClient::ListTagPhotosOutcome CloudPhotoClient::listTagPhotos(const ListTagPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListTagPhotosOutcome(endpointOutcome.error()); return ListTagPhotosOutcome(endpointOutcome.error());
@@ -1318,10 +1310,10 @@ CloudPhotoClient::ListTagPhotosOutcomeCallable CloudPhotoClient::listTagPhotosCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::DeleteAlbumsOutcome CloudPhotoClient::deleteAlbums(const DeleteAlbumsRequest &request) const CloudPhotoClient::DeleteAlbumsOutcome CloudPhotoClient::deleteAlbums(const DeleteAlbumsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteAlbumsOutcome(endpointOutcome.error()); return DeleteAlbumsOutcome(endpointOutcome.error());
@@ -1354,10 +1346,10 @@ CloudPhotoClient::DeleteAlbumsOutcomeCallable CloudPhotoClient::deleteAlbumsCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetDownloadUrlsOutcome CloudPhotoClient::getDownloadUrls(const GetDownloadUrlsRequest &request) const CloudPhotoClient::GetDownloadUrlsOutcome CloudPhotoClient::getDownloadUrls(const GetDownloadUrlsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetDownloadUrlsOutcome(endpointOutcome.error()); return GetDownloadUrlsOutcome(endpointOutcome.error());
@@ -1390,10 +1382,10 @@ CloudPhotoClient::GetDownloadUrlsOutcomeCallable CloudPhotoClient::getDownloadUr
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetPhotosOutcome CloudPhotoClient::getPhotos(const GetPhotosRequest &request) const CloudPhotoClient::GetPhotosOutcome CloudPhotoClient::getPhotos(const GetPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetPhotosOutcome(endpointOutcome.error()); return GetPhotosOutcome(endpointOutcome.error());
@@ -1426,10 +1418,10 @@ CloudPhotoClient::GetPhotosOutcomeCallable CloudPhotoClient::getPhotosCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::RegisterPhotoOutcome CloudPhotoClient::registerPhoto(const RegisterPhotoRequest &request) const CloudPhotoClient::RegisterPhotoOutcome CloudPhotoClient::registerPhoto(const RegisterPhotoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RegisterPhotoOutcome(endpointOutcome.error()); return RegisterPhotoOutcome(endpointOutcome.error());
@@ -1462,10 +1454,10 @@ CloudPhotoClient::RegisterPhotoOutcomeCallable CloudPhotoClient::registerPhotoCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::EditPhotoStoreOutcome CloudPhotoClient::editPhotoStore(const EditPhotoStoreRequest &request) const CloudPhotoClient::EditPhotoStoreOutcome CloudPhotoClient::editPhotoStore(const EditPhotoStoreRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EditPhotoStoreOutcome(endpointOutcome.error()); return EditPhotoStoreOutcome(endpointOutcome.error());
@@ -1498,10 +1490,10 @@ CloudPhotoClient::EditPhotoStoreOutcomeCallable CloudPhotoClient::editPhotoStore
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListTimeLinesOutcome CloudPhotoClient::listTimeLines(const ListTimeLinesRequest &request) const CloudPhotoClient::ListTimeLinesOutcome CloudPhotoClient::listTimeLines(const ListTimeLinesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListTimeLinesOutcome(endpointOutcome.error()); return ListTimeLinesOutcome(endpointOutcome.error());
@@ -1534,10 +1526,10 @@ CloudPhotoClient::ListTimeLinesOutcomeCallable CloudPhotoClient::listTimeLinesCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::SearchPhotosOutcome CloudPhotoClient::searchPhotos(const SearchPhotosRequest &request) const CloudPhotoClient::SearchPhotosOutcome CloudPhotoClient::searchPhotos(const SearchPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SearchPhotosOutcome(endpointOutcome.error()); return SearchPhotosOutcome(endpointOutcome.error());
@@ -1570,10 +1562,10 @@ CloudPhotoClient::SearchPhotosOutcomeCallable CloudPhotoClient::searchPhotosCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ToggleFeaturesOutcome CloudPhotoClient::toggleFeatures(const ToggleFeaturesRequest &request) const CloudPhotoClient::ToggleFeaturesOutcome CloudPhotoClient::toggleFeatures(const ToggleFeaturesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ToggleFeaturesOutcome(endpointOutcome.error()); return ToggleFeaturesOutcome(endpointOutcome.error());
@@ -1606,10 +1598,10 @@ CloudPhotoClient::ToggleFeaturesOutcomeCallable CloudPhotoClient::toggleFeatures
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListRegisteredTagsOutcome CloudPhotoClient::listRegisteredTags(const ListRegisteredTagsRequest &request) const CloudPhotoClient::ListRegisteredTagsOutcome CloudPhotoClient::listRegisteredTags(const ListRegisteredTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListRegisteredTagsOutcome(endpointOutcome.error()); return ListRegisteredTagsOutcome(endpointOutcome.error());
@@ -1642,10 +1634,10 @@ CloudPhotoClient::ListRegisteredTagsOutcomeCallable CloudPhotoClient::listRegist
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::DeletePhotoStoreOutcome CloudPhotoClient::deletePhotoStore(const DeletePhotoStoreRequest &request) const CloudPhotoClient::DeletePhotoStoreOutcome CloudPhotoClient::deletePhotoStore(const DeletePhotoStoreRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeletePhotoStoreOutcome(endpointOutcome.error()); return DeletePhotoStoreOutcome(endpointOutcome.error());
@@ -1678,10 +1670,10 @@ CloudPhotoClient::DeletePhotoStoreOutcomeCallable CloudPhotoClient::deletePhotoS
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::CreateEventOutcome CloudPhotoClient::createEvent(const CreateEventRequest &request) const CloudPhotoClient::CreateEventOutcome CloudPhotoClient::createEvent(const CreateEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateEventOutcome(endpointOutcome.error()); return CreateEventOutcome(endpointOutcome.error());
@@ -1714,10 +1706,10 @@ CloudPhotoClient::CreateEventOutcomeCallable CloudPhotoClient::createEventCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetPhotoStoreOutcome CloudPhotoClient::getPhotoStore(const GetPhotoStoreRequest &request) const CloudPhotoClient::GetPhotoStoreOutcome CloudPhotoClient::getPhotoStore(const GetPhotoStoreRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetPhotoStoreOutcome(endpointOutcome.error()); return GetPhotoStoreOutcome(endpointOutcome.error());
@@ -1750,10 +1742,10 @@ CloudPhotoClient::GetPhotoStoreOutcomeCallable CloudPhotoClient::getPhotoStoreCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListMomentPhotosOutcome CloudPhotoClient::listMomentPhotos(const ListMomentPhotosRequest &request) const CloudPhotoClient::ListMomentPhotosOutcome CloudPhotoClient::listMomentPhotos(const ListMomentPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMomentPhotosOutcome(endpointOutcome.error()); return ListMomentPhotosOutcome(endpointOutcome.error());
@@ -1786,10 +1778,10 @@ CloudPhotoClient::ListMomentPhotosOutcomeCallable CloudPhotoClient::listMomentPh
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetThumbnailOutcome CloudPhotoClient::getThumbnail(const GetThumbnailRequest &request) const CloudPhotoClient::GetThumbnailOutcome CloudPhotoClient::getThumbnail(const GetThumbnailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetThumbnailOutcome(endpointOutcome.error()); return GetThumbnailOutcome(endpointOutcome.error());
@@ -1822,10 +1814,10 @@ CloudPhotoClient::GetThumbnailOutcomeCallable CloudPhotoClient::getThumbnailCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::SetFaceCoverOutcome CloudPhotoClient::setFaceCover(const SetFaceCoverRequest &request) const CloudPhotoClient::SetFaceCoverOutcome CloudPhotoClient::setFaceCover(const SetFaceCoverRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetFaceCoverOutcome(endpointOutcome.error()); return SetFaceCoverOutcome(endpointOutcome.error());
@@ -1858,10 +1850,10 @@ CloudPhotoClient::SetFaceCoverOutcomeCallable CloudPhotoClient::setFaceCoverCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::CreatePhotoOutcome CloudPhotoClient::createPhoto(const CreatePhotoRequest &request) const CloudPhotoClient::CreatePhotoOutcome CloudPhotoClient::createPhoto(const CreatePhotoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreatePhotoOutcome(endpointOutcome.error()); return CreatePhotoOutcome(endpointOutcome.error());
@@ -1894,10 +1886,10 @@ CloudPhotoClient::CreatePhotoOutcomeCallable CloudPhotoClient::createPhotoCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::MoveAlbumPhotosOutcome CloudPhotoClient::moveAlbumPhotos(const MoveAlbumPhotosRequest &request) const CloudPhotoClient::MoveAlbumPhotosOutcome CloudPhotoClient::moveAlbumPhotos(const MoveAlbumPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return MoveAlbumPhotosOutcome(endpointOutcome.error()); return MoveAlbumPhotosOutcome(endpointOutcome.error());
@@ -1930,10 +1922,10 @@ CloudPhotoClient::MoveAlbumPhotosOutcomeCallable CloudPhotoClient::moveAlbumPhot
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::EditEventOutcome CloudPhotoClient::editEvent(const EditEventRequest &request) const CloudPhotoClient::EditEventOutcome CloudPhotoClient::editEvent(const EditEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EditEventOutcome(endpointOutcome.error()); return EditEventOutcome(endpointOutcome.error());
@@ -1966,10 +1958,10 @@ CloudPhotoClient::EditEventOutcomeCallable CloudPhotoClient::editEventCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetDownloadUrlOutcome CloudPhotoClient::getDownloadUrl(const GetDownloadUrlRequest &request) const CloudPhotoClient::GetDownloadUrlOutcome CloudPhotoClient::getDownloadUrl(const GetDownloadUrlRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetDownloadUrlOutcome(endpointOutcome.error()); return GetDownloadUrlOutcome(endpointOutcome.error());
@@ -2002,10 +1994,10 @@ CloudPhotoClient::GetDownloadUrlOutcomeCallable CloudPhotoClient::getDownloadUrl
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::CreateAlbumOutcome CloudPhotoClient::createAlbum(const CreateAlbumRequest &request) const CloudPhotoClient::CreateAlbumOutcome CloudPhotoClient::createAlbum(const CreateAlbumRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateAlbumOutcome(endpointOutcome.error()); return CreateAlbumOutcome(endpointOutcome.error());
@@ -2038,10 +2030,10 @@ CloudPhotoClient::CreateAlbumOutcomeCallable CloudPhotoClient::createAlbumCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListPhotoTagsOutcome CloudPhotoClient::listPhotoTags(const ListPhotoTagsRequest &request) const CloudPhotoClient::ListPhotoTagsOutcome CloudPhotoClient::listPhotoTags(const ListPhotoTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPhotoTagsOutcome(endpointOutcome.error()); return ListPhotoTagsOutcome(endpointOutcome.error());
@@ -2074,10 +2066,10 @@ CloudPhotoClient::ListPhotoTagsOutcomeCallable CloudPhotoClient::listPhotoTagsCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::LikePhotoOutcome CloudPhotoClient::likePhoto(const LikePhotoRequest &request) const CloudPhotoClient::LikePhotoOutcome CloudPhotoClient::likePhoto(const LikePhotoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return LikePhotoOutcome(endpointOutcome.error()); return LikePhotoOutcome(endpointOutcome.error());
@@ -2110,10 +2102,10 @@ CloudPhotoClient::LikePhotoOutcomeCallable CloudPhotoClient::likePhotoCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListPhotoStoresOutcome CloudPhotoClient::listPhotoStores(const ListPhotoStoresRequest &request) const CloudPhotoClient::ListPhotoStoresOutcome CloudPhotoClient::listPhotoStores(const ListPhotoStoresRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPhotoStoresOutcome(endpointOutcome.error()); return ListPhotoStoresOutcome(endpointOutcome.error());
@@ -2146,10 +2138,10 @@ CloudPhotoClient::ListPhotoStoresOutcomeCallable CloudPhotoClient::listPhotoStor
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetAlbumsByNamesOutcome CloudPhotoClient::getAlbumsByNames(const GetAlbumsByNamesRequest &request) const CloudPhotoClient::GetAlbumsByNamesOutcome CloudPhotoClient::getAlbumsByNames(const GetAlbumsByNamesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetAlbumsByNamesOutcome(endpointOutcome.error()); return GetAlbumsByNamesOutcome(endpointOutcome.error());
@@ -2182,10 +2174,10 @@ CloudPhotoClient::GetAlbumsByNamesOutcomeCallable CloudPhotoClient::getAlbumsByN
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::GetPublicAccessUrlsOutcome CloudPhotoClient::getPublicAccessUrls(const GetPublicAccessUrlsRequest &request) const CloudPhotoClient::GetPublicAccessUrlsOutcome CloudPhotoClient::getPublicAccessUrls(const GetPublicAccessUrlsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetPublicAccessUrlsOutcome(endpointOutcome.error()); return GetPublicAccessUrlsOutcome(endpointOutcome.error());
@@ -2218,10 +2210,10 @@ CloudPhotoClient::GetPublicAccessUrlsOutcomeCallable CloudPhotoClient::getPublic
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::EditPhotosOutcome CloudPhotoClient::editPhotos(const EditPhotosRequest &request) const CloudPhotoClient::EditPhotosOutcome CloudPhotoClient::editPhotos(const EditPhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EditPhotosOutcome(endpointOutcome.error()); return EditPhotosOutcome(endpointOutcome.error());
@@ -2254,10 +2246,10 @@ CloudPhotoClient::EditPhotosOutcomeCallable CloudPhotoClient::editPhotosCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::SetAlbumCoverOutcome CloudPhotoClient::setAlbumCover(const SetAlbumCoverRequest &request) const CloudPhotoClient::SetAlbumCoverOutcome CloudPhotoClient::setAlbumCover(const SetAlbumCoverRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetAlbumCoverOutcome(endpointOutcome.error()); return SetAlbumCoverOutcome(endpointOutcome.error());
@@ -2290,10 +2282,10 @@ CloudPhotoClient::SetAlbumCoverOutcomeCallable CloudPhotoClient::setAlbumCoverCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::RenameFaceOutcome CloudPhotoClient::renameFace(const RenameFaceRequest &request) const CloudPhotoClient::RenameFaceOutcome CloudPhotoClient::renameFace(const RenameFaceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RenameFaceOutcome(endpointOutcome.error()); return RenameFaceOutcome(endpointOutcome.error());
@@ -2326,10 +2318,10 @@ CloudPhotoClient::RenameFaceOutcomeCallable CloudPhotoClient::renameFaceCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListMomentsOutcome CloudPhotoClient::listMoments(const ListMomentsRequest &request) const CloudPhotoClient::ListMomentsOutcome CloudPhotoClient::listMoments(const ListMomentsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMomentsOutcome(endpointOutcome.error()); return ListMomentsOutcome(endpointOutcome.error());
@@ -2362,10 +2354,10 @@ CloudPhotoClient::ListMomentsOutcomeCallable CloudPhotoClient::listMomentsCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListTagsOutcome CloudPhotoClient::listTags(const ListTagsRequest &request) const CloudPhotoClient::ListTagsOutcome CloudPhotoClient::listTags(const ListTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListTagsOutcome(endpointOutcome.error()); return ListTagsOutcome(endpointOutcome.error());
@@ -2398,10 +2390,10 @@ CloudPhotoClient::ListTagsOutcomeCallable CloudPhotoClient::listTagsCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CloudPhotoClient::ListFacePhotosOutcome CloudPhotoClient::listFacePhotos(const ListFacePhotosRequest &request) const CloudPhotoClient::ListFacePhotosOutcome CloudPhotoClient::listFacePhotos(const ListFacePhotosRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListFacePhotosOutcome(endpointOutcome.error()); return ListFacePhotosOutcome(endpointOutcome.error());
@@ -2434,4 +2426,4 @@ CloudPhotoClient::ListFacePhotosOutcomeCallable CloudPhotoClient::listFacePhotos
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -486,7 +486,6 @@ namespace AlibabaCloud
QueryCustomEventDetailOutcomeCallable queryCustomEventDetailCallable(const Model::QueryCustomEventDetailRequest& request) const; QueryCustomEventDetailOutcomeCallable queryCustomEventDetailCallable(const Model::QueryCustomEventDetailRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Cms; using namespace AlibabaCloud::Cms;
using namespace AlibabaCloud::Cms::Model; using namespace AlibabaCloud::Cms::Model;
namespace
{
const std::string SERVICE_NAME = "Cms";
}
CmsClient::CmsClient(const Credentials &credentials, const ClientConfiguration &configuration) : CmsClient::CmsClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cms"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cms");
} }
CmsClient::CmsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : CmsClient::CmsClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cms"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cms");
} }
CmsClient::CmsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : CmsClient::CmsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "cms"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cms");
} }
CmsClient::~CmsClient() CmsClient::~CmsClient()
{} {}
CoreClient::EndpointOutcome CmsClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
CmsClient::ProfileSetOutcome CmsClient::profileSet(const ProfileSetRequest &request) const CmsClient::ProfileSetOutcome CmsClient::profileSet(const ProfileSetRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ProfileSetOutcome(endpointOutcome.error()); return ProfileSetOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ CmsClient::ProfileSetOutcomeCallable CmsClient::profileSetCallable(const Profile
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListProductOfActiceAlertOutcome CmsClient::listProductOfActiceAlert(const ListProductOfActiceAlertRequest &request) const CmsClient::ListProductOfActiceAlertOutcome CmsClient::listProductOfActiceAlert(const ListProductOfActiceAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListProductOfActiceAlertOutcome(endpointOutcome.error()); return ListProductOfActiceAlertOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ CmsClient::ListProductOfActiceAlertOutcomeCallable CmsClient::listProductOfActic
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DeleteCustomMetricOutcome CmsClient::deleteCustomMetric(const DeleteCustomMetricRequest &request) const CmsClient::DeleteCustomMetricOutcome CmsClient::deleteCustomMetric(const DeleteCustomMetricRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteCustomMetricOutcome(endpointOutcome.error()); return DeleteCustomMetricOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ CmsClient::DeleteCustomMetricOutcomeCallable CmsClient::deleteCustomMetricCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::GetNotifyPolicyOutcome CmsClient::getNotifyPolicy(const GetNotifyPolicyRequest &request) const CmsClient::GetNotifyPolicyOutcome CmsClient::getNotifyPolicy(const GetNotifyPolicyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetNotifyPolicyOutcome(endpointOutcome.error()); return GetNotifyPolicyOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ CmsClient::GetNotifyPolicyOutcomeCallable CmsClient::getNotifyPolicyCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeUninstallOutcome CmsClient::nodeUninstall(const NodeUninstallRequest &request) const CmsClient::NodeUninstallOutcome CmsClient::nodeUninstall(const NodeUninstallRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeUninstallOutcome(endpointOutcome.error()); return NodeUninstallOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ CmsClient::NodeUninstallOutcomeCallable CmsClient::nodeUninstallCallable(const N
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryCustomEventCountOutcome CmsClient::queryCustomEventCount(const QueryCustomEventCountRequest &request) const CmsClient::QueryCustomEventCountOutcome CmsClient::queryCustomEventCount(const QueryCustomEventCountRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryCustomEventCountOutcome(endpointOutcome.error()); return QueryCustomEventCountOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ CmsClient::QueryCustomEventCountOutcomeCallable CmsClient::queryCustomEventCount
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::UpdateMyGroupInstancesOutcome CmsClient::updateMyGroupInstances(const UpdateMyGroupInstancesRequest &request) const CmsClient::UpdateMyGroupInstancesOutcome CmsClient::updateMyGroupInstances(const UpdateMyGroupInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpdateMyGroupInstancesOutcome(endpointOutcome.error()); return UpdateMyGroupInstancesOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ CmsClient::UpdateMyGroupInstancesOutcomeCallable CmsClient::updateMyGroupInstanc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ProfileGetOutcome CmsClient::profileGet(const ProfileGetRequest &request) const CmsClient::ProfileGetOutcome CmsClient::profileGet(const ProfileGetRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ProfileGetOutcome(endpointOutcome.error()); return ProfileGetOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ CmsClient::ProfileGetOutcomeCallable CmsClient::profileGetCallable(const Profile
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::PutSystemEventOutcome CmsClient::putSystemEvent(const PutSystemEventRequest &request) const CmsClient::PutSystemEventOutcome CmsClient::putSystemEvent(const PutSystemEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return PutSystemEventOutcome(endpointOutcome.error()); return PutSystemEventOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ CmsClient::PutSystemEventOutcomeCallable CmsClient::putSystemEventCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryCustomMetricListOutcome CmsClient::queryCustomMetricList(const QueryCustomMetricListRequest &request) const CmsClient::QueryCustomMetricListOutcome CmsClient::queryCustomMetricList(const QueryCustomMetricListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryCustomMetricListOutcome(endpointOutcome.error()); return QueryCustomMetricListOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ CmsClient::QueryCustomMetricListOutcomeCallable CmsClient::queryCustomMetricList
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::EnableActiveAlertOutcome CmsClient::enableActiveAlert(const EnableActiveAlertRequest &request) const CmsClient::EnableActiveAlertOutcome CmsClient::enableActiveAlert(const EnableActiveAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EnableActiveAlertOutcome(endpointOutcome.error()); return EnableActiveAlertOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ CmsClient::EnableActiveAlertOutcomeCallable CmsClient::enableActiveAlertCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QuerySystemEventDetailOutcome CmsClient::querySystemEventDetail(const QuerySystemEventDetailRequest &request) const CmsClient::QuerySystemEventDetailOutcome CmsClient::querySystemEventDetail(const QuerySystemEventDetailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QuerySystemEventDetailOutcome(endpointOutcome.error()); return QuerySystemEventDetailOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ CmsClient::QuerySystemEventDetailOutcomeCallable CmsClient::querySystemEventDeta
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::CreateNotifyPolicyOutcome CmsClient::createNotifyPolicy(const CreateNotifyPolicyRequest &request) const CmsClient::CreateNotifyPolicyOutcome CmsClient::createNotifyPolicy(const CreateNotifyPolicyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateNotifyPolicyOutcome(endpointOutcome.error()); return CreateNotifyPolicyOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ CmsClient::CreateNotifyPolicyOutcomeCallable CmsClient::createNotifyPolicyCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DeleteAlarmOutcome CmsClient::deleteAlarm(const DeleteAlarmRequest &request) const CmsClient::DeleteAlarmOutcome CmsClient::deleteAlarm(const DeleteAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteAlarmOutcome(endpointOutcome.error()); return DeleteAlarmOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ CmsClient::DeleteAlarmOutcomeCallable CmsClient::deleteAlarmCallable(const Delet
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeListOutcome CmsClient::nodeList(const NodeListRequest &request) const CmsClient::NodeListOutcome CmsClient::nodeList(const NodeListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeListOutcome(endpointOutcome.error()); return NodeListOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ CmsClient::NodeListOutcomeCallable CmsClient::nodeListCallable(const NodeListReq
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeProcessesOutcome CmsClient::nodeProcesses(const NodeProcessesRequest &request) const CmsClient::NodeProcessesOutcome CmsClient::nodeProcesses(const NodeProcessesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeProcessesOutcome(endpointOutcome.error()); return NodeProcessesOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ CmsClient::NodeProcessesOutcomeCallable CmsClient::nodeProcessesCallable(const N
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListMyGroupCategoriesOutcome CmsClient::listMyGroupCategories(const ListMyGroupCategoriesRequest &request) const CmsClient::ListMyGroupCategoriesOutcome CmsClient::listMyGroupCategories(const ListMyGroupCategoriesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMyGroupCategoriesOutcome(endpointOutcome.error()); return ListMyGroupCategoriesOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ CmsClient::ListMyGroupCategoriesOutcomeCallable CmsClient::listMyGroupCategories
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryMetricListOutcome CmsClient::queryMetricList(const QueryMetricListRequest &request) const CmsClient::QueryMetricListOutcome CmsClient::queryMetricList(const QueryMetricListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryMetricListOutcome(endpointOutcome.error()); return QueryMetricListOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ CmsClient::QueryMetricListOutcomeCallable CmsClient::queryMetricListCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListMyGroupInstancesDetailsOutcome CmsClient::listMyGroupInstancesDetails(const ListMyGroupInstancesDetailsRequest &request) const CmsClient::ListMyGroupInstancesDetailsOutcome CmsClient::listMyGroupInstancesDetails(const ListMyGroupInstancesDetailsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMyGroupInstancesDetailsOutcome(endpointOutcome.error()); return ListMyGroupInstancesDetailsOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ CmsClient::ListMyGroupInstancesDetailsOutcomeCallable CmsClient::listMyGroupInst
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DisableAlarmOutcome CmsClient::disableAlarm(const DisableAlarmRequest &request) const CmsClient::DisableAlarmOutcome CmsClient::disableAlarm(const DisableAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DisableAlarmOutcome(endpointOutcome.error()); return DisableAlarmOutcome(endpointOutcome.error());
@@ -778,10 +770,10 @@ CmsClient::DisableAlarmOutcomeCallable CmsClient::disableAlarmCallable(const Dis
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::PutCustomMetricOutcome CmsClient::putCustomMetric(const PutCustomMetricRequest &request) const CmsClient::PutCustomMetricOutcome CmsClient::putCustomMetric(const PutCustomMetricRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return PutCustomMetricOutcome(endpointOutcome.error()); return PutCustomMetricOutcome(endpointOutcome.error());
@@ -814,10 +806,10 @@ CmsClient::PutCustomMetricOutcomeCallable CmsClient::putCustomMetricCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DeleteMyGroupsOutcome CmsClient::deleteMyGroups(const DeleteMyGroupsRequest &request) const CmsClient::DeleteMyGroupsOutcome CmsClient::deleteMyGroups(const DeleteMyGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteMyGroupsOutcome(endpointOutcome.error()); return DeleteMyGroupsOutcome(endpointOutcome.error());
@@ -850,10 +842,10 @@ CmsClient::DeleteMyGroupsOutcomeCallable CmsClient::deleteMyGroupsCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryMetricLastOutcome CmsClient::queryMetricLast(const QueryMetricLastRequest &request) const CmsClient::QueryMetricLastOutcome CmsClient::queryMetricLast(const QueryMetricLastRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryMetricLastOutcome(endpointOutcome.error()); return QueryMetricLastOutcome(endpointOutcome.error());
@@ -886,10 +878,10 @@ CmsClient::QueryMetricLastOutcomeCallable CmsClient::queryMetricLastCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QuerySystemEventHistogramOutcome CmsClient::querySystemEventHistogram(const QuerySystemEventHistogramRequest &request) const CmsClient::QuerySystemEventHistogramOutcome CmsClient::querySystemEventHistogram(const QuerySystemEventHistogramRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QuerySystemEventHistogramOutcome(endpointOutcome.error()); return QuerySystemEventHistogramOutcome(endpointOutcome.error());
@@ -922,10 +914,10 @@ CmsClient::QuerySystemEventHistogramOutcomeCallable CmsClient::querySystemEventH
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DescribeAlarmHistoryOutcome CmsClient::describeAlarmHistory(const DescribeAlarmHistoryRequest &request) const CmsClient::DescribeAlarmHistoryOutcome CmsClient::describeAlarmHistory(const DescribeAlarmHistoryRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAlarmHistoryOutcome(endpointOutcome.error()); return DescribeAlarmHistoryOutcome(endpointOutcome.error());
@@ -958,10 +950,10 @@ CmsClient::DescribeAlarmHistoryOutcomeCallable CmsClient::describeAlarmHistoryCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeStatusOutcome CmsClient::nodeStatus(const NodeStatusRequest &request) const CmsClient::NodeStatusOutcome CmsClient::nodeStatus(const NodeStatusRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeStatusOutcome(endpointOutcome.error()); return NodeStatusOutcome(endpointOutcome.error());
@@ -994,10 +986,10 @@ CmsClient::NodeStatusOutcomeCallable CmsClient::nodeStatusCallable(const NodeSta
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DeleteMyGroupInstancesOutcome CmsClient::deleteMyGroupInstances(const DeleteMyGroupInstancesRequest &request) const CmsClient::DeleteMyGroupInstancesOutcome CmsClient::deleteMyGroupInstances(const DeleteMyGroupInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteMyGroupInstancesOutcome(endpointOutcome.error()); return DeleteMyGroupInstancesOutcome(endpointOutcome.error());
@@ -1030,10 +1022,10 @@ CmsClient::DeleteMyGroupInstancesOutcomeCallable CmsClient::deleteMyGroupInstanc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListProductOfActiveAlertOutcome CmsClient::listProductOfActiveAlert(const ListProductOfActiveAlertRequest &request) const CmsClient::ListProductOfActiveAlertOutcome CmsClient::listProductOfActiveAlert(const ListProductOfActiveAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListProductOfActiveAlertOutcome(endpointOutcome.error()); return ListProductOfActiveAlertOutcome(endpointOutcome.error());
@@ -1066,10 +1058,10 @@ CmsClient::ListProductOfActiveAlertOutcomeCallable CmsClient::listProductOfActiv
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::CreateMyGroupsOutcome CmsClient::createMyGroups(const CreateMyGroupsRequest &request) const CmsClient::CreateMyGroupsOutcome CmsClient::createMyGroups(const CreateMyGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateMyGroupsOutcome(endpointOutcome.error()); return CreateMyGroupsOutcome(endpointOutcome.error());
@@ -1102,10 +1094,10 @@ CmsClient::CreateMyGroupsOutcomeCallable CmsClient::createMyGroupsCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::CreateAlarmOutcome CmsClient::createAlarm(const CreateAlarmRequest &request) const CmsClient::CreateAlarmOutcome CmsClient::createAlarm(const CreateAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateAlarmOutcome(endpointOutcome.error()); return CreateAlarmOutcome(endpointOutcome.error());
@@ -1138,10 +1130,10 @@ CmsClient::CreateAlarmOutcomeCallable CmsClient::createAlarmCallable(const Creat
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListActiveAlertRuleOutcome CmsClient::listActiveAlertRule(const ListActiveAlertRuleRequest &request) const CmsClient::ListActiveAlertRuleOutcome CmsClient::listActiveAlertRule(const ListActiveAlertRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListActiveAlertRuleOutcome(endpointOutcome.error()); return ListActiveAlertRuleOutcome(endpointOutcome.error());
@@ -1174,10 +1166,10 @@ CmsClient::ListActiveAlertRuleOutcomeCallable CmsClient::listActiveAlertRuleCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListMyGroupsOutcome CmsClient::listMyGroups(const ListMyGroupsRequest &request) const CmsClient::ListMyGroupsOutcome CmsClient::listMyGroups(const ListMyGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMyGroupsOutcome(endpointOutcome.error()); return ListMyGroupsOutcome(endpointOutcome.error());
@@ -1210,10 +1202,10 @@ CmsClient::ListMyGroupsOutcomeCallable CmsClient::listMyGroupsCallable(const Lis
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DeleteNotifyPolicyOutcome CmsClient::deleteNotifyPolicy(const DeleteNotifyPolicyRequest &request) const CmsClient::DeleteNotifyPolicyOutcome CmsClient::deleteNotifyPolicy(const DeleteNotifyPolicyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteNotifyPolicyOutcome(endpointOutcome.error()); return DeleteNotifyPolicyOutcome(endpointOutcome.error());
@@ -1246,10 +1238,10 @@ CmsClient::DeleteNotifyPolicyOutcomeCallable CmsClient::deleteNotifyPolicyCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::AddMyGroupInstancesOutcome CmsClient::addMyGroupInstances(const AddMyGroupInstancesRequest &request) const CmsClient::AddMyGroupInstancesOutcome CmsClient::addMyGroupInstances(const AddMyGroupInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddMyGroupInstancesOutcome(endpointOutcome.error()); return AddMyGroupInstancesOutcome(endpointOutcome.error());
@@ -1282,10 +1274,10 @@ CmsClient::AddMyGroupInstancesOutcomeCallable CmsClient::addMyGroupInstancesCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeProcessDeleteOutcome CmsClient::nodeProcessDelete(const NodeProcessDeleteRequest &request) const CmsClient::NodeProcessDeleteOutcome CmsClient::nodeProcessDelete(const NodeProcessDeleteRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeProcessDeleteOutcome(endpointOutcome.error()); return NodeProcessDeleteOutcome(endpointOutcome.error());
@@ -1318,10 +1310,10 @@ CmsClient::NodeProcessDeleteOutcomeCallable CmsClient::nodeProcessDeleteCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::UpdateMyGroupsOutcome CmsClient::updateMyGroups(const UpdateMyGroupsRequest &request) const CmsClient::UpdateMyGroupsOutcome CmsClient::updateMyGroups(const UpdateMyGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpdateMyGroupsOutcome(endpointOutcome.error()); return UpdateMyGroupsOutcome(endpointOutcome.error());
@@ -1354,10 +1346,10 @@ CmsClient::UpdateMyGroupsOutcomeCallable CmsClient::updateMyGroupsCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QuerySystemEventCountOutcome CmsClient::querySystemEventCount(const QuerySystemEventCountRequest &request) const CmsClient::QuerySystemEventCountOutcome CmsClient::querySystemEventCount(const QuerySystemEventCountRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QuerySystemEventCountOutcome(endpointOutcome.error()); return QuerySystemEventCountOutcome(endpointOutcome.error());
@@ -1390,10 +1382,10 @@ CmsClient::QuerySystemEventCountOutcomeCallable CmsClient::querySystemEventCount
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListMyGroupInstancesOutcome CmsClient::listMyGroupInstances(const ListMyGroupInstancesRequest &request) const CmsClient::ListMyGroupInstancesOutcome CmsClient::listMyGroupInstances(const ListMyGroupInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListMyGroupInstancesOutcome(endpointOutcome.error()); return ListMyGroupInstancesOutcome(endpointOutcome.error());
@@ -1426,10 +1418,10 @@ CmsClient::ListMyGroupInstancesOutcomeCallable CmsClient::listMyGroupInstancesCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::AccessKeyGetOutcome CmsClient::accessKeyGet(const AccessKeyGetRequest &request) const CmsClient::AccessKeyGetOutcome CmsClient::accessKeyGet(const AccessKeyGetRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AccessKeyGetOutcome(endpointOutcome.error()); return AccessKeyGetOutcome(endpointOutcome.error());
@@ -1462,10 +1454,10 @@ CmsClient::AccessKeyGetOutcomeCallable CmsClient::accessKeyGetCallable(const Acc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::EnableActiceAlertOutcome CmsClient::enableActiceAlert(const EnableActiceAlertRequest &request) const CmsClient::EnableActiceAlertOutcome CmsClient::enableActiceAlert(const EnableActiceAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EnableActiceAlertOutcome(endpointOutcome.error()); return EnableActiceAlertOutcome(endpointOutcome.error());
@@ -1498,10 +1490,10 @@ CmsClient::EnableActiceAlertOutcomeCallable CmsClient::enableActiceAlertCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::PutMetricDataOutcome CmsClient::putMetricData(const PutMetricDataRequest &request) const CmsClient::PutMetricDataOutcome CmsClient::putMetricData(const PutMetricDataRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return PutMetricDataOutcome(endpointOutcome.error()); return PutMetricDataOutcome(endpointOutcome.error());
@@ -1534,10 +1526,10 @@ CmsClient::PutMetricDataOutcomeCallable CmsClient::putMetricDataCallable(const P
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DisableActiveAlertOutcome CmsClient::disableActiveAlert(const DisableActiveAlertRequest &request) const CmsClient::DisableActiveAlertOutcome CmsClient::disableActiveAlert(const DisableActiveAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DisableActiveAlertOutcome(endpointOutcome.error()); return DisableActiveAlertOutcome(endpointOutcome.error());
@@ -1570,10 +1562,10 @@ CmsClient::DisableActiveAlertOutcomeCallable CmsClient::disableActiveAlertCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::DisableActiceAlertOutcome CmsClient::disableActiceAlert(const DisableActiceAlertRequest &request) const CmsClient::DisableActiceAlertOutcome CmsClient::disableActiceAlert(const DisableActiceAlertRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DisableActiceAlertOutcome(endpointOutcome.error()); return DisableActiceAlertOutcome(endpointOutcome.error());
@@ -1606,10 +1598,10 @@ CmsClient::DisableActiceAlertOutcomeCallable CmsClient::disableActiceAlertCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListAlarmOutcome CmsClient::listAlarm(const ListAlarmRequest &request) const CmsClient::ListAlarmOutcome CmsClient::listAlarm(const ListAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListAlarmOutcome(endpointOutcome.error()); return ListAlarmOutcome(endpointOutcome.error());
@@ -1642,10 +1634,10 @@ CmsClient::ListAlarmOutcomeCallable CmsClient::listAlarmCallable(const ListAlarm
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeInstallOutcome CmsClient::nodeInstall(const NodeInstallRequest &request) const CmsClient::NodeInstallOutcome CmsClient::nodeInstall(const NodeInstallRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeInstallOutcome(endpointOutcome.error()); return NodeInstallOutcome(endpointOutcome.error());
@@ -1678,10 +1670,10 @@ CmsClient::NodeInstallOutcomeCallable CmsClient::nodeInstallCallable(const NodeI
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryCustomEventHistogramOutcome CmsClient::queryCustomEventHistogram(const QueryCustomEventHistogramRequest &request) const CmsClient::QueryCustomEventHistogramOutcome CmsClient::queryCustomEventHistogram(const QueryCustomEventHistogramRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryCustomEventHistogramOutcome(endpointOutcome.error()); return QueryCustomEventHistogramOutcome(endpointOutcome.error());
@@ -1714,10 +1706,10 @@ CmsClient::QueryCustomEventHistogramOutcomeCallable CmsClient::queryCustomEventH
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::PutEventOutcome CmsClient::putEvent(const PutEventRequest &request) const CmsClient::PutEventOutcome CmsClient::putEvent(const PutEventRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return PutEventOutcome(endpointOutcome.error()); return PutEventOutcome(endpointOutcome.error());
@@ -1750,10 +1742,10 @@ CmsClient::PutEventOutcomeCallable CmsClient::putEventCallable(const PutEventReq
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListAlarmHistoryOutcome CmsClient::listAlarmHistory(const ListAlarmHistoryRequest &request) const CmsClient::ListAlarmHistoryOutcome CmsClient::listAlarmHistory(const ListAlarmHistoryRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListAlarmHistoryOutcome(endpointOutcome.error()); return ListAlarmHistoryOutcome(endpointOutcome.error());
@@ -1786,10 +1778,10 @@ CmsClient::ListAlarmHistoryOutcomeCallable CmsClient::listAlarmHistoryCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeStatusListOutcome CmsClient::nodeStatusList(const NodeStatusListRequest &request) const CmsClient::NodeStatusListOutcome CmsClient::nodeStatusList(const NodeStatusListRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeStatusListOutcome(endpointOutcome.error()); return NodeStatusListOutcome(endpointOutcome.error());
@@ -1822,10 +1814,10 @@ CmsClient::NodeStatusListOutcomeCallable CmsClient::nodeStatusListCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListContactGroupOutcome CmsClient::listContactGroup(const ListContactGroupRequest &request) const CmsClient::ListContactGroupOutcome CmsClient::listContactGroup(const ListContactGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListContactGroupOutcome(endpointOutcome.error()); return ListContactGroupOutcome(endpointOutcome.error());
@@ -1858,10 +1850,10 @@ CmsClient::ListContactGroupOutcomeCallable CmsClient::listContactGroupCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::GetMyGroupsOutcome CmsClient::getMyGroups(const GetMyGroupsRequest &request) const CmsClient::GetMyGroupsOutcome CmsClient::getMyGroups(const GetMyGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetMyGroupsOutcome(endpointOutcome.error()); return GetMyGroupsOutcome(endpointOutcome.error());
@@ -1894,10 +1886,10 @@ CmsClient::GetMyGroupsOutcomeCallable CmsClient::getMyGroupsCallable(const GetMy
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::ListNotifyPolicyOutcome CmsClient::listNotifyPolicy(const ListNotifyPolicyRequest &request) const CmsClient::ListNotifyPolicyOutcome CmsClient::listNotifyPolicy(const ListNotifyPolicyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListNotifyPolicyOutcome(endpointOutcome.error()); return ListNotifyPolicyOutcome(endpointOutcome.error());
@@ -1930,10 +1922,10 @@ CmsClient::ListNotifyPolicyOutcomeCallable CmsClient::listNotifyPolicyCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::UpdateAlarmOutcome CmsClient::updateAlarm(const UpdateAlarmRequest &request) const CmsClient::UpdateAlarmOutcome CmsClient::updateAlarm(const UpdateAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpdateAlarmOutcome(endpointOutcome.error()); return UpdateAlarmOutcome(endpointOutcome.error());
@@ -1966,10 +1958,10 @@ CmsClient::UpdateAlarmOutcomeCallable CmsClient::updateAlarmCallable(const Updat
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::NodeProcessCreateOutcome CmsClient::nodeProcessCreate(const NodeProcessCreateRequest &request) const CmsClient::NodeProcessCreateOutcome CmsClient::nodeProcessCreate(const NodeProcessCreateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return NodeProcessCreateOutcome(endpointOutcome.error()); return NodeProcessCreateOutcome(endpointOutcome.error());
@@ -2002,10 +1994,10 @@ CmsClient::NodeProcessCreateOutcomeCallable CmsClient::nodeProcessCreateCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::EnableAlarmOutcome CmsClient::enableAlarm(const EnableAlarmRequest &request) const CmsClient::EnableAlarmOutcome CmsClient::enableAlarm(const EnableAlarmRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EnableAlarmOutcome(endpointOutcome.error()); return EnableAlarmOutcome(endpointOutcome.error());
@@ -2038,10 +2030,10 @@ CmsClient::EnableAlarmOutcomeCallable CmsClient::enableAlarmCallable(const Enabl
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
CmsClient::QueryCustomEventDetailOutcome CmsClient::queryCustomEventDetail(const QueryCustomEventDetailRequest &request) const CmsClient::QueryCustomEventDetailOutcome CmsClient::queryCustomEventDetail(const QueryCustomEventDetailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryCustomEventDetailOutcome(endpointOutcome.error()); return QueryCustomEventDetailOutcome(endpointOutcome.error());
@@ -2074,4 +2066,4 @@ CmsClient::QueryCustomEventDetailOutcomeCallable CmsClient::queryCustomEventDeta
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -374,7 +374,6 @@ namespace AlibabaCloud
CreateClusterOutcomeCallable createClusterCallable(const Model::CreateClusterRequest& request) const; CreateClusterOutcomeCallable createClusterCallable(const Model::CreateClusterRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::CS; using namespace AlibabaCloud::CS;
using namespace AlibabaCloud::CS::Model; using namespace AlibabaCloud::CS::Model;
namespace
{
const std::string SERVICE_NAME = "CS";
}
CSClient::CSClient(const Credentials &credentials, const ClientConfiguration &configuration) : CSClient::CSClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RoaServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
CSClient::CSClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : CSClient::CSClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RoaServiceClient(credentialsProvider, configuration) RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
CSClient::CSClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : CSClient::CSClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RoaServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RoaServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
CSClient::~CSClient() CSClient::~CSClient()
{} {}
CoreClient::EndpointOutcome CSClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
CSClient::AttachInstancesOutcome CSClient::attachInstances(const AttachInstancesRequest &request) const CSClient::AttachInstancesOutcome CSClient::attachInstances(const AttachInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AttachInstancesOutcome(endpointOutcome.error()); return AttachInstancesOutcome(endpointOutcome.error());
@@ -97,7 +89,7 @@ CSClient::AttachInstancesOutcomeCallable CSClient::attachInstancesCallable(const
CSClient::CallbackClusterTokenOutcome CSClient::callbackClusterToken(const CallbackClusterTokenRequest &request) const CSClient::CallbackClusterTokenOutcome CSClient::callbackClusterToken(const CallbackClusterTokenRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CallbackClusterTokenOutcome(endpointOutcome.error()); return CallbackClusterTokenOutcome(endpointOutcome.error());
@@ -133,7 +125,7 @@ CSClient::CallbackClusterTokenOutcomeCallable CSClient::callbackClusterTokenCall
CSClient::DescribeTemplatesOutcome CSClient::describeTemplates(const DescribeTemplatesRequest &request) const CSClient::DescribeTemplatesOutcome CSClient::describeTemplates(const DescribeTemplatesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeTemplatesOutcome(endpointOutcome.error()); return DescribeTemplatesOutcome(endpointOutcome.error());
@@ -169,7 +161,7 @@ CSClient::DescribeTemplatesOutcomeCallable CSClient::describeTemplatesCallable(c
CSClient::GetProjectEventsOutcome CSClient::getProjectEvents(const GetProjectEventsRequest &request) const CSClient::GetProjectEventsOutcome CSClient::getProjectEvents(const GetProjectEventsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetProjectEventsOutcome(endpointOutcome.error()); return GetProjectEventsOutcome(endpointOutcome.error());
@@ -205,7 +197,7 @@ CSClient::GetProjectEventsOutcomeCallable CSClient::getProjectEventsCallable(con
CSClient::CheckAliyunCSServiceRoleOutcome CSClient::checkAliyunCSServiceRole(const CheckAliyunCSServiceRoleRequest &request) const CSClient::CheckAliyunCSServiceRoleOutcome CSClient::checkAliyunCSServiceRole(const CheckAliyunCSServiceRoleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CheckAliyunCSServiceRoleOutcome(endpointOutcome.error()); return CheckAliyunCSServiceRoleOutcome(endpointOutcome.error());
@@ -241,7 +233,7 @@ CSClient::CheckAliyunCSServiceRoleOutcomeCallable CSClient::checkAliyunCSService
CSClient::DescribeTemplateAttributeOutcome CSClient::describeTemplateAttribute(const DescribeTemplateAttributeRequest &request) const CSClient::DescribeTemplateAttributeOutcome CSClient::describeTemplateAttribute(const DescribeTemplateAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeTemplateAttributeOutcome(endpointOutcome.error()); return DescribeTemplateAttributeOutcome(endpointOutcome.error());
@@ -277,7 +269,7 @@ CSClient::DescribeTemplateAttributeOutcomeCallable CSClient::describeTemplateAtt
CSClient::CreateTemplateOutcome CSClient::createTemplate(const CreateTemplateRequest &request) const CSClient::CreateTemplateOutcome CSClient::createTemplate(const CreateTemplateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateTemplateOutcome(endpointOutcome.error()); return CreateTemplateOutcome(endpointOutcome.error());
@@ -313,7 +305,7 @@ CSClient::CreateTemplateOutcomeCallable CSClient::createTemplateCallable(const C
CSClient::DescribeClusterCertsOutcome CSClient::describeClusterCerts(const DescribeClusterCertsRequest &request) const CSClient::DescribeClusterCertsOutcome CSClient::describeClusterCerts(const DescribeClusterCertsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterCertsOutcome(endpointOutcome.error()); return DescribeClusterCertsOutcome(endpointOutcome.error());
@@ -349,7 +341,7 @@ CSClient::DescribeClusterCertsOutcomeCallable CSClient::describeClusterCertsCall
CSClient::DeleteClusterOutcome CSClient::deleteCluster(const DeleteClusterRequest &request) const CSClient::DeleteClusterOutcome CSClient::deleteCluster(const DeleteClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteClusterOutcome(endpointOutcome.error()); return DeleteClusterOutcome(endpointOutcome.error());
@@ -385,7 +377,7 @@ CSClient::DeleteClusterOutcomeCallable CSClient::deleteClusterCallable(const Del
CSClient::DescribeClusterNodesOutcome CSClient::describeClusterNodes(const DescribeClusterNodesRequest &request) const CSClient::DescribeClusterNodesOutcome CSClient::describeClusterNodes(const DescribeClusterNodesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterNodesOutcome(endpointOutcome.error()); return DescribeClusterNodesOutcome(endpointOutcome.error());
@@ -421,7 +413,7 @@ CSClient::DescribeClusterNodesOutcomeCallable CSClient::describeClusterNodesCall
CSClient::CallBackAgilityClusterOutcome CSClient::callBackAgilityCluster(const CallBackAgilityClusterRequest &request) const CSClient::CallBackAgilityClusterOutcome CSClient::callBackAgilityCluster(const CallBackAgilityClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CallBackAgilityClusterOutcome(endpointOutcome.error()); return CallBackAgilityClusterOutcome(endpointOutcome.error());
@@ -457,7 +449,7 @@ CSClient::CallBackAgilityClusterOutcomeCallable CSClient::callBackAgilityCluster
CSClient::DescribeClusterScaledNodeOutcome CSClient::describeClusterScaledNode(const DescribeClusterScaledNodeRequest &request) const CSClient::DescribeClusterScaledNodeOutcome CSClient::describeClusterScaledNode(const DescribeClusterScaledNodeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterScaledNodeOutcome(endpointOutcome.error()); return DescribeClusterScaledNodeOutcome(endpointOutcome.error());
@@ -493,7 +485,7 @@ CSClient::DescribeClusterScaledNodeOutcomeCallable CSClient::describeClusterScal
CSClient::DescribeClusterLogsOutcome CSClient::describeClusterLogs(const DescribeClusterLogsRequest &request) const CSClient::DescribeClusterLogsOutcome CSClient::describeClusterLogs(const DescribeClusterLogsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterLogsOutcome(endpointOutcome.error()); return DescribeClusterLogsOutcome(endpointOutcome.error());
@@ -529,7 +521,7 @@ CSClient::DescribeClusterLogsOutcomeCallable CSClient::describeClusterLogsCallab
CSClient::DescribeClusterDetailOutcome CSClient::describeClusterDetail(const DescribeClusterDetailRequest &request) const CSClient::DescribeClusterDetailOutcome CSClient::describeClusterDetail(const DescribeClusterDetailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterDetailOutcome(endpointOutcome.error()); return DescribeClusterDetailOutcome(endpointOutcome.error());
@@ -565,7 +557,7 @@ CSClient::DescribeClusterDetailOutcomeCallable CSClient::describeClusterDetailCa
CSClient::ResetClusterNodeOutcome CSClient::resetClusterNode(const ResetClusterNodeRequest &request) const CSClient::ResetClusterNodeOutcome CSClient::resetClusterNode(const ResetClusterNodeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ResetClusterNodeOutcome(endpointOutcome.error()); return ResetClusterNodeOutcome(endpointOutcome.error());
@@ -601,7 +593,7 @@ CSClient::ResetClusterNodeOutcomeCallable CSClient::resetClusterNodeCallable(con
CSClient::DescribeServiceContainersOutcome CSClient::describeServiceContainers(const DescribeServiceContainersRequest &request) const CSClient::DescribeServiceContainersOutcome CSClient::describeServiceContainers(const DescribeServiceContainersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeServiceContainersOutcome(endpointOutcome.error()); return DescribeServiceContainersOutcome(endpointOutcome.error());
@@ -637,7 +629,7 @@ CSClient::DescribeServiceContainersOutcomeCallable CSClient::describeServiceCont
CSClient::DescribeTaskInfoOutcome CSClient::describeTaskInfo(const DescribeTaskInfoRequest &request) const CSClient::DescribeTaskInfoOutcome CSClient::describeTaskInfo(const DescribeTaskInfoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeTaskInfoOutcome(endpointOutcome.error()); return DescribeTaskInfoOutcome(endpointOutcome.error());
@@ -673,7 +665,7 @@ CSClient::DescribeTaskInfoOutcomeCallable CSClient::describeTaskInfoCallable(con
CSClient::GetClusterProjectsOutcome CSClient::getClusterProjects(const GetClusterProjectsRequest &request) const CSClient::GetClusterProjectsOutcome CSClient::getClusterProjects(const GetClusterProjectsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetClusterProjectsOutcome(endpointOutcome.error()); return GetClusterProjectsOutcome(endpointOutcome.error());
@@ -709,7 +701,7 @@ CSClient::GetClusterProjectsOutcomeCallable CSClient::getClusterProjectsCallable
CSClient::DescribeClusterServicesOutcome CSClient::describeClusterServices(const DescribeClusterServicesRequest &request) const CSClient::DescribeClusterServicesOutcome CSClient::describeClusterServices(const DescribeClusterServicesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterServicesOutcome(endpointOutcome.error()); return DescribeClusterServicesOutcome(endpointOutcome.error());
@@ -745,7 +737,7 @@ CSClient::DescribeClusterServicesOutcomeCallable CSClient::describeClusterServic
CSClient::ScaleInClusterOutcome CSClient::scaleInCluster(const ScaleInClusterRequest &request) const CSClient::ScaleInClusterOutcome CSClient::scaleInCluster(const ScaleInClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ScaleInClusterOutcome(endpointOutcome.error()); return ScaleInClusterOutcome(endpointOutcome.error());
@@ -781,7 +773,7 @@ CSClient::ScaleInClusterOutcomeCallable CSClient::scaleInClusterCallable(const S
CSClient::DeleteClusterNodeOutcome CSClient::deleteClusterNode(const DeleteClusterNodeRequest &request) const CSClient::DeleteClusterNodeOutcome CSClient::deleteClusterNode(const DeleteClusterNodeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteClusterNodeOutcome(endpointOutcome.error()); return DeleteClusterNodeOutcome(endpointOutcome.error());
@@ -817,7 +809,7 @@ CSClient::DeleteClusterNodeOutcomeCallable CSClient::deleteClusterNodeCallable(c
CSClient::RevokeClusterTokenOutcome CSClient::revokeClusterToken(const RevokeClusterTokenRequest &request) const CSClient::RevokeClusterTokenOutcome CSClient::revokeClusterToken(const RevokeClusterTokenRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RevokeClusterTokenOutcome(endpointOutcome.error()); return RevokeClusterTokenOutcome(endpointOutcome.error());
@@ -853,7 +845,7 @@ CSClient::RevokeClusterTokenOutcomeCallable CSClient::revokeClusterTokenCallable
CSClient::DescribeClustersOutcome CSClient::describeClusters(const DescribeClustersRequest &request) const CSClient::DescribeClustersOutcome CSClient::describeClusters(const DescribeClustersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClustersOutcome(endpointOutcome.error()); return DescribeClustersOutcome(endpointOutcome.error());
@@ -889,7 +881,7 @@ CSClient::DescribeClustersOutcomeCallable CSClient::describeClustersCallable(con
CSClient::AddAgilityClusterOutcome CSClient::addAgilityCluster(const AddAgilityClusterRequest &request) const CSClient::AddAgilityClusterOutcome CSClient::addAgilityCluster(const AddAgilityClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddAgilityClusterOutcome(endpointOutcome.error()); return AddAgilityClusterOutcome(endpointOutcome.error());
@@ -925,7 +917,7 @@ CSClient::AddAgilityClusterOutcomeCallable CSClient::addAgilityClusterCallable(c
CSClient::DescribeImagesOutcome CSClient::describeImages(const DescribeImagesRequest &request) const CSClient::DescribeImagesOutcome CSClient::describeImages(const DescribeImagesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeImagesOutcome(endpointOutcome.error()); return DescribeImagesOutcome(endpointOutcome.error());
@@ -961,7 +953,7 @@ CSClient::DescribeImagesOutcomeCallable CSClient::describeImagesCallable(const D
CSClient::GetTriggerHookOutcome CSClient::getTriggerHook(const GetTriggerHookRequest &request) const CSClient::GetTriggerHookOutcome CSClient::getTriggerHook(const GetTriggerHookRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetTriggerHookOutcome(endpointOutcome.error()); return GetTriggerHookOutcome(endpointOutcome.error());
@@ -997,7 +989,7 @@ CSClient::GetTriggerHookOutcomeCallable CSClient::getTriggerHookCallable(const G
CSClient::DescribeClusterTokensOutcome CSClient::describeClusterTokens(const DescribeClusterTokensRequest &request) const CSClient::DescribeClusterTokensOutcome CSClient::describeClusterTokens(const DescribeClusterTokensRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterTokensOutcome(endpointOutcome.error()); return DescribeClusterTokensOutcome(endpointOutcome.error());
@@ -1033,7 +1025,7 @@ CSClient::DescribeClusterTokensOutcomeCallable CSClient::describeClusterTokensCa
CSClient::UpdateSubUserResoucesOutcome CSClient::updateSubUserResouces(const UpdateSubUserResoucesRequest &request) const CSClient::UpdateSubUserResoucesOutcome CSClient::updateSubUserResouces(const UpdateSubUserResoucesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpdateSubUserResoucesOutcome(endpointOutcome.error()); return UpdateSubUserResoucesOutcome(endpointOutcome.error());
@@ -1069,7 +1061,7 @@ CSClient::UpdateSubUserResoucesOutcomeCallable CSClient::updateSubUserResoucesCa
CSClient::ModifyClusterNameOutcome CSClient::modifyClusterName(const ModifyClusterNameRequest &request) const CSClient::ModifyClusterNameOutcome CSClient::modifyClusterName(const ModifyClusterNameRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyClusterNameOutcome(endpointOutcome.error()); return ModifyClusterNameOutcome(endpointOutcome.error());
@@ -1105,7 +1097,7 @@ CSClient::ModifyClusterNameOutcomeCallable CSClient::modifyClusterNameCallable(c
CSClient::DescribeClusterHostsOutcome CSClient::describeClusterHosts(const DescribeClusterHostsRequest &request) const CSClient::DescribeClusterHostsOutcome CSClient::describeClusterHosts(const DescribeClusterHostsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterHostsOutcome(endpointOutcome.error()); return DescribeClusterHostsOutcome(endpointOutcome.error());
@@ -1141,7 +1133,7 @@ CSClient::DescribeClusterHostsOutcomeCallable CSClient::describeClusterHostsCall
CSClient::DescribeApiVersionOutcome CSClient::describeApiVersion(const DescribeApiVersionRequest &request) const CSClient::DescribeApiVersionOutcome CSClient::describeApiVersion(const DescribeApiVersionRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeApiVersionOutcome(endpointOutcome.error()); return DescribeApiVersionOutcome(endpointOutcome.error());
@@ -1177,7 +1169,7 @@ CSClient::DescribeApiVersionOutcomeCallable CSClient::describeApiVersionCallable
CSClient::GatherLogsTokenOutcome CSClient::gatherLogsToken(const GatherLogsTokenRequest &request) const CSClient::GatherLogsTokenOutcome CSClient::gatherLogsToken(const GatherLogsTokenRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GatherLogsTokenOutcome(endpointOutcome.error()); return GatherLogsTokenOutcome(endpointOutcome.error());
@@ -1213,7 +1205,7 @@ CSClient::GatherLogsTokenOutcomeCallable CSClient::gatherLogsTokenCallable(const
CSClient::CreateClusterTokenOutcome CSClient::createClusterToken(const CreateClusterTokenRequest &request) const CSClient::CreateClusterTokenOutcome CSClient::createClusterToken(const CreateClusterTokenRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateClusterTokenOutcome(endpointOutcome.error()); return CreateClusterTokenOutcome(endpointOutcome.error());
@@ -1249,7 +1241,7 @@ CSClient::CreateClusterTokenOutcomeCallable CSClient::createClusterTokenCallable
CSClient::DescribeUserContainersOutcome CSClient::describeUserContainers(const DescribeUserContainersRequest &request) const CSClient::DescribeUserContainersOutcome CSClient::describeUserContainers(const DescribeUserContainersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeUserContainersOutcome(endpointOutcome.error()); return DescribeUserContainersOutcome(endpointOutcome.error());
@@ -1285,7 +1277,7 @@ CSClient::DescribeUserContainersOutcomeCallable CSClient::describeUserContainers
CSClient::DescribeAgilityTunnelAgentInfoOutcome CSClient::describeAgilityTunnelAgentInfo(const DescribeAgilityTunnelAgentInfoRequest &request) const CSClient::DescribeAgilityTunnelAgentInfoOutcome CSClient::describeAgilityTunnelAgentInfo(const DescribeAgilityTunnelAgentInfoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAgilityTunnelAgentInfoOutcome(endpointOutcome.error()); return DescribeAgilityTunnelAgentInfoOutcome(endpointOutcome.error());
@@ -1321,7 +1313,7 @@ CSClient::DescribeAgilityTunnelAgentInfoOutcomeCallable CSClient::describeAgilit
CSClient::DescribeClusterNodeInfoOutcome CSClient::describeClusterNodeInfo(const DescribeClusterNodeInfoRequest &request) const CSClient::DescribeClusterNodeInfoOutcome CSClient::describeClusterNodeInfo(const DescribeClusterNodeInfoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterNodeInfoOutcome(endpointOutcome.error()); return DescribeClusterNodeInfoOutcome(endpointOutcome.error());
@@ -1357,7 +1349,7 @@ CSClient::DescribeClusterNodeInfoOutcomeCallable CSClient::describeClusterNodeIn
CSClient::ScaleClusterOutcome CSClient::scaleCluster(const ScaleClusterRequest &request) const CSClient::ScaleClusterOutcome CSClient::scaleCluster(const ScaleClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ScaleClusterOutcome(endpointOutcome.error()); return ScaleClusterOutcome(endpointOutcome.error());
@@ -1393,7 +1385,7 @@ CSClient::ScaleClusterOutcomeCallable CSClient::scaleClusterCallable(const Scale
CSClient::DescribeAgilityTunnelCertsOutcome CSClient::describeAgilityTunnelCerts(const DescribeAgilityTunnelCertsRequest &request) const CSClient::DescribeAgilityTunnelCertsOutcome CSClient::describeAgilityTunnelCerts(const DescribeAgilityTunnelCertsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAgilityTunnelCertsOutcome(endpointOutcome.error()); return DescribeAgilityTunnelCertsOutcome(endpointOutcome.error());
@@ -1429,7 +1421,7 @@ CSClient::DescribeAgilityTunnelCertsOutcomeCallable CSClient::describeAgilityTun
CSClient::DescribeClusterNodeInfoWithInstanceOutcome CSClient::describeClusterNodeInfoWithInstance(const DescribeClusterNodeInfoWithInstanceRequest &request) const CSClient::DescribeClusterNodeInfoWithInstanceOutcome CSClient::describeClusterNodeInfoWithInstance(const DescribeClusterNodeInfoWithInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterNodeInfoWithInstanceOutcome(endpointOutcome.error()); return DescribeClusterNodeInfoWithInstanceOutcome(endpointOutcome.error());
@@ -1465,7 +1457,7 @@ CSClient::DescribeClusterNodeInfoWithInstanceOutcomeCallable CSClient::describeC
CSClient::UpgradeClusterComponentsOutcome CSClient::upgradeClusterComponents(const UpgradeClusterComponentsRequest &request) const CSClient::UpgradeClusterComponentsOutcome CSClient::upgradeClusterComponents(const UpgradeClusterComponentsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpgradeClusterComponentsOutcome(endpointOutcome.error()); return UpgradeClusterComponentsOutcome(endpointOutcome.error());
@@ -1501,7 +1493,7 @@ CSClient::UpgradeClusterComponentsOutcomeCallable CSClient::upgradeClusterCompon
CSClient::DownloadClusterNodeCertsOutcome CSClient::downloadClusterNodeCerts(const DownloadClusterNodeCertsRequest &request) const CSClient::DownloadClusterNodeCertsOutcome CSClient::downloadClusterNodeCerts(const DownloadClusterNodeCertsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DownloadClusterNodeCertsOutcome(endpointOutcome.error()); return DownloadClusterNodeCertsOutcome(endpointOutcome.error());
@@ -1537,7 +1529,7 @@ CSClient::DownloadClusterNodeCertsOutcomeCallable CSClient::downloadClusterNodeC
CSClient::CreateClusterOutcome CSClient::createCluster(const CreateClusterRequest &request) const CSClient::CreateClusterOutcome CSClient::createCluster(const CreateClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateClusterOutcome(endpointOutcome.error()); return CreateClusterOutcome(endpointOutcome.error());

View File

@@ -1822,7 +1822,6 @@ namespace AlibabaCloud
ModifyVRouterAttributeOutcomeCallable modifyVRouterAttributeCallable(const Model::ModifyVRouterAttributeRequest& request) const; ModifyVRouterAttributeOutcomeCallable modifyVRouterAttributeCallable(const Model::ModifyVRouterAttributeRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -326,7 +326,6 @@ namespace AlibabaCloud
ModifyUserPasswordsOutcomeCallable modifyUserPasswordsCallable(const Model::ModifyUserPasswordsRequest& request) const; ModifyUserPasswordsOutcomeCallable modifyUserPasswordsCallable(const Model::ModifyUserPasswordsRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -46,12 +46,12 @@ namespace AlibabaCloud
std::string lastModifyTime; std::string lastModifyTime;
std::string submitTime; std::string submitTime;
std::string name; std::string name;
std::string stderr; std::string _stderr;
std::string state; std::string state;
std::vector<Resources> resources; std::vector<Resources> resources;
std::string id; std::string id;
std::string arrayRequest; std::string arrayRequest;
std::string stdout; std::string _stdout;
}; };

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::EHPC; using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::Model; using namespace AlibabaCloud::EHPC::Model;
namespace
{
const std::string SERVICE_NAME = "EHPC";
}
EHPCClient::EHPCClient(const Credentials &credentials, const ClientConfiguration &configuration) : EHPCClient::EHPCClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ehs"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ehs");
} }
EHPCClient::EHPCClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : EHPCClient::EHPCClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ehs"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ehs");
} }
EHPCClient::EHPCClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : EHPCClient::EHPCClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ehs"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ehs");
} }
EHPCClient::~EHPCClient() EHPCClient::~EHPCClient()
{} {}
CoreClient::EndpointOutcome EHPCClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
EHPCClient::DeleteUsersOutcome EHPCClient::deleteUsers(const DeleteUsersRequest &request) const EHPCClient::DeleteUsersOutcome EHPCClient::deleteUsers(const DeleteUsersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteUsersOutcome(endpointOutcome.error()); return DeleteUsersOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ EHPCClient::DeleteUsersOutcomeCallable EHPCClient::deleteUsersCallable(const Del
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::DescribeClusterOutcome EHPCClient::describeCluster(const DescribeClusterRequest &request) const EHPCClient::DescribeClusterOutcome EHPCClient::describeCluster(const DescribeClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeClusterOutcome(endpointOutcome.error()); return DescribeClusterOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ EHPCClient::DescribeClusterOutcomeCallable EHPCClient::describeClusterCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListUsersOutcome EHPCClient::listUsers(const ListUsersRequest &request) const EHPCClient::ListUsersOutcome EHPCClient::listUsers(const ListUsersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListUsersOutcome(endpointOutcome.error()); return ListUsersOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ EHPCClient::ListUsersOutcomeCallable EHPCClient::listUsersCallable(const ListUse
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::UpgradeClientOutcome EHPCClient::upgradeClient(const UpgradeClientRequest &request) const EHPCClient::UpgradeClientOutcome EHPCClient::upgradeClient(const UpgradeClientRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UpgradeClientOutcome(endpointOutcome.error()); return UpgradeClientOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ EHPCClient::UpgradeClientOutcomeCallable EHPCClient::upgradeClientCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListCurrentClientVersionOutcome EHPCClient::listCurrentClientVersion(const ListCurrentClientVersionRequest &request) const EHPCClient::ListCurrentClientVersionOutcome EHPCClient::listCurrentClientVersion(const ListCurrentClientVersionRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListCurrentClientVersionOutcome(endpointOutcome.error()); return ListCurrentClientVersionOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ EHPCClient::ListCurrentClientVersionOutcomeCallable EHPCClient::listCurrentClien
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::DeleteClusterOutcome EHPCClient::deleteCluster(const DeleteClusterRequest &request) const EHPCClient::DeleteClusterOutcome EHPCClient::deleteCluster(const DeleteClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteClusterOutcome(endpointOutcome.error()); return DeleteClusterOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ EHPCClient::DeleteClusterOutcomeCallable EHPCClient::deleteClusterCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListImagesOutcome EHPCClient::listImages(const ListImagesRequest &request) const EHPCClient::ListImagesOutcome EHPCClient::listImages(const ListImagesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListImagesOutcome(endpointOutcome.error()); return ListImagesOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ EHPCClient::ListImagesOutcomeCallable EHPCClient::listImagesCallable(const ListI
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::SetAutoScaleConfigOutcome EHPCClient::setAutoScaleConfig(const SetAutoScaleConfigRequest &request) const EHPCClient::SetAutoScaleConfigOutcome EHPCClient::setAutoScaleConfig(const SetAutoScaleConfigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetAutoScaleConfigOutcome(endpointOutcome.error()); return SetAutoScaleConfigOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ EHPCClient::SetAutoScaleConfigOutcomeCallable EHPCClient::setAutoScaleConfigCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListVolumesOutcome EHPCClient::listVolumes(const ListVolumesRequest &request) const EHPCClient::ListVolumesOutcome EHPCClient::listVolumes(const ListVolumesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListVolumesOutcome(endpointOutcome.error()); return ListVolumesOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ EHPCClient::ListVolumesOutcomeCallable EHPCClient::listVolumesCallable(const Lis
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::AddNodesOutcome EHPCClient::addNodes(const AddNodesRequest &request) const EHPCClient::AddNodesOutcome EHPCClient::addNodes(const AddNodesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddNodesOutcome(endpointOutcome.error()); return AddNodesOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ EHPCClient::AddNodesOutcomeCallable EHPCClient::addNodesCallable(const AddNodesR
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListSoftwaresOutcome EHPCClient::listSoftwares(const ListSoftwaresRequest &request) const EHPCClient::ListSoftwaresOutcome EHPCClient::listSoftwares(const ListSoftwaresRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListSoftwaresOutcome(endpointOutcome.error()); return ListSoftwaresOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ EHPCClient::ListSoftwaresOutcomeCallable EHPCClient::listSoftwaresCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::StopJobsOutcome EHPCClient::stopJobs(const StopJobsRequest &request) const EHPCClient::StopJobsOutcome EHPCClient::stopJobs(const StopJobsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return StopJobsOutcome(endpointOutcome.error()); return StopJobsOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ EHPCClient::StopJobsOutcomeCallable EHPCClient::stopJobsCallable(const StopJobsR
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::GetAutoScaleConfigOutcome EHPCClient::getAutoScaleConfig(const GetAutoScaleConfigRequest &request) const EHPCClient::GetAutoScaleConfigOutcome EHPCClient::getAutoScaleConfig(const GetAutoScaleConfigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetAutoScaleConfigOutcome(endpointOutcome.error()); return GetAutoScaleConfigOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ EHPCClient::GetAutoScaleConfigOutcomeCallable EHPCClient::getAutoScaleConfigCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListNodesOutcome EHPCClient::listNodes(const ListNodesRequest &request) const EHPCClient::ListNodesOutcome EHPCClient::listNodes(const ListNodesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListNodesOutcome(endpointOutcome.error()); return ListNodesOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ EHPCClient::ListNodesOutcomeCallable EHPCClient::listNodesCallable(const ListNod
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::SetJobUserOutcome EHPCClient::setJobUser(const SetJobUserRequest &request) const EHPCClient::SetJobUserOutcome EHPCClient::setJobUser(const SetJobUserRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetJobUserOutcome(endpointOutcome.error()); return SetJobUserOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ EHPCClient::SetJobUserOutcomeCallable EHPCClient::setJobUserCallable(const SetJo
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ModifyUserGroupsOutcome EHPCClient::modifyUserGroups(const ModifyUserGroupsRequest &request) const EHPCClient::ModifyUserGroupsOutcome EHPCClient::modifyUserGroups(const ModifyUserGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyUserGroupsOutcome(endpointOutcome.error()); return ModifyUserGroupsOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ EHPCClient::ModifyUserGroupsOutcomeCallable EHPCClient::modifyUserGroupsCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListClustersOutcome EHPCClient::listClusters(const ListClustersRequest &request) const EHPCClient::ListClustersOutcome EHPCClient::listClusters(const ListClustersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListClustersOutcome(endpointOutcome.error()); return ListClustersOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ EHPCClient::ListClustersOutcomeCallable EHPCClient::listClustersCallable(const L
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::SubmitJobOutcome EHPCClient::submitJob(const SubmitJobRequest &request) const EHPCClient::SubmitJobOutcome EHPCClient::submitJob(const SubmitJobRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SubmitJobOutcome(endpointOutcome.error()); return SubmitJobOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ EHPCClient::SubmitJobOutcomeCallable EHPCClient::submitJobCallable(const SubmitJ
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListCustomImagesOutcome EHPCClient::listCustomImages(const ListCustomImagesRequest &request) const EHPCClient::ListCustomImagesOutcome EHPCClient::listCustomImages(const ListCustomImagesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListCustomImagesOutcome(endpointOutcome.error()); return ListCustomImagesOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ EHPCClient::ListCustomImagesOutcomeCallable EHPCClient::listCustomImagesCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListRegionsOutcome EHPCClient::listRegions(const ListRegionsRequest &request) const EHPCClient::ListRegionsOutcome EHPCClient::listRegions(const ListRegionsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListRegionsOutcome(endpointOutcome.error()); return ListRegionsOutcome(endpointOutcome.error());
@@ -778,10 +770,10 @@ EHPCClient::ListRegionsOutcomeCallable EHPCClient::listRegionsCallable(const Lis
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::AddUsersOutcome EHPCClient::addUsers(const AddUsersRequest &request) const EHPCClient::AddUsersOutcome EHPCClient::addUsers(const AddUsersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddUsersOutcome(endpointOutcome.error()); return AddUsersOutcome(endpointOutcome.error());
@@ -814,10 +806,10 @@ EHPCClient::AddUsersOutcomeCallable EHPCClient::addUsersCallable(const AddUsersR
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListJobTemplatesOutcome EHPCClient::listJobTemplates(const ListJobTemplatesRequest &request) const EHPCClient::ListJobTemplatesOutcome EHPCClient::listJobTemplates(const ListJobTemplatesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListJobTemplatesOutcome(endpointOutcome.error()); return ListJobTemplatesOutcome(endpointOutcome.error());
@@ -850,10 +842,10 @@ EHPCClient::ListJobTemplatesOutcomeCallable EHPCClient::listJobTemplatesCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ModifyClusterAttributesOutcome EHPCClient::modifyClusterAttributes(const ModifyClusterAttributesRequest &request) const EHPCClient::ModifyClusterAttributesOutcome EHPCClient::modifyClusterAttributes(const ModifyClusterAttributesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyClusterAttributesOutcome(endpointOutcome.error()); return ModifyClusterAttributesOutcome(endpointOutcome.error());
@@ -886,10 +878,10 @@ EHPCClient::ModifyClusterAttributesOutcomeCallable EHPCClient::modifyClusterAttr
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::DeleteJobTemplatesOutcome EHPCClient::deleteJobTemplates(const DeleteJobTemplatesRequest &request) const EHPCClient::DeleteJobTemplatesOutcome EHPCClient::deleteJobTemplates(const DeleteJobTemplatesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteJobTemplatesOutcome(endpointOutcome.error()); return DeleteJobTemplatesOutcome(endpointOutcome.error());
@@ -922,10 +914,10 @@ EHPCClient::DeleteJobTemplatesOutcomeCallable EHPCClient::deleteJobTemplatesCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListNodesNoPagingOutcome EHPCClient::listNodesNoPaging(const ListNodesNoPagingRequest &request) const EHPCClient::ListNodesNoPagingOutcome EHPCClient::listNodesNoPaging(const ListNodesNoPagingRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListNodesNoPagingOutcome(endpointOutcome.error()); return ListNodesNoPagingOutcome(endpointOutcome.error());
@@ -958,10 +950,10 @@ EHPCClient::ListNodesNoPagingOutcomeCallable EHPCClient::listNodesNoPagingCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::CreateJobTemplateOutcome EHPCClient::createJobTemplate(const CreateJobTemplateRequest &request) const EHPCClient::CreateJobTemplateOutcome EHPCClient::createJobTemplate(const CreateJobTemplateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateJobTemplateOutcome(endpointOutcome.error()); return CreateJobTemplateOutcome(endpointOutcome.error());
@@ -994,10 +986,10 @@ EHPCClient::CreateJobTemplateOutcomeCallable EHPCClient::createJobTemplateCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::RerunJobsOutcome EHPCClient::rerunJobs(const RerunJobsRequest &request) const EHPCClient::RerunJobsOutcome EHPCClient::rerunJobs(const RerunJobsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RerunJobsOutcome(endpointOutcome.error()); return RerunJobsOutcome(endpointOutcome.error());
@@ -1030,10 +1022,10 @@ EHPCClient::RerunJobsOutcomeCallable EHPCClient::rerunJobsCallable(const RerunJo
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ResetNodesOutcome EHPCClient::resetNodes(const ResetNodesRequest &request) const EHPCClient::ResetNodesOutcome EHPCClient::resetNodes(const ResetNodesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ResetNodesOutcome(endpointOutcome.error()); return ResetNodesOutcome(endpointOutcome.error());
@@ -1066,10 +1058,10 @@ EHPCClient::ResetNodesOutcomeCallable EHPCClient::resetNodesCallable(const Reset
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::EditJobTemplateOutcome EHPCClient::editJobTemplate(const EditJobTemplateRequest &request) const EHPCClient::EditJobTemplateOutcome EHPCClient::editJobTemplate(const EditJobTemplateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EditJobTemplateOutcome(endpointOutcome.error()); return EditJobTemplateOutcome(endpointOutcome.error());
@@ -1102,10 +1094,10 @@ EHPCClient::EditJobTemplateOutcomeCallable EHPCClient::editJobTemplateCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListPreferredEcsTypesOutcome EHPCClient::listPreferredEcsTypes(const ListPreferredEcsTypesRequest &request) const EHPCClient::ListPreferredEcsTypesOutcome EHPCClient::listPreferredEcsTypes(const ListPreferredEcsTypesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListPreferredEcsTypesOutcome(endpointOutcome.error()); return ListPreferredEcsTypesOutcome(endpointOutcome.error());
@@ -1138,10 +1130,10 @@ EHPCClient::ListPreferredEcsTypesOutcomeCallable EHPCClient::listPreferredEcsTyp
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListClusterLogsOutcome EHPCClient::listClusterLogs(const ListClusterLogsRequest &request) const EHPCClient::ListClusterLogsOutcome EHPCClient::listClusterLogs(const ListClusterLogsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListClusterLogsOutcome(endpointOutcome.error()); return ListClusterLogsOutcome(endpointOutcome.error());
@@ -1174,10 +1166,10 @@ EHPCClient::ListClusterLogsOutcomeCallable EHPCClient::listClusterLogsCallable(c
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::DeleteJobsOutcome EHPCClient::deleteJobs(const DeleteJobsRequest &request) const EHPCClient::DeleteJobsOutcome EHPCClient::deleteJobs(const DeleteJobsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteJobsOutcome(endpointOutcome.error()); return DeleteJobsOutcome(endpointOutcome.error());
@@ -1210,10 +1202,10 @@ EHPCClient::DeleteJobsOutcomeCallable EHPCClient::deleteJobsCallable(const Delet
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::DeleteNodesOutcome EHPCClient::deleteNodes(const DeleteNodesRequest &request) const EHPCClient::DeleteNodesOutcome EHPCClient::deleteNodes(const DeleteNodesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteNodesOutcome(endpointOutcome.error()); return DeleteNodesOutcome(endpointOutcome.error());
@@ -1246,10 +1238,10 @@ EHPCClient::DeleteNodesOutcomeCallable EHPCClient::deleteNodesCallable(const Del
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ListJobsOutcome EHPCClient::listJobs(const ListJobsRequest &request) const EHPCClient::ListJobsOutcome EHPCClient::listJobs(const ListJobsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ListJobsOutcome(endpointOutcome.error()); return ListJobsOutcome(endpointOutcome.error());
@@ -1282,10 +1274,10 @@ EHPCClient::ListJobsOutcomeCallable EHPCClient::listJobsCallable(const ListJobsR
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::CreateClusterOutcome EHPCClient::createCluster(const CreateClusterRequest &request) const EHPCClient::CreateClusterOutcome EHPCClient::createCluster(const CreateClusterRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateClusterOutcome(endpointOutcome.error()); return CreateClusterOutcome(endpointOutcome.error());
@@ -1318,10 +1310,10 @@ EHPCClient::CreateClusterOutcomeCallable EHPCClient::createClusterCallable(const
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EHPCClient::ModifyUserPasswordsOutcome EHPCClient::modifyUserPasswords(const ModifyUserPasswordsRequest &request) const EHPCClient::ModifyUserPasswordsOutcome EHPCClient::modifyUserPasswords(const ModifyUserPasswordsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyUserPasswordsOutcome(endpointOutcome.error()); return ModifyUserPasswordsOutcome(endpointOutcome.error());
@@ -1354,4 +1346,4 @@ EHPCClient::ModifyUserPasswordsOutcomeCallable EHPCClient::modifyUserPasswordsCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -61,9 +61,9 @@ void ListJobsResult::parse(const std::string &payload)
if(!value["LastModifyTime"].isNull()) if(!value["LastModifyTime"].isNull())
jobsObject.lastModifyTime = value["LastModifyTime"].asString(); jobsObject.lastModifyTime = value["LastModifyTime"].asString();
if(!value["Stdout"].isNull()) if(!value["Stdout"].isNull())
jobsObject.stdout = value["Stdout"].asString(); jobsObject._stdout = value["Stdout"].asString();
if(!value["Stderr"].isNull()) if(!value["Stderr"].isNull())
jobsObject.stderr = value["Stderr"].asString(); jobsObject._stderr = value["Stderr"].asString();
if(!value["Comment"].isNull()) if(!value["Comment"].isNull())
jobsObject.comment = value["Comment"].asString(); jobsObject.comment = value["Comment"].asString();
if(!value["ArrayRequest"].isNull()) if(!value["ArrayRequest"].isNull())

View File

@@ -302,7 +302,6 @@ namespace AlibabaCloud
ModifyAlertConfigOutcomeCallable modifyAlertConfigCallable(const Model::ModifyAlertConfigRequest& request) const; ModifyAlertConfigOutcomeCallable modifyAlertConfigCallable(const Model::ModifyAlertConfigRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Ess; using namespace AlibabaCloud::Ess;
using namespace AlibabaCloud::Ess::Model; using namespace AlibabaCloud::Ess::Model;
namespace
{
const std::string SERVICE_NAME = "Ess";
}
EssClient::EssClient(const Credentials &credentials, const ClientConfiguration &configuration) : EssClient::EssClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ess"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
} }
EssClient::EssClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : EssClient::EssClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ess"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
} }
EssClient::EssClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : EssClient::EssClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "ess"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
} }
EssClient::~EssClient() EssClient::~EssClient()
{} {}
CoreClient::EndpointOutcome EssClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
EssClient::AttachInstancesOutcome EssClient::attachInstances(const AttachInstancesRequest &request) const EssClient::AttachInstancesOutcome EssClient::attachInstances(const AttachInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AttachInstancesOutcome(endpointOutcome.error()); return AttachInstancesOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ EssClient::AttachInstancesOutcomeCallable EssClient::attachInstancesCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingGroupsOutcome EssClient::describeScalingGroups(const DescribeScalingGroupsRequest &request) const EssClient::DescribeScalingGroupsOutcome EssClient::describeScalingGroups(const DescribeScalingGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingGroupsOutcome(endpointOutcome.error()); return DescribeScalingGroupsOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ EssClient::DescribeScalingGroupsOutcomeCallable EssClient::describeScalingGroups
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingActivitiesOutcome EssClient::describeScalingActivities(const DescribeScalingActivitiesRequest &request) const EssClient::DescribeScalingActivitiesOutcome EssClient::describeScalingActivities(const DescribeScalingActivitiesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingActivitiesOutcome(endpointOutcome.error()); return DescribeScalingActivitiesOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ EssClient::DescribeScalingActivitiesOutcomeCallable EssClient::describeScalingAc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingRulesOutcome EssClient::describeScalingRules(const DescribeScalingRulesRequest &request) const EssClient::DescribeScalingRulesOutcome EssClient::describeScalingRules(const DescribeScalingRulesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingRulesOutcome(endpointOutcome.error()); return DescribeScalingRulesOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ EssClient::DescribeScalingRulesOutcomeCallable EssClient::describeScalingRulesCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::ModifyScalingGroupOutcome EssClient::modifyScalingGroup(const ModifyScalingGroupRequest &request) const EssClient::ModifyScalingGroupOutcome EssClient::modifyScalingGroup(const ModifyScalingGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyScalingGroupOutcome(endpointOutcome.error()); return ModifyScalingGroupOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ EssClient::ModifyScalingGroupOutcomeCallable EssClient::modifyScalingGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::EnableScalingGroupOutcome EssClient::enableScalingGroup(const EnableScalingGroupRequest &request) const EssClient::EnableScalingGroupOutcome EssClient::enableScalingGroup(const EnableScalingGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return EnableScalingGroupOutcome(endpointOutcome.error()); return EnableScalingGroupOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ EssClient::EnableScalingGroupOutcomeCallable EssClient::enableScalingGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DeactivateScalingConfigurationOutcome EssClient::deactivateScalingConfiguration(const DeactivateScalingConfigurationRequest &request) const EssClient::DeactivateScalingConfigurationOutcome EssClient::deactivateScalingConfiguration(const DeactivateScalingConfigurationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeactivateScalingConfigurationOutcome(endpointOutcome.error()); return DeactivateScalingConfigurationOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ EssClient::DeactivateScalingConfigurationOutcomeCallable EssClient::deactivateSc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::VerifyAuthenticationOutcome EssClient::verifyAuthentication(const VerifyAuthenticationRequest &request) const EssClient::VerifyAuthenticationOutcome EssClient::verifyAuthentication(const VerifyAuthenticationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return VerifyAuthenticationOutcome(endpointOutcome.error()); return VerifyAuthenticationOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ EssClient::VerifyAuthenticationOutcomeCallable EssClient::verifyAuthenticationCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::CreateScheduledTaskOutcome EssClient::createScheduledTask(const CreateScheduledTaskRequest &request) const EssClient::CreateScheduledTaskOutcome EssClient::createScheduledTask(const CreateScheduledTaskRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateScheduledTaskOutcome(endpointOutcome.error()); return CreateScheduledTaskOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ EssClient::CreateScheduledTaskOutcomeCallable EssClient::createScheduledTaskCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DeleteScheduledTaskOutcome EssClient::deleteScheduledTask(const DeleteScheduledTaskRequest &request) const EssClient::DeleteScheduledTaskOutcome EssClient::deleteScheduledTask(const DeleteScheduledTaskRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteScheduledTaskOutcome(endpointOutcome.error()); return DeleteScheduledTaskOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ EssClient::DeleteScheduledTaskOutcomeCallable EssClient::deleteScheduledTaskCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::CreateScalingRuleOutcome EssClient::createScalingRule(const CreateScalingRuleRequest &request) const EssClient::CreateScalingRuleOutcome EssClient::createScalingRule(const CreateScalingRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateScalingRuleOutcome(endpointOutcome.error()); return CreateScalingRuleOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ EssClient::CreateScalingRuleOutcomeCallable EssClient::createScalingRuleCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingConfigurationsOutcome EssClient::describeScalingConfigurations(const DescribeScalingConfigurationsRequest &request) const EssClient::DescribeScalingConfigurationsOutcome EssClient::describeScalingConfigurations(const DescribeScalingConfigurationsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingConfigurationsOutcome(endpointOutcome.error()); return DescribeScalingConfigurationsOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ EssClient::DescribeScalingConfigurationsOutcomeCallable EssClient::describeScali
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::ModifyScheduledTaskOutcome EssClient::modifyScheduledTask(const ModifyScheduledTaskRequest &request) const EssClient::ModifyScheduledTaskOutcome EssClient::modifyScheduledTask(const ModifyScheduledTaskRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyScheduledTaskOutcome(endpointOutcome.error()); return ModifyScheduledTaskOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ EssClient::ModifyScheduledTaskOutcomeCallable EssClient::modifyScheduledTaskCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::RemoveInstancesOutcome EssClient::removeInstances(const RemoveInstancesRequest &request) const EssClient::RemoveInstancesOutcome EssClient::removeInstances(const RemoveInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveInstancesOutcome(endpointOutcome.error()); return RemoveInstancesOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ EssClient::RemoveInstancesOutcomeCallable EssClient::removeInstancesCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::ExecuteScalingRuleOutcome EssClient::executeScalingRule(const ExecuteScalingRuleRequest &request) const EssClient::ExecuteScalingRuleOutcome EssClient::executeScalingRule(const ExecuteScalingRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ExecuteScalingRuleOutcome(endpointOutcome.error()); return ExecuteScalingRuleOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ EssClient::ExecuteScalingRuleOutcomeCallable EssClient::executeScalingRuleCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DeleteScalingGroupOutcome EssClient::deleteScalingGroup(const DeleteScalingGroupRequest &request) const EssClient::DeleteScalingGroupOutcome EssClient::deleteScalingGroup(const DeleteScalingGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteScalingGroupOutcome(endpointOutcome.error()); return DeleteScalingGroupOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ EssClient::DeleteScalingGroupOutcomeCallable EssClient::deleteScalingGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingInstancesOutcome EssClient::describeScalingInstances(const DescribeScalingInstancesRequest &request) const EssClient::DescribeScalingInstancesOutcome EssClient::describeScalingInstances(const DescribeScalingInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingInstancesOutcome(endpointOutcome.error()); return DescribeScalingInstancesOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ EssClient::DescribeScalingInstancesOutcomeCallable EssClient::describeScalingIns
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::CreateScalingConfigurationOutcome EssClient::createScalingConfiguration(const CreateScalingConfigurationRequest &request) const EssClient::CreateScalingConfigurationOutcome EssClient::createScalingConfiguration(const CreateScalingConfigurationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateScalingConfigurationOutcome(endpointOutcome.error()); return CreateScalingConfigurationOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ EssClient::CreateScalingConfigurationOutcomeCallable EssClient::createScalingCon
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeCapacityHistoryOutcome EssClient::describeCapacityHistory(const DescribeCapacityHistoryRequest &request) const EssClient::DescribeCapacityHistoryOutcome EssClient::describeCapacityHistory(const DescribeCapacityHistoryRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCapacityHistoryOutcome(endpointOutcome.error()); return DescribeCapacityHistoryOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ EssClient::DescribeCapacityHistoryOutcomeCallable EssClient::describeCapacityHis
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeRegionsOutcome EssClient::describeRegions(const DescribeRegionsRequest &request) const EssClient::DescribeRegionsOutcome EssClient::describeRegions(const DescribeRegionsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeRegionsOutcome(endpointOutcome.error()); return DescribeRegionsOutcome(endpointOutcome.error());
@@ -778,10 +770,10 @@ EssClient::DescribeRegionsOutcomeCallable EssClient::describeRegionsCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScheduledTasksOutcome EssClient::describeScheduledTasks(const DescribeScheduledTasksRequest &request) const EssClient::DescribeScheduledTasksOutcome EssClient::describeScheduledTasks(const DescribeScheduledTasksRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScheduledTasksOutcome(endpointOutcome.error()); return DescribeScheduledTasksOutcome(endpointOutcome.error());
@@ -814,10 +806,10 @@ EssClient::DescribeScheduledTasksOutcomeCallable EssClient::describeScheduledTas
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeAccountAttributesOutcome EssClient::describeAccountAttributes(const DescribeAccountAttributesRequest &request) const EssClient::DescribeAccountAttributesOutcome EssClient::describeAccountAttributes(const DescribeAccountAttributesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAccountAttributesOutcome(endpointOutcome.error()); return DescribeAccountAttributesOutcome(endpointOutcome.error());
@@ -850,10 +842,10 @@ EssClient::DescribeAccountAttributesOutcomeCallable EssClient::describeAccountAt
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DetachInstancesOutcome EssClient::detachInstances(const DetachInstancesRequest &request) const EssClient::DetachInstancesOutcome EssClient::detachInstances(const DetachInstancesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DetachInstancesOutcome(endpointOutcome.error()); return DetachInstancesOutcome(endpointOutcome.error());
@@ -886,10 +878,10 @@ EssClient::DetachInstancesOutcomeCallable EssClient::detachInstancesCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeLimitationOutcome EssClient::describeLimitation(const DescribeLimitationRequest &request) const EssClient::DescribeLimitationOutcome EssClient::describeLimitation(const DescribeLimitationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLimitationOutcome(endpointOutcome.error()); return DescribeLimitationOutcome(endpointOutcome.error());
@@ -922,10 +914,10 @@ EssClient::DescribeLimitationOutcomeCallable EssClient::describeLimitationCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeScalingActivityDetailOutcome EssClient::describeScalingActivityDetail(const DescribeScalingActivityDetailRequest &request) const EssClient::DescribeScalingActivityDetailOutcome EssClient::describeScalingActivityDetail(const DescribeScalingActivityDetailRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeScalingActivityDetailOutcome(endpointOutcome.error()); return DescribeScalingActivityDetailOutcome(endpointOutcome.error());
@@ -958,10 +950,10 @@ EssClient::DescribeScalingActivityDetailOutcomeCallable EssClient::describeScali
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DescribeAlertConfigOutcome EssClient::describeAlertConfig(const DescribeAlertConfigRequest &request) const EssClient::DescribeAlertConfigOutcome EssClient::describeAlertConfig(const DescribeAlertConfigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAlertConfigOutcome(endpointOutcome.error()); return DescribeAlertConfigOutcome(endpointOutcome.error());
@@ -994,10 +986,10 @@ EssClient::DescribeAlertConfigOutcomeCallable EssClient::describeAlertConfigCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::CreateScalingGroupOutcome EssClient::createScalingGroup(const CreateScalingGroupRequest &request) const EssClient::CreateScalingGroupOutcome EssClient::createScalingGroup(const CreateScalingGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateScalingGroupOutcome(endpointOutcome.error()); return CreateScalingGroupOutcome(endpointOutcome.error());
@@ -1030,10 +1022,10 @@ EssClient::CreateScalingGroupOutcomeCallable EssClient::createScalingGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DeleteScalingConfigurationOutcome EssClient::deleteScalingConfiguration(const DeleteScalingConfigurationRequest &request) const EssClient::DeleteScalingConfigurationOutcome EssClient::deleteScalingConfiguration(const DeleteScalingConfigurationRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteScalingConfigurationOutcome(endpointOutcome.error()); return DeleteScalingConfigurationOutcome(endpointOutcome.error());
@@ -1066,10 +1058,10 @@ EssClient::DeleteScalingConfigurationOutcomeCallable EssClient::deleteScalingCon
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DisableScalingGroupOutcome EssClient::disableScalingGroup(const DisableScalingGroupRequest &request) const EssClient::DisableScalingGroupOutcome EssClient::disableScalingGroup(const DisableScalingGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DisableScalingGroupOutcome(endpointOutcome.error()); return DisableScalingGroupOutcome(endpointOutcome.error());
@@ -1102,10 +1094,10 @@ EssClient::DisableScalingGroupOutcomeCallable EssClient::disableScalingGroupCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::ModifyScalingRuleOutcome EssClient::modifyScalingRule(const ModifyScalingRuleRequest &request) const EssClient::ModifyScalingRuleOutcome EssClient::modifyScalingRule(const ModifyScalingRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyScalingRuleOutcome(endpointOutcome.error()); return ModifyScalingRuleOutcome(endpointOutcome.error());
@@ -1138,10 +1130,10 @@ EssClient::ModifyScalingRuleOutcomeCallable EssClient::modifyScalingRuleCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::DeleteScalingRuleOutcome EssClient::deleteScalingRule(const DeleteScalingRuleRequest &request) const EssClient::DeleteScalingRuleOutcome EssClient::deleteScalingRule(const DeleteScalingRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteScalingRuleOutcome(endpointOutcome.error()); return DeleteScalingRuleOutcome(endpointOutcome.error());
@@ -1174,10 +1166,10 @@ EssClient::DeleteScalingRuleOutcomeCallable EssClient::deleteScalingRuleCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::VerifyUserOutcome EssClient::verifyUser(const VerifyUserRequest &request) const EssClient::VerifyUserOutcome EssClient::verifyUser(const VerifyUserRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return VerifyUserOutcome(endpointOutcome.error()); return VerifyUserOutcome(endpointOutcome.error());
@@ -1210,10 +1202,10 @@ EssClient::VerifyUserOutcomeCallable EssClient::verifyUserCallable(const VerifyU
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
EssClient::ModifyAlertConfigOutcome EssClient::modifyAlertConfig(const ModifyAlertConfigRequest &request) const EssClient::ModifyAlertConfigOutcome EssClient::modifyAlertConfig(const ModifyAlertConfigRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyAlertConfigOutcome(endpointOutcome.error()); return ModifyAlertConfigOutcome(endpointOutcome.error());
@@ -1246,4 +1238,4 @@ EssClient::ModifyAlertConfigOutcomeCallable EssClient::modifyAlertConfigCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -1406,7 +1406,6 @@ namespace AlibabaCloud
DescribeBackupSetsForSecurityOutcomeCallable describeBackupSetsForSecurityCallable(const Model::DescribeBackupSetsForSecurityRequest& request) const; DescribeBackupSetsForSecurityOutcomeCallable describeBackupSetsForSecurityCallable(const Model::DescribeBackupSetsForSecurityRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -622,7 +622,6 @@ namespace AlibabaCloud
SetLoadBalancerUDPListenerAttributeOutcomeCallable setLoadBalancerUDPListenerAttributeCallable(const Model::SetLoadBalancerUDPListenerAttributeRequest& request) const; SetLoadBalancerUDPListenerAttributeOutcomeCallable setLoadBalancerUDPListenerAttributeCallable(const Model::SetLoadBalancerUDPListenerAttributeRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Slb; using namespace AlibabaCloud::Slb;
using namespace AlibabaCloud::Slb::Model; using namespace AlibabaCloud::Slb::Model;
namespace
{
const std::string SERVICE_NAME = "Slb";
}
SlbClient::SlbClient(const Credentials &credentials, const ClientConfiguration &configuration) : SlbClient::SlbClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "slb"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "slb");
} }
SlbClient::SlbClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : SlbClient::SlbClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "slb"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "slb");
} }
SlbClient::SlbClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : SlbClient::SlbClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "slb"); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "slb");
} }
SlbClient::~SlbClient() SlbClient::~SlbClient()
{} {}
CoreClient::EndpointOutcome SlbClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
SlbClient::CreateLoadBalancerUDPListenerOutcome SlbClient::createLoadBalancerUDPListener(const CreateLoadBalancerUDPListenerRequest &request) const SlbClient::CreateLoadBalancerUDPListenerOutcome SlbClient::createLoadBalancerUDPListener(const CreateLoadBalancerUDPListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateLoadBalancerUDPListenerOutcome(endpointOutcome.error()); return CreateLoadBalancerUDPListenerOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ SlbClient::CreateLoadBalancerUDPListenerOutcomeCallable SlbClient::createLoadBal
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeMasterSlaveVServerGroupsOutcome SlbClient::describeMasterSlaveVServerGroups(const DescribeMasterSlaveVServerGroupsRequest &request) const SlbClient::DescribeMasterSlaveVServerGroupsOutcome SlbClient::describeMasterSlaveVServerGroups(const DescribeMasterSlaveVServerGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeMasterSlaveVServerGroupsOutcome(endpointOutcome.error()); return DescribeMasterSlaveVServerGroupsOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ SlbClient::DescribeMasterSlaveVServerGroupsOutcomeCallable SlbClient::describeMa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::StartLoadBalancerListenerOutcome SlbClient::startLoadBalancerListener(const StartLoadBalancerListenerRequest &request) const SlbClient::StartLoadBalancerListenerOutcome SlbClient::startLoadBalancerListener(const StartLoadBalancerListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return StartLoadBalancerListenerOutcome(endpointOutcome.error()); return StartLoadBalancerListenerOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ SlbClient::StartLoadBalancerListenerOutcomeCallable SlbClient::startLoadBalancer
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerTCPListenerAttributeOutcome SlbClient::describeLoadBalancerTCPListenerAttribute(const DescribeLoadBalancerTCPListenerAttributeRequest &request) const SlbClient::DescribeLoadBalancerTCPListenerAttributeOutcome SlbClient::describeLoadBalancerTCPListenerAttribute(const DescribeLoadBalancerTCPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerTCPListenerAttributeOutcome(endpointOutcome.error()); return DescribeLoadBalancerTCPListenerAttributeOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ SlbClient::DescribeLoadBalancerTCPListenerAttributeOutcomeCallable SlbClient::de
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeListenerAccessControlAttributeOutcome SlbClient::describeListenerAccessControlAttribute(const DescribeListenerAccessControlAttributeRequest &request) const SlbClient::DescribeListenerAccessControlAttributeOutcome SlbClient::describeListenerAccessControlAttribute(const DescribeListenerAccessControlAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeListenerAccessControlAttributeOutcome(endpointOutcome.error()); return DescribeListenerAccessControlAttributeOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ SlbClient::DescribeListenerAccessControlAttributeOutcomeCallable SlbClient::desc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::StopLoadBalancerListenerOutcome SlbClient::stopLoadBalancerListener(const StopLoadBalancerListenerRequest &request) const SlbClient::StopLoadBalancerListenerOutcome SlbClient::stopLoadBalancerListener(const StopLoadBalancerListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return StopLoadBalancerListenerOutcome(endpointOutcome.error()); return StopLoadBalancerListenerOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ SlbClient::StopLoadBalancerListenerOutcomeCallable SlbClient::stopLoadBalancerLi
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerStatusOutcome SlbClient::setLoadBalancerStatus(const SetLoadBalancerStatusRequest &request) const SlbClient::SetLoadBalancerStatusOutcome SlbClient::setLoadBalancerStatus(const SetLoadBalancerStatusRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerStatusOutcome(endpointOutcome.error()); return SetLoadBalancerStatusOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ SlbClient::SetLoadBalancerStatusOutcomeCallable SlbClient::setLoadBalancerStatus
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::ModifyLoadBalancerInstanceSpecOutcome SlbClient::modifyLoadBalancerInstanceSpec(const ModifyLoadBalancerInstanceSpecRequest &request) const SlbClient::ModifyLoadBalancerInstanceSpecOutcome SlbClient::modifyLoadBalancerInstanceSpec(const ModifyLoadBalancerInstanceSpecRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyLoadBalancerInstanceSpecOutcome(endpointOutcome.error()); return ModifyLoadBalancerInstanceSpecOutcome(endpointOutcome.error());
@@ -346,10 +338,10 @@ SlbClient::ModifyLoadBalancerInstanceSpecOutcomeCallable SlbClient::modifyLoadBa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::MoveResourceGroupOutcome SlbClient::moveResourceGroup(const MoveResourceGroupRequest &request) const SlbClient::MoveResourceGroupOutcome SlbClient::moveResourceGroup(const MoveResourceGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return MoveResourceGroupOutcome(endpointOutcome.error()); return MoveResourceGroupOutcome(endpointOutcome.error());
@@ -382,10 +374,10 @@ SlbClient::MoveResourceGroupOutcomeCallable SlbClient::moveResourceGroupCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerTCPListenerAttributeOutcome SlbClient::setLoadBalancerTCPListenerAttribute(const SetLoadBalancerTCPListenerAttributeRequest &request) const SlbClient::SetLoadBalancerTCPListenerAttributeOutcome SlbClient::setLoadBalancerTCPListenerAttribute(const SetLoadBalancerTCPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerTCPListenerAttributeOutcome(endpointOutcome.error()); return SetLoadBalancerTCPListenerAttributeOutcome(endpointOutcome.error());
@@ -418,10 +410,10 @@ SlbClient::SetLoadBalancerTCPListenerAttributeOutcomeCallable SlbClient::setLoad
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteVServerGroupOutcome SlbClient::deleteVServerGroup(const DeleteVServerGroupRequest &request) const SlbClient::DeleteVServerGroupOutcome SlbClient::deleteVServerGroup(const DeleteVServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteVServerGroupOutcome(endpointOutcome.error()); return DeleteVServerGroupOutcome(endpointOutcome.error());
@@ -454,10 +446,10 @@ SlbClient::DeleteVServerGroupOutcomeCallable SlbClient::deleteVServerGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeVServerGroupAttributeOutcome SlbClient::describeVServerGroupAttribute(const DescribeVServerGroupAttributeRequest &request) const SlbClient::DescribeVServerGroupAttributeOutcome SlbClient::describeVServerGroupAttribute(const DescribeVServerGroupAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeVServerGroupAttributeOutcome(endpointOutcome.error()); return DescribeVServerGroupAttributeOutcome(endpointOutcome.error());
@@ -490,10 +482,10 @@ SlbClient::DescribeVServerGroupAttributeOutcomeCallable SlbClient::describeVServ
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::AddListenerWhiteListItemOutcome SlbClient::addListenerWhiteListItem(const AddListenerWhiteListItemRequest &request) const SlbClient::AddListenerWhiteListItemOutcome SlbClient::addListenerWhiteListItem(const AddListenerWhiteListItemRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddListenerWhiteListItemOutcome(endpointOutcome.error()); return AddListenerWhiteListItemOutcome(endpointOutcome.error());
@@ -526,10 +518,10 @@ SlbClient::AddListenerWhiteListItemOutcomeCallable SlbClient::addListenerWhiteLi
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::RemoveTagsOutcome SlbClient::removeTags(const RemoveTagsRequest &request) const SlbClient::RemoveTagsOutcome SlbClient::removeTags(const RemoveTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveTagsOutcome(endpointOutcome.error()); return RemoveTagsOutcome(endpointOutcome.error());
@@ -562,10 +554,10 @@ SlbClient::RemoveTagsOutcomeCallable SlbClient::removeTagsCallable(const RemoveT
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateLoadBalancerOutcome SlbClient::createLoadBalancer(const CreateLoadBalancerRequest &request) const SlbClient::CreateLoadBalancerOutcome SlbClient::createLoadBalancer(const CreateLoadBalancerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateLoadBalancerOutcome(endpointOutcome.error()); return CreateLoadBalancerOutcome(endpointOutcome.error());
@@ -598,10 +590,10 @@ SlbClient::CreateLoadBalancerOutcomeCallable SlbClient::createLoadBalancerCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerHTTPListenerAttributeOutcome SlbClient::setLoadBalancerHTTPListenerAttribute(const SetLoadBalancerHTTPListenerAttributeRequest &request) const SlbClient::SetLoadBalancerHTTPListenerAttributeOutcome SlbClient::setLoadBalancerHTTPListenerAttribute(const SetLoadBalancerHTTPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerHTTPListenerAttributeOutcome(endpointOutcome.error()); return SetLoadBalancerHTTPListenerAttributeOutcome(endpointOutcome.error());
@@ -634,10 +626,10 @@ SlbClient::SetLoadBalancerHTTPListenerAttributeOutcomeCallable SlbClient::setLoa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerAutoReleaseTimeOutcome SlbClient::setLoadBalancerAutoReleaseTime(const SetLoadBalancerAutoReleaseTimeRequest &request) const SlbClient::SetLoadBalancerAutoReleaseTimeOutcome SlbClient::setLoadBalancerAutoReleaseTime(const SetLoadBalancerAutoReleaseTimeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerAutoReleaseTimeOutcome(endpointOutcome.error()); return SetLoadBalancerAutoReleaseTimeOutcome(endpointOutcome.error());
@@ -670,10 +662,10 @@ SlbClient::SetLoadBalancerAutoReleaseTimeOutcomeCallable SlbClient::setLoadBalan
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetListenerAccessControlStatusOutcome SlbClient::setListenerAccessControlStatus(const SetListenerAccessControlStatusRequest &request) const SlbClient::SetListenerAccessControlStatusOutcome SlbClient::setListenerAccessControlStatus(const SetListenerAccessControlStatusRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetListenerAccessControlStatusOutcome(endpointOutcome.error()); return SetListenerAccessControlStatusOutcome(endpointOutcome.error());
@@ -706,10 +698,10 @@ SlbClient::SetListenerAccessControlStatusOutcomeCallable SlbClient::setListenerA
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::UploadCACertificateOutcome SlbClient::uploadCACertificate(const UploadCACertificateRequest &request) const SlbClient::UploadCACertificateOutcome SlbClient::uploadCACertificate(const UploadCACertificateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UploadCACertificateOutcome(endpointOutcome.error()); return UploadCACertificateOutcome(endpointOutcome.error());
@@ -742,10 +734,10 @@ SlbClient::UploadCACertificateOutcomeCallable SlbClient::uploadCACertificateCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeZonesOutcome SlbClient::describeZones(const DescribeZonesRequest &request) const SlbClient::DescribeZonesOutcome SlbClient::describeZones(const DescribeZonesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeZonesOutcome(endpointOutcome.error()); return DescribeZonesOutcome(endpointOutcome.error());
@@ -778,10 +770,10 @@ SlbClient::DescribeZonesOutcomeCallable SlbClient::describeZonesCallable(const D
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerHTTPSListenerAttributeOutcome SlbClient::setLoadBalancerHTTPSListenerAttribute(const SetLoadBalancerHTTPSListenerAttributeRequest &request) const SlbClient::SetLoadBalancerHTTPSListenerAttributeOutcome SlbClient::setLoadBalancerHTTPSListenerAttribute(const SetLoadBalancerHTTPSListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerHTTPSListenerAttributeOutcome(endpointOutcome.error()); return SetLoadBalancerHTTPSListenerAttributeOutcome(endpointOutcome.error());
@@ -814,10 +806,10 @@ SlbClient::SetLoadBalancerHTTPSListenerAttributeOutcomeCallable SlbClient::setLo
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteLoadBalancerListenerOutcome SlbClient::deleteLoadBalancerListener(const DeleteLoadBalancerListenerRequest &request) const SlbClient::DeleteLoadBalancerListenerOutcome SlbClient::deleteLoadBalancerListener(const DeleteLoadBalancerListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteLoadBalancerListenerOutcome(endpointOutcome.error()); return DeleteLoadBalancerListenerOutcome(endpointOutcome.error());
@@ -850,10 +842,10 @@ SlbClient::DeleteLoadBalancerListenerOutcomeCallable SlbClient::deleteLoadBalanc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeVServerGroupsOutcome SlbClient::describeVServerGroups(const DescribeVServerGroupsRequest &request) const SlbClient::DescribeVServerGroupsOutcome SlbClient::describeVServerGroups(const DescribeVServerGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeVServerGroupsOutcome(endpointOutcome.error()); return DescribeVServerGroupsOutcome(endpointOutcome.error());
@@ -886,10 +878,10 @@ SlbClient::DescribeVServerGroupsOutcomeCallable SlbClient::describeVServerGroups
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerHTTPListenerAttributeOutcome SlbClient::describeLoadBalancerHTTPListenerAttribute(const DescribeLoadBalancerHTTPListenerAttributeRequest &request) const SlbClient::DescribeLoadBalancerHTTPListenerAttributeOutcome SlbClient::describeLoadBalancerHTTPListenerAttribute(const DescribeLoadBalancerHTTPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerHTTPListenerAttributeOutcome(endpointOutcome.error()); return DescribeLoadBalancerHTTPListenerAttributeOutcome(endpointOutcome.error());
@@ -922,10 +914,10 @@ SlbClient::DescribeLoadBalancerHTTPListenerAttributeOutcomeCallable SlbClient::d
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeTagsOutcome SlbClient::describeTags(const DescribeTagsRequest &request) const SlbClient::DescribeTagsOutcome SlbClient::describeTags(const DescribeTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeTagsOutcome(endpointOutcome.error()); return DescribeTagsOutcome(endpointOutcome.error());
@@ -958,10 +950,10 @@ SlbClient::DescribeTagsOutcomeCallable SlbClient::describeTagsCallable(const Des
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteLoadBalancerOutcome SlbClient::deleteLoadBalancer(const DeleteLoadBalancerRequest &request) const SlbClient::DeleteLoadBalancerOutcome SlbClient::deleteLoadBalancer(const DeleteLoadBalancerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteLoadBalancerOutcome(endpointOutcome.error()); return DeleteLoadBalancerOutcome(endpointOutcome.error());
@@ -994,10 +986,10 @@ SlbClient::DeleteLoadBalancerOutcomeCallable SlbClient::deleteLoadBalancerCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateVServerGroupOutcome SlbClient::createVServerGroup(const CreateVServerGroupRequest &request) const SlbClient::CreateVServerGroupOutcome SlbClient::createVServerGroup(const CreateVServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateVServerGroupOutcome(endpointOutcome.error()); return CreateVServerGroupOutcome(endpointOutcome.error());
@@ -1030,10 +1022,10 @@ SlbClient::CreateVServerGroupOutcomeCallable SlbClient::createVServerGroupCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancersRelatedEcsOutcome SlbClient::describeLoadBalancersRelatedEcs(const DescribeLoadBalancersRelatedEcsRequest &request) const SlbClient::DescribeLoadBalancersRelatedEcsOutcome SlbClient::describeLoadBalancersRelatedEcs(const DescribeLoadBalancersRelatedEcsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancersRelatedEcsOutcome(endpointOutcome.error()); return DescribeLoadBalancersRelatedEcsOutcome(endpointOutcome.error());
@@ -1066,10 +1058,10 @@ SlbClient::DescribeLoadBalancersRelatedEcsOutcomeCallable SlbClient::describeLoa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancersOutcome SlbClient::describeLoadBalancers(const DescribeLoadBalancersRequest &request) const SlbClient::DescribeLoadBalancersOutcome SlbClient::describeLoadBalancers(const DescribeLoadBalancersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancersOutcome(endpointOutcome.error()); return DescribeLoadBalancersOutcome(endpointOutcome.error());
@@ -1102,10 +1094,10 @@ SlbClient::DescribeLoadBalancersOutcomeCallable SlbClient::describeLoadBalancers
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetCACertificateNameOutcome SlbClient::setCACertificateName(const SetCACertificateNameRequest &request) const SlbClient::SetCACertificateNameOutcome SlbClient::setCACertificateName(const SetCACertificateNameRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetCACertificateNameOutcome(endpointOutcome.error()); return SetCACertificateNameOutcome(endpointOutcome.error());
@@ -1138,10 +1130,10 @@ SlbClient::SetCACertificateNameOutcomeCallable SlbClient::setCACertificateNameCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeMasterSlaveVServerGroupAttributeOutcome SlbClient::describeMasterSlaveVServerGroupAttribute(const DescribeMasterSlaveVServerGroupAttributeRequest &request) const SlbClient::DescribeMasterSlaveVServerGroupAttributeOutcome SlbClient::describeMasterSlaveVServerGroupAttribute(const DescribeMasterSlaveVServerGroupAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeMasterSlaveVServerGroupAttributeOutcome(endpointOutcome.error()); return DescribeMasterSlaveVServerGroupAttributeOutcome(endpointOutcome.error());
@@ -1174,10 +1166,10 @@ SlbClient::DescribeMasterSlaveVServerGroupAttributeOutcomeCallable SlbClient::de
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateLoadBalancerHTTPListenerOutcome SlbClient::createLoadBalancerHTTPListener(const CreateLoadBalancerHTTPListenerRequest &request) const SlbClient::CreateLoadBalancerHTTPListenerOutcome SlbClient::createLoadBalancerHTTPListener(const CreateLoadBalancerHTTPListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateLoadBalancerHTTPListenerOutcome(endpointOutcome.error()); return CreateLoadBalancerHTTPListenerOutcome(endpointOutcome.error());
@@ -1210,10 +1202,10 @@ SlbClient::CreateLoadBalancerHTTPListenerOutcomeCallable SlbClient::createLoadBa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::RemoveBackendServersOutcome SlbClient::removeBackendServers(const RemoveBackendServersRequest &request) const SlbClient::RemoveBackendServersOutcome SlbClient::removeBackendServers(const RemoveBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveBackendServersOutcome(endpointOutcome.error()); return RemoveBackendServersOutcome(endpointOutcome.error());
@@ -1246,10 +1238,10 @@ SlbClient::RemoveBackendServersOutcomeCallable SlbClient::removeBackendServersCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::ModifyVServerGroupBackendServersOutcome SlbClient::modifyVServerGroupBackendServers(const ModifyVServerGroupBackendServersRequest &request) const SlbClient::ModifyVServerGroupBackendServersOutcome SlbClient::modifyVServerGroupBackendServers(const ModifyVServerGroupBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyVServerGroupBackendServersOutcome(endpointOutcome.error()); return ModifyVServerGroupBackendServersOutcome(endpointOutcome.error());
@@ -1282,10 +1274,10 @@ SlbClient::ModifyVServerGroupBackendServersOutcomeCallable SlbClient::modifyVSer
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerUDPListenerAttributeOutcome SlbClient::describeLoadBalancerUDPListenerAttribute(const DescribeLoadBalancerUDPListenerAttributeRequest &request) const SlbClient::DescribeLoadBalancerUDPListenerAttributeOutcome SlbClient::describeLoadBalancerUDPListenerAttribute(const DescribeLoadBalancerUDPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerUDPListenerAttributeOutcome(endpointOutcome.error()); return DescribeLoadBalancerUDPListenerAttributeOutcome(endpointOutcome.error());
@@ -1318,10 +1310,10 @@ SlbClient::DescribeLoadBalancerUDPListenerAttributeOutcomeCallable SlbClient::de
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeAccessLogsDownloadAttributeOutcome SlbClient::describeAccessLogsDownloadAttribute(const DescribeAccessLogsDownloadAttributeRequest &request) const SlbClient::DescribeAccessLogsDownloadAttributeOutcome SlbClient::describeAccessLogsDownloadAttribute(const DescribeAccessLogsDownloadAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeAccessLogsDownloadAttributeOutcome(endpointOutcome.error()); return DescribeAccessLogsDownloadAttributeOutcome(endpointOutcome.error());
@@ -1354,10 +1346,10 @@ SlbClient::DescribeAccessLogsDownloadAttributeOutcomeCallable SlbClient::describ
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteRulesOutcome SlbClient::deleteRules(const DeleteRulesRequest &request) const SlbClient::DeleteRulesOutcome SlbClient::deleteRules(const DeleteRulesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteRulesOutcome(endpointOutcome.error()); return DeleteRulesOutcome(endpointOutcome.error());
@@ -1390,10 +1382,10 @@ SlbClient::DeleteRulesOutcomeCallable SlbClient::deleteRulesCallable(const Delet
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteMasterSlaveVServerGroupOutcome SlbClient::deleteMasterSlaveVServerGroup(const DeleteMasterSlaveVServerGroupRequest &request) const SlbClient::DeleteMasterSlaveVServerGroupOutcome SlbClient::deleteMasterSlaveVServerGroup(const DeleteMasterSlaveVServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteMasterSlaveVServerGroupOutcome(endpointOutcome.error()); return DeleteMasterSlaveVServerGroupOutcome(endpointOutcome.error());
@@ -1426,10 +1418,10 @@ SlbClient::DeleteMasterSlaveVServerGroupOutcomeCallable SlbClient::deleteMasterS
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeCACertificatesOutcome SlbClient::describeCACertificates(const DescribeCACertificatesRequest &request) const SlbClient::DescribeCACertificatesOutcome SlbClient::describeCACertificates(const DescribeCACertificatesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeCACertificatesOutcome(endpointOutcome.error()); return DescribeCACertificatesOutcome(endpointOutcome.error());
@@ -1462,10 +1454,10 @@ SlbClient::DescribeCACertificatesOutcomeCallable SlbClient::describeCACertificat
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateMasterSlaveVServerGroupOutcome SlbClient::createMasterSlaveVServerGroup(const CreateMasterSlaveVServerGroupRequest &request) const SlbClient::CreateMasterSlaveVServerGroupOutcome SlbClient::createMasterSlaveVServerGroup(const CreateMasterSlaveVServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateMasterSlaveVServerGroupOutcome(endpointOutcome.error()); return CreateMasterSlaveVServerGroupOutcome(endpointOutcome.error());
@@ -1498,10 +1490,10 @@ SlbClient::CreateMasterSlaveVServerGroupOutcomeCallable SlbClient::createMasterS
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetBackendServersOutcome SlbClient::setBackendServers(const SetBackendServersRequest &request) const SlbClient::SetBackendServersOutcome SlbClient::setBackendServers(const SetBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetBackendServersOutcome(endpointOutcome.error()); return SetBackendServersOutcome(endpointOutcome.error());
@@ -1534,10 +1526,10 @@ SlbClient::SetBackendServersOutcomeCallable SlbClient::setBackendServersCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::RemoveVServerGroupBackendServersOutcome SlbClient::removeVServerGroupBackendServers(const RemoveVServerGroupBackendServersRequest &request) const SlbClient::RemoveVServerGroupBackendServersOutcome SlbClient::removeVServerGroupBackendServers(const RemoveVServerGroupBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveVServerGroupBackendServersOutcome(endpointOutcome.error()); return RemoveVServerGroupBackendServersOutcome(endpointOutcome.error());
@@ -1570,10 +1562,10 @@ SlbClient::RemoveVServerGroupBackendServersOutcomeCallable SlbClient::removeVSer
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerAttributeOutcome SlbClient::describeLoadBalancerAttribute(const DescribeLoadBalancerAttributeRequest &request) const SlbClient::DescribeLoadBalancerAttributeOutcome SlbClient::describeLoadBalancerAttribute(const DescribeLoadBalancerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerAttributeOutcome(endpointOutcome.error()); return DescribeLoadBalancerAttributeOutcome(endpointOutcome.error());
@@ -1606,10 +1598,10 @@ SlbClient::DescribeLoadBalancerAttributeOutcomeCallable SlbClient::describeLoadB
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateMasterSlaveServerGroupOutcome SlbClient::createMasterSlaveServerGroup(const CreateMasterSlaveServerGroupRequest &request) const SlbClient::CreateMasterSlaveServerGroupOutcome SlbClient::createMasterSlaveServerGroup(const CreateMasterSlaveServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateMasterSlaveServerGroupOutcome(endpointOutcome.error()); return CreateMasterSlaveServerGroupOutcome(endpointOutcome.error());
@@ -1642,10 +1634,10 @@ SlbClient::CreateMasterSlaveServerGroupOutcomeCallable SlbClient::createMasterSl
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetServerCertificateNameOutcome SlbClient::setServerCertificateName(const SetServerCertificateNameRequest &request) const SlbClient::SetServerCertificateNameOutcome SlbClient::setServerCertificateName(const SetServerCertificateNameRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetServerCertificateNameOutcome(endpointOutcome.error()); return SetServerCertificateNameOutcome(endpointOutcome.error());
@@ -1678,10 +1670,10 @@ SlbClient::SetServerCertificateNameOutcomeCallable SlbClient::setServerCertifica
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteCACertificateOutcome SlbClient::deleteCACertificate(const DeleteCACertificateRequest &request) const SlbClient::DeleteCACertificateOutcome SlbClient::deleteCACertificate(const DeleteCACertificateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteCACertificateOutcome(endpointOutcome.error()); return DeleteCACertificateOutcome(endpointOutcome.error());
@@ -1714,10 +1706,10 @@ SlbClient::DeleteCACertificateOutcomeCallable SlbClient::deleteCACertificateCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateLoadBalancerTCPListenerOutcome SlbClient::createLoadBalancerTCPListener(const CreateLoadBalancerTCPListenerRequest &request) const SlbClient::CreateLoadBalancerTCPListenerOutcome SlbClient::createLoadBalancerTCPListener(const CreateLoadBalancerTCPListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateLoadBalancerTCPListenerOutcome(endpointOutcome.error()); return CreateLoadBalancerTCPListenerOutcome(endpointOutcome.error());
@@ -1750,10 +1742,10 @@ SlbClient::CreateLoadBalancerTCPListenerOutcomeCallable SlbClient::createLoadBal
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetRuleOutcome SlbClient::setRule(const SetRuleRequest &request) const SlbClient::SetRuleOutcome SlbClient::setRule(const SetRuleRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetRuleOutcome(endpointOutcome.error()); return SetRuleOutcome(endpointOutcome.error());
@@ -1786,10 +1778,10 @@ SlbClient::SetRuleOutcomeCallable SlbClient::setRuleCallable(const SetRuleReques
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeMasterSlaveServerGroupsOutcome SlbClient::describeMasterSlaveServerGroups(const DescribeMasterSlaveServerGroupsRequest &request) const SlbClient::DescribeMasterSlaveServerGroupsOutcome SlbClient::describeMasterSlaveServerGroups(const DescribeMasterSlaveServerGroupsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeMasterSlaveServerGroupsOutcome(endpointOutcome.error()); return DescribeMasterSlaveServerGroupsOutcome(endpointOutcome.error());
@@ -1822,10 +1814,10 @@ SlbClient::DescribeMasterSlaveServerGroupsOutcomeCallable SlbClient::describeMas
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeHealthStatusOutcome SlbClient::describeHealthStatus(const DescribeHealthStatusRequest &request) const SlbClient::DescribeHealthStatusOutcome SlbClient::describeHealthStatus(const DescribeHealthStatusRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeHealthStatusOutcome(endpointOutcome.error()); return DescribeHealthStatusOutcome(endpointOutcome.error());
@@ -1858,10 +1850,10 @@ SlbClient::DescribeHealthStatusOutcomeCallable SlbClient::describeHealthStatusCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeRegionsOutcome SlbClient::describeRegions(const DescribeRegionsRequest &request) const SlbClient::DescribeRegionsOutcome SlbClient::describeRegions(const DescribeRegionsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeRegionsOutcome(endpointOutcome.error()); return DescribeRegionsOutcome(endpointOutcome.error());
@@ -1894,10 +1886,10 @@ SlbClient::DescribeRegionsOutcomeCallable SlbClient::describeRegionsCallable(con
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::RemoveListenerWhiteListItemOutcome SlbClient::removeListenerWhiteListItem(const RemoveListenerWhiteListItemRequest &request) const SlbClient::RemoveListenerWhiteListItemOutcome SlbClient::removeListenerWhiteListItem(const RemoveListenerWhiteListItemRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return RemoveListenerWhiteListItemOutcome(endpointOutcome.error()); return RemoveListenerWhiteListItemOutcome(endpointOutcome.error());
@@ -1930,10 +1922,10 @@ SlbClient::RemoveListenerWhiteListItemOutcomeCallable SlbClient::removeListenerW
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateLoadBalancerHTTPSListenerOutcome SlbClient::createLoadBalancerHTTPSListener(const CreateLoadBalancerHTTPSListenerRequest &request) const SlbClient::CreateLoadBalancerHTTPSListenerOutcome SlbClient::createLoadBalancerHTTPSListener(const CreateLoadBalancerHTTPSListenerRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateLoadBalancerHTTPSListenerOutcome(endpointOutcome.error()); return CreateLoadBalancerHTTPSListenerOutcome(endpointOutcome.error());
@@ -1966,10 +1958,10 @@ SlbClient::CreateLoadBalancerHTTPSListenerOutcomeCallable SlbClient::createLoadB
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteMasterSlaveServerGroupOutcome SlbClient::deleteMasterSlaveServerGroup(const DeleteMasterSlaveServerGroupRequest &request) const SlbClient::DeleteMasterSlaveServerGroupOutcome SlbClient::deleteMasterSlaveServerGroup(const DeleteMasterSlaveServerGroupRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteMasterSlaveServerGroupOutcome(endpointOutcome.error()); return DeleteMasterSlaveServerGroupOutcome(endpointOutcome.error());
@@ -2002,10 +1994,10 @@ SlbClient::DeleteMasterSlaveServerGroupOutcomeCallable SlbClient::deleteMasterSl
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeServerCertificatesOutcome SlbClient::describeServerCertificates(const DescribeServerCertificatesRequest &request) const SlbClient::DescribeServerCertificatesOutcome SlbClient::describeServerCertificates(const DescribeServerCertificatesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeServerCertificatesOutcome(endpointOutcome.error()); return DescribeServerCertificatesOutcome(endpointOutcome.error());
@@ -2038,10 +2030,10 @@ SlbClient::DescribeServerCertificatesOutcomeCallable SlbClient::describeServerCe
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeRulesOutcome SlbClient::describeRules(const DescribeRulesRequest &request) const SlbClient::DescribeRulesOutcome SlbClient::describeRules(const DescribeRulesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeRulesOutcome(endpointOutcome.error()); return DescribeRulesOutcome(endpointOutcome.error());
@@ -2074,10 +2066,10 @@ SlbClient::DescribeRulesOutcomeCallable SlbClient::describeRulesCallable(const D
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteAccessLogsDownloadAttributeOutcome SlbClient::deleteAccessLogsDownloadAttribute(const DeleteAccessLogsDownloadAttributeRequest &request) const SlbClient::DeleteAccessLogsDownloadAttributeOutcome SlbClient::deleteAccessLogsDownloadAttribute(const DeleteAccessLogsDownloadAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteAccessLogsDownloadAttributeOutcome(endpointOutcome.error()); return DeleteAccessLogsDownloadAttributeOutcome(endpointOutcome.error());
@@ -2110,10 +2102,10 @@ SlbClient::DeleteAccessLogsDownloadAttributeOutcomeCallable SlbClient::deleteAcc
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeRuleAttributeOutcome SlbClient::describeRuleAttribute(const DescribeRuleAttributeRequest &request) const SlbClient::DescribeRuleAttributeOutcome SlbClient::describeRuleAttribute(const DescribeRuleAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeRuleAttributeOutcome(endpointOutcome.error()); return DescribeRuleAttributeOutcome(endpointOutcome.error());
@@ -2146,10 +2138,10 @@ SlbClient::DescribeRuleAttributeOutcomeCallable SlbClient::describeRuleAttribute
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::UploadServerCertificateOutcome SlbClient::uploadServerCertificate(const UploadServerCertificateRequest &request) const SlbClient::UploadServerCertificateOutcome SlbClient::uploadServerCertificate(const UploadServerCertificateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return UploadServerCertificateOutcome(endpointOutcome.error()); return UploadServerCertificateOutcome(endpointOutcome.error());
@@ -2182,10 +2174,10 @@ SlbClient::UploadServerCertificateOutcomeCallable SlbClient::uploadServerCertifi
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetAccessLogsDownloadAttributeOutcome SlbClient::setAccessLogsDownloadAttribute(const SetAccessLogsDownloadAttributeRequest &request) const SlbClient::SetAccessLogsDownloadAttributeOutcome SlbClient::setAccessLogsDownloadAttribute(const SetAccessLogsDownloadAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetAccessLogsDownloadAttributeOutcome(endpointOutcome.error()); return SetAccessLogsDownloadAttributeOutcome(endpointOutcome.error());
@@ -2218,10 +2210,10 @@ SlbClient::SetAccessLogsDownloadAttributeOutcomeCallable SlbClient::setAccessLog
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerAutoReleaseTimeOutcome SlbClient::describeLoadBalancerAutoReleaseTime(const DescribeLoadBalancerAutoReleaseTimeRequest &request) const SlbClient::DescribeLoadBalancerAutoReleaseTimeOutcome SlbClient::describeLoadBalancerAutoReleaseTime(const DescribeLoadBalancerAutoReleaseTimeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerAutoReleaseTimeOutcome(endpointOutcome.error()); return DescribeLoadBalancerAutoReleaseTimeOutcome(endpointOutcome.error());
@@ -2254,10 +2246,10 @@ SlbClient::DescribeLoadBalancerAutoReleaseTimeOutcomeCallable SlbClient::describ
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DeleteServerCertificateOutcome SlbClient::deleteServerCertificate(const DeleteServerCertificateRequest &request) const SlbClient::DeleteServerCertificateOutcome SlbClient::deleteServerCertificate(const DeleteServerCertificateRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DeleteServerCertificateOutcome(endpointOutcome.error()); return DeleteServerCertificateOutcome(endpointOutcome.error());
@@ -2290,10 +2282,10 @@ SlbClient::DeleteServerCertificateOutcomeCallable SlbClient::deleteServerCertifi
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerNameOutcome SlbClient::setLoadBalancerName(const SetLoadBalancerNameRequest &request) const SlbClient::SetLoadBalancerNameOutcome SlbClient::setLoadBalancerName(const SetLoadBalancerNameRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerNameOutcome(endpointOutcome.error()); return SetLoadBalancerNameOutcome(endpointOutcome.error());
@@ -2326,10 +2318,10 @@ SlbClient::SetLoadBalancerNameOutcomeCallable SlbClient::setLoadBalancerNameCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetVServerGroupAttributeOutcome SlbClient::setVServerGroupAttribute(const SetVServerGroupAttributeRequest &request) const SlbClient::SetVServerGroupAttributeOutcome SlbClient::setVServerGroupAttribute(const SetVServerGroupAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetVServerGroupAttributeOutcome(endpointOutcome.error()); return SetVServerGroupAttributeOutcome(endpointOutcome.error());
@@ -2362,10 +2354,10 @@ SlbClient::SetVServerGroupAttributeOutcomeCallable SlbClient::setVServerGroupAtt
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::ModifyLoadBalancerInternetSpecOutcome SlbClient::modifyLoadBalancerInternetSpec(const ModifyLoadBalancerInternetSpecRequest &request) const SlbClient::ModifyLoadBalancerInternetSpecOutcome SlbClient::modifyLoadBalancerInternetSpec(const ModifyLoadBalancerInternetSpecRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyLoadBalancerInternetSpecOutcome(endpointOutcome.error()); return ModifyLoadBalancerInternetSpecOutcome(endpointOutcome.error());
@@ -2398,10 +2390,10 @@ SlbClient::ModifyLoadBalancerInternetSpecOutcomeCallable SlbClient::modifyLoadBa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeLoadBalancerHTTPSListenerAttributeOutcome SlbClient::describeLoadBalancerHTTPSListenerAttribute(const DescribeLoadBalancerHTTPSListenerAttributeRequest &request) const SlbClient::DescribeLoadBalancerHTTPSListenerAttributeOutcome SlbClient::describeLoadBalancerHTTPSListenerAttribute(const DescribeLoadBalancerHTTPSListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeLoadBalancerHTTPSListenerAttributeOutcome(endpointOutcome.error()); return DescribeLoadBalancerHTTPSListenerAttributeOutcome(endpointOutcome.error());
@@ -2434,10 +2426,10 @@ SlbClient::DescribeLoadBalancerHTTPSListenerAttributeOutcomeCallable SlbClient::
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::DescribeMasterSlaveServerGroupAttributeOutcome SlbClient::describeMasterSlaveServerGroupAttribute(const DescribeMasterSlaveServerGroupAttributeRequest &request) const SlbClient::DescribeMasterSlaveServerGroupAttributeOutcome SlbClient::describeMasterSlaveServerGroupAttribute(const DescribeMasterSlaveServerGroupAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return DescribeMasterSlaveServerGroupAttributeOutcome(endpointOutcome.error()); return DescribeMasterSlaveServerGroupAttributeOutcome(endpointOutcome.error());
@@ -2470,10 +2462,10 @@ SlbClient::DescribeMasterSlaveServerGroupAttributeOutcomeCallable SlbClient::des
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::AddTagsOutcome SlbClient::addTags(const AddTagsRequest &request) const SlbClient::AddTagsOutcome SlbClient::addTags(const AddTagsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddTagsOutcome(endpointOutcome.error()); return AddTagsOutcome(endpointOutcome.error());
@@ -2506,10 +2498,10 @@ SlbClient::AddTagsOutcomeCallable SlbClient::addTagsCallable(const AddTagsReques
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::ModifyLoadBalancerPayTypeOutcome SlbClient::modifyLoadBalancerPayType(const ModifyLoadBalancerPayTypeRequest &request) const SlbClient::ModifyLoadBalancerPayTypeOutcome SlbClient::modifyLoadBalancerPayType(const ModifyLoadBalancerPayTypeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ModifyLoadBalancerPayTypeOutcome(endpointOutcome.error()); return ModifyLoadBalancerPayTypeOutcome(endpointOutcome.error());
@@ -2542,10 +2534,10 @@ SlbClient::ModifyLoadBalancerPayTypeOutcomeCallable SlbClient::modifyLoadBalance
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::AddBackendServersOutcome SlbClient::addBackendServers(const AddBackendServersRequest &request) const SlbClient::AddBackendServersOutcome SlbClient::addBackendServers(const AddBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddBackendServersOutcome(endpointOutcome.error()); return AddBackendServersOutcome(endpointOutcome.error());
@@ -2578,10 +2570,10 @@ SlbClient::AddBackendServersOutcomeCallable SlbClient::addBackendServersCallable
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::CreateRulesOutcome SlbClient::createRules(const CreateRulesRequest &request) const SlbClient::CreateRulesOutcome SlbClient::createRules(const CreateRulesRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return CreateRulesOutcome(endpointOutcome.error()); return CreateRulesOutcome(endpointOutcome.error());
@@ -2614,10 +2606,10 @@ SlbClient::CreateRulesOutcomeCallable SlbClient::createRulesCallable(const Creat
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::AddVServerGroupBackendServersOutcome SlbClient::addVServerGroupBackendServers(const AddVServerGroupBackendServersRequest &request) const SlbClient::AddVServerGroupBackendServersOutcome SlbClient::addVServerGroupBackendServers(const AddVServerGroupBackendServersRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return AddVServerGroupBackendServersOutcome(endpointOutcome.error()); return AddVServerGroupBackendServersOutcome(endpointOutcome.error());
@@ -2650,10 +2642,10 @@ SlbClient::AddVServerGroupBackendServersOutcomeCallable SlbClient::addVServerGro
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
SlbClient::SetLoadBalancerUDPListenerAttributeOutcome SlbClient::setLoadBalancerUDPListenerAttribute(const SetLoadBalancerUDPListenerAttributeRequest &request) const SlbClient::SetLoadBalancerUDPListenerAttributeOutcome SlbClient::setLoadBalancerUDPListenerAttribute(const SetLoadBalancerUDPListenerAttributeRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return SetLoadBalancerUDPListenerAttributeOutcome(endpointOutcome.error()); return SetLoadBalancerUDPListenerAttributeOutcome(endpointOutcome.error());
@@ -2686,4 +2678,4 @@ SlbClient::SetLoadBalancerUDPListenerAttributeOutcomeCallable SlbClient::setLoad
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -78,7 +78,6 @@ namespace AlibabaCloud
HostGetsOutcomeCallable hostGetsCallable(const Model::HostGetsRequest& request) const; HostGetsOutcomeCallable hostGetsCallable(const Model::HostGetsRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::TeslaDam; using namespace AlibabaCloud::TeslaDam;
using namespace AlibabaCloud::TeslaDam::Model; using namespace AlibabaCloud::TeslaDam::Model;
namespace
{
const std::string SERVICE_NAME = "TeslaDam";
}
TeslaDamClient::TeslaDamClient(const Credentials &credentials, const ClientConfiguration &configuration) : TeslaDamClient::TeslaDamClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaDamClient::TeslaDamClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : TeslaDamClient::TeslaDamClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaDamClient::TeslaDamClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : TeslaDamClient::TeslaDamClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaDamClient::~TeslaDamClient() TeslaDamClient::~TeslaDamClient()
{} {}
CoreClient::EndpointOutcome TeslaDamClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
TeslaDamClient::ActionOutcome TeslaDamClient::action(const ActionRequest &request) const TeslaDamClient::ActionOutcome TeslaDamClient::action(const ActionRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ActionOutcome(endpointOutcome.error()); return ActionOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ TeslaDamClient::ActionOutcomeCallable TeslaDamClient::actionCallable(const Actio
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaDamClient::ActionDiskRmaOutcome TeslaDamClient::actionDiskRma(const ActionDiskRmaRequest &request) const TeslaDamClient::ActionDiskRmaOutcome TeslaDamClient::actionDiskRma(const ActionDiskRmaRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ActionDiskRmaOutcome(endpointOutcome.error()); return ActionDiskRmaOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ TeslaDamClient::ActionDiskRmaOutcomeCallable TeslaDamClient::actionDiskRmaCallab
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaDamClient::ActionDiskMaskOutcome TeslaDamClient::actionDiskMask(const ActionDiskMaskRequest &request) const TeslaDamClient::ActionDiskMaskOutcome TeslaDamClient::actionDiskMask(const ActionDiskMaskRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ActionDiskMaskOutcome(endpointOutcome.error()); return ActionDiskMaskOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ TeslaDamClient::ActionDiskMaskOutcomeCallable TeslaDamClient::actionDiskMaskCall
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaDamClient::ActionDiskCheckOutcome TeslaDamClient::actionDiskCheck(const ActionDiskCheckRequest &request) const TeslaDamClient::ActionDiskCheckOutcome TeslaDamClient::actionDiskCheck(const ActionDiskCheckRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return ActionDiskCheckOutcome(endpointOutcome.error()); return ActionDiskCheckOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ TeslaDamClient::ActionDiskCheckOutcomeCallable TeslaDamClient::actionDiskCheckCa
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaDamClient::HostGetsOutcome TeslaDamClient::hostGets(const HostGetsRequest &request) const TeslaDamClient::HostGetsOutcome TeslaDamClient::hostGets(const HostGetsRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return HostGetsOutcome(endpointOutcome.error()); return HostGetsOutcome(endpointOutcome.error());
@@ -238,4 +230,4 @@ TeslaDamClient::HostGetsOutcomeCallable TeslaDamClient::hostGetsCallable(const H
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -102,7 +102,6 @@ namespace AlibabaCloud
GetQuotaHistoryInfoOutcomeCallable getQuotaHistoryInfoCallable(const Model::GetQuotaHistoryInfoRequest& request) const; GetQuotaHistoryInfoOutcomeCallable getQuotaHistoryInfoCallable(const Model::GetQuotaHistoryInfoRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

View File

@@ -22,46 +22,38 @@ using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::TeslaMaxCompute; using namespace AlibabaCloud::TeslaMaxCompute;
using namespace AlibabaCloud::TeslaMaxCompute::Model; using namespace AlibabaCloud::TeslaMaxCompute::Model;
namespace
{
const std::string SERVICE_NAME = "TeslaMaxCompute";
}
TeslaMaxComputeClient::TeslaMaxComputeClient(const Credentials &credentials, const ClientConfiguration &configuration) : TeslaMaxComputeClient::TeslaMaxComputeClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentials, configuration); auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) : TeslaMaxComputeClient::TeslaMaxComputeClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(credentialsProvider, configuration) RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration); auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : TeslaMaxComputeClient::TeslaMaxComputeClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration) RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{ {
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration); auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), ""); endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
} }
TeslaMaxComputeClient::~TeslaMaxComputeClient() TeslaMaxComputeClient::~TeslaMaxComputeClient()
{} {}
CoreClient::EndpointOutcome TeslaMaxComputeClient::endpoint()const
{
if(!configuration().endpoint().empty())
return CoreClient::EndpointOutcome(configuration().endpoint());
auto endpoint = endpointProvider_->getEndpoint();
if (endpoint.empty())
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
else
return CoreClient::EndpointOutcome(endpoint);
}
TeslaMaxComputeClient::GetUserInstanceOutcome TeslaMaxComputeClient::getUserInstance(const GetUserInstanceRequest &request) const TeslaMaxComputeClient::GetUserInstanceOutcome TeslaMaxComputeClient::getUserInstance(const GetUserInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetUserInstanceOutcome(endpointOutcome.error()); return GetUserInstanceOutcome(endpointOutcome.error());
@@ -94,10 +86,10 @@ TeslaMaxComputeClient::GetUserInstanceOutcomeCallable TeslaMaxComputeClient::get
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::GetProjectInstanceOutcome TeslaMaxComputeClient::getProjectInstance(const GetProjectInstanceRequest &request) const TeslaMaxComputeClient::GetProjectInstanceOutcome TeslaMaxComputeClient::getProjectInstance(const GetProjectInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetProjectInstanceOutcome(endpointOutcome.error()); return GetProjectInstanceOutcome(endpointOutcome.error());
@@ -130,10 +122,10 @@ TeslaMaxComputeClient::GetProjectInstanceOutcomeCallable TeslaMaxComputeClient::
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::QueryResourceInventoryOutcome TeslaMaxComputeClient::queryResourceInventory(const QueryResourceInventoryRequest &request) const TeslaMaxComputeClient::QueryResourceInventoryOutcome TeslaMaxComputeClient::queryResourceInventory(const QueryResourceInventoryRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryResourceInventoryOutcome(endpointOutcome.error()); return QueryResourceInventoryOutcome(endpointOutcome.error());
@@ -166,10 +158,10 @@ TeslaMaxComputeClient::QueryResourceInventoryOutcomeCallable TeslaMaxComputeClie
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::QueryTopologyOutcome TeslaMaxComputeClient::queryTopology(const QueryTopologyRequest &request) const TeslaMaxComputeClient::QueryTopologyOutcome TeslaMaxComputeClient::queryTopology(const QueryTopologyRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return QueryTopologyOutcome(endpointOutcome.error()); return QueryTopologyOutcome(endpointOutcome.error());
@@ -202,10 +194,10 @@ TeslaMaxComputeClient::QueryTopologyOutcomeCallable TeslaMaxComputeClient::query
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::GetInstancesStatusCountOutcome TeslaMaxComputeClient::getInstancesStatusCount(const GetInstancesStatusCountRequest &request) const TeslaMaxComputeClient::GetInstancesStatusCountOutcome TeslaMaxComputeClient::getInstancesStatusCount(const GetInstancesStatusCountRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetInstancesStatusCountOutcome(endpointOutcome.error()); return GetInstancesStatusCountOutcome(endpointOutcome.error());
@@ -238,10 +230,10 @@ TeslaMaxComputeClient::GetInstancesStatusCountOutcomeCallable TeslaMaxComputeCli
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::GetQuotaInstanceOutcome TeslaMaxComputeClient::getQuotaInstance(const GetQuotaInstanceRequest &request) const TeslaMaxComputeClient::GetQuotaInstanceOutcome TeslaMaxComputeClient::getQuotaInstance(const GetQuotaInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetQuotaInstanceOutcome(endpointOutcome.error()); return GetQuotaInstanceOutcome(endpointOutcome.error());
@@ -274,10 +266,10 @@ TeslaMaxComputeClient::GetQuotaInstanceOutcomeCallable TeslaMaxComputeClient::ge
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::GetClusterInstanceOutcome TeslaMaxComputeClient::getClusterInstance(const GetClusterInstanceRequest &request) const TeslaMaxComputeClient::GetClusterInstanceOutcome TeslaMaxComputeClient::getClusterInstance(const GetClusterInstanceRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetClusterInstanceOutcome(endpointOutcome.error()); return GetClusterInstanceOutcome(endpointOutcome.error());
@@ -310,10 +302,10 @@ TeslaMaxComputeClient::GetClusterInstanceOutcomeCallable TeslaMaxComputeClient::
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }
TeslaMaxComputeClient::GetQuotaHistoryInfoOutcome TeslaMaxComputeClient::getQuotaHistoryInfo(const GetQuotaHistoryInfoRequest &request) const TeslaMaxComputeClient::GetQuotaHistoryInfoOutcome TeslaMaxComputeClient::getQuotaHistoryInfo(const GetQuotaHistoryInfoRequest &request) const
{ {
auto endpointOutcome = endpoint(); auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess()) if (!endpointOutcome.isSuccess())
return GetQuotaHistoryInfoOutcome(endpointOutcome.error()); return GetQuotaHistoryInfoOutcome(endpointOutcome.error());
@@ -346,4 +338,4 @@ TeslaMaxComputeClient::GetQuotaHistoryInfoOutcomeCallable TeslaMaxComputeClient:
asyncExecute(new Runnable([task]() { (*task)(); })); asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future(); return task->get_future();
} }

View File

@@ -1150,7 +1150,6 @@ namespace AlibabaCloud
DescribeSnatTableEntriesOutcomeCallable describeSnatTableEntriesCallable(const Model::DescribeSnatTableEntriesRequest& request) const; DescribeSnatTableEntriesOutcomeCallable describeSnatTableEntriesCallable(const Model::DescribeSnatTableEntriesRequest& request) const;
private: private:
virtual EndpointOutcome endpoint()const override;
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;
}; };
} }

File diff suppressed because it is too large Load Diff