UpdatePullRequestDescriptionCommand

Replaces the contents of the description of a pull request.

Example Syntax

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

import { CodeCommitClient, UpdatePullRequestDescriptionCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, UpdatePullRequestDescriptionCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // UpdatePullRequestDescriptionInput
  pullRequestId: "STRING_VALUE", // required
  description: "STRING_VALUE", // required
};
const command = new UpdatePullRequestDescriptionCommand(input);
const response = await client.send(command);
// { // UpdatePullRequestDescriptionOutput
//   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",
//         },
//       },
//     ],
//   },
// };

UpdatePullRequestDescriptionCommand Input

Parameter
Type
Description
description
Required
string | undefined

The updated content of the description for the pull request. This content replaces the existing description.

pullRequestId
Required
string | undefined

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

UpdatePullRequestDescriptionCommand 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
InvalidDescriptionException
client

The pull request description is not valid. Descriptions cannot be more than 1,000 characters.

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.

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.

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