Skip to content

get_access_token async

get_access_token(
    access_token_id: ResourceId,
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
) -> GetAccessTokenOutput

Retrieves information about an access token.

Route 53 Global Resolver is a global service that supports resolvers in multiple Amazon Web Services Regions but you must specify the US East (Ohio) Region to create, update, or otherwise work with Route 53 Global Resolver resources. That is, for example, specify --region us-east-2 on Amazon Web Services CLI commands.

Parameters:

  • access_token_id (ResourceId) –

    ID of the token.

Raises:

Source code in docs_src/capo_route53globalresolver/_services/async_route53_global_resolver.py
async def get_access_token(
    self,
    access_token_id: "capo_route53globalresolver.types.resource_id.ResourceId",
    *,
    config_overrides: Optional[AsyncRoute53GlobalResolverClientConfig] = None,
) -> (
    "capo_route53globalresolver.types.get_access_token_output.GetAccessTokenOutput"
):
    """<p>Retrieves information about an access token.</p> <important> <p>Route 53 Global Resolver is a global service that supports resolvers in multiple Amazon Web Services Regions but you must specify the US East (Ohio) Region to create, update, or otherwise work with Route 53 Global Resolver resources. That is, for example, specify <code>--region us-east-2</code> on Amazon Web Services CLI commands.</p> </important>

    Args:
        access_token_id: <p>ID of the token.</p>

    Raises:
        capo_route53globalresolver.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform this operation. Check your IAM permissions and try again.</p>
        capo_route53globalresolver.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Try again later.</p>
        capo_route53globalresolver.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify the resource ID and try again.</p>
        capo_route53globalresolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Wait a moment and try again.</p>
        capo_route53globalresolver.errors.validation_exception.ValidationException: <p>The input parameters are invalid. Check the parameter values and try again.</p>
        capo_route53globalresolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53globalresolver.types.get_access_token_input.GetAccessTokenInput]",
    ) -> AsyncOperationResponse[
        "capo_route53globalresolver.types.get_access_token_output.GetAccessTokenOutput"
    ]:
        import capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.get_access_token

        (
            output,
            http_response,
        ) = await capo_route53globalresolver._operations.ec2_dns_global_resolver_customer_api.get_access_token.async_get_access_token(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_route53globalresolver.types.get_access_token_output.GetAccessTokenOutput",
    ) -> dict[str, Any]:
        import capo_route53globalresolver.types.get_access_token_output

        return capo_route53globalresolver.types.get_access_token_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetAccessToken", redact_output=_redact_output),
    )
    input_: capo_route53globalresolver.types.get_access_token_input.GetAccessTokenInput = {
        "access_token_id": access_token_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output