def revoke_o_auth2_token_with_iam(
self,
token: "capo_signin.types.revocation_token.RevocationToken",
*,
config_overrides: Optional[SigninClientConfig] = None,
) -> "capo_signin.types.revoke_o_auth2_token_with_iam_response.RevokeOAuth2TokenWithIAMResponse":
"""Revokes an OAuth 2.0 refresh token and its associated token chain.
Args:
token: The refresh token to revoke. Must be a refresh token issued by AWS Sign-In. Access tokens are not accepted for revocation.
Raises:
capo_signin.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action.
capo_signin.errors.internal_server_exception.InternalServerException: The request failed because of an internal server error.
capo_signin.errors.too_many_requests_error.TooManyRequestsError: The request failed because you exceeded the request rate limit for this operation.
capo_signin.errors.validation_exception.ValidationException: The request failed because it contains a malformed, missing, or invalid parameter.
capo_signin.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest]",
) -> OperationResponse[
"capo_signin.types.revoke_o_auth2_token_with_iam_response.RevokeOAuth2TokenWithIAMResponse"
]:
import capo_signin._operations.signin.revoke_o_auth2_token_with_iam
output, http_response = (
capo_signin._operations.signin.revoke_o_auth2_token_with_iam.revoke_o_auth2_token_with_iam(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest",
) -> dict[str, Any]:
import capo_signin.types.revoke_o_auth2_token_with_iam_request
return capo_signin.types.revoke_o_auth2_token_with_iam_request.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("RevokeOAuth2TokenWithIAM", redact_input=_redact_input),
)
input_: capo_signin.types.revoke_o_auth2_token_with_iam_request.RevokeOAuth2TokenWithIAMRequest = {
"token": token
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output