• 沒有找到結果。

Amazon CodeGuru Reviewer

N/A
N/A
Protected

Academic year: 2022

Share "Amazon CodeGuru Reviewer"

Copied!
95
0
0

加載中.... (立即查看全文)

全文

(1)

Amazon CodeGuru Reviewer

API Reference

API Version 2019-09-19

(2)

Amazon CodeGuru Reviewer: API Reference

Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

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.

(3)

Table of Contents

Welcome ... 1

Actions ... 2

AssociateRepository ... 3

Request Syntax ... 3

URI Request Parameters ... 3

Request Body ... 4

Response Syntax ... 4

Response Elements ... 5

Errors ... 5

See Also ... 6

CreateCodeReview ... 7

Request Syntax ... 7

URI Request Parameters ... 7

Request Body ... 8

Response Syntax ... 8

Response Elements ... 9

Errors ... 10

See Also ... 10

DescribeCodeReview ... 11

Request Syntax ... 11

URI Request Parameters ... 11

Request Body ... 11

Response Syntax ... 11

Response Elements ... 12

Errors ... 12

See Also ... 13

DescribeRecommendationFeedback ... 14

Request Syntax ... 14

URI Request Parameters ... 14

Request Body ... 14

Response Syntax ... 14

Response Elements ... 15

Errors ... 15

See Also ... 15

DescribeRepositoryAssociation ... 17

Request Syntax ... 17

URI Request Parameters ... 17

Request Body ... 17

Response Syntax ... 17

Response Elements ... 18

Errors ... 18

See Also ... 19

DisassociateRepository ... 20

Request Syntax ... 20

URI Request Parameters ... 20

Request Body ... 20

Response Syntax ... 20

Response Elements ... 21

Errors ... 21

See Also ... 22

ListCodeReviews ... 23

Request Syntax ... 23

URI Request Parameters ... 23

Request Body ... 24

(4)

Response Syntax ... 24

Response Elements ... 25

Errors ... 25

See Also ... 26

ListRecommendationFeedback ... 27

Request Syntax ... 27

URI Request Parameters ... 27

Request Body ... 28

Response Syntax ... 28

Response Elements ... 28

Errors ... 28

See Also ... 29

ListRecommendations ... 30

Request Syntax ... 30

URI Request Parameters ... 30

Request Body ... 30

Response Syntax ... 30

Response Elements ... 31

Errors ... 31

See Also ... 32

ListRepositoryAssociations ... 33

Request Syntax ... 33

URI Request Parameters ... 33

Request Body ... 34

Response Syntax ... 34

Response Elements ... 35

Errors ... 35

See Also ... 35

ListTagsForResource ... 37

Request Syntax ... 37

URI Request Parameters ... 37

Request Body ... 37

Response Syntax ... 37

Response Elements ... 37

Errors ... 38

See Also ... 38

PutRecommendationFeedback ... 39

Request Syntax ... 39

URI Request Parameters ... 39

Request Body ... 39

Response Syntax ... 40

Response Elements ... 40

Errors ... 40

See Also ... 40

TagResource ... 42

Request Syntax ... 42

URI Request Parameters ... 42

Request Body ... 42

Response Syntax ... 43

Response Elements ... 43

Errors ... 43

See Also ... 43

UntagResource ... 44

Request Syntax ... 44

URI Request Parameters ... 44

Request Body ... 44

Response Syntax ... 44

(5)

Response Elements ... 44

Errors ... 44

See Also ... 45

Data Types ... 46

BranchDiffSourceCodeType ... 47

Contents ... 47

See Also ... 47

CodeArtifacts ... 48

Contents ... 48

See Also ... 48

CodeCommitRepository ... 49

Contents ... 49

See Also ... 49

CodeReview ... 50

Contents ... 50

See Also ... 52

CodeReviewSummary ... 53

Contents ... 53

See Also ... 55

CodeReviewType ... 56

Contents ... 56

See Also ... 56

CommitDiffSourceCodeType ... 57

Contents ... 57

See Also ... 57

EventInfo ... 58

Contents ... 58

See Also ... 58

KMSKeyDetails ... 59

Contents ... 59

See Also ... 59

Metrics ... 60

Contents ... 60

See Also ... 60

MetricsSummary ... 61

Contents ... 61

See Also ... 61

