text:
// This file is auto-generated, don't edit it. Thanks.

#include <alibabacloud/ess_20140828.hpp>
#include <alibabacloud/endpoint_util.hpp>
#include <alibabacloud/open_api.hpp>
#include <alibabacloud/open_api_util.hpp>
#include <boost/any.hpp>
#include <boost/throw_exception.hpp>
#include <darabonba/core.hpp>
#include <darabonba/util.hpp>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

using namespace Alibabacloud_Ess20140828;

Alibabacloud_Ess20140828::Client::Client(const shared_ptr<Alibabacloud_OpenApi::Config>& config) : Alibabacloud_OpenApi::Client(config) {
  _endpointRule = make_shared<string>("regional");
  _endpointMap = make_shared<map<string, string>>(map<string, string>({
    {"cn-qingdao", "ess.aliyuncs.com"},
    {"cn-beijing", "ess.aliyuncs.com"},
    {"cn-hangzhou", "ess.aliyuncs.com"},
    {"cn-shanghai", "ess.aliyuncs.com"},
    {"cn-shenzhen", "ess.aliyuncs.com"},
    {"cn-hongkong", "ess.aliyuncs.com"},
    {"ap-southeast-1", "ess.aliyuncs.com"},
    {"us-west-1", "ess.aliyuncs.com"},
    {"us-east-1", "ess.aliyuncs.com"},
    {"cn-shanghai-finance-1", "ess.aliyuncs.com"},
    {"cn-shenzhen-finance-1", "ess.aliyuncs.com"},
    {"cn-north-2-gov-1", "ess.aliyuncs.com"},
    {"ap-northeast-2-pop", "ess.ap-northeast-1.aliyuncs.com"},
    {"cn-beijing-finance-1", "ess.aliyuncs.com"},
    {"cn-beijing-finance-pop", "ess.aliyuncs.com"},
    {"cn-beijing-gov-1", "ess.aliyuncs.com"},
    {"cn-beijing-nu16-b01", "ess.aliyuncs.com"},
    {"cn-edge-1", "ess.aliyuncs.com"},
    {"cn-fujian", "ess.aliyuncs.com"},
    {"cn-haidian-cm12-c01", "ess.aliyuncs.com"},
    {"cn-hangzhou-bj-b01", "ess.aliyuncs.com"},
    {"cn-hangzhou-finance", "ess.aliyuncs.com"},
    {"cn-hangzhou-internal-prod-1", "ess.aliyuncs.com"},
    {"cn-hangzhou-internal-test-1", "ess.aliyuncs.com"},
    {"cn-hangzhou-internal-test-2", "ess.aliyuncs.com"},
    {"cn-hangzhou-internal-test-3", "ess.aliyuncs.com"},
    {"cn-hangzhou-test-306", "ess.aliyuncs.com"},
    {"cn-hongkong-finance-pop", "ess.aliyuncs.com"},
    {"cn-qingdao-nebula", "ess.aliyuncs.com"},
    {"cn-shanghai-et15-b01", "ess.aliyuncs.com"},
    {"cn-shanghai-et2-b01", "ess.aliyuncs.com"},
    {"cn-shanghai-inner", "ess.aliyuncs.com"},
    {"cn-shanghai-internal-test-1", "ess.aliyuncs.com"},
    {"cn-shenzhen-inner", "ess.aliyuncs.com"},
    {"cn-shenzhen-st4-d01", "ess.aliyuncs.com"},
    {"cn-shenzhen-su18-b01", "ess.aliyuncs.com"},
    {"cn-wuhan", "ess.aliyuncs.com"},
    {"cn-yushanfang", "ess.aliyuncs.com"},
    {"cn-zhangbei-na61-b01", "ess.aliyuncs.com"},
    {"cn-zhangjiakou-na62-a01", "ess.aliyuncs.com"},
    {"cn-zhengzhou-nebula-1", "ess.aliyuncs.com"},
    {"eu-west-1-oxs", "ess.ap-northeast-1.aliyuncs.com"},
    {"rus-west-1-pop", "ess.ap-northeast-1.aliyuncs.com"}
  })
);
  checkConfig(config);
  _endpoint = make_shared<string>(getEndpoint(make_shared<string>("ess"), _regionId, _endpointRule, _network, _suffix, _endpointMap, _endpoint));
};

