public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AWSSupport.Model.AddAttachmentsToSetRequest(); if (cmdletContext.Attachment != null) { request.Attachments = cmdletContext.Attachment; } if (cmdletContext.AttachmentSetId != null) { request.AttachmentSetId = cmdletContext.AttachmentSetId; } 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); }
private Amazon.AWSSupport.Model.AddAttachmentsToSetResponse CallAWSServiceOperation(IAmazonAWSSupport client, Amazon.AWSSupport.Model.AddAttachmentsToSetRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Support", "AddAttachmentsToSet"); try { #if DESKTOP return(client.AddAttachmentsToSet(request)); #elif CORECLR return(client.AddAttachmentsToSetAsync(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 AddAttachmentsToSet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet 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 EndAddAttachmentsToSet /// operation.</returns> public IAsyncResult BeginAddAttachmentsToSet(AddAttachmentsToSetRequest request, AsyncCallback callback, object state) { var marshaller = new AddAttachmentsToSetRequestMarshaller(); var unmarshaller = AddAttachmentsToSetResponseUnmarshaller.Instance; return BeginInvoke<AddAttachmentsToSetRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the AddAttachmentsToSet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet 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<AddAttachmentsToSetResponse> AddAttachmentsToSetAsync(AddAttachmentsToSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddAttachmentsToSetRequestMarshaller(); var unmarshaller = AddAttachmentsToSetResponseUnmarshaller.Instance; return InvokeAsync<AddAttachmentsToSetRequest,AddAttachmentsToSetResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Adds one or more attachments to an attachment set. If an <code>AttachmentSetId</code> /// is not specified, a new attachment set is created, and the ID of the set is returned /// in the response. If an <code>AttachmentSetId</code> is specified, the attachments /// are added to the specified set, if it exists. /// /// /// <para> /// An attachment set is a temporary container for attachments that are to be added to /// a case or case communication. The set is available for one hour after it is created; /// the <code>ExpiryTime</code> returned in the response indicates when the set expires. /// The maximum number of attachments in a set is 3, and the maximum size of any attachment /// in the set is 5 MB. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet service method.</param> /// /// <returns>The response from the AddAttachmentsToSet service method, as returned by AWSSupport.</returns> /// <exception cref="Amazon.AWSSupport.Model.AttachmentLimitExceededException"> /// The limit for the number of attachment sets created in a short period of time has /// been exceeded. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.AttachmentSetExpiredException"> /// The expiration time of the attachment set has passed. The set expires 1 hour after /// it is created. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.AttachmentSetIdNotFoundException"> /// An attachment set with the specified ID could not be found. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.AttachmentSetSizeLimitExceededException"> /// A limit for the size of an attachment set has been exceeded. The limits are 3 attachments /// and 5 MB per attachment. /// </exception> /// <exception cref="Amazon.AWSSupport.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> public AddAttachmentsToSetResponse AddAttachmentsToSet(AddAttachmentsToSetRequest request) { var marshaller = new AddAttachmentsToSetRequestMarshaller(); var unmarshaller = AddAttachmentsToSetResponseUnmarshaller.Instance; return Invoke<AddAttachmentsToSetRequest,AddAttachmentsToSetResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the AddAttachmentsToSet operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport.AddAttachmentsToSet"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet 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<AddAttachmentsToSetResponse> AddAttachmentsToSetAsync(AddAttachmentsToSetRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddAttachmentsToSetRequestMarshaller(); var unmarshaller = AddAttachmentsToSetResponseUnmarshaller.GetInstance(); return Invoke<IRequest, AddAttachmentsToSetRequest, AddAttachmentsToSetResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Adds one or more attachments to an attachment set. If an <code>AttachmentSetId</code> /// is not specified, a new attachment set is created, and the ID of the set is returned /// in the response. If an <code>AttachmentSetId</code> is specified, the attachments /// are added to the specified set, if it exists. /// /// /// <para> /// An attachment set is a temporary container for attachments that are to be added to /// a case or case communication. The set is available for one hour after it is created; /// the <code>ExpiryTime</code> returned in the response indicates when the set expires. /// The maximum number of attachments in a set is 3, and the maximum size of any attachment /// in the set is 5 MB. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet service method.</param> /// /// <returns>The response from the AddAttachmentsToSet service method, as returned by AWSSupport.</returns> /// <exception cref="T:Amazon.AWSSupport.Model.AttachmentLimitExceededException"> /// The limit for the number of attachment sets created in a short period of time has /// been exceeded. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.AttachmentSetExpiredException"> /// The expiration time of the attachment set has passed. The set expires 1 hour after /// it is created. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.AttachmentSetIdNotFoundException"> /// An attachment set with the specified ID could not be found. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.AttachmentSetSizeLimitExceededException"> /// A limit for the size of an attachment set has been exceeded. The limits are 3 attachments /// and 5 MB per attachment. /// </exception> /// <exception cref="T:Amazon.AWSSupport.Model.InternalServerErrorException"> /// An internal server error occurred. /// </exception> public AddAttachmentsToSetResponse AddAttachmentsToSet(AddAttachmentsToSetRequest request) { var task = AddAttachmentsToSetAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeAddAttachmentsToSet(AddAttachmentsToSetRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new AddAttachmentsToSetRequestMarshaller(); var unmarshaller = AddAttachmentsToSetResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the AddAttachmentsToSet operation. /// <seealso cref="Amazon.AWSSupport.IAmazonAWSSupport"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet 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 EndAddAttachmentsToSet /// operation.</returns> public IAsyncResult BeginAddAttachmentsToSet(AddAttachmentsToSetRequest request, AsyncCallback callback, object state) { return invokeAddAttachmentsToSet(request, callback, state, false); }
/// <summary> /// Adds one or more attachments to an attachment set. If an <code>AttachmentSetId</code> /// is not specified, a new attachment set is created, and the ID of the set is returned /// in the response. If an <code>AttachmentSetId</code> is specified, the attachments /// are added to the specified set, if it exists. /// /// /// <para> /// An attachment set is a temporary container for attachments that are to be added to /// a case or case communication. The set is available for one hour after it is created; /// the <code>ExpiryTime</code> returned in the response indicates when the set expires. /// The maximum number of attachments in a set is 3, and the maximum size of any attachment /// in the set is 5 MB. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddAttachmentsToSet service method.</param> /// /// <returns>The response from the AddAttachmentsToSet service method, as returned by AWSSupport.</returns> /// <exception cref="AttachmentLimitExceededException"> /// The limit for the number of attachment sets created in a short period of time has /// been exceeded. /// </exception> /// <exception cref="AttachmentSetExpiredException"> /// The expiration time of the attachment set has passed. The set expires 1 hour after /// it is created. /// </exception> /// <exception cref="AttachmentSetIdNotFoundException"> /// An attachment set with the specified ID could not be found. /// </exception> /// <exception cref="AttachmentSetSizeLimitExceededException"> /// A limit for the size of an attachment set has been exceeded. The limits are 3 attachments /// and 5 MB per attachment. /// </exception> /// <exception cref="InternalServerErrorException"> /// An internal server error occurred. /// </exception> public AddAttachmentsToSetResponse AddAttachmentsToSet(AddAttachmentsToSetRequest request) { IAsyncResult asyncResult = invokeAddAttachmentsToSet(request, null, null, true); return EndAddAttachmentsToSet(asyncResult); }