UpdatePullRequestStatusCommand

Updates the status of a pull request.

Example Syntax

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

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

UpdatePullRequestStatusCommand Input

Parameter
Type
Description
pullRequestId
Required
string | undefined

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

pullRequestStatus
Required
PullRequestStatusEnum | undefined

The status of the pull request. The only valid operations are to update the status from OPEN to OPEN, OPEN to CLOSED or from CLOSED to CLOSED.

UpdatePullRequestStatusCommand Output

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

Information about the pull request.

Throws

Name
Fault
Details
EncryptionIntegrityChecksFailedException
server

An encryption integrity check failed.

EncryptionKeyAccessDeniedException
client

An encryption key could not be accessed.

EncryptionKeyDisabledException
client

The encryption key is disabled.

EncryptionKeyNotFoundException
client

No encryption key was found.

EncryptionKeyUnavailableException
client

The encryption key is not available.

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.

InvalidPullRequestStatusException
client

The pull request status is not valid. The only valid values are OPEN and CLOSED.

InvalidPullRequestStatusUpdateException
client

The pull request status update is not valid. The only valid update is from OPEN to 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.

PullRequestStatusRequiredException
client

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

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