replace tab with 2 spaces in core dir
Copyright time changed to 1999-2019
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,22 +22,22 @@ using namespace AlibabaCloud::Location;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "Location";
|
||||
const std::string ENDPOINT = "location.aliyuncs.com";
|
||||
const std::string SERVICE_NAME = "Location";
|
||||
const std::string ENDPOINT = "location.aliyuncs.com";
|
||||
}
|
||||
|
||||
LocationClient::LocationClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
}
|
||||
|
||||
LocationClient::LocationClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
}
|
||||
|
||||
LocationClient::LocationClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,31 +52,31 @@ LocationClient::~LocationClient()
|
||||
|
||||
LocationClient::DescribeEndpointsOutcome LocationClient::describeEndpoints(const Model::DescribeEndpointsRequest &request) const
|
||||
{
|
||||
auto outcome = makeRequest(ENDPOINT, request);
|
||||
auto outcome = makeRequest(ENDPOINT, request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeEndpointsOutcome(Model::DescribeEndpointsResult(outcome.result()));
|
||||
else
|
||||
return DescribeEndpointsOutcome(outcome.error());
|
||||
if (outcome.isSuccess())
|
||||
return DescribeEndpointsOutcome(Model::DescribeEndpointsResult(outcome.result()));
|
||||
else
|
||||
return DescribeEndpointsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void LocationClient::describeEndpointsAsync(const Model::DescribeEndpointsRequest& request, const DescribeEndpointsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
std::async(std::launch::async,
|
||||
[this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeEndpoints(request), context);
|
||||
});
|
||||
std::async(std::launch::async,
|
||||
[this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeEndpoints(request), context);
|
||||
});
|
||||
}
|
||||
|
||||
LocationClient::DescribeEndpointsOutcomeCallable LocationClient::describeEndpointsCallable(const Model::DescribeEndpointsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeEndpointsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeEndpoints(request);
|
||||
});
|
||||
auto task = std::make_shared<std::packaged_task<DescribeEndpointsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeEndpoints(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
/*
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,8 +19,10 @@
|
||||
using namespace AlibabaCloud::Location;
|
||||
|
||||
LocationRequest::LocationRequest(const std::string & action) :
|
||||
RpcServiceRequest("location", "2015-06-12", action)
|
||||
{ }
|
||||
RpcServiceRequest("location", "2015-06-12", action)
|
||||
{
|
||||
}
|
||||
|
||||
LocationRequest::~LocationRequest()
|
||||
{ }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,7 @@ using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Location::Model;
|
||||
|
||||
DescribeEndpointsRequest::DescribeEndpointsRequest() :
|
||||
LocationRequest("DescribeEndpoints")
|
||||
LocationRequest("DescribeEndpoints")
|
||||
{}
|
||||
|
||||
DescribeEndpointsRequest::~DescribeEndpointsRequest()
|
||||
@@ -28,31 +28,30 @@ DescribeEndpointsRequest::~DescribeEndpointsRequest()
|
||||
|
||||
std::string DescribeEndpointsRequest::serviceCode()const
|
||||
{
|
||||
return parameter("ServiceCode");
|
||||
return parameter("ServiceCode");
|
||||
}
|
||||
|
||||
void DescribeEndpointsRequest::setServiceCode(const std::string & serviceCode)
|
||||
{
|
||||
setParameter("ServiceCode", serviceCode);
|
||||
setParameter("ServiceCode", serviceCode);
|
||||
}
|
||||
|
||||
std::string DescribeEndpointsRequest::id()const
|
||||
{
|
||||
return parameter("Id");
|
||||
return parameter("Id");
|
||||
}
|
||||
|
||||
void DescribeEndpointsRequest::setId(const std::string & id)
|
||||
{
|
||||
setParameter("Id", id);
|
||||
setParameter("Id", id);
|
||||
}
|
||||
|
||||
std::string DescribeEndpointsRequest::type()const
|
||||
{
|
||||
return parameter("Type");
|
||||
return parameter("Type");
|
||||
}
|
||||
|
||||
void DescribeEndpointsRequest::setType(const std::string & type)
|
||||
{
|
||||
setParameter("Type", type);
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
* Copyright 1999-2019 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,14 +21,14 @@ using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Location::Model;
|
||||
|
||||
DescribeEndpointsResult::DescribeEndpointsResult() :
|
||||
ServiceResult()
|
||||
ServiceResult()
|
||||
{
|
||||
}
|
||||
|
||||
DescribeEndpointsResult::DescribeEndpointsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeEndpointsResult::~DescribeEndpointsResult()
|
||||
@@ -36,48 +36,47 @@ DescribeEndpointsResult::~DescribeEndpointsResult()
|
||||
|
||||
void DescribeEndpointsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
success_ = value["Success"].asBool();
|
||||
auto allEndpoints = value["Endpoints"]["Endpoint"];
|
||||
for (const auto &item : allEndpoints)
|
||||
{
|
||||
Endpoint region;
|
||||
region.endpoint = item["Endpoint"].asString();
|
||||
region.id = item["Id"].asString();
|
||||
region.namespace_ = item["Namespace"].asString();
|
||||
region.serivceCode = item["SerivceCode"].asString();
|
||||
region.type = item["Type"].asString();
|
||||
auto allProtocols = item["Protocols"]["Protocols"];
|
||||
for (const auto &item : allProtocols)
|
||||
{
|
||||
region.protocols.push_back(item.asString());
|
||||
}
|
||||
endpoints_.push_back(region);
|
||||
}
|
||||
success_ = value["Success"].asBool();
|
||||
auto allEndpoints = value["Endpoints"]["Endpoint"];
|
||||
for (const auto &item : allEndpoints)
|
||||
{
|
||||
Endpoint region;
|
||||
region.endpoint = item["Endpoint"].asString();
|
||||
region.id = item["Id"].asString();
|
||||
region.namespace_ = item["Namespace"].asString();
|
||||
region.serivceCode = item["SerivceCode"].asString();
|
||||
region.type = item["Type"].asString();
|
||||
auto allProtocols = item["Protocols"]["Protocols"];
|
||||
for (const auto &item : allProtocols)
|
||||
{
|
||||
region.protocols.push_back(item.asString());
|
||||
}
|
||||
endpoints_.push_back(region);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<DescribeEndpointsResult::Endpoint> DescribeEndpointsResult::endpoints()const
|
||||
{
|
||||
return endpoints_;
|
||||
return endpoints_;
|
||||
}
|
||||
|
||||
void DescribeEndpointsResult::setEndpoints(const std::vector<Endpoint> & endpoints)
|
||||
{
|
||||
endpoints_ = endpoints;
|
||||
endpoints_ = endpoints;
|
||||
}
|
||||
|
||||
bool DescribeEndpointsResult::success()const
|
||||
{
|
||||
return success_;
|
||||
return success_;
|
||||
}
|
||||
|
||||
void DescribeEndpointsResult::setSuccess(const bool & success)
|
||||
{
|
||||
success_ = success;
|
||||
success_ = success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user