ListPullRequests - AWS CodeCommit

ListPullRequests

Returns a list of pull requests for a specified repository. The return list can be refined by pull request status or pull request author ARN.

Request Syntax

{ "authorArn": "string", "maxResults": number, "nextToken": "string", "pullRequestStatus": "string", "repositoryName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

authorArn

Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results to pull requests created by that user.

Type: String

Required: No

maxResults

A non-zero, non-negative integer used to limit the number of returned results.

Type: Integer

Required: No

nextToken

An enumeration token that, when provided in a request, returns the next batch of the results.

Type: String

Required: No

pullRequestStatus

Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.

Type: String

Valid Values: OPEN | CLOSED

Required: No

repositoryName

The name of the repository for which you want to list pull requests.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: [\w\.-]+

Required: Yes

Response Syntax

{ "nextToken": "string", "pullRequestIds": [ "string" ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

nextToken

An enumeration token that allows the operation to batch the next results of the operation.

Type: String

pullRequestIds

The system-generated IDs of the pull requests.

Type: Array of strings

Errors

For information about the errors that are common to all actions, see Common Errors.

AuthorDoesNotExistException

The specified Amazon Resource Name (ARN) does not exist in the AWS account.

HTTP Status Code: 400

EncryptionIntegrityChecksFailedException

An encryption integrity check failed.

HTTP Status Code: 500

EncryptionKeyAccessDeniedException

An encryption key could not be accessed.

HTTP Status Code: 400

EncryptionKeyDisabledException

The encryption key is disabled.

HTTP Status Code: 400

EncryptionKeyNotFoundException

No encryption key was found.

HTTP Status Code: 400

EncryptionKeyUnavailableException

The encryption key is not available.

HTTP Status Code: 400

InvalidAuthorArnException

The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the full ARN for the author of the pull request, and then try again.

HTTP Status Code: 400

InvalidContinuationTokenException

The specified continuation token is not valid.

HTTP Status Code: 400

InvalidMaxResultsException

The specified number of maximum results is not valid.

HTTP Status Code: 400

InvalidPullRequestStatusException

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

HTTP Status Code: 400

InvalidRepositoryNameException

A specified repository name is not valid.

Note

This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.

HTTP Status Code: 400

RepositoryDoesNotExistException

The specified repository does not exist.

HTTP Status Code: 400

RepositoryNameRequiredException

A repository name is required, but was not specified.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ListPullRequests.

Sample Request

>POST / HTTP/1.1 Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 174 X-Amz-Target: CodeCommit_20150413.ListPullRequests X-Amz-Date: 20171025T132023Z User-Agent: aws-cli/1.11.187 Python/2.7.9 Windows/8 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20171025/us-east-1/codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE { "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", "maxResults": 20, "nextToken": "", "pullRequestStatus": "CLOSED", "repositoryName": "MyDemoRepo" }

Sample Response

{ "nextToken": "exampleToken", "pullRequestIds": ["2","12","16","22","30","23","35","39","47"] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: