/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace IoTDataPlane
{
namespace Model
{
class DeleteThingShadowRequest;
class GetThingShadowRequest;
class ListNamedShadowsForThingRequest;
class PublishRequest;
class UpdateThingShadowRequest;
typedef Aws::Utils::Outcome DeleteThingShadowOutcome;
typedef Aws::Utils::Outcome GetThingShadowOutcome;
typedef Aws::Utils::Outcome ListNamedShadowsForThingOutcome;
typedef Aws::Utils::Outcome PublishOutcome;
typedef Aws::Utils::Outcome UpdateThingShadowOutcome;
typedef std::future DeleteThingShadowOutcomeCallable;
typedef std::future GetThingShadowOutcomeCallable;
typedef std::future ListNamedShadowsForThingOutcomeCallable;
typedef std::future PublishOutcomeCallable;
typedef std::future UpdateThingShadowOutcomeCallable;
} // namespace Model
class IoTDataPlaneClient;
typedef std::function&) > DeleteThingShadowResponseReceivedHandler;
typedef std::function&) > GetThingShadowResponseReceivedHandler;
typedef std::function&) > ListNamedShadowsForThingResponseReceivedHandler;
typedef std::function&) > PublishResponseReceivedHandler;
typedef std::function&) > UpdateThingShadowResponseReceivedHandler;
/**
* AWS IoT AWS IoT-Data enables secure, bi-directional
* communication between Internet-connected things (such as sensors, actuators,
* embedded devices, or smart appliances) and the AWS cloud. It implements a broker
* for applications and things to publish messages over HTTP (Publish) and
* retrieve, update, and delete shadows. A shadow is a persistent representation of
* your things and their state in the AWS cloud.
Find the endpoint address
* for actions in the AWS IoT data plane by running this CLI command:
* aws iot describe-endpoint --endpoint-type iot:Data-ATS
The
* service name used by AWS
* Signature Version 4 to sign requests is: iotdevicegateway.
*/
class AWS_IOTDATAPLANE_API IoTDataPlaneClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* 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.
*/
IoTDataPlaneClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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.
*/
IoTDataPlaneClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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
*/
IoTDataPlaneClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~IoTDataPlaneClient();
/**
* Deletes the shadow for the specified thing.
For more information, see
* DeleteThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*/
virtual Model::DeleteThingShadowOutcome DeleteThingShadow(const Model::DeleteThingShadowRequest& request) const;
/**
* Deletes the shadow for the specified thing.
For more information, see
* DeleteThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::DeleteThingShadowOutcomeCallable DeleteThingShadowCallable(const Model::DeleteThingShadowRequest& request) const;
/**
* Deletes the shadow for the specified thing.
For more information, see
* DeleteThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void DeleteThingShadowAsync(const Model::DeleteThingShadowRequest& request, const DeleteThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Gets the shadow for the specified thing.
For more information, see GetThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*/
virtual Model::GetThingShadowOutcome GetThingShadow(const Model::GetThingShadowRequest& request) const;
/**
* Gets the shadow for the specified thing.
For more information, see GetThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetThingShadowOutcomeCallable GetThingShadowCallable(const Model::GetThingShadowRequest& request) const;
/**
* Gets the shadow for the specified thing.
For more information, see GetThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetThingShadowAsync(const Model::GetThingShadowRequest& request, const GetThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Lists the shadows for the specified thing.
See Also:
AWS
* API Reference
*/
virtual Model::ListNamedShadowsForThingOutcome ListNamedShadowsForThing(const Model::ListNamedShadowsForThingRequest& request) const;
/**
* Lists the shadows for the specified thing.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListNamedShadowsForThingOutcomeCallable ListNamedShadowsForThingCallable(const Model::ListNamedShadowsForThingRequest& request) const;
/**
* Lists the shadows for the specified thing.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListNamedShadowsForThingAsync(const Model::ListNamedShadowsForThingRequest& request, const ListNamedShadowsForThingResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Publishes state information.
For more information, see HTTP
* Protocol in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*/
virtual Model::PublishOutcome Publish(const Model::PublishRequest& request) const;
/**
* Publishes state information.
For more information, see HTTP
* Protocol in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::PublishOutcomeCallable PublishCallable(const Model::PublishRequest& request) const;
/**
* Publishes state information.
For more information, see HTTP
* Protocol in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void PublishAsync(const Model::PublishRequest& request, const PublishResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Updates the shadow for the specified thing.
For more information, see
* UpdateThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*/
virtual Model::UpdateThingShadowOutcome UpdateThingShadow(const Model::UpdateThingShadowRequest& request) const;
/**
* Updates the shadow for the specified thing.
For more information, see
* UpdateThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::UpdateThingShadowOutcomeCallable UpdateThingShadowCallable(const Model::UpdateThingShadowRequest& request) const;
/**
* Updates the shadow for the specified thing.
For more information, see
* UpdateThingShadow
* in the AWS IoT Developer Guide.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void UpdateThingShadowAsync(const Model::UpdateThingShadowRequest& request, const UpdateThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void DeleteThingShadowAsyncHelper(const Model::DeleteThingShadowRequest& request, const DeleteThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void GetThingShadowAsyncHelper(const Model::GetThingShadowRequest& request, const GetThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListNamedShadowsForThingAsyncHelper(const Model::ListNamedShadowsForThingRequest& request, const ListNamedShadowsForThingResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void PublishAsyncHelper(const Model::PublishRequest& request, const PublishResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void UpdateThingShadowAsyncHelper(const Model::UpdateThingShadowRequest& request, const UpdateThingShadowResponseReceivedHandler& handler, const std::shared_ptr& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace IoTDataPlane
} // namespace Aws