AWS Codeguru Reviewer Api DOcumentation
AWS Codeguru Reviewer Api DOcumentation
Amazon's trademarks and trade dress may not be used in connection with any product or service
that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any
manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are
the property of their respective owners, who may or may not be affiliated with, connected to, or
sponsored by Amazon.
Amazon CodeGuru Reviewer API Reference
Table of Contents
Welcome ........................................................................................................................................... 1
Actions .............................................................................................................................................. 2
AssociateRepository ..................................................................................................................................... 3
Request Syntax ........................................................................................................................................ 3
URI Request Parameters ........................................................................................................................ 4
Request Body ........................................................................................................................................... 4
Response Syntax ...................................................................................................................................... 5
Response Elements ................................................................................................................................. 6
Errors .......................................................................................................................................................... 7
See Also ..................................................................................................................................................... 8
CreateCodeReview ........................................................................................................................................ 9
Request Syntax ........................................................................................................................................ 9
URI Request Parameters ...................................................................................................................... 10
Request Body ......................................................................................................................................... 10
Response Syntax ................................................................................................................................... 11
Response Elements ............................................................................................................................... 13
Errors ....................................................................................................................................................... 13
See Also .................................................................................................................................................. 14
DescribeCodeReview .................................................................................................................................. 15
Request Syntax ...................................................................................................................................... 15
URI Request Parameters ...................................................................................................................... 15
Request Body ......................................................................................................................................... 15
Response Syntax ................................................................................................................................... 15
Response Elements ............................................................................................................................... 17
Errors ....................................................................................................................................................... 17
See Also .................................................................................................................................................. 18
DescribeRecommendationFeedback ....................................................................................................... 19
Request Syntax ...................................................................................................................................... 19
URI Request Parameters ...................................................................................................................... 19
Request Body ......................................................................................................................................... 20
Response Syntax ................................................................................................................................... 20
Response Elements ............................................................................................................................... 20
Errors ....................................................................................................................................................... 20
See Also .................................................................................................................................................. 21
DescribeRepositoryAssociation ................................................................................................................ 22
Request Syntax ...................................................................................................................................... 22
URI Request Parameters ...................................................................................................................... 22
Request Body ......................................................................................................................................... 22
Response Syntax ................................................................................................................................... 22
Response Elements ............................................................................................................................... 23
Errors ....................................................................................................................................................... 24
See Also .................................................................................................................................................. 25
DisassociateRepository .............................................................................................................................. 26
Request Syntax ...................................................................................................................................... 26
URI Request Parameters ...................................................................................................................... 26
Request Body ......................................................................................................................................... 26
Response Syntax ................................................................................................................................... 26
Response Elements ............................................................................................................................... 27
Errors ....................................................................................................................................................... 28
See Also .................................................................................................................................................. 29
ListCodeReviews ......................................................................................................................................... 30
Request Syntax ...................................................................................................................................... 30
URI Request Parameters ...................................................................................................................... 30
Request Body ......................................................................................................................................... 31
Response Syntax ................................................................................................................................... 31
Response Elements ............................................................................................................................... 33
Errors ....................................................................................................................................................... 33
See Also .................................................................................................................................................. 34
ListRecommendationFeedback ................................................................................................................ 35
Request Syntax ...................................................................................................................................... 35
URI Request Parameters ...................................................................................................................... 35
Request Body ......................................................................................................................................... 36
Response Syntax ................................................................................................................................... 36
Response Elements ............................................................................................................................... 36
Errors ....................................................................................................................................................... 37
See Also .................................................................................................................................................. 38
ListRecommendations ............................................................................................................................... 39
Request Syntax ...................................................................................................................................... 39
URI Request Parameters ...................................................................................................................... 39
Request Body ......................................................................................................................................... 39
UntagResource ............................................................................................................................................ 57
Request Syntax ...................................................................................................................................... 57
URI Request Parameters ...................................................................................................................... 57
Request Body ......................................................................................................................................... 57
Response Syntax ................................................................................................................................... 57
Response Elements ............................................................................................................................... 58
Errors ....................................................................................................................................................... 58
See Also .................................................................................................................................................. 58
Data Types ..................................................................................................................................... 59
BranchDiffSourceCodeType ...................................................................................................................... 61
Contents .................................................................................................................................................. 61
See Also .................................................................................................................................................. 61
CodeArtifacts ............................................................................................................................................... 62
Contents .................................................................................................................................................. 62
See Also .................................................................................................................................................. 62
CodeCommitRepository ............................................................................................................................ 64
Contents .................................................................................................................................................. 64
See Also .................................................................................................................................................. 64
CodeReview ................................................................................................................................................. 65
Contents .................................................................................................................................................. 65
See Also .................................................................................................................................................. 69
CodeReviewSummary ................................................................................................................................ 70
Contents .................................................................................................................................................. 70
See Also .................................................................................................................................................. 73
CodeReviewType ......................................................................................................................................... 74
Contents .................................................................................................................................................. 74
See Also .................................................................................................................................................. 74
CommitDiffSourceCodeType .................................................................................................................... 76
Contents .................................................................................................................................................. 76
See Also .................................................................................................................................................. 76
EventInfo ...................................................................................................................................................... 78
Contents .................................................................................................................................................. 78
See Also .................................................................................................................................................. 78
KMSKeyDetails ............................................................................................................................................ 80
Contents .................................................................................................................................................. 80
See Also .................................................................................................................................................. 80
Metrics .......................................................................................................................................................... 82
Contents .................................................................................................................................................. 82
See Also .................................................................................................................................................. 82
MetricsSummary ......................................................................................................................................... 84
Contents .................................................................................................................................................. 84
See Also .................................................................................................................................................. 85
RecommendationFeedback ...................................................................................................................... 86
Contents .................................................................................................................................................. 86
See Also .................................................................................................................................................. 87
RecommendationFeedbackSummary ..................................................................................................... 88
Contents .................................................................................................................................................. 88
See Also .................................................................................................................................................. 89
RecommendationSummary ...................................................................................................................... 90
Contents .................................................................................................................................................. 90
See Also .................................................................................................................................................. 92
Repository .................................................................................................................................................... 93
Contents .................................................................................................................................................. 93
See Also .................................................................................................................................................. 93
RepositoryAnalysis ..................................................................................................................................... 95
Contents .................................................................................................................................................. 95
See Also .................................................................................................................................................. 95
RepositoryAssociation ............................................................................................................................... 96
Contents .................................................................................................................................................. 96
See Also .................................................................................................................................................. 99
RepositoryAssociationSummary ............................................................................................................ 101
Contents ............................................................................................................................................... 101
See Also ................................................................................................................................................ 104
RepositoryHeadSourceCodeType .......................................................................................................... 105
Contents ............................................................................................................................................... 105
See Also ................................................................................................................................................ 105
RequestMetadata ..................................................................................................................................... 106
Contents ............................................................................................................................................... 106
See Also ................................................................................................................................................ 107
RuleMetadata ............................................................................................................................................ 108
Contents ............................................................................................................................................... 108
See Also ................................................................................................................................................ 109
Welcome
This section provides documentation for the Amazon CodeGuru Reviewer API operations. CodeGuru
Reviewer is a service that uses program analysis and machine learning to detect potential defects
that are difficult for developers to find and recommends fixes in your Java and Python code.
By proactively detecting and providing recommendations for addressing code defects and
implementing best practices, CodeGuru Reviewer improves the overall quality and maintainability
of your code base during the code review stage. For more information about CodeGuru Reviewer,
see the Amazon CodeGuru Reviewer User Guide.
To improve the security of your CodeGuru Reviewer API calls, you can establish a private
connection between your VPC and CodeGuru Reviewer by creating an interface VPC endpoint. For
more information, see CodeGuru Reviewer and interface VPC endpoints (AWS PrivateLink) in the
Amazon CodeGuru Reviewer User Guide.
Actions
The following actions are supported:
• AssociateRepository
• CreateCodeReview
• DescribeCodeReview
• DescribeRecommendationFeedback
• DescribeRepositoryAssociation
• DisassociateRepository
• ListCodeReviews
• ListRecommendationFeedback
• ListRecommendations
• ListRepositoryAssociations
• ListTagsForResource
• PutRecommendationFeedback
• TagResource
• UntagResource
AssociateRepository
Use to associate an AWS CodeCommit repository or a repository managed by AWS CodeStar
Connections with Amazon CodeGuru Reviewer. When you associate a repository, CodeGuru
Reviewer reviews source code changes in the repository's pull requests and provides automatic
recommendations. You can view recommendations using the CodeGuru Reviewer console. For
more information, see Recommendations in Amazon CodeGuru Reviewer in the Amazon CodeGuru
Reviewer User Guide.
If you associate a CodeCommit or S3 repository, it must be in the same AWS Region and AWS
account where its CodeGuru Reviewer code reviews are configured.
Bitbucket and GitHub Enterprise Server repositories are managed by AWS CodeStar Connections
to connect to CodeGuru Reviewer. For more information, see Associate a repository in the Amazon
CodeGuru Reviewer User Guide.
Note
You cannot use the CodeGuru Reviewer SDK or the AWS CLI to associate a GitHub
repository with Amazon CodeGuru Reviewer. To associate a GitHub repository, use the
console. For more information, see Getting started with CodeGuru Reviewer in the
CodeGuru Reviewer User Guide.
Request Syntax
{
"ClientRequestToken": "string",
"KMSKeyDetails": {
"EncryptionOption": "string",
"KMSKeyId": "string"
},
"Repository": {
"Bitbucket": {
"ConnectionArn": "string",
"Name": "string",
"Owner": "string"
},
"CodeCommit": {
"Name": "string"
},
"GitHubEnterpriseServer": {
"ConnectionArn": "string",
"Name": "string",
"Owner": "string"
},
"S3Bucket": {
"BucketName": "string",
"Name": "string"
}
},
"Tags": {
"string" : "string"
}
}
Request Body
ClientRequestToken
Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate
repository associations if there are failures and retries.
Type: String
Pattern: ^[\w-]+$
Required: No
KMSKeyDetails
Required: No
Repository
Required: Yes
Tags
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
"RepositoryAssociation": {
"AssociationArn": "string",
"AssociationId": "string",
"ConnectionArn": "string",
"CreatedTimeStamp": number,
"KMSKeyDetails": {
"EncryptionOption": "string",
"KMSKeyId": "string"
},
"LastUpdatedTimeStamp": number,
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"S3RepositoryDetails": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"State": "string",
"StateReason": "string"
},
"Tags": {
"string" : "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
RepositoryAssociation
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The requested operation would cause a conflict with the current state of a service resource
associated with the request. Resolve the conflict before retrying this request.
The server encountered an internal error and is unable to complete the request.
ValidationException
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CreateCodeReview
Use to create a code review with a CodeReviewType of RepositoryAnalysis. This type of code
review analyzes all code under a specified branch in an associated repository. PullRequest code
reviews are automatically triggered by a pull request.
Request Syntax
{
"ClientRequestToken": "string",
"Name": "string",
"RepositoryAssociationArn": "string",
"Type": {
"AnalysisTypes": [ "string" ],
"RepositoryAnalysis": {
"RepositoryHead": {
"BranchName": "string"
},
"SourceCodeType": {
"BranchDiff": {
"DestinationBranchName": "string",
"SourceBranchName": "string"
},
"CommitDiff": {
"DestinationCommit": "string",
"MergeBaseCommit": "string",
"SourceCommit": "string"
},
"RepositoryHead": {
"BranchName": "string"
},
"RequestMetadata": {
"EventInfo": {
"Name": "string",
"State": "string"
},
"Requester": "string",
"RequestId": "string",
"VendorName": "string"
},
"S3BucketRepository": {
"Details": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"Name": "string"
}
}
}
}
}
Request Body
The request accepts the following data in JSON format.
ClientRequestToken
Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code
reviews if there are failures and retries.
Type: String
Pattern: ^[\w-]+$
Required: No
Name
The name of the code review. The name of each code review in your AWS account must be
unique.
Type: String
Pattern: [a-zA-Z0-9-_]*
Required: Yes
RepositoryAssociationArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
A code review can only be created on an associated repository. This is the ARN of the associated
repository.
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
Type
The type of code review to create. This is specified using a CodeReviewType object. You can
create a code review only of type RepositoryAnalysis.
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"CodeReview": {
"AnalysisTypes": [ "string" ],
"AssociationArn": "string",
"CodeReviewArn": "string",
"ConfigFileState": "string",
"CreatedTimeStamp": number,
"LastUpdatedTimeStamp": number,
"Metrics": {
"FindingsCount": number,
"MeteredLinesOfCodeCount": number,
"SuppressedLinesOfCodeCount": number
},
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"PullRequestId": "string",
"RepositoryName": "string",
"SourceCodeType": {
"BranchDiff": {
"DestinationBranchName": "string",
"SourceBranchName": "string"
},
"CommitDiff": {
"DestinationCommit": "string",
"MergeBaseCommit": "string",
"SourceCommit": "string"
},
"RepositoryHead": {
"BranchName": "string"
},
"RequestMetadata": {
"EventInfo": {
"Name": "string",
"State": "string"
},
"Requester": "string",
"RequestId": "string",
"VendorName": "string"
},
"S3BucketRepository": {
"Details": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"Name": "string"
}
},
"State": "string",
"StateReason": "string",
"Type": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
CodeReview
Information about a code review. A code review belongs to the associated repository that
contains the reviewed code.
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The requested operation would cause a conflict with the current state of a service resource
associated with the request. Resolve the conflict before retrying this request.
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
DescribeCodeReview
Returns the metadata associated with the code review along with its status.
Request Syntax
CodeReviewArn
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"CodeReview": {
"AnalysisTypes": [ "string" ],
"AssociationArn": "string",
"CodeReviewArn": "string",
"ConfigFileState": "string",
"CreatedTimeStamp": number,
"LastUpdatedTimeStamp": number,
"Metrics": {
"FindingsCount": number,
"MeteredLinesOfCodeCount": number,
"SuppressedLinesOfCodeCount": number
},
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"PullRequestId": "string",
"RepositoryName": "string",
"SourceCodeType": {
"BranchDiff": {
"DestinationBranchName": "string",
"SourceBranchName": "string"
},
"CommitDiff": {
"DestinationCommit": "string",
"MergeBaseCommit": "string",
"SourceCommit": "string"
},
"RepositoryHead": {
"BranchName": "string"
},
"RequestMetadata": {
"EventInfo": {
"Name": "string",
"State": "string"
},
"Requester": "string",
"RequestId": "string",
"VendorName": "string"
},
"S3BucketRepository": {
"Details": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"Name": "string"
}
},
"State": "string",
"StateReason": "string",
"Type": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
CodeReview
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
DescribeRecommendationFeedback
Describes the customer feedback for a CodeGuru Reviewer recommendation.
Request Syntax
CodeReviewArn
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: Yes
RecommendationId
The recommendation ID that can be used to track the provided recommendations and then to
collect the feedback.
Required: Yes
UserId
Optional parameter to describe the feedback for a given user. If this is not supplied, it defaults
to the user making the request.
The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon
Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and
Access Management User Guide.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"RecommendationFeedback": {
"CodeReviewArn": "string",
"CreatedTimeStamp": number,
"LastUpdatedTimeStamp": number,
"Reactions": [ "string" ],
"RecommendationId": "string",
"UserId": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
RecommendationFeedback
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
InternalServerException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
DescribeRepositoryAssociation
Returns a RepositoryAssociation object that contains information about the requested repository
association.
Request Syntax
AssociationArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
Request Body
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"RepositoryAssociation": {
"AssociationArn": "string",
"AssociationId": "string",
"ConnectionArn": "string",
"CreatedTimeStamp": number,
"KMSKeyDetails": {
"EncryptionOption": "string",
"KMSKeyId": "string"
},
"LastUpdatedTimeStamp": number,
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"S3RepositoryDetails": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"State": "string",
"StateReason": "string"
},
"Tags": {
"string" : "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
RepositoryAssociation
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
DisassociateRepository
Removes the association between Amazon CodeGuru Reviewer and a repository.
Request Syntax
AssociationArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"RepositoryAssociation": {
"AssociationArn": "string",
"AssociationId": "string",
"ConnectionArn": "string",
"CreatedTimeStamp": number,
"KMSKeyDetails": {
"EncryptionOption": "string",
"KMSKeyId": "string"
},
"LastUpdatedTimeStamp": number,
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"S3RepositoryDetails": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"State": "string",
"StateReason": "string"
},
"Tags": {
"string" : "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
RepositoryAssociation
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The requested operation would cause a conflict with the current state of a service resource
associated with the request. Resolve the conflict before retrying this request.
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ListCodeReviews
Lists all the code reviews that the customer has created in the past 90 days.
Request Syntax
GET /codereviews?
MaxResults=MaxResults&NextToken=NextToken&ProviderTypes=ProviderTypes&RepositoryNames=Repositor
HTTP/1.1
MaxResults
The maximum number of results that are returned per call. The default is 100.
If nextToken is returned, there are more results available. The value of nextToken is a unique
pagination token for each page. Make the call again using the returned token to retrieve the
next page. Keep all other arguments unchanged.
List of provider types for filtering that needs to be applied before displaying the result. For
example, providerTypes=[GitHub] lists code reviews from GitHub.
List of repository names for filtering that needs to be applied before displaying the result.
Pattern: ^\S[\w.-]*$
States
List of states for filtering that needs to be applied before displaying the result. For example,
states=[Pending] lists code reviews in the Pending state.
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"CodeReviewSummaries": [
{
"CodeReviewArn": "string",
"CreatedTimeStamp": number,
"LastUpdatedTimeStamp": number,
"MetricsSummary": {
"FindingsCount": number,
"MeteredLinesOfCodeCount": number,
"SuppressedLinesOfCodeCount": number
},
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"PullRequestId": "string",
"RepositoryName": "string",
"SourceCodeType": {
"BranchDiff": {
"DestinationBranchName": "string",
"SourceBranchName": "string"
},
"CommitDiff": {
"DestinationCommit": "string",
"MergeBaseCommit": "string",
"SourceCommit": "string"
},
"RepositoryHead": {
"BranchName": "string"
},
"RequestMetadata": {
"EventInfo": {
"Name": "string",
"State": "string"
},
"Requester": "string",
"RequestId": "string",
"VendorName": "string"
},
"S3BucketRepository": {
"Details": {
"BucketName": "string",
"CodeArtifacts": {
"BuildArtifactsObjectKey": "string",
"SourceCodeArtifactsObjectKey": "string"
}
},
"Name": "string"
}
},
"State": "string",
"Type": "string"
}
],
"NextToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
CodeReviewSummaries
Pagination token.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ListRecommendationFeedback
Returns a list of RecommendationFeedbackSummary objects that contain customer
recommendation feedback for all CodeGuru Reviewer users.
Request Syntax
GET /feedback/CodeReviewArn/RecommendationFeedback?
MaxResults=MaxResults&NextToken=NextToken&RecommendationIds=RecommendationIds&UserIds=UserIds
HTTP/1.1
CodeReviewArn
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: Yes
MaxResults
The maximum number of results that are returned per call. The default is 100.
If nextToken is returned, there are more results available. The value of nextToken is a unique
pagination token for each page. Make the call again using the returned token to retrieve the
next page. Keep all other arguments unchanged.
An AWS user's account ID or Amazon Resource Name (ARN). Use this ID to query the
recommendation feedback for a code review from that user.
The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon
Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and
Access Management User Guide.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"NextToken": "string",
"RecommendationFeedbackSummaries": [
{
"Reactions": [ "string" ],
"RecommendationId": "string",
"UserId": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
NextToken
If nextToken is returned, there are more results available. The value of nextToken is a unique
pagination token for each page. Make the call again using the returned token to retrieve the
next page. Keep all other arguments unchanged.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
ValidationException
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ListRecommendations
Returns the list of all recommendations for a completed code review.
Request Syntax
GET /codereviews/CodeReviewArn/Recommendations?
MaxResults=MaxResults&NextToken=NextToken HTTP/1.1
CodeReviewArn
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: Yes
MaxResults
The maximum number of results that are returned per call. The default is 100.
Pagination token.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"NextToken": "string",
"RecommendationSummaries": [
{
"Description": "string",
"EndLine": number,
"FilePath": "string",
"RecommendationCategory": "string",
"RecommendationId": "string",
"RuleMetadata": {
"LongDescription": "string",
"RuleId": "string",
"RuleName": "string",
"RuleTags": [ "string" ],
"ShortDescription": "string"
},
"Severity": "string",
"StartLine": number
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
NextToken
Pagination token.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ListRepositoryAssociations
Returns a list of RepositoryAssociationSummary objects that contain summary information about a
repository association. You can filter the returned list by ProviderType, Name, State, and Owner.
Request Syntax
GET /associations?
MaxResults=MaxResults&Name=Names&NextToken=NextToken&Owner=Owners&ProviderType=ProviderTypes&St
HTTP/1.1
MaxResults
Names
Pattern: ^\S[\w.-]*$
NextToken
Note
Treat this token as an opaque identifier that is only used to retrieve the next items in a
list and not for other programmatic purposes.
List of owners to use as a filter. For AWS CodeCommit, it is the name of the CodeCommit
account that was used to associate the repository. For other repository source providers, such as
Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate
the repository.
Pattern: ^\S(.*\S)?$
ProviderTypes
• Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru
Reviewer review.
Note
If your repository ProviderType is GitHub, GitHub Enterprise Server, or
Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger
CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your
repository cannot be triggered.
• Setting up source code access. This is required for CodeGuru Reviewer to securely clone
code in your repository.
• Failed: The repository failed to associate or disassociate.
• Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and
source code access.
• Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create
a new association with this repository if you want to review source code in it later. You can
control access to code reviews created in anassociated repository with tags after it has
been disassociated. For more information, see Using tags to control access to associated
repositories in the Amazon CodeGuru Reviewer User Guide.
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"NextToken": "string",
"RepositoryAssociationSummaries": [
{
"AssociationArn": "string",
"AssociationId": "string",
"ConnectionArn": "string",
"LastUpdatedTimeStamp": number,
"Name": "string",
"Owner": "string",
"ProviderType": "string",
"State": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
NextToken
The nextToken value to include in a future ListRecommendations request. When the results
of a ListRecommendations request exceed maxResults, this value can be used to retrieve
the next page of results. This value is null when there are no more results to return.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
InternalServerException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ListTagsForResource
Returns the list of tags associated with an associated repository resource.
Request Syntax
resourceArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
Request Body
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"Tags": {
"string" : "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
Tags
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Errors
For information about the errors that are common to all actions, see Common Errors.
InternalServerException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
PutRecommendationFeedback
Stores customer feedback for a CodeGuru Reviewer recommendation. When this API is called again
with different reactions the previous feedback is overwritten.
Request Syntax
{
"CodeReviewArn": "string",
"Reactions": [ "string" ],
"RecommendationId": "string"
}
Request Body
The request accepts the following data in JSON format.
CodeReviewArn
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: Yes
Reactions
List for storing reactions. Reactions are utf-8 text code for emojis. If you send an empty list it
clears all your feedback.
Required: Yes
RecommendationId
The recommendation ID that can be used to track the provided recommendations and then to
collect the feedback.
Type: String
Required: Yes
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
TagResource
Adds one or more tags to an associated repository.
Request Syntax
{
"Tags": {
"string" : "string"
}
}
resourceArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
Request Body
Tags
An array of key-value pairs used to tag an associated repository. A tag is a custom attribute
label with two parts:
• A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case
sensitive.
• An optional field known as a tag value (for example, 111122223333, Production, or a team
name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values
are case sensitive.
Required: Yes
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
InternalServerException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
UntagResource
Removes a tag from an associated repository.
Request Syntax
resourceArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: Yes
TagKeys
A list of the keys for each tag you want to remove from an associated repository.
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
InternalServerException
The server encountered an internal error and is unable to complete the request.
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
Data Types
The Amazon CodeGuru Reviewer API contains several data types that various actions use. This
section describes each data type in detail.
Note
The order of each element in a data type structure is not guaranteed. Applications should
not assume a particular order.
• BranchDiffSourceCodeType
• CodeArtifacts
• CodeCommitRepository
• CodeReview
• CodeReviewSummary
• CodeReviewType
• CommitDiffSourceCodeType
• EventInfo
• KMSKeyDetails
• Metrics
• MetricsSummary
• RecommendationFeedback
• RecommendationFeedbackSummary
• RecommendationSummary
• Repository
• RepositoryAnalysis
• RepositoryAssociation
• RepositoryAssociationSummary
• RepositoryHeadSourceCodeType
• RequestMetadata
• RuleMetadata
• S3BucketRepository
• S3Repository
• S3RepositoryDetails
• SourceCodeType
• ThirdPartySourceRepository
BranchDiffSourceCodeType
A type of SourceCodeType that specifies a code diff between a source and destination branch in an
associated repository.
Contents
DestinationBranchName
Type: String
Required: Yes
SourceBranchName
Type: String
Required: Yes
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CodeArtifacts
Code artifacts are source code artifacts and build artifacts used in a repository analysis or a pull
request review.
• Source code artifacts are source code files in a Git repository that are compressed into a .zip file.
• Build artifacts are .jar or .class files that are compressed in a .zip file.
Contents
SourceCodeArtifactsObjectKey
The S3 object key for a source code .zip file. This is required for all code reviews.
Type: String
Pattern: ^\S(.*\S)?$
Required: Yes
BuildArtifactsObjectKey
The S3 object key for a build artifacts .zip file that contains .jar or .class files. This is required for
a code review with security analysis. For more information, see Create code reviews with GitHub
Actions in the Amazon CodeGuru Reviewer User Guide.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CodeCommitRepository
Information about an AWS CodeCommit repository. The CodeCommit repository must be in the
same AWS Region and AWS account where its CodeGuru Reviewer code reviews are configured.
Contents
Name
The name of the AWS CodeCommit repository. For more information, see repositoryName in
the AWS CodeCommit API Reference.
Type: String
Pattern: ^\S[\w.-]*$
Required: Yes
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CodeReview
Information about a code review. A code review belongs to the associated repository that contains
the reviewed code.
Contents
AnalysisTypes
The types of analysis performed during a repository analysis or a pull request review. You can
specify either Security, CodeQuality, or both.
Required: No
AssociationArn
The Amazon Resource Name (ARN) of the RepositoryAssociation that contains the reviewed
source code. You can retrieve associated repository ARNs by calling ListRepositoryAssociations.
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:association:[a-
f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
Required: No
CodeReviewArn
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: No
ConfigFileState
Type: String
Required: No
CreatedTimeStamp
The time, in milliseconds since the epoch, when the code review was created.
Type: Timestamp
Required: No
LastUpdatedTimeStamp
The time, in milliseconds since the epoch, when the code review was last updated.
Type: Timestamp
Required: No
Metrics
Required: No
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: No
Owner
The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID
of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket
repository, this is the username for the account that owns the repository. For an S3 repository, it
can be the username or AWS account ID.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
ProviderType
The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).
Type: String
Required: No
PullRequestId
Type: String
Required: No
RepositoryName
Type: String
Pattern: ^\S[\w.-]*$
Required: No
SourceCodeType
Required: No
State
Type: String
Required: No
StateReason
Type: String
Required: No
Type
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CodeReviewSummary
Information about the summary of the code review.
Contents
CodeReviewArn
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: No
CreatedTimeStamp
The time, in milliseconds since the epoch, when the code review was created.
Type: Timestamp
Required: No
LastUpdatedTimeStamp
The time, in milliseconds since the epoch, when the code review was last updated.
Type: Timestamp
Required: No
MetricsSummary
Required: No
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: No
Owner
The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID
of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket
repository, this is the username for the account that owns the repository. For an S3 repository, it
can be the username or AWS account ID.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
ProviderType
Type: String
Required: No
PullRequestId
Type: String
Required: No
RepositoryName
Type: String
Pattern: ^\S[\w.-]*$
Required: No
SourceCodeType
Required: No
State
Type: String
Required: No
Type
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CodeReviewType
The type of a code review. There are two code review types:
Contents
RepositoryAnalysis
A code review that analyzes all code under a specified branch in an associated repository. The
associated repository is specified using its ARN in CreateCodeReview.
Required: Yes
AnalysisTypes
They types of analysis performed during a repository analysis or a pull request review. You can
specify either Security, CodeQuality, or both.
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
CommitDiffSourceCodeType
A type of SourceCodeType that specifies the commit diff for a pull request on an associated
repository. The SourceCommit and DestinationCommit fields are required to do a pull request
code review.
Contents
DestinationCommit
The SHA of the destination commit used to generate a commit diff. This field is required for a
pull request code review.
Type: String
Required: No
MergeBaseCommit
Type: String
Required: No
SourceCommit
The SHA of the source commit used to generate a commit diff. This field is required for a pull
request code review.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
EventInfo
Information about an event. The event might be a push, pull request, scheduled request, or
another type of event.
Contents
Name
The name of the event. The possible names are pull_request, workflow_dispatch,
schedule, and push
Type: String
Pattern: ^[ \-A-Z_a-z]+$
Required: No
State
The state of an event. The state might be open, closed, or another state.
Type: String
Pattern: ^[ \-A-Z_a-z]+$
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
KMSKeyDetails
An object that contains:
• The encryption option for a repository association. It is either owned by AWS Key Management
Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).
• The ID of the AWS KMS key that is associated with a repository association.
Contents
EncryptionOption
The encryption option for a repository association. It is either owned by AWS Key Management
Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).
Type: String
Required: No
KMSKeyId
The ID of the AWS KMS key that is associated with a repository association.
Type: String
Pattern: [a-zA-Z0-9-]+
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
Metrics
Information about the statistics from the code review.
Contents
FindingsCount
Type: Long
Required: No
MeteredLinesOfCodeCount
MeteredLinesOfCodeCount is the number of lines of code in the repository where the code
review happened. This does not include non-code lines such as comments and blank lines.
Type: Long
Required: No
SuppressedLinesOfCodeCount
Type: Long
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
MetricsSummary
Information about metrics summaries.
Contents
FindingsCount
Type: Long
Required: No
MeteredLinesOfCodeCount
Lines of code metered in the code review. For the initial code review pull request and all
subsequent revisions, this includes all lines of code in the files added to the pull request. In
subsequent revisions, for files that already existed in the pull request, this includes only the
changed lines of code. In both cases, this does not include non-code lines such as comments
and import statements. For example, if you submit a pull request containing 5 files, each with
500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and
also modified a total of 25 lines across the initial 5 files, MeteredLinesOfCodeCount includes
the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code
for a total of 2,725 lines of code.
Type: Long
Required: No
SuppressedLinesOfCodeCount
Lines of code suppressed in the code review based on the excludeFiles element in the aws-
codeguru-reviewer.yml file. For full repository analyses, this number includes all lines of
code in the files that are suppressed. For pull requests, this number only includes the changed
lines of code that are suppressed. In both cases, this number does not include non-code lines
such as comments and import statements. For example, if you initiate a full repository analysis
on a repository containing 5 files, each file with 100 lines of code, and 2 files are listed as
excluded in the aws-codeguru-reviewer.yml file, then SuppressedLinesOfCodeCount
returns 200 (2 * 100) as the total number of lines of code suppressed. However, if you submit
a pull request for the same repository, then SuppressedLinesOfCodeCount only includes
the lines in the 2 files that changed. If only 1 of the 2 files changed in the pull request, then
SuppressedLinesOfCodeCount returns 100 (1 * 100) as the total number of lines of code
suppressed.
Type: Long
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RecommendationFeedback
Information about the recommendation feedback.
Contents
CodeReviewArn
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: No
CreatedTimeStamp
Type: Timestamp
Required: No
LastUpdatedTimeStamp
Type: Timestamp
Required: No
Reactions
List for storing reactions. Reactions are utf-8 text code for emojis. You can send an empty list to
clear off all your feedback.
Required: No
RecommendationId
The recommendation ID that can be used to track the provided recommendations. Later on it
can be used to collect the feedback.
Type: String
Required: No
UserId
The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon
Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and
Access Management User Guide.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RecommendationFeedbackSummary
Information about recommendation feedback summaries.
Contents
Reactions
List for storing reactions. Reactions are utf-8 text code for emojis.
Required: No
RecommendationId
The recommendation ID that can be used to track the provided recommendations. Later on it
can be used to collect the feedback.
Type: String
Required: No
UserId
The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon
Resource Name (ARN). For more information, see Specifying a Principal in the AWS Identity and
Access Management User Guide.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RecommendationSummary
Information about recommendations.
Contents
Description
A description of the recommendation generated by CodeGuru Reviewer for the lines of code
between the start line and the end line.
Type: String
Required: No
EndLine
Last line where the recommendation is applicable in the source commit or source branch. For a
single line comment the start line and end line values are the same.
Type: Integer
Required: No
FilePath
Type: String
Required: No
RecommendationCategory
Type: String
Required: No
RecommendationId
The recommendation ID that can be used to track the provided recommendations. Later on it
can be used to collect the feedback.
Type: String
Required: No
RuleMetadata
Metadata about a rule. Rule metadata includes an ID, a name, a list of tags, and a short and
long description. CodeGuru Reviewer uses rules to analyze code. A rule's recommendation is
included in analysis results if code is detected that violates the rule.
Required: No
Severity
The severity of the issue in the code that generated this recommendation.
Type: String
Required: No
StartLine
Start line from where the recommendation is applicable in the source commit or source branch.
Type: Integer
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
Repository
Information about an associated AWS CodeCommit repository or an associated repository that is
managed by AWS CodeStar Connections (for example, Bitbucket). This Repository object is not
used if your source code is in an associated GitHub repository.
Contents
Bitbucket
Required: No
CodeCommit
Required: No
GitHubEnterpriseServer
Required: No
S3Bucket
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RepositoryAnalysis
A code review type that analyzes all code under a specified branch in an associated repository. The
associated repository is specified using its ARN when you call CreateCodeReview.
Contents
RepositoryHead
Required: No
SourceCodeType
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RepositoryAssociation
Information about a repository association. The DescribeRepositoryAssociation operation returns a
RepositoryAssociation object.
Contents
AssociationArn
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: No
AssociationId
Type: String
Required: No
ConnectionArn
The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format
is arn:aws:codestar-connections:region-id:aws-account_id:connection/
connection-id. For more information, see Connection in the AWS CodeStar Connections API
Reference.
Type: String
Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+
Required: No
CreatedTimeStamp
The time, in milliseconds since the epoch, when the repository association was created.
Type: Timestamp
Required: No
KMSKeyDetails
Required: No
LastUpdatedTimeStamp
The time, in milliseconds since the epoch, when the repository association was last updated.
Type: Timestamp
Required: No
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: No
Owner
The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID
of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket
repository, this is the username for the account that owns the repository. For an S3 repository, it
can be the username or AWS account ID.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
ProviderType
Type: String
Required: No
S3RepositoryDetails
Specifies the name of an S3 bucket and a CodeArtifacts object that contains the S3 object
keys for a source code .zip file and for a build artifacts .zip file that contains .jar or .class files.
Required: No
State
Note
If your repository ProviderType is GitHub, GitHub Enterprise Server, or
Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger
CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your
repository cannot be triggered.
• Setting up source code access. This is required for CodeGuru Reviewer to securely clone
code in your repository.
• Failed: The repository failed to associate or disassociate.
• Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and
source code access.
• Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create
a new association with this repository if you want to review source code in it later. You can
control access to code reviews created in anassociated repository with tags after it has
been disassociated. For more information, see Using tags to control access to associated
repositories in the Amazon CodeGuru Reviewer User Guide.
Type: String
Required: No
StateReason
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RepositoryAssociationSummary
Summary information about a repository association. The ListRepositoryAssociations operation
returns a list of RepositoryAssociationSummary objects.
Contents
AssociationArn
The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this
ARN by calling ListRepositoryAssociations.
Type: String
Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
Required: No
AssociationId
Type: String
Required: No
ConnectionArn
The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format
is arn:aws:codestar-connections:region-id:aws-account_id:connection/
connection-id. For more information, see Connection in the AWS CodeStar Connections API
Reference.
Type: String
Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+
Required: No
LastUpdatedTimeStamp
The time, in milliseconds since the epoch, since the repository association was last updated.
Type: Timestamp
Required: No
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: No
Owner
The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID
of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket
repository, this is the username for the account that owns the repository. For an S3 repository, it
can be the username or AWS account ID.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
ProviderType
Type: String
Required: No
State
• Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru
Reviewer review.
Note
If your repository ProviderType is GitHub, GitHub Enterprise Server, or
Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger
CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your
repository cannot be triggered.
• Setting up source code access. This is required for CodeGuru Reviewer to securely clone
code in your repository.
• Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and
source code access.
• Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create
a new association with this repository if you want to review source code in it later. You can
control access to code reviews created in anassociated repository with tags after it has
been disassociated. For more information, see Using tags to control access to associated
repositories in the Amazon CodeGuru Reviewer User Guide.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RepositoryHeadSourceCodeType
A SourceCodeType that specifies the tip of a branch in an associated repository.
Contents
BranchName
Type: String
Required: Yes
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RequestMetadata
Metadata that is associated with a code review. This applies to both pull request and repository
analysis code reviews.
Contents
EventInfo
Required: No
Requester
An identifier, such as a name or account ID, that is associated with the requester. The
Requester is used to capture the author/actor name of the event request.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
RequestId
The ID of the request. This is required for a pull request code review.
Type: String
Required: No
VendorName
The name of the repository vendor used to upload code to an S3 bucket for a CI/CD code
review. For example, if code and artifacts are uploaded to an S3 bucket for a CI/CD code review
by GitHub scripts from a GitHub repository, then the repository association's ProviderType
is S3Bucket and the CI/CD repository vendor name is GitHub. For more information, see the
definition for ProviderType in RepositoryAssociation.
Type: String
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
RuleMetadata
Metadata about a rule. Rule metadata includes an ID, a name, a list of tags, and a short and long
description. CodeGuru Reviewer uses rules to analyze code. A rule's recommendation is included in
analysis results if code is detected that violates the rule.
Contents
LongDescription
Type: String
Pattern: ^\S(.*\S)?$
Required: No
RuleId
Type: String
Pattern: ^\S+\/[a-zA-Z0-9-]+@v\d+\.\d+$
Required: No
RuleName
Type: String
Pattern: ^\S(.*\S)?$
Required: No
RuleTags
Pattern: ^\S(.*\S)?$
Required: No
ShortDescription
Type: String
Pattern: ^\S(.*\S)?$
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
S3BucketRepository
Information about an associated repository in an S3 bucket. The associated repository contains a
source code .zip file and a build artifacts .zip file that contains .jar or .class files.
Contents
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: Yes
Details
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
S3Repository
Information about a repository in an S3 bucket.
Contents
BucketName
The name of the S3 bucket used for associating a new S3 repository. It must begin with
codeguru-reviewer-.
Type: String
Pattern: ^\S(.*\S)?$
Required: Yes
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: Yes
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
S3RepositoryDetails
Specifies the name of an S3 bucket and a CodeArtifacts object that contains the S3 object keys
for a source code .zip file and for a build artifacts .zip file that contains .jar or .class files.
Contents
BucketName
The name of the S3 bucket used for associating a new S3 repository. It must begin with
codeguru-reviewer-.
Type: String
Pattern: ^\S(.*\S)?$
Required: No
CodeArtifacts
A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for a source
code .zip file and for a build artifacts .zip file that contains .jar or .class files.
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
SourceCodeType
Specifies the source code that is analyzed in a code review.
Contents
BranchDiff
A type of SourceCodeType that specifies a source branch name and a destination branch name
in an associated repository.
Required: No
CommitDiff
Required: No
RepositoryHead
Required: No
RequestMetadata
Metadata that is associated with a code review. This applies to any type of code review
supported by CodeGuru Reviewer. The RequestMetadaa field captures any event metadata.
For example, it might capture metadata associated with an event trigger, such as a push or a
pull request.
Required: No
S3BucketRepository
Information about an associated repository in an S3 bucket that includes its name and an
S3RepositoryDetails object. The S3RepositoryDetails object includes the name of
an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file.
S3BucketRepository is required in SourceCodeType for S3BucketRepository based code
reviews.
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
ThirdPartySourceRepository
Information about a third-party source repository connected to CodeGuru Reviewer.
Contents
ConnectionArn
The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format
is arn:aws:codestar-connections:region-id:aws-account_id:connection/
connection-id. For more information, see Connection in the AWS CodeStar Connections API
Reference.
Type: String
Pattern: arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+
Required: Yes
Name
Type: String
Pattern: ^\S[\w.-]*$
Required: Yes
Owner
The owner of the repository. For a GitHub, GitHub Enterprise, or Bitbucket repository, this is
the username for the account that owns the repository. For an S3 repository, this can be the
username or AWS account ID
Type: String
Pattern: ^\S(.*\S)?$
Required: Yes
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the
following:
Common Parameters
The following list contains the parameters that all actions use for signing Signature Version 4
requests with a query string. Any action-specific parameters are listed in the topic for that action.
For more information about Signature Version 4, see Signing AWS API requests in the IAM User
Guide.
Action
Type: string
Required: Yes
Version
The API version that the request is written for, expressed in the format YYYY-MM-DD.
Type: string
Required: Yes
X-Amz-Algorithm
The hash algorithm that you used to create the request signature.
Condition: Specify this parameter when you include authentication information in a query
string instead of in the HTTP authorization header.
Type: string
Required: Conditional
X-Amz-Credential
The credential scope value, which is a string that includes your access key, the date, the region
you are targeting, the service you are requesting, and a termination string ("aws4_request").
The value is expressed in the following format: access_key/YYYYMMDD/region/service/
aws4_request.
For more information, see Create a signed AWS API request in the IAM User Guide.
Condition: Specify this parameter when you include authentication information in a query
string instead of in the HTTP authorization header.
Type: string
Required: Conditional
X-Amz-Date
The date that is used to create the signature. The format must be ISO 8601 basic format
(YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value:
20120325T120000Z.
Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for
signing requests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not
required. When X-Amz-Date is used, it always overrides the value of the Date header. For more
information, see Elements of an AWS API request signature in the IAM User Guide.
Type: string
Required: Conditional
X-Amz-Security-Token
The temporary security token that was obtained through a call to AWS Security Token Service
(AWS STS). For a list of services that support temporary security credentials from AWS STS, see
AWS services that work with IAM in the IAM User Guide.
Condition: If you're using temporary security credentials from AWS STS, you must include the
security token.
Type: string
Required: Conditional
X-Amz-Signature
Specifies the hex-encoded signature that was calculated from the string to sign and the derived
signing key.
Condition: Specify this parameter when you include authentication information in a query
string instead of in the HTTP authorization header.
Type: string
Required: Conditional
X-Amz-SignedHeaders
Specifies all the HTTP headers that were included as part of the canonical request. For more
information about specifying signed headers, see Create a signed AWS API request in the IAM
User Guide.
Condition: Specify this parameter when you include authentication information in a query
string instead of in the HTTP authorization header.
Type: string
Required: Conditional
Common Errors
This section lists the errors common to the API actions of all AWS services. For errors specific to an
API action for this service, see the topic for that API action.
AccessDeniedException
The request processing has failed because of an unknown error, exception or failure.
Problems with the request at the HTTP level, e.g. we can't decompress the body according to
the decompression algorithm specified by the content-encoding.
Convenient exception that can be used when a request is aborted before a reply is sent back
(e.g. client closed connection).
Problems with the request at the HTTP level. The request entity is too large.
The request reached the service more than 15 minutes after the date stamp on the request or
more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the
date stamp on the request is more than 15 minutes in the future.
Problems with the request at the HTTP level. Reading the Request timed out.
The X.509 certificate or AWS access key ID provided does not exist in our records.
UnknownOperationException
The action or operation requested is invalid. Verify that the action is typed correctly.