Skip to content

update_pull_request_title async

update_pull_request_title(
    pull_request_id: PullRequestId,
    title: Title,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> UpdatePullRequestTitleOutput

Replaces the title of a pull request.

Parameters:

  • pull_request_id (PullRequestId) –

    The system-generated ID of the pull request. To get this ID, use ListPullRequests.

  • title (Title) –

    The updated title of the pull request. This replaces the existing title.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def update_pull_request_title(
    self,
    pull_request_id: "capo_codecommit.types.pull_request_id.PullRequestId",
    title: "capo_codecommit.types.title.Title",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> "capo_codecommit.types.update_pull_request_title_output.UpdatePullRequestTitleOutput":
    """<p>Replaces the title of a pull request.</p>

    Args:
        pull_request_id: <p>The system-generated ID of the pull request. To get this ID, use <a>ListPullRequests</a>.</p>
        title: <p>The updated title of the pull request. This replaces the existing title.</p>

    Raises:
        capo_codecommit.errors.invalid_pull_request_id_exception.InvalidPullRequestIdException: <p>The pull request ID is not valid. Make sure that you have provided the full ID and that the pull request is in the specified repository, and then try again.</p>
        capo_codecommit.errors.invalid_title_exception.InvalidTitleException: <p>The title of the pull request is not valid. Pull request titles cannot exceed 100 characters in length.</p>
        capo_codecommit.errors.pull_request_already_closed_exception.PullRequestAlreadyClosedException: <p>The pull request status cannot be updated because it is already closed.</p>
        capo_codecommit.errors.pull_request_does_not_exist_exception.PullRequestDoesNotExistException: <p>The pull request ID could not be found. Make sure that you have specified the correct repository name and pull request ID, and then try again.</p>
        capo_codecommit.errors.pull_request_id_required_exception.PullRequestIdRequiredException: <p>A pull request ID is required, but none was provided.</p>
        capo_codecommit.errors.title_required_exception.TitleRequiredException: <p>A pull request title is required. It cannot be empty or null.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codecommit.types.update_pull_request_title_input.UpdatePullRequestTitleInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.update_pull_request_title_output.UpdatePullRequestTitleOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.update_pull_request_title

        (
            output,
            http_response,
        ) = await capo_codecommit._operations.code_commit_20150413.update_pull_request_title.async_update_pull_request_title(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePullRequestTitle")
    )
    input_: capo_codecommit.types.update_pull_request_title_input.UpdatePullRequestTitleInput = {
        "pull_request_id": pull_request_id,
        "title": title,
    }

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