Skip to content

accept_fork_pull_request_deployment async

accept_fork_pull_request_deployment(
    app_name: AppName,
    environment_name: EnvironmentName,
    commit_sha: CommitSha,
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    pull_request_number: Optional[PullRequestNumber] = None,
) -> AcceptForkPullRequestDeploymentResponse

Accepts a deployment for a specific commit from a forked-repository pull request. Each commit must be accepted before it can be deployed to a preview environment.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • environment_name (EnvironmentName) –

    The name of the environment.

  • commit_sha (CommitSha) –

    The full commit SHA in the forked-repository pull request to accept.

  • pull_request_number (Optional[PullRequestNumber], default: None ) –

    The number of the forked-repository pull request.

Raises:

Source code in docs_src/capo_amplifygen3/_services/async_amplify_gen3.py
async def accept_fork_pull_request_deployment(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    environment_name: "capo_amplifygen3.types.environment_name.EnvironmentName",
    commit_sha: "capo_amplifygen3.types.commit_sha.CommitSha",
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    pull_request_number: Optional[
        "capo_amplifygen3.types.pull_request_number.PullRequestNumber"
    ] = None,
) -> "capo_amplifygen3.types.accept_fork_pull_request_deployment_response.AcceptForkPullRequestDeploymentResponse":
    """<p>Accepts a deployment for a specific commit from a forked-repository pull request. Each commit must be accepted before it can be deployed to a preview environment.</p>

    Args:
        app_name: <p>The name of the app.</p>
        environment_name: <p>The name of the environment.</p>
        commit_sha: <p>The full commit SHA in the forked-repository pull request to accept.</p>
        pull_request_number: <p>The number of the forked-repository pull request.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifygen3.types.accept_fork_pull_request_deployment_request.AcceptForkPullRequestDeploymentRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifygen3.types.accept_fork_pull_request_deployment_response.AcceptForkPullRequestDeploymentResponse"
    ]:
        import capo_amplifygen3._operations.omega.accept_fork_pull_request_deployment

        (
            output,
            http_response,
        ) = await capo_amplifygen3._operations.omega.accept_fork_pull_request_deployment.async_accept_fork_pull_request_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptForkPullRequestDeployment")
    )
    input_: capo_amplifygen3.types.accept_fork_pull_request_deployment_request.AcceptForkPullRequestDeploymentRequest = {
        "app_name": app_name,
        "environment_name": environment_name,
        "commit_sha": commit_sha,
    }
    if pull_request_number is not None:
        input_["pull_request_number"] = pull_request_number

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