Skip to content

refresh_token

refresh_token(
    provider: TokenProviders,
    refresh_token_body: RefreshTokenRequestBody,
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
) -> RefreshTokenResponse

This is for internal use.

Amplify uses this action to refresh a previously issued access token that might have expired.

Parameters:

  • provider (TokenProviders) –

    The third-party provider for the token. The only valid value is figma.

  • refresh_token_body (RefreshTokenRequestBody) –

    Information about the refresh token request.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/amplify_ui_builder.py
def refresh_token(
    self,
    provider: "capo_amplifyuibuilder.types.token_providers.TokenProviders",
    refresh_token_body: "capo_amplifyuibuilder.types.refresh_token_request_body.RefreshTokenRequestBody",
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
) -> "capo_amplifyuibuilder.types.refresh_token_response.RefreshTokenResponse":
    """<note> <p>This is for internal use.</p> </note> <p>Amplify uses this action to refresh a previously issued access token that might have expired.</p>

    Args:
        provider: <p>The third-party provider for the token. The only valid value is <code>figma</code>.</p>
        refresh_token_body: <p>Information about the refresh token request.</p>

    Raises:
        capo_amplifyuibuilder.errors.invalid_parameter_exception.InvalidParameterException: <p>An invalid or out-of-range value was supplied for the input parameter.</p>
        capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifyuibuilder.types.refresh_token_request.RefreshTokenRequest]",
    ) -> OperationResponse[
        "capo_amplifyuibuilder.types.refresh_token_response.RefreshTokenResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.refresh_token

        output, http_response = (
            capo_amplifyuibuilder._operations.amplify_ui_builder.refresh_token.refresh_token(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_amplifyuibuilder.types.refresh_token_request.RefreshTokenRequest",
    ) -> dict[str, Any]:
        import capo_amplifyuibuilder.types.refresh_token_request

        return capo_amplifyuibuilder.types.refresh_token_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_amplifyuibuilder.types.refresh_token_response.RefreshTokenResponse",
    ) -> dict[str, Any]:
        import capo_amplifyuibuilder.types.refresh_token_response

        return capo_amplifyuibuilder.types.refresh_token_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RefreshToken", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_amplifyuibuilder.types.refresh_token_request.RefreshTokenRequest = {
        "provider": provider,
        "refresh_token_body": refresh_token_body,
    }

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