public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AWSSupport.Model.DescribeAttachmentRequest(); if (cmdletContext.AttachmentId != null) { request.AttachmentId = cmdletContext.AttachmentId; } 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 DescribeAttachment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment operation on AmazonAWSSupportClient.</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 EndDescribeAttachment /// operation.</returns> public IAsyncResult BeginDescribeAttachment(DescribeAttachmentRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeAttachmentRequestMarshaller(); var unmarshaller = DescribeAttachmentResponseUnmarshaller.Instance; return BeginInvoke<DescribeAttachmentRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Returns the attachment that has the specified ID. Attachment IDs are generated by /// the case management system when you add an attachment to a case or case communication. /// Attachment IDs are returned in the <a>AttachmentDetails</a> objects that are returned /// by the <a>DescribeCommunications</a> operation. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment service method.</param> /// /// <returns>The response from the DescribeAttachment service method, as returned by AWSSupport.</returns> /// <exception cref="Amazon.AWSSupport.Model.AttachmentIdNotFoundException"> /// An attachment with the specified ID could not be found. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.DescribeAttachmentLimitExceededException"> /// The limit for the number of <a>DescribeAttachment</a> requests in a short period of /// time has been exceeded. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> public DescribeAttachmentResponse DescribeAttachment(DescribeAttachmentRequest request) { var marshaller = new DescribeAttachmentRequestMarshaller(); var unmarshaller = DescribeAttachmentResponseUnmarshaller.Instance; return Invoke<DescribeAttachmentRequest,DescribeAttachmentResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeAttachment operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment 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<DescribeAttachmentResponse> DescribeAttachmentAsync(DescribeAttachmentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeAttachmentRequestMarshaller(); var unmarshaller = DescribeAttachmentResponseUnmarshaller.Instance; return InvokeAsync<DescribeAttachmentRequest,DescribeAttachmentResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DescribeAttachment operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.DescribeAttachment"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment 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<DescribeAttachmentResponse> DescribeAttachmentAsync(DescribeAttachmentRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeAttachmentRequestMarshaller(); var unmarshaller = DescribeAttachmentResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeAttachmentRequest, DescribeAttachmentResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Returns the attachment that has the specified ID. Attachment IDs are generated by /// the case management system when you add an attachment to a case or case communication. /// Attachment IDs are returned in the <a>AttachmentDetails</a> objects that are returned /// by the <a>DescribeCommunications</a> operation. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment service method.</param> /// /// <returns>The response from the DescribeAttachment service method, as returned by AWSSupport.</returns> /// <exception cref="T:Amazon.AWSSupport.Model.AttachmentIdNotFoundException"> /// An attachment with the specified ID could not be found. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.DescribeAttachmentLimitExceededException"> /// The limit for the number of <a>DescribeAttachment</a> requests in a short period of /// time has been exceeded. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> public DescribeAttachmentResponse DescribeAttachment(DescribeAttachmentRequest request) { var task = DescribeAttachmentAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.AWSSupport.Model.DescribeAttachmentResponse CallAWSServiceOperation(IAmazonAWSSupport client, Amazon.AWSSupport.Model.DescribeAttachmentRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Support", "DescribeAttachment"); try { #if DESKTOP return(client.DescribeAttachment(request)); #elif CORECLR return(client.DescribeAttachmentAsync(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; } }
IAsyncResult invokeDescribeAttachment(DescribeAttachmentRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DescribeAttachmentRequestMarshaller(); var unmarshaller = DescribeAttachmentResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DescribeAttachment operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment operation on AmazonAWSSupportClient.</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 EndDescribeAttachment /// operation.</returns> public IAsyncResult BeginDescribeAttachment(DescribeAttachmentRequest request, AsyncCallback callback, object state) { return invokeDescribeAttachment(request, callback, state, false); }
/// <summary> /// Returns the attachment that has the specified ID. Attachment IDs are generated by /// the case management system when you add an attachment to a case or case communication. /// Attachment IDs are returned in the <a>AttachmentDetails</a> objects that are returned /// by the <a>DescribeCommunications</a> operation. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAttachment service method.</param> /// /// <returns>The response from the DescribeAttachment service method, as returned by AWSSupport.</returns> /// <exception cref="AttachmentIdNotFoundException"> /// An attachment with the specified ID could not be found. /// </exception> /// <exception cref="DescribeAttachmentLimitExceededException"> /// The limit for the number of <a>DescribeAttachment</a> requests in a short period of /// time has been exceeded. /// </exception> /// <exception cref="InternalServerErrorException"> /// An internal server error occurred. /// </exception> public DescribeAttachmentResponse DescribeAttachment(DescribeAttachmentRequest request) { IAsyncResult asyncResult = invokeDescribeAttachment(request, null, null, true); return EndDescribeAttachment(asyncResult); }