Skip to content

delete_token

delete_token(
    token_id: String, *, config_overrides: Optional[LicenseManagerClientConfig] = None
) -> DeleteTokenResponse

Deletes the specified token. Must be called in the license home Region.

Parameters:

  • token_id (String) –

    Token ID.

Raises:

Source code in docs_src/capo_license_manager/_services/license_manager.py
def delete_token(
    self,
    token_id: "capo_license_manager.types.string.String",
    *,
    config_overrides: Optional[LicenseManagerClientConfig] = None,
) -> "capo_license_manager.types.delete_token_response.DeleteTokenResponse":
    """<p>Deletes the specified token. Must be called in the license home Region.</p>

    Args:
        token_id: <p>Token ID.</p>

    Raises:
        capo_license_manager.errors.access_denied_exception.AccessDeniedException: <p>Access to resource denied.</p>
        capo_license_manager.errors.authorization_exception.AuthorizationException: <p>The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy associated with this account.</p>
        capo_license_manager.errors.rate_limit_exceeded_exception.RateLimitExceededException: <p>Too many requests have been submitted. Try again after a brief wait.</p>
        capo_license_manager.errors.redirect_exception.RedirectException: <p>This is not the correct Region for the resource. Try again.</p>
        capo_license_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_license_manager.errors.server_internal_exception.ServerInternalException: <p>The server experienced an internal error. Try again.</p>
        capo_license_manager.errors.validation_exception.ValidationException: <p>The provided input is not valid. Try your request again.</p>
        capo_license_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_license_manager.types.delete_token_request.DeleteTokenRequest]",
    ) -> OperationResponse[
        "capo_license_manager.types.delete_token_response.DeleteTokenResponse"
    ]:
        import capo_license_manager._operations.aws_license_manager.delete_token

        output, http_response = (
            capo_license_manager._operations.aws_license_manager.delete_token.delete_token(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteToken")
    )
    input_: capo_license_manager.types.delete_token_request.DeleteTokenRequest = {
        "token_id": token_id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output