RecommendationFeedback ... 62

Contents ... 62

See Also ... 63

RecommendationFeedbackSummary ... 64

Contents ... 64

See Also ... 64

RecommendationSummary ... 65

Contents ... 65

See Also ... 66

Repository ... 67

Contents ... 67

See Also ... 67

RepositoryAnalysis ... 68

Contents ... 68

See Also ... 68

RepositoryAssociation ... 69

Contents ... 69

See Also ... 71

RepositoryAssociationSummary ... 72

Contents ... 72

(6)

See Also ... 74

RepositoryHeadSourceCodeType ... 75

Contents ... 75

See Also ... 75

RequestMetadata ... 76

Contents ... 76

See Also ... 76

RuleMetadata ... 78

Contents ... 78

See Also ... 79

S3BucketRepository ... 80

Contents ... 80

See Also ... 80

S3Repository ... 81

Contents ... 81

See Also ... 81

S3RepositoryDetails ... 82

Contents ... 82

See Also ... 82

SourceCodeType ... 83

Contents ... 83

See Also ... 83

ThirdPartySourceRepository ... 85

Contents ... 85

See Also ... 85

Common Parameters ... 86

Common Errors ... 88

(7)

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.

This document was last published on March 6, 2022.

(8)

Actions

The following actions are supported:

• AssociateRepository (p. 3)

• CreateCodeReview (p. 7)

• DescribeCodeReview (p. 11)

• DescribeRecommendationFeedback (p. 14)

• DescribeRepositoryAssociation (p. 17)

• DisassociateRepository (p. 20)

• ListCodeReviews (p. 23)

• ListRecommendationFeedback (p. 27)

• ListRecommendations (p. 30)

• ListRepositoryAssociations (p. 33)

• ListTagsForResource (p. 37)

• PutRecommendationFeedback (p. 39)

• TagResource (p. 42)

• UntagResource (p. 44)

(9)

AssociateRepository

AssociateRepository

Use to associate an AWS CodeCommit repository or a repostory 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.

NoteYou 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

POST /associations HTTP/1.1 Content-type: application/json { "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"

} }

URI Request Parameters

The request does not use any URI parameters.

(10)

Request Body

Request Body

The request accepts the following data in JSON format.

ClientRequestToken (p. 3)

Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate repository associations if there are failures and retries.

Type: String

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

Pattern: ^[\w-]+$

Required: No KMSKeyDetails (p. 3)

A KMSKeyDetails object that contains:

• The encryption option for this 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 this respository association.

Type: KMSKeyDetails (p. 59) object Required: No

Repository (p. 3)

The repository to associate.

Type: Repository (p. 67) object Required: Yes

Tags (p. 3)

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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 200

Content-type: application/json {

(11)

Response Elements

"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.

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

RepositoryAssociation (p. 4)

Information about the repository association.

Type: RepositoryAssociation (p. 69) object Tags (p. 4)

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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Errors

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

(12)

See Also

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 ConflictException

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.

HTTP Status Code: 409 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(13)

CreateCodeReview

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

POST /codereviews HTTP/1.1 Content-type: application/json {

"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"

} } } }}

URI Request Parameters

The request does not use any URI parameters.

(14)

Request Body

Request Body

The request accepts the following data in JSON format.

ClientRequestToken (p. 7)

Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.

Type: String

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

Pattern: ^[\w-]+$

Required: No Name (p. 7)

The name of the code review. The name of each code review in your AWS account must be unique.

Type: String

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

Pattern: [a-zA-Z0-9-_]*

Required: Yes

RepositoryAssociationArn (p. 7)

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

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

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 (p. 7)

The type of code review to create. This is specified using a CodeReviewType object. You can create a code review only of type RepositoryAnalysis.

Type: CodeReviewType (p. 56) object Required: Yes

Response Syntax

HTTP/1.1 200

