/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the iot-jobs-data-2017-09-29.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using Amazon.IoTJobsDataPlane.Model;
using Amazon.IoTJobsDataPlane.Model.Internal.MarshallTransformations;
using Amazon.IoTJobsDataPlane.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.IoTJobsDataPlane
{
///
/// Implementation for accessing 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
///
///
public partial class AmazonIoTJobsDataPlaneClient : AmazonServiceClient, IAmazonIoTJobsDataPlane
{
private static IServiceMetadata serviceMetadata = new AmazonIoTJobsDataPlaneMetadata();
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customize the pipeline
///
///
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonIoTJobsDataPlaneEndpointResolver());
}
///
/// Capture metadata for the service.
///
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
///
/// Disposes the service client.
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
#region DescribeJobExecution
///
/// Gets details of a job execution.
///
/// Container for the necessary parameters to execute the DescribeJobExecution service method.
///
/// The response from the DescribeJobExecution service method, as returned by IoTJobsDataPlane.
///
/// The certificate is invalid.
///
///
/// The contents of the request were invalid. For example, this code is returned when
/// an UpdateJobExecution request contains invalid status details. The message contains
/// details about the error.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The job is in a terminal state.
///
///
/// The rate exceeds the limit.
///
/// REST API Reference for DescribeJobExecution Operation
public virtual DescribeJobExecutionResponse DescribeJobExecution(DescribeJobExecutionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeJobExecutionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the DescribeJobExecution operation.
///
///
/// Container for the necessary parameters to execute the DescribeJobExecution operation on AmazonIoTJobsDataPlaneClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeJobExecution
/// operation.
/// REST API Reference for DescribeJobExecution Operation
public virtual IAsyncResult BeginDescribeJobExecution(DescribeJobExecutionRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeJobExecutionResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the DescribeJobExecution operation.
///
///
/// The IAsyncResult returned by the call to BeginDescribeJobExecution.
///
/// Returns a DescribeJobExecutionResult from IoTJobsDataPlane.
/// REST API Reference for DescribeJobExecution Operation
public virtual DescribeJobExecutionResponse EndDescribeJobExecution(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region GetPendingJobExecutions
///
/// Gets the list of all jobs for a thing that are not in a terminal status.
///
/// Container for the necessary parameters to execute the GetPendingJobExecutions service method.
///
/// The response from the GetPendingJobExecutions service method, as returned by IoTJobsDataPlane.
///
/// The certificate is invalid.
///
///
/// The contents of the request were invalid. For example, this code is returned when
/// an UpdateJobExecution request contains invalid status details. The message contains
/// details about the error.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
/// REST API Reference for GetPendingJobExecutions Operation
public virtual GetPendingJobExecutionsResponse GetPendingJobExecutions(GetPendingJobExecutionsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetPendingJobExecutionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetPendingJobExecutionsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the GetPendingJobExecutions operation.
///
///
/// Container for the necessary parameters to execute the GetPendingJobExecutions operation on AmazonIoTJobsDataPlaneClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetPendingJobExecutions
/// operation.
/// REST API Reference for GetPendingJobExecutions Operation
public virtual IAsyncResult BeginGetPendingJobExecutions(GetPendingJobExecutionsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetPendingJobExecutionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetPendingJobExecutionsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the GetPendingJobExecutions operation.
///
///
/// The IAsyncResult returned by the call to BeginGetPendingJobExecutions.
///
/// Returns a GetPendingJobExecutionsResult from IoTJobsDataPlane.
/// REST API Reference for GetPendingJobExecutions Operation
public virtual GetPendingJobExecutionsResponse EndGetPendingJobExecutions(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region StartNextPendingJobExecution
///
/// Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for
/// a thing.
///
/// Container for the necessary parameters to execute the StartNextPendingJobExecution service method.
///
/// The response from the StartNextPendingJobExecution service method, as returned by IoTJobsDataPlane.
///
/// The certificate is invalid.
///
///
/// The contents of the request were invalid. For example, this code is returned when
/// an UpdateJobExecution request contains invalid status details. The message contains
/// details about the error.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
/// REST API Reference for StartNextPendingJobExecution Operation
public virtual StartNextPendingJobExecutionResponse StartNextPendingJobExecution(StartNextPendingJobExecutionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartNextPendingJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the StartNextPendingJobExecution operation.
///
///
/// Container for the necessary parameters to execute the StartNextPendingJobExecution operation on AmazonIoTJobsDataPlaneClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartNextPendingJobExecution
/// operation.
/// REST API Reference for StartNextPendingJobExecution Operation
public virtual IAsyncResult BeginStartNextPendingJobExecution(StartNextPendingJobExecutionRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartNextPendingJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the StartNextPendingJobExecution operation.
///
///
/// The IAsyncResult returned by the call to BeginStartNextPendingJobExecution.
///
/// Returns a StartNextPendingJobExecutionResult from IoTJobsDataPlane.
/// REST API Reference for StartNextPendingJobExecution Operation
public virtual StartNextPendingJobExecutionResponse EndStartNextPendingJobExecution(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region UpdateJobExecution
///
/// Updates the status of a job execution.
///
/// Container for the necessary parameters to execute the UpdateJobExecution service method.
///
/// The response from the UpdateJobExecution service method, as returned by IoTJobsDataPlane.
///
/// The certificate is invalid.
///
///
/// The contents of the request were invalid. For example, this code is returned when
/// an UpdateJobExecution request contains invalid status details. The message contains
/// details about the error.
///
///
/// An update attempted to change the job execution to a state that is invalid because
/// of the job execution's current state (for example, an attempt to change a request
/// in state SUCCESS to state IN_PROGRESS). In this case, the body of the error message
/// also contains the executionState field.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
/// REST API Reference for UpdateJobExecution Operation
public virtual UpdateJobExecutionResponse UpdateJobExecution(UpdateJobExecutionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateJobExecutionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the UpdateJobExecution operation.
///
///
/// Container for the necessary parameters to execute the UpdateJobExecution operation on AmazonIoTJobsDataPlaneClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateJobExecution
/// operation.
/// REST API Reference for UpdateJobExecution Operation
public virtual IAsyncResult BeginUpdateJobExecution(UpdateJobExecutionRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateJobExecutionRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateJobExecutionResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the UpdateJobExecution operation.
///
///
/// The IAsyncResult returned by the call to BeginUpdateJobExecution.
///
/// Returns a UpdateJobExecutionResult from IoTJobsDataPlane.
/// REST API Reference for UpdateJobExecution Operation
public virtual UpdateJobExecutionResponse EndUpdateJobExecution(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
}
}