/**
* 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 IoTJobsDataPlane
{
/**
* AWS IoT Jobs is a service that allows you to define a set of jobs — remote
* operations that are sent to and executed on one or more devices connected to AWS
* IoT. For example, you can define a job that instructs a set of devices to
* download and install application or firmware updates, reboot, rotate
* certificates, or perform remote troubleshooting operations.
To create a
* job, you make a job document which is a description of the remote operations to
* be performed, and you specify a list of targets that should perform the
* operations. The targets can be individual things, thing groups or both.
* AWS IoT Jobs sends a message to inform the targets that a job is available. The
* target starts the execution of the job by downloading the job document,
* performing the operations it specifies, and reporting its progress to AWS IoT.
* The Jobs service provides commands to track the progress of a job on a specific
* target and for all the targets of the job
*/
class AWS_IOTJOBSDATAPLANE_API IoTJobsDataPlaneClient : 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 IoTJobsDataPlaneClientConfiguration ClientConfigurationType;
typedef IoTJobsDataPlaneEndpointProvider 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.
*/
IoTJobsDataPlaneClient(const Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration& clientConfiguration = Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration(),
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.
*/
IoTJobsDataPlaneClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration& clientConfiguration = Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration());
/**
* 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
*/
IoTJobsDataPlaneClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration& clientConfiguration = Aws::IoTJobsDataPlane::IoTJobsDataPlaneClientConfiguration());
/* 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.
*/
IoTJobsDataPlaneClient(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.
*/
IoTJobsDataPlaneClient(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
*/
IoTJobsDataPlaneClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~IoTJobsDataPlaneClient();
/**
* Gets details of a job execution.
See Also:
AWS
* API Reference
*/
virtual Model::DescribeJobExecutionOutcome DescribeJobExecution(const Model::DescribeJobExecutionRequest& request) const;
/**
* A Callable wrapper for DescribeJobExecution that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DescribeJobExecutionOutcomeCallable DescribeJobExecutionCallable(const DescribeJobExecutionRequestT& request) const
{
return SubmitCallable(&IoTJobsDataPlaneClient::DescribeJobExecution, request);
}
/**
* An Async wrapper for DescribeJobExecution that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DescribeJobExecutionAsync(const DescribeJobExecutionRequestT& request, const DescribeJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTJobsDataPlaneClient::DescribeJobExecution, request, handler, context);
}
/**
* Gets the list of all jobs for a thing that are not in a terminal
* status.
See Also:
AWS
* API Reference
*/
virtual Model::GetPendingJobExecutionsOutcome GetPendingJobExecutions(const Model::GetPendingJobExecutionsRequest& request) const;
/**
* A Callable wrapper for GetPendingJobExecutions that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetPendingJobExecutionsOutcomeCallable GetPendingJobExecutionsCallable(const GetPendingJobExecutionsRequestT& request) const
{
return SubmitCallable(&IoTJobsDataPlaneClient::GetPendingJobExecutions, request);
}
/**
* An Async wrapper for GetPendingJobExecutions that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetPendingJobExecutionsAsync(const GetPendingJobExecutionsRequestT& request, const GetPendingJobExecutionsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTJobsDataPlaneClient::GetPendingJobExecutions, request, handler, context);
}
/**
* Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution
* for a thing.
See Also:
AWS
* API Reference
*/
virtual Model::StartNextPendingJobExecutionOutcome StartNextPendingJobExecution(const Model::StartNextPendingJobExecutionRequest& request) const;
/**
* A Callable wrapper for StartNextPendingJobExecution that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::StartNextPendingJobExecutionOutcomeCallable StartNextPendingJobExecutionCallable(const StartNextPendingJobExecutionRequestT& request) const
{
return SubmitCallable(&IoTJobsDataPlaneClient::StartNextPendingJobExecution, request);
}
/**
* An Async wrapper for StartNextPendingJobExecution that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void StartNextPendingJobExecutionAsync(const StartNextPendingJobExecutionRequestT& request, const StartNextPendingJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTJobsDataPlaneClient::StartNextPendingJobExecution, request, handler, context);
}
/**
* Updates the status of a job execution.
See Also:
AWS
* API Reference
*/
virtual Model::UpdateJobExecutionOutcome UpdateJobExecution(const Model::UpdateJobExecutionRequest& request) const;
/**
* A Callable wrapper for UpdateJobExecution that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::UpdateJobExecutionOutcomeCallable UpdateJobExecutionCallable(const UpdateJobExecutionRequestT& request) const
{
return SubmitCallable(&IoTJobsDataPlaneClient::UpdateJobExecution, request);
}
/**
* An Async wrapper for UpdateJobExecution that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void UpdateJobExecutionAsync(const UpdateJobExecutionRequestT& request, const UpdateJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&IoTJobsDataPlaneClient::UpdateJobExecution, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const IoTJobsDataPlaneClientConfiguration& clientConfiguration);
IoTJobsDataPlaneClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace IoTJobsDataPlane
} // namespace Aws