public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AutoScaling.Model.CreateOrUpdateTagsRequest(); if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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 CreateOrUpdateTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOrUpdateTags 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<CreateOrUpdateTagsResponse> CreateOrUpdateTagsAsync(CreateOrUpdateTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateOrUpdateTagsRequestMarshaller(); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.Instance; return InvokeAsync<CreateOrUpdateTagsRequest,CreateOrUpdateTagsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateOrUpdateTagsResponse CreateOrUpdateTags(CreateOrUpdateTagsRequest request) { var marshaller = new CreateOrUpdateTagsRequestMarshaller(); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.Instance; return Invoke<CreateOrUpdateTagsRequest,CreateOrUpdateTagsResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeCreateOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateOrUpdateTagsRequestMarshaller().Marshall(createOrUpdateTagsRequest); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CreateOrUpdateTags operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateOrUpdateTags"/> /// </summary> /// /// <param name="createOrUpdateTagsRequest">Container for the necessary parameters to execute the CreateOrUpdateTags operation on /// AmazonAutoScaling.</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> public IAsyncResult BeginCreateOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest, AsyncCallback callback, object state) { return invokeCreateOrUpdateTags(createOrUpdateTagsRequest, callback, state, false); }
/// <summary> /// <para> Creates new tags or updates existing tags for an Auto Scaling group. </para> <para><b>NOTE:</b> A tag's definition is composed of a /// resource ID, resource type, key and value, and the propagate flag. Value and the propagate flag are optional parameters. See the Request /// Parameters for more information. </para> <para>For information on creating tags for your Auto Scaling group, see <a /// href="http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html" >Tag Your Auto Scaling Groups and Amazon EC2 /// Instances</a> .</para> /// </summary> /// /// <param name="createOrUpdateTagsRequest">Container for the necessary parameters to execute the CreateOrUpdateTags service method on /// AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> /// <exception cref="AlreadyExistsException"/> public CreateOrUpdateTagsResponse CreateOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest) { IAsyncResult asyncResult = invokeCreateOrUpdateTags(createOrUpdateTagsRequest, null, null, true); return EndCreateOrUpdateTags(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateOrUpdateTags operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateOrUpdateTags"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOrUpdateTags 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<CreateOrUpdateTagsResponse> CreateOrUpdateTagsAsync(CreateOrUpdateTagsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateOrUpdateTagsRequestMarshaller(); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateOrUpdateTagsRequest, CreateOrUpdateTagsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Creates new tags or updates existing tags for an Auto Scaling group. </para> <para><b>NOTE:</b> A tag's definition is composed of a /// resource ID, resource type, key and value, and the propagate flag. Value and the propagate flag are optional parameters. See the Request /// Parameters for more information. </para> <para>For information on creating tags for your Auto Scaling group, see <a href="http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html">Tag Your Auto Scaling Groups and Amazon EC2 /// Instances</a> .</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOrUpdateTags service method on /// AmazonAutoScaling.</param> /// /// <exception cref="T:Amazon.AutoScaling.Model.LimitExceededException" /> /// <exception cref="T:Amazon.AutoScaling.Model.AlreadyExistsException" /> public CreateOrUpdateTagsResponse CreateOrUpdateTags(CreateOrUpdateTagsRequest request) { var task = CreateOrUpdateTagsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the CreateOrUpdateTags operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOrUpdateTags operation on AmazonAutoScalingClient.</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 EndCreateOrUpdateTags /// operation.</returns> public IAsyncResult BeginCreateOrUpdateTags(CreateOrUpdateTagsRequest request, AsyncCallback callback, object state) { var marshaller = new CreateOrUpdateTagsRequestMarshaller(); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.Instance; return BeginInvoke<CreateOrUpdateTagsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Creates new tags or updates existing tags for an Auto Scaling group. </para> <para><b>NOTE:</b> A tag's definition is composed of a /// resource ID, resource type, key and value, and the propagate flag. Value and the propagate flag are optional parameters. See the Request /// Parameters for more information. </para> /// </summary> /// /// <param name="createOrUpdateTagsRequest">Container for the necessary parameters to execute the CreateOrUpdateTags service method on /// AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> /// <exception cref="AlreadyExistsException"/> public CreateOrUpdateTagsResponse CreateOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest) { IRequest<CreateOrUpdateTagsRequest> request = new CreateOrUpdateTagsRequestMarshaller().Marshall(createOrUpdateTagsRequest); CreateOrUpdateTagsResponse response = Invoke<CreateOrUpdateTagsRequest, CreateOrUpdateTagsResponse> (request, this.signer, CreateOrUpdateTagsResponseUnmarshaller.GetInstance()); return response; }
internal CreateOrUpdateTagsResponse CreateOrUpdateTags(CreateOrUpdateTagsRequest request) { var task = CreateOrUpdateTagsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the CreateOrUpdateTags operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateOrUpdateTags"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOrUpdateTags 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 async Task<CreateOrUpdateTagsResponse> CreateOrUpdateTagsAsync(CreateOrUpdateTagsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateOrUpdateTagsRequestMarshaller(); var unmarshaller = CreateOrUpdateTagsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateOrUpdateTagsRequest, CreateOrUpdateTagsResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private Amazon.AutoScaling.Model.CreateOrUpdateTagsResponse CallAWSServiceOperation(IAmazonAutoScaling client, Amazon.AutoScaling.Model.CreateOrUpdateTagsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Auto Scaling", "CreateOrUpdateTags"); try { #if DESKTOP return(client.CreateOrUpdateTags(request)); #elif CORECLR return(client.CreateOrUpdateTagsAsync(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; } }