Skip to content

update_component async

update_component(
    app_id: str,
    environment_name: str,
    id: Uuid,
    updated_component: UpdateComponentData,
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> UpdateComponentResponse

Updates an existing component.

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 component.

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

    The unique client token.

  • updated_component (UpdateComponentData) –

    The configuration of the updated component.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/async_amplify_ui_builder.py
async def update_component(
    self,
    app_id: str,
    environment_name: str,
    id: "capo_amplifyuibuilder.types.uuid.Uuid",
    updated_component: "capo_amplifyuibuilder.types.update_component_data.UpdateComponentData",
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> (
    "capo_amplifyuibuilder.types.update_component_response.UpdateComponentResponse"
):
    """<p>Updates an existing component.</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 component.</p>
        client_token: <p>The unique client token.</p>
        updated_component: <p>The configuration of the updated component.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifyuibuilder.types.update_component_request.UpdateComponentRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifyuibuilder.types.update_component_response.UpdateComponentResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.update_component

        (
            output,
            http_response,
        ) = await capo_amplifyuibuilder._operations.amplify_ui_builder.update_component.async_update_component(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateComponent")
    )
    input_: capo_amplifyuibuilder.types.update_component_request.UpdateComponentRequest = {
        "app_id": app_id,
        "environment_name": environment_name,
        "id": id,
        "updated_component": updated_component,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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