string Alibabacloud_Ess20140828::Client::getEndpoint(shared_ptr<string> productId,
                                                     shared_ptr<string> regionId,
                                                     shared_ptr<string> endpointRule,
                                                     shared_ptr<string> network,
                                                     shared_ptr<string> suffix,
                                                     shared_ptr<map<string, string>> endpointMap,
                                                     shared_ptr<string> endpoint) {
  if (!Darabonba_Util::Client::empty(endpoint)) {
    return *endpoint;
  }
  if (!Darabonba_Util::Client::isUnset<map<string, string>>(endpointMap) && !Darabonba_Util::Client::empty(make_shared<string>((*endpointMap)[regionId]))) {
    return (*endpointMap)[regionId];
  }
  return Alibabacloud_EndpointUtil::Client::getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

AttachAlbServerGroupsResponse Alibabacloud_Ess20140828::Client::attachAlbServerGroupsWithOptions(shared_ptr<AttachAlbServerGroupsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return AttachAlbServerGroupsResponse(doRPCRequest(make_shared<string>("AttachAlbServerGroups"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

AttachAlbServerGroupsResponse Alibabacloud_Ess20140828::Client::attachAlbServerGroups(shared_ptr<AttachAlbServerGroupsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return attachAlbServerGroupsWithOptions(request, runtime);
}

AttachDBInstancesResponse Alibabacloud_Ess20140828::Client::attachDBInstancesWithOptions(shared_ptr<AttachDBInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return AttachDBInstancesResponse(doRPCRequest(make_shared<string>("AttachDBInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

AttachDBInstancesResponse Alibabacloud_Ess20140828::Client::attachDBInstances(shared_ptr<AttachDBInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return attachDBInstancesWithOptions(request, runtime);
}

AttachInstancesResponse Alibabacloud_Ess20140828::Client::attachInstancesWithOptions(shared_ptr<AttachInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return AttachInstancesResponse(doRPCRequest(make_shared<string>("AttachInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

AttachInstancesResponse Alibabacloud_Ess20140828::Client::attachInstances(shared_ptr<AttachInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return attachInstancesWithOptions(request, runtime);
}

AttachLoadBalancersResponse Alibabacloud_Ess20140828::Client::attachLoadBalancersWithOptions(shared_ptr<AttachLoadBalancersRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return AttachLoadBalancersResponse(doRPCRequest(make_shared<string>("AttachLoadBalancers"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

AttachLoadBalancersResponse Alibabacloud_Ess20140828::Client::attachLoadBalancers(shared_ptr<AttachLoadBalancersRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return attachLoadBalancersWithOptions(request, runtime);
}

AttachVServerGroupsResponse Alibabacloud_Ess20140828::Client::attachVServerGroupsWithOptions(shared_ptr<AttachVServerGroupsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return AttachVServerGroupsResponse(doRPCRequest(make_shared<string>("AttachVServerGroups"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

AttachVServerGroupsResponse Alibabacloud_Ess20140828::Client::attachVServerGroups(shared_ptr<AttachVServerGroupsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return attachVServerGroupsWithOptions(request, runtime);
}

CompleteLifecycleActionResponse Alibabacloud_Ess20140828::Client::completeLifecycleActionWithOptions(shared_ptr<CompleteLifecycleActionRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CompleteLifecycleActionResponse(doRPCRequest(make_shared<string>("CompleteLifecycleAction"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CompleteLifecycleActionResponse Alibabacloud_Ess20140828::Client::completeLifecycleAction(shared_ptr<CompleteLifecycleActionRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return completeLifecycleActionWithOptions(request, runtime);
}

CreateAlarmResponse Alibabacloud_Ess20140828::Client::createAlarmWithOptions(shared_ptr<CreateAlarmRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateAlarmResponse(doRPCRequest(make_shared<string>("CreateAlarm"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateAlarmResponse Alibabacloud_Ess20140828::Client::createAlarm(shared_ptr<CreateAlarmRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createAlarmWithOptions(request, runtime);
}

CreateLifecycleHookResponse Alibabacloud_Ess20140828::Client::createLifecycleHookWithOptions(shared_ptr<CreateLifecycleHookRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateLifecycleHookResponse(doRPCRequest(make_shared<string>("CreateLifecycleHook"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateLifecycleHookResponse Alibabacloud_Ess20140828::Client::createLifecycleHook(shared_ptr<CreateLifecycleHookRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createLifecycleHookWithOptions(request, runtime);
}

CreateNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::createNotificationConfigurationWithOptions(shared_ptr<CreateNotificationConfigurationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateNotificationConfigurationResponse(doRPCRequest(make_shared<string>("CreateNotificationConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::createNotificationConfiguration(shared_ptr<CreateNotificationConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createNotificationConfigurationWithOptions(request, runtime);
}

CreateScalingConfigurationResponse Alibabacloud_Ess20140828::Client::createScalingConfigurationWithOptions(shared_ptr<CreateScalingConfigurationRequest> tmpReq, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(tmpReq);
  shared_ptr<CreateScalingConfigurationShrinkRequest> request = make_shared<CreateScalingConfigurationShrinkRequest>();
  Alibabacloud_OpenApiUtil::Client::convert(tmpReq, request);
  if (!Darabonba_Util::Client::isUnset<map<string, boost::any>>(tmpReq->schedulerOptions)) {
    request->schedulerOptionsShrink = make_shared<string>(Alibabacloud_OpenApiUtil::Client::arrayToStringWithSpecifiedStyle(tmpReq->schedulerOptions, make_shared<string>("SchedulerOptions"), make_shared<string>("json")));
  }
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateScalingConfigurationResponse(doRPCRequest(make_shared<string>("CreateScalingConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateScalingConfigurationResponse Alibabacloud_Ess20140828::Client::createScalingConfiguration(shared_ptr<CreateScalingConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createScalingConfigurationWithOptions(request, runtime);
}

CreateScalingGroupResponse Alibabacloud_Ess20140828::Client::createScalingGroupWithOptions(shared_ptr<CreateScalingGroupRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateScalingGroupResponse(doRPCRequest(make_shared<string>("CreateScalingGroup"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateScalingGroupResponse Alibabacloud_Ess20140828::Client::createScalingGroup(shared_ptr<CreateScalingGroupRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createScalingGroupWithOptions(request, runtime);
}

CreateScalingRuleResponse Alibabacloud_Ess20140828::Client::createScalingRuleWithOptions(shared_ptr<CreateScalingRuleRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateScalingRuleResponse(doRPCRequest(make_shared<string>("CreateScalingRule"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateScalingRuleResponse Alibabacloud_Ess20140828::Client::createScalingRule(shared_ptr<CreateScalingRuleRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createScalingRuleWithOptions(request, runtime);
}

CreateScheduledTaskResponse Alibabacloud_Ess20140828::Client::createScheduledTaskWithOptions(shared_ptr<CreateScheduledTaskRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return CreateScheduledTaskResponse(doRPCRequest(make_shared<string>("CreateScheduledTask"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

CreateScheduledTaskResponse Alibabacloud_Ess20140828::Client::createScheduledTask(shared_ptr<CreateScheduledTaskRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return createScheduledTaskWithOptions(request, runtime);
}

DeactivateScalingConfigurationResponse Alibabacloud_Ess20140828::Client::deactivateScalingConfigurationWithOptions(shared_ptr<DeactivateScalingConfigurationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeactivateScalingConfigurationResponse(doRPCRequest(make_shared<string>("DeactivateScalingConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeactivateScalingConfigurationResponse Alibabacloud_Ess20140828::Client::deactivateScalingConfiguration(shared_ptr<DeactivateScalingConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deactivateScalingConfigurationWithOptions(request, runtime);
}

DeleteAlarmResponse Alibabacloud_Ess20140828::Client::deleteAlarmWithOptions(shared_ptr<DeleteAlarmRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteAlarmResponse(doRPCRequest(make_shared<string>("DeleteAlarm"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteAlarmResponse Alibabacloud_Ess20140828::Client::deleteAlarm(shared_ptr<DeleteAlarmRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteAlarmWithOptions(request, runtime);
}

DeleteLifecycleHookResponse Alibabacloud_Ess20140828::Client::deleteLifecycleHookWithOptions(shared_ptr<DeleteLifecycleHookRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteLifecycleHookResponse(doRPCRequest(make_shared<string>("DeleteLifecycleHook"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteLifecycleHookResponse Alibabacloud_Ess20140828::Client::deleteLifecycleHook(shared_ptr<DeleteLifecycleHookRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteLifecycleHookWithOptions(request, runtime);
}

DeleteNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::deleteNotificationConfigurationWithOptions(shared_ptr<DeleteNotificationConfigurationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteNotificationConfigurationResponse(doRPCRequest(make_shared<string>("DeleteNotificationConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::deleteNotificationConfiguration(shared_ptr<DeleteNotificationConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteNotificationConfigurationWithOptions(request, runtime);
}

DeleteScalingConfigurationResponse Alibabacloud_Ess20140828::Client::deleteScalingConfigurationWithOptions(shared_ptr<DeleteScalingConfigurationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteScalingConfigurationResponse(doRPCRequest(make_shared<string>("DeleteScalingConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteScalingConfigurationResponse Alibabacloud_Ess20140828::Client::deleteScalingConfiguration(shared_ptr<DeleteScalingConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteScalingConfigurationWithOptions(request, runtime);
}

DeleteScalingGroupResponse Alibabacloud_Ess20140828::Client::deleteScalingGroupWithOptions(shared_ptr<DeleteScalingGroupRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteScalingGroupResponse(doRPCRequest(make_shared<string>("DeleteScalingGroup"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteScalingGroupResponse Alibabacloud_Ess20140828::Client::deleteScalingGroup(shared_ptr<DeleteScalingGroupRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteScalingGroupWithOptions(request, runtime);
}

DeleteScalingRuleResponse Alibabacloud_Ess20140828::Client::deleteScalingRuleWithOptions(shared_ptr<DeleteScalingRuleRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteScalingRuleResponse(doRPCRequest(make_shared<string>("DeleteScalingRule"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteScalingRuleResponse Alibabacloud_Ess20140828::Client::deleteScalingRule(shared_ptr<DeleteScalingRuleRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteScalingRuleWithOptions(request, runtime);
}

DeleteScheduledTaskResponse Alibabacloud_Ess20140828::Client::deleteScheduledTaskWithOptions(shared_ptr<DeleteScheduledTaskRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DeleteScheduledTaskResponse(doRPCRequest(make_shared<string>("DeleteScheduledTask"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DeleteScheduledTaskResponse Alibabacloud_Ess20140828::Client::deleteScheduledTask(shared_ptr<DeleteScheduledTaskRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return deleteScheduledTaskWithOptions(request, runtime);
}

DescribeAlarmsResponse Alibabacloud_Ess20140828::Client::describeAlarmsWithOptions(shared_ptr<DescribeAlarmsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeAlarmsResponse(doRPCRequest(make_shared<string>("DescribeAlarms"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeAlarmsResponse Alibabacloud_Ess20140828::Client::describeAlarms(shared_ptr<DescribeAlarmsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeAlarmsWithOptions(request, runtime);
}

DescribeLifecycleActionsResponse Alibabacloud_Ess20140828::Client::describeLifecycleActionsWithOptions(shared_ptr<DescribeLifecycleActionsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeLifecycleActionsResponse(doRPCRequest(make_shared<string>("DescribeLifecycleActions"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeLifecycleActionsResponse Alibabacloud_Ess20140828::Client::describeLifecycleActions(shared_ptr<DescribeLifecycleActionsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeLifecycleActionsWithOptions(request, runtime);
}

DescribeLifecycleHooksResponse Alibabacloud_Ess20140828::Client::describeLifecycleHooksWithOptions(shared_ptr<DescribeLifecycleHooksRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeLifecycleHooksResponse(doRPCRequest(make_shared<string>("DescribeLifecycleHooks"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeLifecycleHooksResponse Alibabacloud_Ess20140828::Client::describeLifecycleHooks(shared_ptr<DescribeLifecycleHooksRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeLifecycleHooksWithOptions(request, runtime);
}

DescribeLimitationResponse Alibabacloud_Ess20140828::Client::describeLimitationWithOptions(shared_ptr<DescribeLimitationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeLimitationResponse(doRPCRequest(make_shared<string>("DescribeLimitation"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeLimitationResponse Alibabacloud_Ess20140828::Client::describeLimitation(shared_ptr<DescribeLimitationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeLimitationWithOptions(request, runtime);
}

DescribeNotificationConfigurationsResponse Alibabacloud_Ess20140828::Client::describeNotificationConfigurationsWithOptions(shared_ptr<DescribeNotificationConfigurationsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeNotificationConfigurationsResponse(doRPCRequest(make_shared<string>("DescribeNotificationConfigurations"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeNotificationConfigurationsResponse Alibabacloud_Ess20140828::Client::describeNotificationConfigurations(shared_ptr<DescribeNotificationConfigurationsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeNotificationConfigurationsWithOptions(request, runtime);
}

DescribeNotificationTypesResponse Alibabacloud_Ess20140828::Client::describeNotificationTypesWithOptions(shared_ptr<DescribeNotificationTypesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeNotificationTypesResponse(doRPCRequest(make_shared<string>("DescribeNotificationTypes"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeNotificationTypesResponse Alibabacloud_Ess20140828::Client::describeNotificationTypes(shared_ptr<DescribeNotificationTypesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeNotificationTypesWithOptions(request, runtime);
}

DescribeRegionsResponse Alibabacloud_Ess20140828::Client::describeRegionsWithOptions(shared_ptr<DescribeRegionsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeRegionsResponse(doRPCRequest(make_shared<string>("DescribeRegions"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeRegionsResponse Alibabacloud_Ess20140828::Client::describeRegions(shared_ptr<DescribeRegionsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeRegionsWithOptions(request, runtime);
}

DescribeScalingActivitiesResponse Alibabacloud_Ess20140828::Client::describeScalingActivitiesWithOptions(shared_ptr<DescribeScalingActivitiesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScalingActivitiesResponse(doRPCRequest(make_shared<string>("DescribeScalingActivities"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScalingActivitiesResponse Alibabacloud_Ess20140828::Client::describeScalingActivities(shared_ptr<DescribeScalingActivitiesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScalingActivitiesWithOptions(request, runtime);
}

DescribeScalingActivityDetailResponse Alibabacloud_Ess20140828::Client::describeScalingActivityDetailWithOptions(shared_ptr<DescribeScalingActivityDetailRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScalingActivityDetailResponse(doRPCRequest(make_shared<string>("DescribeScalingActivityDetail"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScalingActivityDetailResponse Alibabacloud_Ess20140828::Client::describeScalingActivityDetail(shared_ptr<DescribeScalingActivityDetailRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScalingActivityDetailWithOptions(request, runtime);
}

DescribeScalingConfigurationsResponse Alibabacloud_Ess20140828::Client::describeScalingConfigurationsWithOptions(shared_ptr<DescribeScalingConfigurationsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScalingConfigurationsResponse(doRPCRequest(make_shared<string>("DescribeScalingConfigurations"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScalingConfigurationsResponse Alibabacloud_Ess20140828::Client::describeScalingConfigurations(shared_ptr<DescribeScalingConfigurationsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScalingConfigurationsWithOptions(request, runtime);
}

DescribeScalingInstancesResponse Alibabacloud_Ess20140828::Client::describeScalingInstancesWithOptions(shared_ptr<DescribeScalingInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScalingInstancesResponse(doRPCRequest(make_shared<string>("DescribeScalingInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScalingInstancesResponse Alibabacloud_Ess20140828::Client::describeScalingInstances(shared_ptr<DescribeScalingInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScalingInstancesWithOptions(request, runtime);
}

DescribeScalingRulesResponse Alibabacloud_Ess20140828::Client::describeScalingRulesWithOptions(shared_ptr<DescribeScalingRulesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScalingRulesResponse(doRPCRequest(make_shared<string>("DescribeScalingRules"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScalingRulesResponse Alibabacloud_Ess20140828::Client::describeScalingRules(shared_ptr<DescribeScalingRulesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScalingRulesWithOptions(request, runtime);
}

DescribeScheduledTasksResponse Alibabacloud_Ess20140828::Client::describeScheduledTasksWithOptions(shared_ptr<DescribeScheduledTasksRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DescribeScheduledTasksResponse(doRPCRequest(make_shared<string>("DescribeScheduledTasks"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DescribeScheduledTasksResponse Alibabacloud_Ess20140828::Client::describeScheduledTasks(shared_ptr<DescribeScheduledTasksRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return describeScheduledTasksWithOptions(request, runtime);
}

DetachAlbServerGroupsResponse Alibabacloud_Ess20140828::Client::detachAlbServerGroupsWithOptions(shared_ptr<DetachAlbServerGroupsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DetachAlbServerGroupsResponse(doRPCRequest(make_shared<string>("DetachAlbServerGroups"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DetachAlbServerGroupsResponse Alibabacloud_Ess20140828::Client::detachAlbServerGroups(shared_ptr<DetachAlbServerGroupsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return detachAlbServerGroupsWithOptions(request, runtime);
}

DetachDBInstancesResponse Alibabacloud_Ess20140828::Client::detachDBInstancesWithOptions(shared_ptr<DetachDBInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DetachDBInstancesResponse(doRPCRequest(make_shared<string>("DetachDBInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DetachDBInstancesResponse Alibabacloud_Ess20140828::Client::detachDBInstances(shared_ptr<DetachDBInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return detachDBInstancesWithOptions(request, runtime);
}

DetachInstancesResponse Alibabacloud_Ess20140828::Client::detachInstancesWithOptions(shared_ptr<DetachInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DetachInstancesResponse(doRPCRequest(make_shared<string>("DetachInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DetachInstancesResponse Alibabacloud_Ess20140828::Client::detachInstances(shared_ptr<DetachInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return detachInstancesWithOptions(request, runtime);
}

DetachLoadBalancersResponse Alibabacloud_Ess20140828::Client::detachLoadBalancersWithOptions(shared_ptr<DetachLoadBalancersRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DetachLoadBalancersResponse(doRPCRequest(make_shared<string>("DetachLoadBalancers"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DetachLoadBalancersResponse Alibabacloud_Ess20140828::Client::detachLoadBalancers(shared_ptr<DetachLoadBalancersRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return detachLoadBalancersWithOptions(request, runtime);
}

DetachVServerGroupsResponse Alibabacloud_Ess20140828::Client::detachVServerGroupsWithOptions(shared_ptr<DetachVServerGroupsRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DetachVServerGroupsResponse(doRPCRequest(make_shared<string>("DetachVServerGroups"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DetachVServerGroupsResponse Alibabacloud_Ess20140828::Client::detachVServerGroups(shared_ptr<DetachVServerGroupsRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return detachVServerGroupsWithOptions(request, runtime);
}

DisableAlarmResponse Alibabacloud_Ess20140828::Client::disableAlarmWithOptions(shared_ptr<DisableAlarmRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DisableAlarmResponse(doRPCRequest(make_shared<string>("DisableAlarm"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DisableAlarmResponse Alibabacloud_Ess20140828::Client::disableAlarm(shared_ptr<DisableAlarmRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return disableAlarmWithOptions(request, runtime);
}

DisableScalingGroupResponse Alibabacloud_Ess20140828::Client::disableScalingGroupWithOptions(shared_ptr<DisableScalingGroupRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return DisableScalingGroupResponse(doRPCRequest(make_shared<string>("DisableScalingGroup"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

DisableScalingGroupResponse Alibabacloud_Ess20140828::Client::disableScalingGroup(shared_ptr<DisableScalingGroupRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return disableScalingGroupWithOptions(request, runtime);
}

EnableAlarmResponse Alibabacloud_Ess20140828::Client::enableAlarmWithOptions(shared_ptr<EnableAlarmRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return EnableAlarmResponse(doRPCRequest(make_shared<string>("EnableAlarm"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

EnableAlarmResponse Alibabacloud_Ess20140828::Client::enableAlarm(shared_ptr<EnableAlarmRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return enableAlarmWithOptions(request, runtime);
}

EnableScalingGroupResponse Alibabacloud_Ess20140828::Client::enableScalingGroupWithOptions(shared_ptr<EnableScalingGroupRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return EnableScalingGroupResponse(doRPCRequest(make_shared<string>("EnableScalingGroup"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

EnableScalingGroupResponse Alibabacloud_Ess20140828::Client::enableScalingGroup(shared_ptr<EnableScalingGroupRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return enableScalingGroupWithOptions(request, runtime);
}

EnterStandbyResponse Alibabacloud_Ess20140828::Client::enterStandbyWithOptions(shared_ptr<EnterStandbyRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return EnterStandbyResponse(doRPCRequest(make_shared<string>("EnterStandby"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

EnterStandbyResponse Alibabacloud_Ess20140828::Client::enterStandby(shared_ptr<EnterStandbyRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return enterStandbyWithOptions(request, runtime);
}

ExecuteScalingRuleResponse Alibabacloud_Ess20140828::Client::executeScalingRuleWithOptions(shared_ptr<ExecuteScalingRuleRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ExecuteScalingRuleResponse(doRPCRequest(make_shared<string>("ExecuteScalingRule"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ExecuteScalingRuleResponse Alibabacloud_Ess20140828::Client::executeScalingRule(shared_ptr<ExecuteScalingRuleRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return executeScalingRuleWithOptions(request, runtime);
}

ExitStandbyResponse Alibabacloud_Ess20140828::Client::exitStandbyWithOptions(shared_ptr<ExitStandbyRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ExitStandbyResponse(doRPCRequest(make_shared<string>("ExitStandby"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ExitStandbyResponse Alibabacloud_Ess20140828::Client::exitStandby(shared_ptr<ExitStandbyRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return exitStandbyWithOptions(request, runtime);
}

ListTagKeysResponse Alibabacloud_Ess20140828::Client::listTagKeysWithOptions(shared_ptr<ListTagKeysRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ListTagKeysResponse(doRPCRequest(make_shared<string>("ListTagKeys"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ListTagKeysResponse Alibabacloud_Ess20140828::Client::listTagKeys(shared_ptr<ListTagKeysRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return listTagKeysWithOptions(request, runtime);
}

ListTagResourcesResponse Alibabacloud_Ess20140828::Client::listTagResourcesWithOptions(shared_ptr<ListTagResourcesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ListTagResourcesResponse(doRPCRequest(make_shared<string>("ListTagResources"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ListTagResourcesResponse Alibabacloud_Ess20140828::Client::listTagResources(shared_ptr<ListTagResourcesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return listTagResourcesWithOptions(request, runtime);
}

ListTagValuesResponse Alibabacloud_Ess20140828::Client::listTagValuesWithOptions(shared_ptr<ListTagValuesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ListTagValuesResponse(doRPCRequest(make_shared<string>("ListTagValues"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ListTagValuesResponse Alibabacloud_Ess20140828::Client::listTagValues(shared_ptr<ListTagValuesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return listTagValuesWithOptions(request, runtime);
}

ModifyAlarmResponse Alibabacloud_Ess20140828::Client::modifyAlarmWithOptions(shared_ptr<ModifyAlarmRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyAlarmResponse(doRPCRequest(make_shared<string>("ModifyAlarm"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyAlarmResponse Alibabacloud_Ess20140828::Client::modifyAlarm(shared_ptr<ModifyAlarmRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyAlarmWithOptions(request, runtime);
}

ModifyLifecycleHookResponse Alibabacloud_Ess20140828::Client::modifyLifecycleHookWithOptions(shared_ptr<ModifyLifecycleHookRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyLifecycleHookResponse(doRPCRequest(make_shared<string>("ModifyLifecycleHook"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyLifecycleHookResponse Alibabacloud_Ess20140828::Client::modifyLifecycleHook(shared_ptr<ModifyLifecycleHookRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyLifecycleHookWithOptions(request, runtime);
}

ModifyNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::modifyNotificationConfigurationWithOptions(shared_ptr<ModifyNotificationConfigurationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyNotificationConfigurationResponse(doRPCRequest(make_shared<string>("ModifyNotificationConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyNotificationConfigurationResponse Alibabacloud_Ess20140828::Client::modifyNotificationConfiguration(shared_ptr<ModifyNotificationConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyNotificationConfigurationWithOptions(request, runtime);
}

ModifyScalingConfigurationResponse Alibabacloud_Ess20140828::Client::modifyScalingConfigurationWithOptions(shared_ptr<ModifyScalingConfigurationRequest> tmpReq, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(tmpReq);
  shared_ptr<ModifyScalingConfigurationShrinkRequest> request = make_shared<ModifyScalingConfigurationShrinkRequest>();
  Alibabacloud_OpenApiUtil::Client::convert(tmpReq, request);
  if (!Darabonba_Util::Client::isUnset<map<string, boost::any>>(tmpReq->schedulerOptions)) {
    request->schedulerOptionsShrink = make_shared<string>(Alibabacloud_OpenApiUtil::Client::arrayToStringWithSpecifiedStyle(tmpReq->schedulerOptions, make_shared<string>("SchedulerOptions"), make_shared<string>("json")));
  }
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyScalingConfigurationResponse(doRPCRequest(make_shared<string>("ModifyScalingConfiguration"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyScalingConfigurationResponse Alibabacloud_Ess20140828::Client::modifyScalingConfiguration(shared_ptr<ModifyScalingConfigurationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyScalingConfigurationWithOptions(request, runtime);
}

ModifyScalingGroupResponse Alibabacloud_Ess20140828::Client::modifyScalingGroupWithOptions(shared_ptr<ModifyScalingGroupRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyScalingGroupResponse(doRPCRequest(make_shared<string>("ModifyScalingGroup"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyScalingGroupResponse Alibabacloud_Ess20140828::Client::modifyScalingGroup(shared_ptr<ModifyScalingGroupRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyScalingGroupWithOptions(request, runtime);
}

ModifyScalingRuleResponse Alibabacloud_Ess20140828::Client::modifyScalingRuleWithOptions(shared_ptr<ModifyScalingRuleRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyScalingRuleResponse(doRPCRequest(make_shared<string>("ModifyScalingRule"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyScalingRuleResponse Alibabacloud_Ess20140828::Client::modifyScalingRule(shared_ptr<ModifyScalingRuleRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyScalingRuleWithOptions(request, runtime);
}

ModifyScheduledTaskResponse Alibabacloud_Ess20140828::Client::modifyScheduledTaskWithOptions(shared_ptr<ModifyScheduledTaskRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ModifyScheduledTaskResponse(doRPCRequest(make_shared<string>("ModifyScheduledTask"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ModifyScheduledTaskResponse Alibabacloud_Ess20140828::Client::modifyScheduledTask(shared_ptr<ModifyScheduledTaskRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return modifyScheduledTaskWithOptions(request, runtime);
}

RebalanceInstancesResponse Alibabacloud_Ess20140828::Client::rebalanceInstancesWithOptions(shared_ptr<RebalanceInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return RebalanceInstancesResponse(doRPCRequest(make_shared<string>("RebalanceInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

RebalanceInstancesResponse Alibabacloud_Ess20140828::Client::rebalanceInstances(shared_ptr<RebalanceInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return rebalanceInstancesWithOptions(request, runtime);
}

RecordLifecycleActionHeartbeatResponse Alibabacloud_Ess20140828::Client::recordLifecycleActionHeartbeatWithOptions(shared_ptr<RecordLifecycleActionHeartbeatRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return RecordLifecycleActionHeartbeatResponse(doRPCRequest(make_shared<string>("RecordLifecycleActionHeartbeat"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

RecordLifecycleActionHeartbeatResponse Alibabacloud_Ess20140828::Client::recordLifecycleActionHeartbeat(shared_ptr<RecordLifecycleActionHeartbeatRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return recordLifecycleActionHeartbeatWithOptions(request, runtime);
}

RemoveInstancesResponse Alibabacloud_Ess20140828::Client::removeInstancesWithOptions(shared_ptr<RemoveInstancesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return RemoveInstancesResponse(doRPCRequest(make_shared<string>("RemoveInstances"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

RemoveInstancesResponse Alibabacloud_Ess20140828::Client::removeInstances(shared_ptr<RemoveInstancesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return removeInstancesWithOptions(request, runtime);
}

ResumeProcessesResponse Alibabacloud_Ess20140828::Client::resumeProcessesWithOptions(shared_ptr<ResumeProcessesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ResumeProcessesResponse(doRPCRequest(make_shared<string>("ResumeProcesses"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ResumeProcessesResponse Alibabacloud_Ess20140828::Client::resumeProcesses(shared_ptr<ResumeProcessesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return resumeProcessesWithOptions(request, runtime);
}

ScaleWithAdjustmentResponse Alibabacloud_Ess20140828::Client::scaleWithAdjustmentWithOptions(shared_ptr<ScaleWithAdjustmentRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return ScaleWithAdjustmentResponse(doRPCRequest(make_shared<string>("ScaleWithAdjustment"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

ScaleWithAdjustmentResponse Alibabacloud_Ess20140828::Client::scaleWithAdjustment(shared_ptr<ScaleWithAdjustmentRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return scaleWithAdjustmentWithOptions(request, runtime);
}

SetGroupDeletionProtectionResponse Alibabacloud_Ess20140828::Client::setGroupDeletionProtectionWithOptions(shared_ptr<SetGroupDeletionProtectionRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return SetGroupDeletionProtectionResponse(doRPCRequest(make_shared<string>("SetGroupDeletionProtection"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

SetGroupDeletionProtectionResponse Alibabacloud_Ess20140828::Client::setGroupDeletionProtection(shared_ptr<SetGroupDeletionProtectionRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return setGroupDeletionProtectionWithOptions(request, runtime);
}

SetInstanceHealthResponse Alibabacloud_Ess20140828::Client::setInstanceHealthWithOptions(shared_ptr<SetInstanceHealthRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return SetInstanceHealthResponse(doRPCRequest(make_shared<string>("SetInstanceHealth"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

SetInstanceHealthResponse Alibabacloud_Ess20140828::Client::setInstanceHealth(shared_ptr<SetInstanceHealthRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return setInstanceHealthWithOptions(request, runtime);
}

SetInstancesProtectionResponse Alibabacloud_Ess20140828::Client::setInstancesProtectionWithOptions(shared_ptr<SetInstancesProtectionRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return SetInstancesProtectionResponse(doRPCRequest(make_shared<string>("SetInstancesProtection"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

SetInstancesProtectionResponse Alibabacloud_Ess20140828::Client::setInstancesProtection(shared_ptr<SetInstancesProtectionRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return setInstancesProtectionWithOptions(request, runtime);
}

SuspendProcessesResponse Alibabacloud_Ess20140828::Client::suspendProcessesWithOptions(shared_ptr<SuspendProcessesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return SuspendProcessesResponse(doRPCRequest(make_shared<string>("SuspendProcesses"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

SuspendProcessesResponse Alibabacloud_Ess20140828::Client::suspendProcesses(shared_ptr<SuspendProcessesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return suspendProcessesWithOptions(request, runtime);
}

TagResourcesResponse Alibabacloud_Ess20140828::Client::tagResourcesWithOptions(shared_ptr<TagResourcesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return TagResourcesResponse(doRPCRequest(make_shared<string>("TagResources"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

TagResourcesResponse Alibabacloud_Ess20140828::Client::tagResources(shared_ptr<TagResourcesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return tagResourcesWithOptions(request, runtime);
}

UntagResourcesResponse Alibabacloud_Ess20140828::Client::untagResourcesWithOptions(shared_ptr<UntagResourcesRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return UntagResourcesResponse(doRPCRequest(make_shared<string>("UntagResources"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

UntagResourcesResponse Alibabacloud_Ess20140828::Client::untagResources(shared_ptr<UntagResourcesRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return untagResourcesWithOptions(request, runtime);
}

VerifyAuthenticationResponse Alibabacloud_Ess20140828::Client::verifyAuthenticationWithOptions(shared_ptr<VerifyAuthenticationRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return VerifyAuthenticationResponse(doRPCRequest(make_shared<string>("VerifyAuthentication"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("json"), req, runtime));
}

VerifyAuthenticationResponse Alibabacloud_Ess20140828::Client::verifyAuthentication(shared_ptr<VerifyAuthenticationRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return verifyAuthenticationWithOptions(request, runtime);
}

VerifyUserResponse Alibabacloud_Ess20140828::Client::verifyUserWithOptions(shared_ptr<VerifyUserRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime) {
  Darabonba_Util::Client::validateModel(request);
  shared_ptr<Alibabacloud_OpenApi::OpenApiRequest> req = make_shared<Alibabacloud_OpenApi::OpenApiRequest>(map<string, boost::any>({
    {"body", boost::any(Darabonba_Util::Client::toMap(request))}
  }));
  return VerifyUserResponse(doRPCRequest(make_shared<string>("VerifyUser"), make_shared<string>("2014-08-28"), make_shared<string>("HTTPS"), make_shared<string>("POST"), make_shared<string>("AK"), make_shared<string>("none"), req, runtime));
}

VerifyUserResponse Alibabacloud_Ess20140828::Client::verifyUser(shared_ptr<VerifyUserRequest> request) {
  shared_ptr<Darabonba_Util::RuntimeOptions> runtime = make_shared<Darabonba_Util::RuntimeOptions>();
  return verifyUserWithOptions(request, runtime);
}

max_stars_repo_name: aliyun/alibabacloud-cpp-sdk

max_issues_repo_name: aliyun/alibabacloud-cpp-sdk

max_forks_repo_name: aliyun/alibabacloud-cpp-sdk


text:
#pragma once

#include <nano/node/bootstrap/bootstrap_bulk_pull.hpp>
#include <nano/node/common.hpp>
#include <nano/node/socket.hpp>
#include <nano/secure/blockstore.hpp>
#include <nano/secure/ledger.hpp>

#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/thread/thread.hpp>

#include <atomic>
#include <future>
#include <queue>
#include <unordered_set>

namespace mi = boost::multi_index;

namespace nano
{
class bootstrap_attempt;
class bootstrap_client;
class node;
namespace transport
{
	class channel_tcp;
}
enum class sync_result
{
	success,
	error,
	fork
};
enum class bootstrap_mode
{
	legacy,
	lazy,
	wallet_lazy
};
class lazy_state_backlog_item final
{
public:
	nano::link link{ 0 };
	nano::uint128_t balance{ 0 };
	unsigned retry_limit{ 0 };
};
class lazy_destinations_item final
{
public:
	nano::account account{ 0 };
	uint64_t count{ 0 };
};
class frontier_req_client;
class bulk_push_client;
class bootstrap_attempt final : public std::enable_shared_from_this<bootstrap_attempt>
{
public:
	explicit bootstrap_attempt (std::shared_ptr<nano::node> node_a, nano::bootstrap_mode mode_a = nano::bootstrap_mode::legacy);
	~bootstrap_attempt ();
	void run ();
	std::shared_ptr<nano::bootstrap_client> connection (nano::unique_lock<std::mutex> &, bool = false);
	bool consume_future (std::future<bool> &);
	void populate_connections ();
	void start_populate_connections ();
	bool request_frontier (nano::unique_lock<std::mutex> &, bool = false);
	void request_pull (nano::unique_lock<std::mutex> &);
	void request_push (nano::unique_lock<std::mutex> &);
	void add_connection (nano::endpoint const &);
	void connect_client (nano::tcp_endpoint const &);
	void pool_connection (std::shared_ptr<nano::bootstrap_client>);
	void stop ();
	void requeue_pull (nano::pull_info const &, bool = false);
	void add_pull (nano::pull_info const &);
	bool still_pulling ();
	void run_start (nano::unique_lock<std::mutex> &);
	unsigned target_connections (size_t pulls_remaining);
	bool should_log ();
	void add_bulk_push_target (nano::block_hash const &, nano::block_hash const &);
	void attempt_restart_check (nano::unique_lock<std::mutex> &);
	bool confirm_frontiers (nano::unique_lock<std::mutex> &);
	bool process_block (std::shared_ptr<nano::block>, nano::account const &, uint64_t, nano::bulk_pull::count_t, bool, unsigned);
	/** Lazy bootstrap */
	void lazy_run ();
	void lazy_start (nano::hash_or_account const &, bool confirmed = true);
	void lazy_add (nano::hash_or_account const &, unsigned = std::numeric_limits<unsigned>::max ());
	void lazy_requeue (nano::block_hash const &, nano::block_hash const &, bool);
	bool lazy_finished ();
	bool lazy_has_expired () const;
	void lazy_pull_flush ();
	void lazy_clear ();
	bool process_block_lazy (std::shared_ptr<nano::block>, nano::account const &, uint64_t, nano::bulk_pull::count_t, unsigned);
	void lazy_block_state (std::shared_ptr<nano::block>, unsigned);
	void lazy_block_state_backlog_check (std::shared_ptr<nano::block>, nano::block_hash const &);
	void lazy_backlog_cleanup ();
	void lazy_destinations_increment (nano::account const &);
	void lazy_destinations_flush ();
	bool lazy_processed_or_exists (nano::block_hash const &);
	/** Lazy bootstrap */
	/** Wallet bootstrap */
	void request_pending (nano::unique_lock<std::mutex> &);
	void requeue_pending (nano::account const &);
	void wallet_run ();
	void wallet_start (std::deque<nano::account> &);
	bool wallet_finished ();
	/** Wallet bootstrap */
	std::mutex next_log_mutex;
	std::chrono::steady_clock::time_point next_log;
	std::deque<std::weak_ptr<nano::bootstrap_client>> clients;
	std::weak_ptr<nano::bootstrap_client> connection_frontier_request;
	nano::tcp_endpoint endpoint_frontier_request;
	std::weak_ptr<nano::frontier_req_client> frontiers;
	std::weak_ptr<nano::bulk_push_client> push;
	std::deque<nano::pull_info> pulls;
	std::deque<nano::block_hash> recent_pulls_head;
	std::deque<std::shared_ptr<nano::bootstrap_client>> idle;
	std::atomic<unsigned> connections{ 0 };
	std::atomic<unsigned> pulling{ 0 };
	std::shared_ptr<nano::node> node;
	std::atomic<unsigned> account_count{ 0 };
	std::atomic<uint64_t> total_blocks{ 0 };
	std::atomic<unsigned> runs_count{ 0 };
	std::atomic<unsigned> requeued_pulls{ 0 };
	std::vector<std::pair<nano::block_hash, nano::block_hash>> bulk_push_targets;
	std::atomic<bool> frontiers_received{ false };
	std::atomic<bool> frontiers_confirmed{ false };
	std::atomic<bool> populate_connections_started{ false };
	std::atomic<bool> stopped{ false };
	std::chrono::steady_clock::time_point attempt_start{ std::chrono::steady_clock::now () };
	nano::bootstrap_mode mode;
	std::mutex mutex;
	nano::condition_variable condition;
	// Lazy bootstrap
	std::unordered_set<nano::block_hash> lazy_blocks;
	std::unordered_map<nano::block_hash, nano::lazy_state_backlog_item> lazy_state_backlog;
	std::unordered_set<nano::block_hash> lazy_undefined_links;
	std::unordered_map<nano::block_hash, nano::uint128_t> lazy_balances;
	std::unordered_set<nano::block_hash> lazy_keys;
	std::deque<std::pair<nano::hash_or_account, unsigned>> lazy_pulls;
	std::chrono::steady_clock::time_point lazy_start_time;
	std::chrono::steady_clock::time_point last_lazy_flush{ std::chrono::steady_clock::now () };
	class account_tag
	{
	};
	class count_tag
	{
	};
	// clang-format off
	boost::multi_index_container<lazy_destinations_item,
	mi::indexed_by<
		mi::ordered_non_unique<mi::tag<count_tag>,
			mi::member<lazy_destinations_item, uint64_t, &lazy_destinations_item::count>,
			std::greater<uint64_t>>,
		mi::hashed_unique<mi::tag<account_tag>,
			mi::member<lazy_destinations_item, nano::account, &lazy_destinations_item::account>>>>
	lazy_destinations;
	// clang-format on
	std::atomic<size_t> lazy_blocks_count{ 0 };
	std::atomic<bool> lazy_destinations_flushed{ false };
	std::mutex lazy_mutex;
	// Wallet lazy bootstrap
	std::deque<nano::account> wallet_accounts;
};
class bootstrap_client final : public std::enable_shared_from_this<bootstrap_client>
{
public:
	bootstrap_client (std::shared_ptr<nano::node>, std::shared_ptr<nano::bootstrap_attempt>, std::shared_ptr<nano::transport::channel_tcp>, std::shared_ptr<nano::socket>);
	~bootstrap_client ();
	std::shared_ptr<nano::bootstrap_client> shared ();
	void stop (bool force);
	double block_rate () const;
	double elapsed_seconds () const;
	std::shared_ptr<nano::node> node;
	std::shared_ptr<nano::bootstrap_attempt> attempt;
	std::shared_ptr<nano::transport::channel_tcp> channel;
	std::shared_ptr<nano::socket> socket;
	std::shared_ptr<std::vector<uint8_t>> receive_buffer;
	std::chrono::steady_clock::time_point start_time;
	std::atomic<uint64_t> block_count;
	std::atomic<bool> pending_stop;
	std::atomic<bool> hard_stop;
};
class cached_pulls final
{
public:
	std::chrono::steady_clock::time_point time;
	nano::uint512_union account_head;
	nano::block_hash new_head;
};
class pulls_cache final
{
public:
	void add (nano::pull_info const &);
	void update_pull (nano::pull_info &);
	void remove (nano::pull_info const &);
	std::mutex pulls_cache_mutex;
	class account_head_tag
	{
	};
	// clang-format off
	boost::multi_index_container<nano::cached_pulls,
	mi::indexed_by<
		mi::ordered_non_unique<
			mi::member<nano::cached_pulls, std::chrono::steady_clock::time_point, &nano::cached_pulls::time>>,
		mi::hashed_unique<mi::tag<account_head_tag>,
			mi::member<nano::cached_pulls, nano::uint512_union, &nano::cached_pulls::account_head>>>>
	cache;
	// clang-format on
	constexpr static size_t cache_size_max = 10000;
};
class excluded_peers_item final
{
public:
	std::chrono::steady_clock::time_point exclude_until;
	nano::tcp_endpoint endpoint;
	uint64_t score;
};
class bootstrap_excluded_peers final
{
public:
	uint64_t add (nano::tcp_endpoint const &, size_t);
	bool check (nano::tcp_endpoint const &);
	void remove (nano::tcp_endpoint const &);
	std::mutex excluded_peers_mutex;
	class endpoint_tag
	{
	};
	// clang-format off
	boost::multi_index_container<nano::excluded_peers_item,
	mi::indexed_by<
		mi::ordered_non_unique<
			mi::member<nano::excluded_peers_item, std::chrono::steady_clock::time_point, &nano::excluded_peers_item::exclude_until>>,
		mi::hashed_unique<mi::tag<endpoint_tag>,
			mi::member<nano::excluded_peers_item, nano::tcp_endpoint, &nano::excluded_peers_item::endpoint>>>>
	peers;
	// clang-format on
	constexpr static size_t excluded_peers_size_max = 5000;
	constexpr static double excluded_peers_percentage_limit = 0.5;
	constexpr static uint64_t score_limit = 2;
	constexpr static std::chrono::hours exclude_time_hours = std::chrono::hours (1);
	constexpr static std::chrono::hours exclude_remove_hours = std::chrono::hours (24);
};

class bootstrap_initiator final
{
public:
	explicit bootstrap_initiator (nano::node &);
	~bootstrap_initiator ();
	void bootstrap (nano::endpoint const &, bool add_to_peers = true, bool frontiers_confirmed = false);
	void bootstrap (bool force = false);
	void bootstrap_lazy (nano::hash_or_account const &, bool force = false, bool confirmed = true);
	void bootstrap_wallet (std::deque<nano::account> &);
	void run_bootstrap ();
	void notify_listeners (bool);
	void add_observer (std::function<void(bool)> const &);
	bool in_progress ();
	std::shared_ptr<nano::bootstrap_attempt> current_attempt ();
	nano::pulls_cache cache;
	nano::bootstrap_excluded_peers excluded_peers;
	void stop ();

private:
	nano::node & node;
	std::shared_ptr<nano::bootstrap_attempt> attempt;
	std::atomic<bool> stopped;
	std::mutex mutex;
	nano::condition_variable condition;
	std::mutex observers_mutex;
	std::vector<std::function<void(bool)>> observers;
	boost::thread thread;

	friend std::unique_ptr<seq_con_info_component> collect_seq_con_info (bootstrap_initiator & bootstrap_initiator, const std::string & name);
};

std::unique_ptr<seq_con_info_component> collect_seq_con_info (bootstrap_initiator & bootstrap_initiator, const std::string & name);
class bootstrap_limits final
{
public:
	static constexpr double bootstrap_connection_scale_target_blocks = 50000.0;
	static constexpr double bootstrap_connection_scale_target_blocks_lazy = bootstrap_connection_scale_target_blocks / 5;
	static constexpr double bootstrap_connection_warmup_time_sec = 5.0;
	static constexpr double bootstrap_minimum_blocks_per_sec = 10.0;
	static constexpr double bootstrap_minimum_elapsed_seconds_blockrate = 0.02;
	static constexpr double bootstrap_minimum_frontier_blocks_per_sec = 1000.0;
	static constexpr double bootstrap_minimum_termination_time_sec = 30.0;
	static constexpr unsigned bootstrap_max_new_connections = 32;
	static constexpr size_t bootstrap_max_confirm_frontiers = 70;
	static constexpr double required_frontier_confirmation_ratio = 0.8;
	static constexpr unsigned frontier_confirmation_blocks_limit = 128 * 1024;
	static constexpr unsigned requeued_pulls_limit = 256;
	static constexpr unsigned requeued_pulls_limit_test = 2;
	static constexpr unsigned bulk_push_cost_limit = 200;
	static constexpr std::chrono::seconds lazy_flush_delay_sec = std::chrono::seconds (5);
	static constexpr unsigned lazy_destinations_request_limit = 256 * 1024;
	static constexpr uint64_t lazy_batch_pull_count_resize_blocks_limit = 4 * 1024 * 1024;
	static constexpr double lazy_batch_pull_count_resize_ratio = 2.0;
	static constexpr size_t lazy_blocks_restart_limit = 1024 * 1024;
};
}

ext: hpp

max_stars_repo_name: ArdeshirV/nano-node

max_issues_repo_name: ArdeshirV/nano-node

max_forks_repo_name: ArdeshirV/nano-node


text:
///////////////////////////////////////////////////////////////
//  Copyright 2015 John Maddock. Distributed under the Boost
//  Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
//

#include <boost/config.hpp>

#ifndef BOOST_NO_CXX11_HDR_REGEX

#include "performance.hpp"
#include <regex>

struct std_regex : public abstract_regex
{
private:
   std::regex e;
   std::cmatch what;
public:
   virtual bool set_expression(const char* pe, bool isperl)
   {
      try
      {
         e.assign(pe, isperl ? std::regex::ECMAScript : std::regex::extended);
      }
      catch(const std::exception&)
      {
         return false;
      }
      return true;
   }
   virtual bool match_test(const char* text);
   virtual unsigned find_all(const char* text);
   virtual std::string name();

   struct initializer
   {
      initializer()
      {
         std_regex::register_instance(boost::shared_ptr<abstract_regex>(new std_regex));
      }
      void do_nothing()const {}
   };
   static const initializer init;
};

const std_regex::initializer std_regex::init;

bool std_regex::match_test(const char * text)
{
   return regex_match(text, what, e);
}

unsigned std_regex::find_all(const char * text)
{
   std::regex_iterator<const char*> i(text, text + std::strlen(text), e), j;
   unsigned count = 0;
   while(i != j)
   {
      ++i;
      ++count;
   }
   return count;
}

std::string std_regex::name()
{
   init.do_nothing();
   return "std::regex";
}

#endif

ext: cpp

max_stars_repo_name: cpp-pm/boost

max_issues_repo_name: cpp-pm/boost

max_forks_repo_name: cpp-pm/boost


text:
#include "NetworkClient.h"
#include <stdexcept>
#include <boost/bind.hpp>
#include "core/global.h"
#include "config/ConfigVariable.h"
using namespace std;
using boost::asio::ip::tcp;
namespace ssl = boost::asio::ssl;

NetworkClient::NetworkClient(NetworkHandler *handler) : m_handler(handler), m_socket(nullptr),
    m_secure_socket(nullptr),
    m_async_timer(io_service), m_send_queue()
{
}

NetworkClient::~NetworkClient()
{
    std::unique_lock<std::mutex> lock(m_mutex);
    assert(!is_connected(lock));
    if(m_secure_socket) {
        // This also deletes m_socket:
        delete m_secure_socket;
    } else {
        // ONLY delete m_socket if we must do so directly. If it's wrapped in
        // an SSL stream, the stream "owns" the socket.
        delete m_socket;
    }

    delete [] m_data_buf;
    delete [] m_send_buf;
}

void NetworkClient::initialize(tcp::socket *socket, std::unique_lock<std::mutex> &lock)
{
    if(m_socket) {
        throw std::logic_error("Trying to set a socket of a network client whose socket was already set.");
    }
    m_socket = socket;

    boost::asio::socket_base::keep_alive keepalive(true);
    m_socket->set_option(keepalive);

    boost::asio::ip::tcp::no_delay nodelay(true);
    m_socket->set_option(nodelay);

    bool endpoints_set = (m_remote.port() && m_local.port());
    if(endpoints_set || determine_endpoints(m_remote, m_local, lock)) {
        async_receive(lock);
    }
}

void NetworkClient::initialize(tcp::socket *socket,
                               const tcp::endpoint &remote,
                               const tcp::endpoint &local,
                               std::unique_lock<std::mutex> &lock)
{
    if(m_socket) {
        throw std::logic_error("Trying to set a socket of a network client whose socket was already set.");
    }
    m_remote = remote;
    m_local = local;

    initialize(socket, lock);
}

void NetworkClient::initialize(ssl::stream<tcp::socket> *stream, std::unique_lock<std::mutex> &lock)
{
    if(m_socket) {
        throw std::logic_error("Trying to set a socket of a network client whose socket was already set.");
    }

    m_secure_socket = stream;

    initialize(&stream->next_layer(), lock);
}

void NetworkClient::initialize(ssl::stream<tcp::socket> *stream,
                               const tcp::endpoint &remote,
                               const tcp::endpoint &local,
                               std::unique_lock<std::mutex> &lock)
{
    if(m_socket) {
        throw std::logic_error("Trying to set a socket of a network client whose socket was already set.");
    }

    m_secure_socket = stream;

    initialize(&stream->next_layer(), remote, local, lock);
}

bool NetworkClient::determine_endpoints(tcp::endpoint &remote, tcp::endpoint &local,
                                        std::unique_lock<std::mutex> &lock)
{
    boost::system::error_code ec;
    remote = m_socket->remote_endpoint(ec);
    local = m_socket->local_endpoint(ec);

    if(ec) {
        disconnect(ec, lock);
        return false;
    } else {
        return true;
    }
}

void NetworkClient::set_write_timeout(unsigned int timeout)
{
    std::unique_lock<std::mutex> lock(m_mutex);
    m_write_timeout = timeout;
}

void NetworkClient::set_write_buffer(uint64_t max_bytes)
{
    std::unique_lock<std::mutex> lock(m_mutex);
    m_max_queue_size = max_bytes;
}

void NetworkClient::send_datagram(DatagramHandle dg)
{
    std::unique_lock<std::mutex> lock(m_mutex);

    if(m_is_sending) {
        m_send_queue.push(dg);
        m_total_queue_size += dg->size();
        if(m_total_queue_size > m_max_queue_size && m_max_queue_size != 0) {
            boost::system::error_code enobufs(boost::system::errc::errc_t::no_buffer_space,
                                              boost::system::system_category());
            disconnect(enobufs, lock);
        }
    } else {
        m_is_sending = true;
        async_send(dg, lock);
    }
}

bool NetworkClient::is_connected(std::unique_lock<std::mutex> &)
{
    return m_socket && m_socket->is_open();
}

void NetworkClient::async_receive(std::unique_lock<std::mutex> &lock)
{
    try {
        if(m_is_data) { // Read data
            socket_read(m_data_buf, m_data_size, &NetworkClient::receive_data, lock);
        } else { // Read length
            socket_read(m_size_buf, sizeof(dgsize_t), &NetworkClient::receive_size, lock);
        }
    } catch(const boost::system::system_error &err) {
        // An exception happening when trying to initiate a read is a clear
        // indicator that something happened to the connection. Therefore:
        disconnect(err.code(), lock);
    }
}

void NetworkClient::disconnect(const boost::system::error_code &ec, std::unique_lock<std::mutex> &)
{
    if(m_local_disconnect || m_disconnect_handled) {
        // We've already set the error code and closed the socket; wait.
        return;
    }

    m_local_disconnect = true;
    m_disconnect_error = ec;

    m_socket->cancel();
    m_socket->close();

    m_async_timer.cancel();
}

void NetworkClient::handle_disconnect(const boost::system::error_code &ec,
                                      std::unique_lock<std::mutex> &lock)
{
    if(m_disconnect_handled) {
        return;
    }
    m_disconnect_handled = true;

    if(is_connected(lock)) {
        m_socket->close();
    }

    // Do NOT hold the lock when calling this. Our handler may acquire a
    // lock of its own, and the network lock should always be the lowest in the
    // lock hierarchy.
    lock.unlock();
    if(m_local_disconnect) {
        m_handler->receive_disconnect(m_disconnect_error);
    } else {
        m_handler->receive_disconnect(ec);
    }
}

void NetworkClient::receive_size(const boost::system::error_code &ec, size_t bytes_transferred)
{
    std::unique_lock<std::mutex> lock(m_mutex);

    if(ec) {
        handle_disconnect(ec, lock);
        return;
    }

    if(bytes_transferred != sizeof(m_size_buf)) {
        boost::system::error_code epipe(boost::system::errc::errc_t::broken_pipe,
                                        boost::system::system_category());
        handle_disconnect(epipe, lock);
        return;
    }

    // required to disable strict-aliasing optimizations, which can break the code
    dgsize_t* new_size_p = (dgsize_t*)m_size_buf;
    m_data_size = swap_le(*new_size_p);
    m_data_buf = new uint8_t[m_data_size];
    m_is_data = true;
    async_receive(lock);
}

void NetworkClient::receive_data(const boost::system::error_code &ec, size_t bytes_transferred)
{
    std::unique_lock<std::mutex> lock(m_mutex);
    DatagramPtr dg;

    if(ec) {
        handle_disconnect(ec, lock);
        return;
    }

    if(bytes_transferred != m_data_size) {
        boost::system::error_code epipe(boost::system::errc::errc_t::broken_pipe,
                                        boost::system::system_category());
        handle_disconnect(epipe, lock);
        return;
    }

    dg = Datagram::create(m_data_buf, m_data_size); // Datagram makes a copy

    delete [] m_data_buf;
    m_data_buf = nullptr;

    m_is_data = false;
    async_receive(lock);

    // Do NOT hold the lock when calling this. Our handler may acquire a
    // lock of its own, and the network lock should always be the lowest in the
    // lock hierarchy.
    lock.unlock();
    m_handler->receive_datagram(dg);
}

void NetworkClient::async_send(DatagramHandle dg, std::unique_lock<std::mutex> &lock)
{
    size_t buffer_size = sizeof(dgsize_t) + dg->size();
    dgsize_t len = swap_le(dg->size());
    m_send_buf = new uint8_t[buffer_size];
    memcpy(m_send_buf, (uint8_t*)&len, sizeof(dgsize_t));
    memcpy(m_send_buf + sizeof(dgsize_t), dg->get_data(), dg->size());

    try {
        socket_write(m_send_buf, buffer_size, lock);
    } catch(const boost::system::system_error& err) {
        // An exception happening when trying to initiate a send is a clear
        // indicator that something happened to the connection, therefore:
        disconnect(err.code(), lock);
    }
}

void NetworkClient::send_finished(const boost::system::error_code &ec)
{
    std::unique_lock<std::mutex> lock(m_mutex);

    // Cancel the outstanding timeout
    m_async_timer.cancel();

    // Discard the buffer we just used:
    delete [] m_send_buf;
    m_send_buf = nullptr;

    // Check if the write had errors
    if(ec.value() != 0) {
        m_is_sending = false;
        disconnect(ec, lock);
        return;
    }

    // Check if we have more items in the queue
    if(m_send_queue.size() > 0) {
        // Send the next item in the queue
        DatagramHandle dg = m_send_queue.front();
        m_total_queue_size -= dg->size();
        m_send_queue.pop();
        async_send(dg, lock);
        return;
    }

    // Nothing left in the queue to send, lets open up for another write
    m_is_sending = false;
}

void NetworkClient::send_expired(const boost::system::error_code& ec)
{
    std::unique_lock<std::mutex> lock(m_mutex);

    // operation_aborted is received if the the timer is cancelled,
    //     ie. if the send completed before it expires, so don't do anything
    if(ec != boost::asio::error::operation_aborted) {
        boost::system::error_code etimeout(boost::system::errc::errc_t::timed_out,
                                           boost::system::system_category());
        disconnect(etimeout, lock);
    }
}

void NetworkClient::socket_read(uint8_t* buf, size_t length, receive_handler_t callback,
                                std::unique_lock<std::mutex> &)
{
    if(m_secure_socket) {
        async_read(*m_secure_socket, boost::asio::buffer(buf, length),
                   boost::bind(callback, shared_from_this(),
                               boost::asio::placeholders::error,
                               boost::asio::placeholders::bytes_transferred));
    } else {
        async_read(*m_socket, boost::asio::buffer(buf, length),
                   boost::bind(callback, shared_from_this(),
                               boost::asio::placeholders::error,
                               boost::asio::placeholders::bytes_transferred));
    }
}

void NetworkClient::socket_write(const uint8_t* buf, size_t length, std::unique_lock<std::mutex> &)
{
    // Start async timeout, a value of 0 indicates the writes shouldn't timeout (used in debugging)
    if(m_write_timeout > 0) {
        m_async_timer.expires_from_now(boost::posix_time::milliseconds(m_write_timeout));
        m_async_timer.async_wait(boost::bind(&NetworkClient::send_expired, shared_from_this(),
                                             boost::asio::placeholders::error));
    }

    // Start async write
    if(m_secure_socket) {
        async_write(*m_secure_socket, boost::asio::buffer(buf, length),
                    boost::bind(&NetworkClient::send_finished, shared_from_this(),
                                boost::asio::placeholders::error));
    } else {
        async_write(*m_socket, boost::asio::buffer(buf, length),
                    boost::bind(&NetworkClient::send_finished, shared_from_this(),
                                boost::asio::placeholders::error));
    }
}