/** * 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 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 IoTJobsDataPlane { namespace Model { class DescribeJobExecutionRequest; class GetPendingJobExecutionsRequest; class StartNextPendingJobExecutionRequest; class UpdateJobExecutionRequest; typedef Aws::Utils::Outcome DescribeJobExecutionOutcome; typedef Aws::Utils::Outcome GetPendingJobExecutionsOutcome; typedef Aws::Utils::Outcome StartNextPendingJobExecutionOutcome; typedef Aws::Utils::Outcome UpdateJobExecutionOutcome; typedef std::future DescribeJobExecutionOutcomeCallable; typedef std::future GetPendingJobExecutionsOutcomeCallable; typedef std::future StartNextPendingJobExecutionOutcomeCallable; typedef std::future UpdateJobExecutionOutcomeCallable; } // namespace Model class IoTJobsDataPlaneClient; typedef std::function&) > DescribeJobExecutionResponseReceivedHandler; typedef std::function&) > GetPendingJobExecutionsResponseReceivedHandler; typedef std::function&) > StartNextPendingJobExecutionResponseReceivedHandler; typedef std::function&) > UpdateJobExecutionResponseReceivedHandler; /** *

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: 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. */ IoTJobsDataPlaneClient(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. */ IoTJobsDataPlaneClient(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 */ IoTJobsDataPlaneClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~IoTJobsDataPlaneClient(); /** *

Gets details of a job execution.

See Also:

AWS * API Reference

*/ virtual Model::DescribeJobExecutionOutcome DescribeJobExecution(const Model::DescribeJobExecutionRequest& request) const; /** *

Gets details of a job execution.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DescribeJobExecutionOutcomeCallable DescribeJobExecutionCallable(const Model::DescribeJobExecutionRequest& request) const; /** *

Gets details of a job execution.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DescribeJobExecutionAsync(const Model::DescribeJobExecutionRequest& request, const DescribeJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

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; /** *

Gets the list of all jobs for a thing that are not in a terminal * status.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetPendingJobExecutionsOutcomeCallable GetPendingJobExecutionsCallable(const Model::GetPendingJobExecutionsRequest& request) const; /** *

Gets the list of all jobs for a thing that are not in a terminal * status.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetPendingJobExecutionsAsync(const Model::GetPendingJobExecutionsRequest& request, const GetPendingJobExecutionsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

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; /** *

Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution * for a 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::StartNextPendingJobExecutionOutcomeCallable StartNextPendingJobExecutionCallable(const Model::StartNextPendingJobExecutionRequest& request) const; /** *

Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution * for a thing.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartNextPendingJobExecutionAsync(const Model::StartNextPendingJobExecutionRequest& request, const StartNextPendingJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Updates the status of a job execution.

See Also:

AWS * API Reference

*/ virtual Model::UpdateJobExecutionOutcome UpdateJobExecution(const Model::UpdateJobExecutionRequest& request) const; /** *

Updates the status of a job execution.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateJobExecutionOutcomeCallable UpdateJobExecutionCallable(const Model::UpdateJobExecutionRequest& request) const; /** *

Updates the status of a job execution.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateJobExecutionAsync(const Model::UpdateJobExecutionRequest& request, const UpdateJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void DescribeJobExecutionAsyncHelper(const Model::DescribeJobExecutionRequest& request, const DescribeJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context) const; void GetPendingJobExecutionsAsyncHelper(const Model::GetPendingJobExecutionsRequest& request, const GetPendingJobExecutionsResponseReceivedHandler& handler, const std::shared_ptr& context) const; void StartNextPendingJobExecutionAsyncHelper(const Model::StartNextPendingJobExecutionRequest& request, const StartNextPendingJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context) const; void UpdateJobExecutionAsyncHelper(const Model::UpdateJobExecutionRequest& request, const UpdateJobExecutionResponseReceivedHandler& handler, const std::shared_ptr& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr m_executor; }; } // namespace IoTJobsDataPlane } // namespace Aws