Content-type: application/json {

(15)

Response Elements

"CodeReview": {

"AnalysisTypes": [ "string" ], "AssociationArn": "string", "CodeReviewArn": "string", "CreatedTimeStamp": number, "LastUpdatedTimeStamp": number, "Metrics": {

"FindingsCount": number,

"MeteredLinesOfCodeCount": 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.

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

CodeReview (p. 8)

Information about a code review. A code review belongs to the associated repository that contains the reviewed code.

(16)

Errors

Type: CodeReview (p. 50) object

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 ConflictException

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.

HTTP Status Code: 409 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(17)

DescribeCodeReview

DescribeCodeReview

Returns the metadata associated with the code review along with its status.

Request Syntax

GET /codereviews/CodeReviewArn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

CodeReviewArn (p. 11)

The Amazon Resource Name (ARN) of the CodeReview object.

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

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", "CreatedTimeStamp": number, "LastUpdatedTimeStamp": number, "Metrics": {

"FindingsCount": number,

"MeteredLinesOfCodeCount": number },

"Name": "string", "Owner": "string",

"ProviderType": "string", "PullRequestId": "string", "RepositoryName": "string", "SourceCodeType": { "BranchDiff": {

"DestinationBranchName": "string", "SourceBranchName": "string"

},

"CommitDiff": {

"DestinationCommit": "string", "MergeBaseCommit": "string", "SourceCommit": "string"

(18)

Response Elements

},

"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.

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

CodeReview (p. 11)

Information about the code review.

Type: CodeReview (p. 50) object

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

(19)

See Also

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(20)

DescribeRecommendationFeedback

DescribeRecommendationFeedback

Describes the customer feedback for a CodeGuru Reviewer recommendation.

Request Syntax

GET /feedback/CodeReviewArn?RecommendationId=RecommendationId&UserId=UserId HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

CodeReviewArn (p. 14)

The Amazon Resource Name (ARN) of the CodeReview object.

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

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: Yes

RecommendationId (p. 14)

The recommendation ID that can be used to track the provided recommendations and then to collect the feedback.

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

Required: Yes UserId (p. 14)

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.

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

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,

(21)

Response Elements

"Reactions": [ "string" ], "RecommendationId": "string", "UserId": "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.

RecommendationFeedback (p. 14)

The recommendation feedback given by the user.

Type: RecommendationFeedback (p. 62) object

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

(22)

See Also

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(23)

DescribeRepositoryAssociation

DescribeRepositoryAssociation

Returns a RepositoryAssociation object that contains information about the requested repository association.

Request Syntax

GET /associations/AssociationArn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

AssociationArn (p. 17)

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

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

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"

} },

(24)

Response Elements

"State": "string", "StateReason": "string"

},

"Tags": {

"string" : "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.

RepositoryAssociation (p. 17)

Information about the repository association.

Type: RepositoryAssociation (p. 69) object Tags (p. 17)

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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 NotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404

(25)

See Also

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(26)

DisassociateRepository

DisassociateRepository

Removes the association between Amazon CodeGuru Reviewer and a repository.

Request Syntax

DELETE /associations/AssociationArn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

AssociationArn (p. 20)

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

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

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",

(27)

Response Elements

"StateReason": "string"

},

"Tags": {

"string" : "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.

RepositoryAssociation (p. 20)

Information about the disassociated repository.

Type: RepositoryAssociation (p. 69) object Tags (p. 20)

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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 ConflictException

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.

HTTP Status Code: 409 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500

(28)

See Also

NotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(29)

ListCodeReviews

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=RepositoryNames&States=States&Type=Type HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

MaxResults (p. 23)

The maximum number of results that are returned per call. The default is 100.

Valid Range: Minimum value of 1. Maximum value of 100.

NextToken (p. 23)

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.

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

ProviderTypes (p. 23)

List of provider types for filtering that needs to be applied before displaying the result. For example, providerTypes=[GitHub] lists code reviews from GitHub.

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: CodeCommit | GitHub | Bitbucket | GitHubEnterpriseServer | S3Bucket

RepositoryNames (p. 23)

List of repository names for filtering that needs to be applied before displaying the result.

Array Members: Minimum number of 1 item. Maximum number of 100 items.

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

Pattern: ^\S[\w.-]*$

States (p. 23)

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.

The valid code review states are:

• Completed: The code review is complete.

• Pending: The code review started and has not completed or failed.

• Failed: The code review failed.

• Deleting: The code review is being deleted.

(30)

Request Body

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: Completed | Pending | Failed | Deleting Type (p. 23)

The type of code reviews to list in the response.

Valid Values: PullRequest | RepositoryAnalysis 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 },

