Skip to content

update_theme

update_theme(
    app_id: str,
    environment_name: str,
    id: Uuid,
    updated_theme: UpdateThemeData,
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> UpdateThemeResponse

Updates an existing theme.

Parameters:

  • app_id (str) –

    The unique ID for the Amplify app.

  • environment_name (str) –

    The name of the backend environment that is part of the Amplify app.

  • id (Uuid) –

    The unique ID for the theme.

  • client_token (Optional[str], default: None ) –

    The unique client token.

  • updated_theme (UpdateThemeData) –

    The configuration of the updated theme.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/amplify_ui_builder.py
def update_theme(
    self,
    app_id: str,
    environment_name: str,
    id: "capo_amplifyuibuilder.types.uuid.Uuid",
    updated_theme: "capo_amplifyuibuilder.types.update_theme_data.UpdateThemeData",
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> "capo_amplifyuibuilder.types.update_theme_response.UpdateThemeResponse":
    """<p>Updates an existing theme.</p>

    Args:
        app_id: <p>The unique ID for the Amplify app.</p>
        environment_name: <p>The name of the backend environment that is part of the Amplify app.</p>
        id: <p>The unique ID for the theme.</p>
        client_token: <p>The unique client token.</p>
        updated_theme: <p>The configuration of the updated theme.</p>

    Raises:
        capo_amplifyuibuilder.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred. Please retry your request.</p>
        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.resource_conflict_exception.ResourceConflictException: <p>The resource specified in the request conflicts with an existing resource.</p>
        capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifyuibuilder.types.update_theme_request.UpdateThemeRequest]",
    ) -> OperationResponse[
        "capo_amplifyuibuilder.types.update_theme_response.UpdateThemeResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.update_theme

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTheme")
    )
    input_: capo_amplifyuibuilder.types.update_theme_request.UpdateThemeRequest = {
        "app_id": app_id,
        "environment_name": environment_name,
        "id": id,
        "updated_theme": updated_theme,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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