/// <summary> /// Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for /// a thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartNextPendingJobExecution service method.</param> /// /// <returns>The response from the StartNextPendingJobExecution service method, as returned by IoTJobsDataPlane.</returns> /// <exception cref="Amazon.IoTJobsDataPlane.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoTJobsDataPlane.Model.InvalidRequestException"> /// 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. /// </exception> /// <exception cref="Amazon.IoTJobsDataPlane.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoTJobsDataPlane.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoTJobsDataPlane.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecution">REST API Reference for StartNextPendingJobExecution Operation</seealso> public virtual StartNextPendingJobExecutionResponse StartNextPendingJobExecution(StartNextPendingJobExecutionRequest request) { var marshaller = new StartNextPendingJobExecutionRequestMarshaller(); var unmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance; return(Invoke <StartNextPendingJobExecutionRequest, StartNextPendingJobExecutionResponse>(request, marshaller, unmarshaller)); }
public void StartNextPendingJobExecution_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("StartNextPendingJobExecution"); var request = InstantiateClassGenerator.Execute <StartNextPendingJobExecutionRequest>(); var marshaller = new StartNextPendingJobExecutionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartNextPendingJobExecution", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" }, { "x-amzn-ErrorType", "ThrottlingException" }, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = StartNextPendingJobExecutionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
public void StartNextPendingJobExecutionMarshallTest() { var operation = service_model.FindOperation("StartNextPendingJobExecution"); var request = InstantiateClassGenerator.Execute <StartNextPendingJobExecutionRequest>(); var marshaller = new StartNextPendingJobExecutionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("StartNextPendingJobExecution", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as StartNextPendingJobExecutionResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the StartNextPendingJobExecution operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartNextPendingJobExecution operation on AmazonIoTJobsDataPlaneClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartNextPendingJobExecution /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecution">REST API Reference for StartNextPendingJobExecution Operation</seealso> public virtual IAsyncResult BeginStartNextPendingJobExecution(StartNextPendingJobExecutionRequest request, AsyncCallback callback, object state) { var marshaller = new StartNextPendingJobExecutionRequestMarshaller(); var unmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance; return(BeginInvoke <StartNextPendingJobExecutionRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Initiates the asynchronous execution of the StartNextPendingJobExecution operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartNextPendingJobExecution operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecution">REST API Reference for StartNextPendingJobExecution Operation</seealso> public virtual Task <StartNextPendingJobExecutionResponse> StartNextPendingJobExecutionAsync(StartNextPendingJobExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new StartNextPendingJobExecutionRequestMarshaller(); var unmarshaller = StartNextPendingJobExecutionResponseUnmarshaller.Instance; return(InvokeAsync <StartNextPendingJobExecutionRequest, StartNextPendingJobExecutionResponse>(request, marshaller, unmarshaller, cancellationToken)); }