"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": {

(31)

Response Elements

"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.

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

CodeReviewSummaries (p. 24)

A list of code reviews that meet the criteria of the request.

Type: Array of CodeReviewSummary (p. 53) objects NextToken (p. 24)

Pagination token.

Type: String

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

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

(32)

See Also

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(33)

ListRecommendationFeedback

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

URI Request Parameters

The request uses the following URI parameters.

CodeReviewArn (p. 27)

The Amazon Resource Name (ARN) of the CodeReview object.

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

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: Yes MaxResults (p. 27)

The maximum number of results that are returned per call. The default is 100.

Valid Range: Minimum value of 1. Maximum value of 100.

NextToken (p. 27)

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.

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

RecommendationIds (p. 27)

Used to query the recommendation feedback for a given recommendation.

Array Members: Minimum number of 1 item. Maximum number of 100 items.

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

UserIds (p. 27)

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.

Array Members: Minimum number of 1 item. Maximum number of 100 items.

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

(34)

Request Body

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.

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

NextToken (p. 28)

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

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

RecommendationFeedbackSummaries (p. 28)

Recommendation feedback summaries corresponding to the code review ARN.

Type: Array of RecommendationFeedbackSummary (p. 64) objects

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500

(35)

See Also

ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(36)

ListRecommendations

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

URI Request Parameters

The request uses the following URI parameters.

CodeReviewArn (p. 30)

The Amazon Resource Name (ARN) of the CodeReview object.

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

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: Yes MaxResults (p. 30)

The maximum number of results that are returned per call. The default is 100.

Valid Range: Minimum value of 1. Maximum value of 300.

NextToken (p. 30) Pagination token.

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

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",

(37)

Response Elements

"RuleTags": [ "string" ], "ShortDescription": "string"

},

"Severity": "string", "StartLine": number }

]}

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 (p. 30) Pagination token.

Type: String

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

RecommendationSummaries (p. 30)

List of recommendations for the requested code review.

Type: Array of RecommendationSummary (p. 65) objects

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

(38)

See Also

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(39)

ListRepositoryAssociations

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&State=States HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

MaxResults (p. 33)

The maximum number of repository association results returned by

ListRepositoryAssociations in paginated output. When this parameter is used, ListRepositoryAssociations only returns maxResults results in a single page with a nextToken response element. The remaining results of the initial request can be seen by sending another ListRepositoryAssociations request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, ListRepositoryAssociations returns up to 100 results and a nextToken value if applicable.

Valid Range: Minimum value of 1. Maximum value of 100.

Names (p. 33)

List of repository names to use as a filter.

Array Members: Minimum number of 1 item. Maximum number of 3 items.

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

Pattern: ^\S[\w.-]*$

NextToken (p. 33)

The nextToken value returned from a previous paginated ListRepositoryAssociations request where maxResults was used and the results exceeded the value of that parameter.

Pagination continues from the end of the previous results that returned the nextToken value.

NoteTreat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

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

Owners (p. 33)

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.

Array Members: Minimum number of 1 item. Maximum number of 3 items.

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

Pattern: ^\S(.*\S)?$

(40)

Request Body

ProviderTypes (p. 33)

List of provider types to use as a filter.

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: CodeCommit | GitHub | Bitbucket | GitHubEnterpriseServer | S3Bucket

States (p. 33)

List of repository association states to use as a filter.

The valid repository association states are:

Associated: The repository association is complete.

Associating: CodeGuru Reviewer is:

• 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 an associated 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.

Array Members: Minimum number of 1 item. Maximum number of 5 items.

Valid Values: Associated | Associating | Failed | Disassociating | Disassociated

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,

(41)

Response Elements

"Name": "string", "Owner": "string", "ProviderType": "string", "State": "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 (p. 34)

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

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

RepositoryAssociationSummaries (p. 34)

A list of repository associations that meet the criteria of the request.

Type: Array of RepositoryAssociationSummary (p. 72) objects

Errors

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

InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

(42)

See Also

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(43)

ListTagsForResource

ListTagsForResource

Returns the list of tags associated with an associated repository resource.

Request Syntax

GET /tags/resourceArn HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

