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

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