async 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[AsyncAmplifyUIBuilderClientConfig] = 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_amplifyuibuilder.types.refresh_token_request.RefreshTokenRequest]",
) -> AsyncOperationResponse[
"capo_amplifyuibuilder.types.refresh_token_response.RefreshTokenResponse"
]:
import capo_amplifyuibuilder._operations.amplify_ui_builder.refresh_token
(
output,
http_response,
) = await capo_amplifyuibuilder._operations.amplify_ui_builder.refresh_token.async_refresh_token(
req.options, req.input
)
return AsyncOperationResponse(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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output