Container for the parameters to the AcknowledgeJob operation. Returns information about a specified job and whether that job has been received by the job worker. Only used for custom actions.
Inheritance: AmazonCodePipelineRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CodePipeline.Model.AcknowledgeJobRequest();

            if (cmdletContext.JobId != null)
            {
                request.JobId = cmdletContext.JobId;
            }
            if (cmdletContext.Nonce != null)
            {
                request.Nonce = cmdletContext.Nonce;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the AcknowledgeJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AcknowledgeJob 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>
        public Task<AcknowledgeJobResponse> AcknowledgeJobAsync(AcknowledgeJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new AcknowledgeJobRequestMarshaller();
            var unmarshaller = AcknowledgeJobResponseUnmarshaller.Instance;

            return InvokeAsync<AcknowledgeJobRequest,AcknowledgeJobResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Returns information about a specified job and whether that job has been received by
        /// the job worker. Only used for custom actions.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the AcknowledgeJob service method.</param>
        /// 
        /// <returns>The response from the AcknowledgeJob service method, as returned by CodePipeline.</returns>
        /// <exception cref="Amazon.CodePipeline.Model.InvalidNonceException">
        /// The specified nonce was specified in an invalid format.
        /// </exception>
        /// <exception cref="Amazon.CodePipeline.Model.JobNotFoundException">
        /// The specified job was specified in an invalid format or cannot be found.
        /// </exception>
        /// <exception cref="Amazon.CodePipeline.Model.ValidationException">
        /// The validation was specified in an invalid format.
        /// </exception>
        public AcknowledgeJobResponse AcknowledgeJob(AcknowledgeJobRequest request)
        {
            var marshaller = new AcknowledgeJobRequestMarshaller();
            var unmarshaller = AcknowledgeJobResponseUnmarshaller.Instance;

            return Invoke<AcknowledgeJobRequest,AcknowledgeJobResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Returns information about a specified job and whether that job has been received by
 /// the job worker. Only used for custom actions.
 /// </summary>
 /// <param name="jobId">The unique system-generated ID of the job for which you want to confirm receipt.</param>
 /// <param name="nonce">A system-generated random number that AWS CodePipeline uses to ensure that the job is being worked on by only one job worker. This number must be returned in the response.</param>
 /// 
 /// <returns>The response from the AcknowledgeJob service method, as returned by CodePipeline.</returns>
 /// <exception cref="Amazon.CodePipeline.Model.InvalidNonceException">
 /// The specified nonce was specified in an invalid format.
 /// </exception>
 /// <exception cref="Amazon.CodePipeline.Model.JobNotFoundException">
 /// The specified job was specified in an invalid format or cannot be found.
 /// </exception>
 /// <exception cref="Amazon.CodePipeline.Model.ValidationException">
 /// The validation was specified in an invalid format.
 /// </exception>
 public AcknowledgeJobResponse AcknowledgeJob(string jobId, string nonce)
 {
     var request = new AcknowledgeJobRequest();
     request.JobId = jobId;
     request.Nonce = nonce;
     return AcknowledgeJob(request);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns information about a specified job and whether that job has been received by
 /// the job worker. Only used for custom actions.
 /// </summary>
 /// <param name="jobId">The unique system-generated ID of the job for which you want to confirm receipt.</param>
 /// <param name="nonce">A system-generated random number that AWS CodePipeline uses to ensure that the job is being worked on by only one job worker. This number must be returned in the response.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the AcknowledgeJob service method, as returned by CodePipeline.</returns>
 /// <exception cref="Amazon.CodePipeline.Model.InvalidNonceException">
 /// The specified nonce was specified in an invalid format.
 /// </exception>
 /// <exception cref="Amazon.CodePipeline.Model.JobNotFoundException">
 /// The specified job was specified in an invalid format or cannot be found.
 /// </exception>
 /// <exception cref="Amazon.CodePipeline.Model.ValidationException">
 /// The validation was specified in an invalid format.
 /// </exception>
 public Task<AcknowledgeJobResponse> AcknowledgeJobAsync(string jobId, string nonce, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new AcknowledgeJobRequest();
     request.JobId = jobId;
     request.Nonce = nonce;
     return AcknowledgeJobAsync(request, cancellationToken);
 }
 private Amazon.CodePipeline.Model.AcknowledgeJobResponse CallAWSServiceOperation(IAmazonCodePipeline client, Amazon.CodePipeline.Model.AcknowledgeJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CodePipeline", "AcknowledgeJob");
     try
     {
         #if DESKTOP
         return(client.AcknowledgeJob(request));
         #elif CORECLR
         return(client.AcknowledgeJobAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        /// <summary>
        /// Initiates the asynchronous execution of the AcknowledgeJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AcknowledgeJob operation on AmazonCodePipelineClient.</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 EndAcknowledgeJob
        ///         operation.</returns>
        public IAsyncResult BeginAcknowledgeJob(AcknowledgeJobRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new AcknowledgeJobRequestMarshaller();
            var unmarshaller = AcknowledgeJobResponseUnmarshaller.Instance;

            return BeginInvoke<AcknowledgeJobRequest>(request, marshaller, unmarshaller,
                callback, state);
        }