Container for the parameters to the RetireGrant operation. Retires a grant. To clean up, you can retire a grant when you're done using it. You should revoke a grant when you intend to actively deny operations that depend on it. The following are permitted to call this API:
  • The AWS account (root user) under which the grant was created

  • The RetiringPrincipal, if present in the grant

  • The GranteePrincipal, if RetireGrant is an operation specified in the grant

You must identify the grant to retire by its grant token or by a combination of the grant ID and the Amazon Resource Name (ARN) of the customer master key (CMK). A grant token is a unique variable-length base64-encoded string. A grant ID is a 64 character unique identifier of a grant. The CreateGrant operation returns both.

Наследование: AmazonKeyManagementServiceRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.KeyManagementService.Model.RetireGrantRequest();

            if (cmdletContext.GrantId != null)
            {
                request.GrantId = cmdletContext.GrantId;
            }
            if (cmdletContext.GrantToken != null)
            {
                request.GrantToken = cmdletContext.GrantToken;
            }
            if (cmdletContext.KeyId != null)
            {
                request.KeyId = cmdletContext.KeyId;
            }

            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 RetireGrant operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RetireGrant 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<RetireGrantResponse> RetireGrantAsync(RetireGrantRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new RetireGrantRequestMarshaller();
            var unmarshaller = RetireGrantResponseUnmarshaller.Instance;

            return InvokeAsync<RetireGrantRequest,RetireGrantResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// Retires a grant. You can retire a grant when you're done using it to clean up. You
 /// should revoke a grant when you intend to actively deny operations that depend on it.
 /// The following are permitted to call this API: <ul> <li>The account that created the
 /// grant</li> <li>The <code>RetiringPrincipal</code>, if present</li> <li>The <code>GranteePrincipal</code>,
 /// if <code>RetireGrant</code> is a grantee operation</li> </ul> The grant to retire
 /// must be identified by its grant token or by a combination of the key ARN and the grant
 /// ID. A grant token is a unique variable-length base64-encoded string. A grant ID is
 /// a 64 character unique identifier of a grant. Both are returned by the <code>CreateGrant</code>
 /// function.
 /// </summary>
 /// <param name="grantToken">Token that identifies the grant to be retired.</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 RetireGrant service method, as returned by KeyManagementService.</returns>
 /// <exception cref="Amazon.KeyManagementService.Model.DependencyTimeoutException">
 /// The system timed out while trying to fulfill the request.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.InvalidGrantTokenException">
 /// A grant token provided as part of the request is invalid.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.KMSInternalException">
 /// The request was rejected because an internal exception occurred. This error can be
 /// retried.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.NotFoundException">
 /// The request was rejected because the specified entity or resource could not be found.
 /// </exception>
 public Task<RetireGrantResponse> RetireGrantAsync(string grantToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new RetireGrantRequest();
     request.GrantToken = grantToken;
     return RetireGrantAsync(request, cancellationToken);
 }
        /// <summary>
        /// Retires a grant. You can retire a grant when you're done using it to clean up. You
        /// should revoke a grant when you intend to actively deny operations that depend on it.
        /// The following are permitted to call this API: <ul> <li>The account that created the
        /// grant</li> <li>The <code>RetiringPrincipal</code>, if present</li> <li>The <code>GranteePrincipal</code>,
        /// if <code>RetireGrant</code> is a grantee operation</li> </ul> The grant to retire
        /// must be identified by its grant token or by a combination of the key ARN and the grant
        /// ID. A grant token is a unique variable-length base64-encoded string. A grant ID is
        /// a 64 character unique identifier of a grant. Both are returned by the <code>CreateGrant</code>
        /// function.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the RetireGrant service method.</param>
        /// 
        /// <returns>The response from the RetireGrant service method, as returned by KeyManagementService.</returns>
        /// <exception cref="Amazon.KeyManagementService.Model.DependencyTimeoutException">
        /// The system timed out while trying to fulfill the request.
        /// </exception>
        /// <exception cref="Amazon.KeyManagementService.Model.InvalidGrantTokenException">
        /// A grant token provided as part of the request is invalid.
        /// </exception>
        /// <exception cref="Amazon.KeyManagementService.Model.KMSInternalException">
        /// The request was rejected because an internal exception occurred. This error can be
        /// retried.
        /// </exception>
        /// <exception cref="Amazon.KeyManagementService.Model.NotFoundException">
        /// The request was rejected because the specified entity or resource could not be found.
        /// </exception>
        public RetireGrantResponse RetireGrant(RetireGrantRequest request)
        {
            var marshaller = new RetireGrantRequestMarshaller();
            var unmarshaller = RetireGrantResponseUnmarshaller.Instance;

            return Invoke<RetireGrantRequest,RetireGrantResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Retires a grant. You can retire a grant when you're done using it to clean up. You
 /// should revoke a grant when you intend to actively deny operations that depend on it.
 /// The following are permitted to call this API: <ul> <li>The account that created the
 /// grant</li> <li>The <code>RetiringPrincipal</code>, if present</li> <li>The <code>GranteePrincipal</code>,
 /// if <code>RetireGrant</code> is a grantee operation</li> </ul> The grant to retire
 /// must be identified by its grant token or by a combination of the key ARN and the grant
 /// ID. A grant token is a unique variable-length base64-encoded string. A grant ID is
 /// a 64 character unique identifier of a grant. Both are returned by the <code>CreateGrant</code>
 /// function.
 /// </summary>
 /// <param name="grantToken">Token that identifies the grant to be retired.</param>
 /// 
 /// <returns>The response from the RetireGrant service method, as returned by KeyManagementService.</returns>
 /// <exception cref="Amazon.KeyManagementService.Model.DependencyTimeoutException">
 /// The system timed out while trying to fulfill the request.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.InvalidGrantTokenException">
 /// A grant token provided as part of the request is invalid.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.KMSInternalException">
 /// The request was rejected because an internal exception occurred. This error can be
 /// retried.
 /// </exception>
 /// <exception cref="Amazon.KeyManagementService.Model.NotFoundException">
 /// The request was rejected because the specified entity or resource could not be found.
 /// </exception>
 public RetireGrantResponse RetireGrant(string grantToken)
 {
     var request = new RetireGrantRequest();
     request.GrantToken = grantToken;
     return RetireGrant(request);
 }
 private Amazon.KeyManagementService.Model.RetireGrantResponse CallAWSServiceOperation(IAmazonKeyManagementService client, Amazon.KeyManagementService.Model.RetireGrantRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Key Management Service", "RetireGrant");
     try
     {
         #if DESKTOP
         return(client.RetireGrant(request));
         #elif CORECLR
         return(client.RetireGrantAsync(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 RetireGrant operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the RetireGrant operation on AmazonKeyManagementServiceClient.</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 EndRetireGrant
        ///         operation.</returns>
        public IAsyncResult BeginRetireGrant(RetireGrantRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new RetireGrantRequestMarshaller();
            var unmarshaller = RetireGrantResponseUnmarshaller.Instance;

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