Add a new Alibaba Cloud Bill API named QueryAccountBill.

This commit is contained in:
sdk-team
2019-10-29 14:57:42 +08:00
parent 58ae8a9ac1
commit 0d843e2d71
63 changed files with 542 additions and 58 deletions

View File

@@ -31,21 +31,21 @@ BssOpenApiClient::BssOpenApiClient(const Credentials &credentials, const ClientC
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "bssopenapi");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
BssOpenApiClient::BssOpenApiClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "bssopenapi");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
BssOpenApiClient::BssOpenApiClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "bssopenapi");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
BssOpenApiClient::~BssOpenApiClient()
@@ -879,6 +879,42 @@ BssOpenApiClient::QueryAccountBalanceOutcomeCallable BssOpenApiClient::queryAcco
return task->get_future();
}
BssOpenApiClient::QueryAccountBillOutcome BssOpenApiClient::queryAccountBill(const QueryAccountBillRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QueryAccountBillOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QueryAccountBillOutcome(QueryAccountBillResult(outcome.result()));
else
return QueryAccountBillOutcome(outcome.error());
}
void BssOpenApiClient::queryAccountBillAsync(const QueryAccountBillRequest& request, const QueryAccountBillAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, queryAccountBill(request), context);
};
asyncExecute(new Runnable(fn));
}
BssOpenApiClient::QueryAccountBillOutcomeCallable BssOpenApiClient::queryAccountBillCallable(const QueryAccountBillRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QueryAccountBillOutcome()>>(
[this, request]()
{
return this->queryAccountBill(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
BssOpenApiClient::QueryAccountTransactionsOutcome BssOpenApiClient::queryAccountTransactions(const QueryAccountTransactionsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();