Skip to content

update_form async

update_form(
    app_id: str,
    environment_name: str,
    id: Uuid,
    updated_form: UpdateFormData,
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> UpdateFormResponse

Updates an existing form.

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

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

    The unique client token.

  • updated_form (UpdateFormData) –

    The request accepts the following data in JSON format.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/async_amplify_ui_builder.py
async def update_form(
    self,
    app_id: str,
    environment_name: str,
    id: "capo_amplifyuibuilder.types.uuid.Uuid",
    updated_form: "capo_amplifyuibuilder.types.update_form_data.UpdateFormData",
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> "capo_amplifyuibuilder.types.update_form_response.UpdateFormResponse":
    """<p>Updates an existing form.</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 form.</p>
        client_token: <p>The unique client token.</p>
        updated_form: <p>The request accepts the following data in JSON format.</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_form_request.UpdateFormRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifyuibuilder.types.update_form_response.UpdateFormResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.update_form

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateForm")
    )
    input_: capo_amplifyuibuilder.types.update_form_request.UpdateFormRequest = {
        "app_id": app_id,
        "environment_name": environment_name,
        "id": id,
        "updated_form": updated_form,
    }
    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