Skip to content

start_codegen_job

start_codegen_job(
    app_id: AppId,
    environment_name: str,
    codegen_job_to_create: StartCodegenJobData,
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> StartCodegenJobResponse

Starts a code generation job for a specified Amplify app and backend environment.

Parameters:

  • app_id (AppId) –

    The unique ID for the Amplify app.

  • environment_name (str) –

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

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

    The idempotency token used to ensure that the code generation job request completes only once.

  • codegen_job_to_create (StartCodegenJobData) –

    The code generation job resource configuration.

Raises:

Source code in docs_src/capo_amplifyuibuilder/_services/amplify_ui_builder.py
def start_codegen_job(
    self,
    app_id: "capo_amplifyuibuilder.types.app_id.AppId",
    environment_name: str,
    codegen_job_to_create: "capo_amplifyuibuilder.types.start_codegen_job_data.StartCodegenJobData",
    *,
    config_overrides: Optional[AmplifyUIBuilderClientConfig] = None,
    client_token: Optional[str] = None,
) -> (
    "capo_amplifyuibuilder.types.start_codegen_job_response.StartCodegenJobResponse"
):
    """<p>Starts a code generation job for a specified Amplify app and backend environment.</p>

    Args:
        app_id: <p>The unique ID for the Amplify app.</p>
        environment_name: <p>The name of the backend environment that is a part of the Amplify app.</p>
        client_token: <p>The idempotency token used to ensure that the code generation job request completes only once.</p>
        codegen_job_to_create: <p>The code generation job resource configuration.</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.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_amplifyuibuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifyuibuilder.types.start_codegen_job_request.StartCodegenJobRequest]",
    ) -> OperationResponse[
        "capo_amplifyuibuilder.types.start_codegen_job_response.StartCodegenJobResponse"
    ]:
        import capo_amplifyuibuilder._operations.amplify_ui_builder.start_codegen_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCodegenJob")
    )
    input_: capo_amplifyuibuilder.types.start_codegen_job_request.StartCodegenJobRequest = {
        "app_id": app_id,
        "environment_name": environment_name,
        "codegen_job_to_create": codegen_job_to_create,
    }
    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