Skip to content

create_form async

create_form(
    app_id: str,
    environment_name: str,
    form_to_create: CreateFormData,
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> CreateFormResponse

Creates a new form for an Amplify app.

Parameters:

  • app_id (str) –

    The unique ID of the Amplify app to associate with the form.

  • environment_name (str) –

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

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

    The unique client token.

  • form_to_create (CreateFormData) –

    Represents the configuration of the form to create.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/async_amplify_ui_builder.py
async def create_form(
    self,
    app_id: str,
    environment_name: str,
    form_to_create: "capo_amplifyuibuilder.types.create_form_data.CreateFormData",
    *,
    config_overrides: Optional[AsyncAmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> "capo_amplifyuibuilder.types.create_form_response.CreateFormResponse":
    """<p>Creates a new form for an Amplify app.</p>

    Args:
        app_id: <p>The unique ID of the Amplify app to associate with the form.</p>
        environment_name: <p>The name of the backend environment that is a part of the Amplify app.</p>
        client_token: <p>The unique client token.</p>
        form_to_create: <p>Represents the configuration of the form to create.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account. </p>
        capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifyuibuilder.types.create_form_request.CreateFormRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifyuibuilder.types.create_form_response.CreateFormResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.create_form

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateForm")
    )
    input_: capo_amplifyuibuilder.types.create_form_request.CreateFormRequest = {
        "app_id": app_id,
        "environment_name": environment_name,
        "form_to_create": form_to_create,
    }
    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