/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace TimestreamQuery
{
/**
* Amazon Timestream Query
*/
class AWS_TIMESTREAMQUERY_API TimestreamQueryClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
static const char* SERVICE_NAME;
static const char* ALLOCATION_TAG;
typedef TimestreamQueryClientConfiguration ClientConfigurationType;
typedef TimestreamQueryEndpointProvider EndpointProviderType;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TimestreamQueryClient(const Aws::TimestreamQuery::TimestreamQueryClientConfiguration& clientConfiguration = Aws::TimestreamQuery::TimestreamQueryClientConfiguration(),
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG));
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TimestreamQueryClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::TimestreamQuery::TimestreamQueryClientConfiguration& clientConfiguration = Aws::TimestreamQuery::TimestreamQueryClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
TimestreamQueryClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::TimestreamQuery::TimestreamQueryClientConfiguration& clientConfiguration = Aws::TimestreamQuery::TimestreamQueryClientConfiguration());
/* Legacy constructors due deprecation */
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TimestreamQueryClient(const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TimestreamQueryClient(const Aws::Auth::AWSCredentials& credentials,
const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
TimestreamQueryClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~TimestreamQueryClient();
/**
* Cancels a query that has been issued. Cancellation is provided only if the
* query has not completed running before the cancellation request was issued.
* Because cancellation is an idempotent operation, subsequent cancellation
* requests will return a CancellationMessage
, indicating that the
* query has already been canceled. See code
* sample for details.
See Also:
AWS
* API Reference
*/
virtual Model::CancelQueryOutcome CancelQuery(const Model::CancelQueryRequest& request) const;
/**
* A Callable wrapper for CancelQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CancelQueryOutcomeCallable CancelQueryCallable(const CancelQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::CancelQuery, request);
}
/**
* An Async wrapper for CancelQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CancelQueryAsync(const CancelQueryRequestT& request, const CancelQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::CancelQuery, request, handler, context);
}
/**
* Create a scheduled query that will be run on your behalf at the configured
* schedule. Timestream assumes the execution role provided as part of the
* ScheduledQueryExecutionRoleArn
parameter to run the query. You can
* use the NotificationConfiguration
parameter to configure
* notification for your scheduled query operations.
See Also:
AWS
* API Reference
*/
virtual Model::CreateScheduledQueryOutcome CreateScheduledQuery(const Model::CreateScheduledQueryRequest& request) const;
/**
* A Callable wrapper for CreateScheduledQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CreateScheduledQueryOutcomeCallable CreateScheduledQueryCallable(const CreateScheduledQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::CreateScheduledQuery, request);
}
/**
* An Async wrapper for CreateScheduledQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CreateScheduledQueryAsync(const CreateScheduledQueryRequestT& request, const CreateScheduledQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::CreateScheduledQuery, request, handler, context);
}
/**
* Deletes a given scheduled query. This is an irreversible operation.
*
See Also:
AWS
* API Reference
*/
virtual Model::DeleteScheduledQueryOutcome DeleteScheduledQuery(const Model::DeleteScheduledQueryRequest& request) const;
/**
* A Callable wrapper for DeleteScheduledQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DeleteScheduledQueryOutcomeCallable DeleteScheduledQueryCallable(const DeleteScheduledQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::DeleteScheduledQuery, request);
}
/**
* An Async wrapper for DeleteScheduledQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DeleteScheduledQueryAsync(const DeleteScheduledQueryRequestT& request, const DeleteScheduledQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::DeleteScheduledQuery, request, handler, context);
}
/**
* DescribeEndpoints returns a list of available endpoints to make Timestream
* API calls against. This API is available through both Write and Query.
* Because the Timestream SDKs are designed to transparently work with the
* service’s architecture, including the management and mapping of the service
* endpoints, it is not recommended that you use this API unless:
For detailed information on how and when to
* use and implement DescribeEndpoints, see The
* Endpoint Discovery Pattern.
See Also:
AWS
* API Reference
*/
virtual Model::DescribeEndpointsOutcome DescribeEndpoints(const Model::DescribeEndpointsRequest& request) const;
/**
* A Callable wrapper for DescribeEndpoints that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DescribeEndpointsOutcomeCallable DescribeEndpointsCallable(const DescribeEndpointsRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::DescribeEndpoints, request);
}
/**
* An Async wrapper for DescribeEndpoints that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DescribeEndpointsAsync(const DescribeEndpointsRequestT& request, const DescribeEndpointsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::DescribeEndpoints, request, handler, context);
}
/**
* Provides detailed information about a scheduled query.
See
* Also:
AWS
* API Reference
*/
virtual Model::DescribeScheduledQueryOutcome DescribeScheduledQuery(const Model::DescribeScheduledQueryRequest& request) const;
/**
* A Callable wrapper for DescribeScheduledQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DescribeScheduledQueryOutcomeCallable DescribeScheduledQueryCallable(const DescribeScheduledQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::DescribeScheduledQuery, request);
}
/**
* An Async wrapper for DescribeScheduledQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DescribeScheduledQueryAsync(const DescribeScheduledQueryRequestT& request, const DescribeScheduledQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::DescribeScheduledQuery, request, handler, context);
}
/**
* You can use this API to run a scheduled query manually.
See
* Also:
AWS
* API Reference
*/
virtual Model::ExecuteScheduledQueryOutcome ExecuteScheduledQuery(const Model::ExecuteScheduledQueryRequest& request) const;
/**
* A Callable wrapper for ExecuteScheduledQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ExecuteScheduledQueryOutcomeCallable ExecuteScheduledQueryCallable(const ExecuteScheduledQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::ExecuteScheduledQuery, request);
}
/**
* An Async wrapper for ExecuteScheduledQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ExecuteScheduledQueryAsync(const ExecuteScheduledQueryRequestT& request, const ExecuteScheduledQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::ExecuteScheduledQuery, request, handler, context);
}
/**
* Gets a list of all scheduled queries in the caller's Amazon account and
* Region. ListScheduledQueries
is eventually consistent.
*
See Also:
AWS
* API Reference
*/
virtual Model::ListScheduledQueriesOutcome ListScheduledQueries(const Model::ListScheduledQueriesRequest& request) const;
/**
* A Callable wrapper for ListScheduledQueries that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListScheduledQueriesOutcomeCallable ListScheduledQueriesCallable(const ListScheduledQueriesRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::ListScheduledQueries, request);
}
/**
* An Async wrapper for ListScheduledQueries that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListScheduledQueriesAsync(const ListScheduledQueriesRequestT& request, const ListScheduledQueriesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::ListScheduledQueries, request, handler, context);
}
/**
* List all tags on a Timestream query resource.
See Also:
AWS
* API Reference
*/
virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const;
/**
* A Callable wrapper for ListTagsForResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const ListTagsForResourceRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::ListTagsForResource, request);
}
/**
* An Async wrapper for ListTagsForResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTagsForResourceAsync(const ListTagsForResourceRequestT& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::ListTagsForResource, request, handler, context);
}
/**
* A synchronous operation that allows you to submit a query with parameters to
* be stored by Timestream for later running. Timestream only supports using this
* operation with the PrepareQueryRequest$ValidateOnly
set to
* true
.
See Also:
AWS
* API Reference
*/
virtual Model::PrepareQueryOutcome PrepareQuery(const Model::PrepareQueryRequest& request) const;
/**
* A Callable wrapper for PrepareQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::PrepareQueryOutcomeCallable PrepareQueryCallable(const PrepareQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::PrepareQuery, request);
}
/**
* An Async wrapper for PrepareQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void PrepareQueryAsync(const PrepareQueryRequestT& request, const PrepareQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::PrepareQuery, request, handler, context);
}
/**
* Query
is a synchronous operation that enables you to run a
* query against your Amazon Timestream data. Query
will time out
* after 60 seconds. You must update the default timeout in the SDK to support a
* timeout of 60 seconds. See the code
* sample for details.
Your query request will fail in the following
* cases:
-
If you submit a Query
request with the
* same client token outside of the 5-minute idempotency window.
-
*
If you submit a Query
request with the same client token, but
* change other parameters, within the 5-minute idempotency window.
-
*
If the size of the row (including the query metadata) exceeds 1 MB, then the
* query will fail with the following error message:
Query aborted
* as max page response size has been exceeded by the output result row
* -
If the IAM principal of the query initiator and the result reader
* are not the same and/or the query initiator and the result reader do not have
* the same query string in the query requests, the query will fail with an
* Invalid pagination token
error.
See
* Also:
AWS
* API Reference
*/
virtual Model::QueryOutcome Query(const Model::QueryRequest& request) const;
/**
* A Callable wrapper for Query that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::QueryOutcomeCallable QueryCallable(const QueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::Query, request);
}
/**
* An Async wrapper for Query that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void QueryAsync(const QueryRequestT& request, const QueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::Query, request, handler, context);
}
/**
* Associate a set of tags with a Timestream resource. You can then activate
* these user-defined tags so that they appear on the Billing and Cost Management
* console for cost allocation tracking.
See Also:
AWS
* API Reference
*/
virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const;
/**
* A Callable wrapper for TagResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::TagResourceOutcomeCallable TagResourceCallable(const TagResourceRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::TagResource, request);
}
/**
* An Async wrapper for TagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void TagResourceAsync(const TagResourceRequestT& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::TagResource, request, handler, context);
}
/**
* Removes the association of tags from a Timestream query
* resource.
See Also:
AWS
* API Reference
*/
virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const;
/**
* A Callable wrapper for UntagResource that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::UntagResourceOutcomeCallable UntagResourceCallable(const UntagResourceRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::UntagResource, request);
}
/**
* An Async wrapper for UntagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void UntagResourceAsync(const UntagResourceRequestT& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::UntagResource, request, handler, context);
}
/**
* Update a scheduled query.
See Also:
AWS
* API Reference
*/
virtual Model::UpdateScheduledQueryOutcome UpdateScheduledQuery(const Model::UpdateScheduledQueryRequest& request) const;
/**
* A Callable wrapper for UpdateScheduledQuery that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::UpdateScheduledQueryOutcomeCallable UpdateScheduledQueryCallable(const UpdateScheduledQueryRequestT& request) const
{
return SubmitCallable(&TimestreamQueryClient::UpdateScheduledQuery, request);
}
/**
* An Async wrapper for UpdateScheduledQuery that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void UpdateScheduledQueryAsync(const UpdateScheduledQueryRequestT& request, const UpdateScheduledQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&TimestreamQueryClient::UpdateScheduledQuery, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const TimestreamQueryClientConfiguration& clientConfiguration);
mutable Aws::Utils::ConcurrentCache m_endpointsCache;
TimestreamQueryClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace TimestreamQuery
} // namespace Aws