/**
* 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 IoTSecureTunneling
{
/**
* IoT Secure Tunneling IoT Secure Tunneling creates remote
* connections to devices deployed in the field.
For more information about
* how IoT Secure Tunneling works, see IoT
* Secure Tunneling.
*/
class AWS_IOTSECURETUNNELING_API IoTSecureTunnelingClient : 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 IoTSecureTunnelingClientConfiguration ClientConfigurationType;
typedef IoTSecureTunnelingEndpointProvider 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.
*/
IoTSecureTunnelingClient(const Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration& clientConfiguration = Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration(),
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.
*/
IoTSecureTunnelingClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration& clientConfiguration = Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration());
/**
* 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
*/
IoTSecureTunnelingClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration& clientConfiguration = Aws::IoTSecureTunneling::IoTSecureTunnelingClientConfiguration());
/* 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.
*/
IoTSecureTunnelingClient(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.
*/
IoTSecureTunnelingClient(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
*/
IoTSecureTunnelingClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~IoTSecureTunnelingClient();
/**
* Closes a tunnel identified by the unique tunnel id. When a
* CloseTunnel
request is received, we close the WebSocket connections
* between the client and proxy server so no data can be transmitted.
* Requires permission to access the CloseTunnel
* action.
See Also:
AWS
* API Reference
*/
virtual Model::CloseTunnelOutcome CloseTunnel(const Model::CloseTunnelRequest& request) const;
/**
* A Callable wrapper for CloseTunnel that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CloseTunnelOutcomeCallable CloseTunnelCallable(const CloseTunnelRequestT& request) const
{
return SubmitCallable(&IoTSecureTunnelingClient::CloseTunnel, request);
}
/**
* An Async wrapper for CloseTunnel that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CloseTunnelAsync(const CloseTunnelRequestT& request, const CloseTunnelResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTSecureTunnelingClient::CloseTunnel, request, handler, context);
}
/**
* Gets information about a tunnel identified by the unique tunnel id.
* Requires permission to access the DescribeTunnel
* action.
See Also:
AWS
* API Reference
*/
virtual Model::DescribeTunnelOutcome DescribeTunnel(const Model::DescribeTunnelRequest& request) const;
/**
* A Callable wrapper for DescribeTunnel that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DescribeTunnelOutcomeCallable DescribeTunnelCallable(const DescribeTunnelRequestT& request) const
{
return SubmitCallable(&IoTSecureTunnelingClient::DescribeTunnel, request);
}
/**
* An Async wrapper for DescribeTunnel that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DescribeTunnelAsync(const DescribeTunnelRequestT& request, const DescribeTunnelResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTSecureTunnelingClient::DescribeTunnel, request, handler, context);
}
/**
* Lists the tags for the specified 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(&IoTSecureTunnelingClient::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(&IoTSecureTunnelingClient::ListTagsForResource, request, handler, context);
}
/**
* List all tunnels for an Amazon Web Services account. Tunnels are listed by
* creation time in descending order, newer tunnels will be listed before older
* tunnels.
Requires permission to access the ListTunnels
* action.
See Also:
AWS
* API Reference
*/
virtual Model::ListTunnelsOutcome ListTunnels(const Model::ListTunnelsRequest& request) const;
/**
* A Callable wrapper for ListTunnels that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTunnelsOutcomeCallable ListTunnelsCallable(const ListTunnelsRequestT& request) const
{
return SubmitCallable(&IoTSecureTunnelingClient::ListTunnels, request);
}
/**
* An Async wrapper for ListTunnels that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTunnelsAsync(const ListTunnelsRequestT& request, const ListTunnelsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTSecureTunnelingClient::ListTunnels, request, handler, context);
}
/**
* Creates a new tunnel, and returns two client access tokens for clients to use
* to connect to the IoT Secure Tunneling proxy server.
Requires permission
* to access the OpenTunnel
* action.
See Also:
AWS
* API Reference
*/
virtual Model::OpenTunnelOutcome OpenTunnel(const Model::OpenTunnelRequest& request) const;
/**
* A Callable wrapper for OpenTunnel that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::OpenTunnelOutcomeCallable OpenTunnelCallable(const OpenTunnelRequestT& request) const
{
return SubmitCallable(&IoTSecureTunnelingClient::OpenTunnel, request);
}
/**
* An Async wrapper for OpenTunnel that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void OpenTunnelAsync(const OpenTunnelRequestT& request, const OpenTunnelResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTSecureTunnelingClient::OpenTunnel, request, handler, context);
}
/**
* Revokes the current client access token (CAT) and returns new CAT for clients
* to use when reconnecting to secure tunneling to access the same tunnel.
* Requires permission to access the RotateTunnelAccessToken
* action.
Rotating the CAT doesn't extend the tunnel duration. For
* example, say the tunnel duration is 12 hours and the tunnel has already been
* open for 4 hours. When you rotate the access tokens, the new tokens that are
* generated can only be used for the remaining 8 hours.
See
* Also:
AWS
* API Reference
*/
virtual Model::RotateTunnelAccessTokenOutcome RotateTunnelAccessToken(const Model::RotateTunnelAccessTokenRequest& request) const;
/**
* A Callable wrapper for RotateTunnelAccessToken that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::RotateTunnelAccessTokenOutcomeCallable RotateTunnelAccessTokenCallable(const RotateTunnelAccessTokenRequestT& request) const
{
return SubmitCallable(&IoTSecureTunnelingClient::RotateTunnelAccessToken, request);
}
/**
* An Async wrapper for RotateTunnelAccessToken that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void RotateTunnelAccessTokenAsync(const RotateTunnelAccessTokenRequestT& request, const RotateTunnelAccessTokenResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTSecureTunnelingClient::RotateTunnelAccessToken, request, handler, context);
}
/**
* A resource tag.
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(&IoTSecureTunnelingClient::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(&IoTSecureTunnelingClient::TagResource, request, handler, context);
}
/**
* Removes a tag from a 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(&IoTSecureTunnelingClient::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(&IoTSecureTunnelingClient::UntagResource, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const IoTSecureTunnelingClientConfiguration& clientConfiguration);
IoTSecureTunnelingClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace IoTSecureTunneling
} // namespace Aws