UpdatePullRequestTitleCommand

Replaces the title of a pull request.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CodeCommitClient, UpdatePullRequestTitleCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, UpdatePullRequestTitleCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // UpdatePullRequestTitleInput
  pullRequestId: "STRING_VALUE", // required
  title: "STRING_VALUE", // required
};
const command = new UpdatePullRequestTitleCommand(input);
const response = await client.send(command);
// { // UpdatePullRequestTitleOutput
//   pullRequest: { // PullRequest
//     pullRequestId: "STRING_VALUE",
//     title: "STRING_VALUE",
//     description: "STRING_VALUE",
//     lastActivityDate: new Date("TIMESTAMP"),
//     creationDate: new Date("TIMESTAMP"),
//     pullRequestStatus: "OPEN" || "CLOSED",
//     authorArn: "STRING_VALUE",
//     pullRequestTargets: [ // PullRequestTargetList
//       { // PullRequestTarget
//         repositoryName: "STRING_VALUE",
//         sourceReference: "STRING_VALUE",
//         destinationReference: "STRING_VALUE",
//         destinationCommit: "STRING_VALUE",
//         sourceCommit: "STRING_VALUE",
//         mergeBase: "STRING_VALUE",
//         mergeMetadata: { // MergeMetadata
//           isMerged: true || false,
//           mergedBy: "STRING_VALUE",
//           mergeCommitId: "STRING_VALUE",
//           mergeOption: "FAST_FORWARD_MERGE" || "SQUASH_MERGE" || "THREE_WAY_MERGE",
//         },
//       },
//     ],
//     clientRequestToken: "STRING_VALUE",
//     revisionId: "STRING_VALUE",
//     approvalRules: [ // ApprovalRulesList
//       { // ApprovalRule
//         approvalRuleId: "STRING_VALUE",
//         approvalRuleName: "STRING_VALUE",
//         approvalRuleContent: "STRING_VALUE",
//         ruleContentSha256: "STRING_VALUE",
//         lastModifiedDate: new Date("TIMESTAMP"),
//         creationDate: new Date("TIMESTAMP"),
//         lastModifiedUser: "STRING_VALUE",
//         originApprovalRuleTemplate: { // OriginApprovalRuleTemplate
//           approvalRuleTemplateId: "STRING_VALUE",
//           approvalRuleTemplateName: "STRING_VALUE",
//         },
//       },
//     ],
//   },
// };

UpdatePullRequestTitleCommand Input

Parameter
Type
Description
pullRequestId
Required
string | undefined

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

title
Required
string | undefined

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

UpdatePullRequestTitleCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
pullRequest
Required
PullRequest | undefined

Information about the updated pull request.

Throws

Name
Fault
Details
InvalidPullRequestIdException
client

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.

InvalidTitleException
client

The title of the pull request is not valid. Pull request titles cannot exceed 100 characters in length.

PullRequestAlreadyClosedException
client

The pull request status cannot be updated because it is already closed.

PullRequestDoesNotExistException
client

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.

PullRequestIdRequiredException
client

A pull request ID is required, but none was provided.

TitleRequiredException
client

A pull request title is required. It cannot be empty or null.

CodeCommitServiceException
Base exception class for all service exceptions from CodeCommit service.