resourceArn (p. 37)

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

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

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 {

"Tags": {

"string" : "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.

Tags (p. 37)

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.

(44)

Errors

• 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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Errors

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

InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(45)

PutRecommendationFeedback

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

PUT /feedback HTTP/1.1

Content-type: application/json { "CodeReviewArn": "string", "Reactions": [ "string" ], "RecommendationId": "string"

}

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

CodeReviewArn (p. 39)

The Amazon Resource Name (ARN) of the CodeReview object.

Type: String

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

Pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$

Required: Yes Reactions (p. 39)

List for storing reactions. Reactions are utf-8 text code for emojis. If you send an empty list it clears all your feedback.

Type: Array of strings

Array Members: Minimum number of 0 items. Maximum number of 1 item.

Valid Values: ThumbsUp | ThumbsDown Required: Yes

RecommendationId (p. 39)

The recommendation ID that can be used to track the provided recommendations and then to collect the feedback.

Type: String

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

Required: Yes

(46)

Response Syntax

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 (p. 88).

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403 InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(47)

See Also

(48)

TagResource

TagResource

Adds one or more tags to an associated repository.

Request Syntax

POST /tags/resourceArn HTTP/1.1 Content-type: application/json {

"Tags": {

"string" : "string"

} }

URI Request Parameters

The request uses the following URI parameters.

resourceArn (p. 42)

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

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

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 accepts the following data in JSON format.

Tags (p. 42)

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.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Maximum length of 256.

Required: Yes

(49)

Response Syntax

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 (p. 88).

InternalServerException

The server encountered an internal error and is unable to complete the request.

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(50)

UntagResource

UntagResource

Removes a tag from an associated repository.

Request Syntax

DELETE /tags/resourceArn?tagKeys=TagKeys HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

resourceArn (p. 44)

The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

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

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 (p. 44)

A list of the keys for each tag you want to remove from an associated repository.

Array Members: Minimum number of 1 item. Maximum number of 50 items.

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

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 (p. 88).

InternalServerException

The server encountered an internal error and is unable to complete the request.

(51)

See Also

HTTP Status Code: 500 ResourceNotFoundException

The resource specified in the request was not found.

HTTP Status Code: 404 ValidationException

The input fails to satisfy the specified constraints.

HTTP Status Code: 400

See Also

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

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

(52)

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.

The following data types are supported:

• BranchDiffSourceCodeType (p. 47)

• CodeArtifacts (p. 48)

• CodeCommitRepository (p. 49)

• CodeReview (p. 50)

• CodeReviewSummary (p. 53)

• CodeReviewType (p. 56)

• CommitDiffSourceCodeType (p. 57)

• EventInfo (p. 58)

• KMSKeyDetails (p. 59)

• Metrics (p. 60)

• MetricsSummary (p. 61)

• RecommendationFeedback (p. 62)

• RecommendationFeedbackSummary (p. 64)

• RecommendationSummary (p. 65)

• Repository (p. 67)

• RepositoryAnalysis (p. 68)

• RepositoryAssociation (p. 69)

• RepositoryAssociationSummary (p. 72)

• RepositoryHeadSourceCodeType (p. 75)

• RequestMetadata (p. 76)

• RuleMetadata (p. 78)

• S3BucketRepository (p. 80)

• S3Repository (p. 81)

• S3RepositoryDetails (p. 82)

• SourceCodeType (p. 83)

• ThirdPartySourceRepository (p. 85)

參考文獻

相關文件

Once you have created a complete dialog with widgets or arbitrary window hier- archy, the Interface Builder generates the source code needed to recreate it programmati- cally and

Dialysis can help you feel better and live longer, but it is not a cure for kidney failure. After you start dialysis, you will need to keep doing it to stay as healthy

多組樣本重複測量分析方法 多組樣本重複測量分析方法 Repeated measures ANOVA Repeated measures ANOVA..

If you see difficult sentences/ a difficult sentence or have (any) questions / a question, going over/through (=browsing) the article(s) again.. can/may help you

 If I buy a call option from you, I am paying you a certain amount of money in return for the right to force you to sell me a share of the stock, if I want it, at the strike price,

If w e sell you land, you m ust rem em ber that it is sacred, and you m ust teach your children that it is sacred and that each ghostly reflection in the clear w ater of the lakes tells

可以設定遊戲音 效以及是否離開

• It is a plus if you have background knowledge on computer vision, image processing and computer graphics.. • It is a plus if you have access to digital cameras