public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CertificateManager.Model.AddTagsToCertificateRequest(); if (cmdletContext.CertificateArn != null) { request.CertificateArn = cmdletContext.CertificateArn; } 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 AddTagsToCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToCertificate operation on AmazonCertificateManagerClient.</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 EndAddTagsToCertificate /// operation.</returns> public IAsyncResult BeginAddTagsToCertificate(AddTagsToCertificateRequest request, AsyncCallback callback, object state) { var marshaller = new AddTagsToCertificateRequestMarshaller(); var unmarshaller = AddTagsToCertificateResponseUnmarshaller.Instance; return BeginInvoke<AddTagsToCertificateRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Adds one or more tags to an ACM Certificate. Tags are labels that you can use to identify /// and organize your AWS resources. Each tag consists of a <code>key</code> and an optional /// <code>value</code>. You specify the certificate on input by its Amazon Resource Name /// (ARN). You specify the tag by using a key-value pair. /// /// /// <para> /// You can apply a tag to just one certificate if you want to identify a specific characteristic /// of that certificate, or you can apply the same tag to multiple certificates if you /// want to filter for a common relationship among those certificates. Similarly, you /// can apply the same tag to multiple resources if you want to specify a relationship /// among those resources. For example, you can add the same tag to an ACM Certificate /// and an Elastic Load Balancing load balancer to indicate that they are both used by /// the same website. For more information, see <a href="http://docs.aws.amazon.com/acm/latest/userguide/tags.html">Tagging /// ACM Certificates</a>. /// </para> /// /// <para> /// To remove one or more tags, use the <a>RemoveTagsFromCertificate</a> action. To view /// all of the tags that have been applied to the certificate, use the <a>ListTagsForCertificate</a> /// action. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddTagsToCertificate service method.</param> /// /// <returns>The response from the AddTagsToCertificate service method, as returned by CertificateManager.</returns> /// <exception cref="Amazon.CertificateManager.Model.InvalidArnException"> /// The requested Amazon Resource Name (ARN) does not refer to an existing resource. /// </exception> /// <exception cref="Amazon.CertificateManager.Model.InvalidTagException"> /// One or both of the values that make up the key-value pair is not valid. For example, /// you cannot specify a tag value that begins with <code>aws:</code>. /// </exception> /// <exception cref="Amazon.CertificateManager.Model.ResourceNotFoundException"> /// The specified certificate cannot be found in the caller's account, or the caller's /// account cannot be found. /// </exception> /// <exception cref="Amazon.CertificateManager.Model.TooManyTagsException"> /// The request contains too many tags. Try the request again with fewer tags. /// </exception> public AddTagsToCertificateResponse AddTagsToCertificate(AddTagsToCertificateRequest request) { var marshaller = new AddTagsToCertificateRequestMarshaller(); var unmarshaller = AddTagsToCertificateResponseUnmarshaller.Instance; return Invoke<AddTagsToCertificateRequest,AddTagsToCertificateResponse>(request, marshaller, unmarshaller); }
private Amazon.CertificateManager.Model.AddTagsToCertificateResponse CallAWSServiceOperation(IAmazonCertificateManager client, Amazon.CertificateManager.Model.AddTagsToCertificateRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Certificate Manager", "AddTagsToCertificate"); try { #if DESKTOP return(client.AddTagsToCertificate(request)); #elif CORECLR return(client.AddTagsToCertificateAsync(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 AddTagsToCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTagsToCertificate 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<AddTagsToCertificateResponse> AddTagsToCertificateAsync(AddTagsToCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new AddTagsToCertificateRequestMarshaller(); var unmarshaller = AddTagsToCertificateResponseUnmarshaller.Instance; return InvokeAsync<AddTagsToCertificateRequest,AddTagsToCertificateResponse>(request, marshaller, unmarshaller, cancellationToken); }