openapi: 3.0.0
info:
version: '2019-09-19'
x-release: v4
title: Amazon CodeGuru Reviewer Associations Codereviews#Type API
description: <p>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.</p> <p>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 <i> <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/welcome.html">Amazon CodeGuru Reviewer User Guide</a>.</i> </p> <p>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 <i>interface VPC endpoint</i>. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/vpc-interface-endpoints.html">CodeGuru Reviewer and interface VPC endpoints (Amazon Web Services PrivateLink)</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.</p>
x-logo:
url: https://twitter.com/awscloud/profile_image?size=original
backgroundColor: '#FFFFFF'
termsOfService: https://aws.amazon.com/service-terms/
contact:
name: Mike Ralphson
email: mike.ralphson@gmail.com
url: https://github.com/mermade/aws2openapi
x-twitter: PermittedSoc
license:
name: Apache 2.0 License
url: http://www.apache.org/licenses/
x-providerName: amazonaws.com
x-serviceName: codeguru-reviewer
x-aws-signingName: codeguru-reviewer
x-origin:
- contentType: application/json
url: https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/codeguru-reviewer-2019-09-19.normal.json
converter:
url: https://github.com/mermade/aws2openapi
version: 1.0.0
x-apisguru-driver: external
x-apiClientRegistration:
url: https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct
x-apisguru-categories:
- cloud
x-preferred: true
servers:
- url: http://codeguru-reviewer.{region}.amazonaws.com
variables:
region:
description: The AWS region
enum:
- us-east-1
- us-east-2
- us-west-1
- us-west-2
- us-gov-west-1
- us-gov-east-1
- ca-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- eu-central-1
- eu-south-1
- af-south-1
- ap-northeast-1
- ap-northeast-2
- ap-northeast-3
- ap-southeast-1
- ap-southeast-2
- ap-east-1
- ap-south-1
- sa-east-1
- me-south-1
default: us-east-1
description: The CodeGuruReviewer multi-region endpoint
- url: https://codeguru-reviewer.{region}.amazonaws.com
variables:
region:
description: The AWS region
enum:
- us-east-1
- us-east-2
- us-west-1
- us-west-2
- us-gov-west-1
- us-gov-east-1
- ca-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- eu-central-1
- eu-south-1
- af-south-1
- ap-northeast-1
- ap-northeast-2
- ap-northeast-3
- ap-southeast-1
- ap-southeast-2
- ap-east-1
- ap-south-1
- sa-east-1
- me-south-1
default: us-east-1
description: The CodeGuruReviewer multi-region endpoint
- url: http://codeguru-reviewer.{region}.amazonaws.com.cn
variables:
region:
description: The AWS region
enum:
- cn-north-1
- cn-northwest-1
default: cn-north-1
description: The CodeGuruReviewer endpoint for China (Beijing) and China (Ningxia)
- url: https://codeguru-reviewer.{region}.amazonaws.com.cn
variables:
region:
description: The AWS region
enum:
- cn-north-1
- cn-northwest-1
default: cn-north-1
description: The CodeGuruReviewer endpoint for China (Beijing) and China (Ningxia)
security:
- hmac: []
tags:
- name: Codereviews#Type
paths:
/codereviews#Type:
parameters:
- $ref: '#/components/parameters/X-Amz-Content-Sha256'
- $ref: '#/components/parameters/X-Amz-Date'
- $ref: '#/components/parameters/X-Amz-Algorithm'
- $ref: '#/components/parameters/X-Amz-Credential'
- $ref: '#/components/parameters/X-Amz-Security-Token'
- $ref: '#/components/parameters/X-Amz-Signature'
- $ref: '#/components/parameters/X-Amz-SignedHeaders'
get:
operationId: ListCodeReviews
description: Lists all the code reviews that the customer has created in the past 90 days.
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ListCodeReviewsResponse'
examples:
ListCodeReviews200Example:
summary: Default ListCodeReviews 200 response
x-microcks-default: true
value:
CodeReviewSummaries: example-value
NextToken: example-value
'480':
description: InternalServerException
content:
application/json:
schema:
$ref: '#/components/schemas/InternalServerException'
examples:
ListCodeReviews480Example:
summary: Default ListCodeReviews 480 response
x-microcks-default: true
value: example-value
'481':
description: ValidationException
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationException'
examples:
ListCodeReviews481Example:
summary: Default ListCodeReviews 481 response
x-microcks-default: true
value: example-value
'482':
description: ThrottlingException
content:
application/json:
schema:
$ref: '#/components/schemas/ThrottlingException'
examples:
ListCodeReviews482Example:
summary: Default ListCodeReviews 482 response
x-microcks-default: true
value: example-value
'483':
description: AccessDeniedException
content:
application/json:
schema:
$ref: '#/components/schemas/AccessDeniedException'
examples:
ListCodeReviews483Example:
summary: Default ListCodeReviews 483 response
x-microcks-default: true
value: example-value
parameters:
- name: ProviderTypes
in: query
required: false
description: List of provider types for filtering that needs to be applied before displaying the result. For example, <code>providerTypes=[GitHub]</code> lists code reviews from GitHub.
schema:
type: array
items:
$ref: '#/components/schemas/ProviderType'
minItems: 1
maxItems: 3
- name: States
in: query
required: false
description: '<p>List of states for filtering that needs to be applied before displaying the result. For example, <code>states=[Pending]</code> lists code reviews in the Pending state.</p> <p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete.</p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed.</p> </li> <li> <p> <code>Failed</code>: The code review failed.</p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted.</p> </li> </ul>'
schema:
type: array
items:
$ref: '#/components/schemas/JobState'
minItems: 1
maxItems: 3
- name: RepositoryNames
in: query
required: false
description: List of repository names for filtering that needs to be applied before displaying the result.
schema:
type: array
items:
$ref: '#/components/schemas/Name'
minItems: 1
maxItems: 100
- name: Type
in: query
required: true
description: The type of code reviews to list in the response.
schema:
type: string
enum:
- PullRequest
- RepositoryAnalysis
- name: MaxResults
in: query
required: false
description: The maximum number of results that are returned per call. The default is 100.
schema:
type: integer
minimum: 1
maximum: 100
- name: NextToken
in: query
required: false
description: If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> 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.
schema:
type: string
minLength: 1
maxLength: 2048
summary: Amazon CodeGuru Reviewer List Code Reviews
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
tags:
- Codereviews#Type
components:
schemas:
Type:
type: string
enum:
- PullRequest
- RepositoryAnalysis
RequestMetadata:
type: object
properties:
RequestId:
allOf:
- $ref: '#/components/schemas/RequestId'
- description: The ID of the request. This is required for a pull request code review.
Requester:
allOf:
- $ref: '#/components/schemas/Requester'
- description: An identifier, such as a name or account ID, that is associated with the requester. The <code>Requester</code> is used to capture the <code>author/actor</code> name of the event request.
EventInfo:
allOf:
- $ref: '#/components/schemas/EventInfo'
- description: Information about the event associated with a code review.
VendorName:
allOf:
- $ref: '#/components/schemas/VendorName'
- description: 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 <code>ProviderType</code> is <code>S3Bucket</code> and the CI/CD repository vendor name is GitHub. For more information, see the definition for <code>ProviderType</code> in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a>.
description: Metadata that is associated with a code review. This applies to both pull request and repository analysis code reviews.
LinesOfCodeCount:
type: integer
ProviderType:
type: string
enum:
- CodeCommit
- GitHub
- Bitbucket
- GitHubEnterpriseServer
- S3Bucket
PullRequestId:
type: string
minLength: 1
maxLength: 64
EventInfo:
type: object
properties:
Name:
allOf:
- $ref: '#/components/schemas/EventName'
- description: 'The name of the event. The possible names are <code>pull_request</code>, <code>workflow_dispatch</code>, <code>schedule</code>, and <code>push</code> '
State:
allOf:
- $ref: '#/components/schemas/EventState'
- description: The state of an event. The state might be open, closed, or another state.
description: Information about an event. The event might be a push, pull request, scheduled request, or another type of event.
Requester:
type: string
pattern: ^\S(.*\S)?$
minLength: 1
maxLength: 100
ListCodeReviewsResponse:
type: object
properties:
CodeReviewSummaries:
allOf:
- $ref: '#/components/schemas/CodeReviewSummaries'
- description: A list of code reviews that meet the criteria of the request.
NextToken:
allOf:
- $ref: '#/components/schemas/NextToken'
- description: Pagination token.
ValidationException: {}
SourceCodeType:
type: object
properties:
CommitDiff:
allOf:
- $ref: '#/components/schemas/CommitDiffSourceCodeType'
- description: A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.
RepositoryHead:
$ref: '#/components/schemas/RepositoryHeadSourceCodeType'
BranchDiff:
allOf:
- $ref: '#/components/schemas/BranchDiffSourceCodeType'
- description: A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.
S3BucketRepository:
allOf:
- $ref: '#/components/schemas/S3BucketRepository'
- description: Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> 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. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.
RequestMetadata:
allOf:
- $ref: '#/components/schemas/RequestMetadata'
- description: Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.
description: Specifies the source code that is analyzed in a code review.
BuildArtifactsObjectKey:
type: string
pattern: ^\S(.*\S)?$
minLength: 1
maxLength: 1024
VendorName:
type: string
enum:
- GitHub
- GitLab
- NativeS3
Name:
type: string
pattern: ^\S[\w.-]*$
minLength: 1
maxLength: 100
CommitDiffSourceCodeType:
type: object
properties:
SourceCommit:
allOf:
- $ref: '#/components/schemas/CommitId'
- description: The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.
DestinationCommit:
allOf:
- $ref: '#/components/schemas/CommitId'
- description: The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.
MergeBaseCommit:
allOf:
- $ref: '#/components/schemas/CommitId'
- description: The SHA of the merge base of a commit.
description: A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the commit diff for a pull request on an associated repository. The <code>SourceCommit</code> and <code>DestinationCommit</code> fields are required to do a pull request code review.
BranchDiffSourceCodeType:
type: object
required:
- SourceBranchName
- DestinationBranchName
properties:
SourceBranchName:
allOf:
- $ref: '#/components/schemas/BranchName'
- description: The source branch for a diff in an associated repository.
DestinationBranchName:
allOf:
- $ref: '#/components/schemas/BranchName'
- description: The destination branch for a diff in an associated repository.
description: A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a code diff between a source and destination branch in an associated repository.
Owner:
type: string
pattern: ^\S(.*\S)?$
minLength: 1
maxLength: 100
CommitId:
type: string
minLength: 6
maxLength: 64
S3RepositoryDetails:
type: object
properties:
BucketName:
allOf:
- $ref: '#/components/schemas/S3BucketName'
- description: 'The name of the S3 bucket used for associating a new S3 repository. It must begin with <code>codeguru-reviewer-</code>. '
CodeArtifacts:
allOf:
- $ref: '#/components/schemas/CodeArtifacts'
- description: A <code>CodeArtifacts</code> object. The <code>CodeArtifacts</code> 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.
description: Specifies the name of an S3 bucket and a <code>CodeArtifacts</code> 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.
CodeReviewSummaries:
type: array
items:
$ref: '#/components/schemas/CodeReviewSummary'
BranchName:
type: string
minLength: 1
maxLength: 256
RepositoryHeadSourceCodeType:
type: object
required:
- BranchName
properties:
BranchName:
allOf:
- $ref: '#/components/schemas/BranchName'
- description: The name of the branch in an associated repository. The <code>RepositoryHeadSourceCodeType</code> specifies the tip of this branch.
description: A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.
S3BucketName:
type: string
pattern: ^\S(.*\S)?$
minLength: 3
maxLength: 63
RequestId:
type: string
minLength: 1
maxLength: 64
NextToken:
type: string
minLength: 1
maxLength: 2048
S3BucketRepository:
type: object
required:
- Name
properties:
Name:
allOf:
- $ref: '#/components/schemas/Name'
- description: The name of the repository when the <code>ProviderType</code> is <code>S3Bucket</code>.
Details:
allOf:
- $ref: '#/components/schemas/S3RepositoryDetails'
- description: An <code>S3RepositoryDetails</code> object that specifies the name of an S3 bucket and a <code>CodeArtifacts</code> object. The <code>CodeArtifacts</code> object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.
description: 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.
EventName:
type: string
pattern: ^[ \-A-Z_a-z]+$
minLength: 1
maxLength: 32
SourceCodeArtifactsObjectKey:
type: string
pattern: ^\S(.*\S)?$
minLength: 1
maxLength: 1024
TimeStamp:
type: string
format: date-time
Arn:
type: string
pattern: ^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$
minLength: 1
maxLength: 1600
EventState:
type: string
pattern: ^[ \-A-Z_a-z]+$
minLength: 1
maxLength: 32
ThrottlingException: {}
CodeArtifacts:
type: object
required:
- SourceCodeArtifactsObjectKey
properties:
SourceCodeArtifactsObjectKey:
allOf:
- $ref: '#/components/schemas/SourceCodeArtifactsObjectKey'
- description: The S3 object key for a source code .zip file. This is required for all code reviews.
BuildArtifactsObjectKey:
allOf:
- $ref: '#/components/schemas/BuildArtifactsObjectKey'
- description: 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 <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/working-with-cicd.html">Create code reviews with GitHub Actions</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.
description: <p>Code artifacts are source code artifacts and build artifacts used in a repository analysis or a pull request review.</p> <ul> <li> <p>Source code artifacts are source code files in a Git repository that are compressed into a .zip file.</p> </li> <li> <p>Build artifacts are .jar or .class files that are compressed in a .zip file.</p> </li> </ul>
JobState:
type: string
enum:
- Completed
- Pending
- Failed
- Deleting
MetricsSummary:
type: object
properties:
MeteredLinesOfCodeCount:
allOf:
- $ref: '#/components/schemas/LinesOfCodeCount'
- description: 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, <code>MeteredLinesOfCodeCount</code> 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.
SuppressedLinesOfCodeCount:
allOf:
- $ref: '#/components/schemas/LinesOfCodeCount'
- description: Lines of code suppressed in the code review based on the <code>excludeFiles</code> element in the <code>aws-codeguru-reviewer.yml</code> 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 <i>changed</i> 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 <code>aws-codeguru-reviewer.yml</code> file, then <code>SuppressedLinesOfCodeCount</code> 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 <code>SuppressedLinesOfCodeCount</code> only includes the lines in the 2 files that changed. If only 1 of the 2 files changed in the pull request, then <code>SuppressedLinesOfCodeCount</code> returns 100 (1 * 100) as the total number of lines of code suppressed.
FindingsCount:
allOf:
- $ref: '#/components/schemas/FindingsCount'
- description: Total number of recommendations found in the code review.
description: Information about metrics summaries.
CodeReviewSummary:
type: object
properties:
Name:
allOf:
- $ref: '#/components/schemas/Name'
- description: The name of the code review.
CodeReviewArn:
allOf:
- $ref: '#/components/schemas/Arn'
- description: 'The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html">CodeReview</a> object. '
RepositoryName:
allOf:
- $ref: '#/components/schemas/Name'
- description: The name of the repository.
Owner:
allOf:
- $ref: '#/components/schemas/Owner'
- description: The owner of the repository. For an Amazon Web Services CodeCommit repository, this is the Amazon Web Services 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 Amazon Web Services account ID.
ProviderType:
allOf:
- $ref: '#/components/schemas/ProviderType'
- description: The provider type of the repository association.
State:
allOf:
- $ref: '#/components/schemas/JobState'
- description: '<p>The state of the code review.</p> <p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete.</p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed.</p> </li> <li> <p> <code>Failed</code>: The code review failed.</p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted.</p> </li> </ul>'
CreatedTimeStamp:
allOf:
- $ref: '#/components/schemas/TimeStamp'
- description: The time, in milliseconds since the epoch, when the code review was created.
LastUpdatedTimeStamp:
allOf:
- $ref: '#/components/schemas/TimeStamp'
- description: The time, in milliseconds since the epoch, when the code review was last updated.
Type:
allOf:
- $ref: '#/components/schemas/Type'
- description: The type of the code review.
PullRequestId:
allOf:
- $ref: '#/components/schemas/PullRequestId'
- description: The pull request ID for the code review.
MetricsSummary:
allOf:
- $ref: '#/components/schemas/MetricsSummary'
- description: The statistics from the code review.
SourceCodeType:
$ref: '#/components/schemas/SourceCodeType'
description: Information about the summary of the code review.
AccessDeniedException: {}
FindingsCount:
type: integer
InternalServerException: {}
parameters:
X-Amz-Date:
name: X-Amz-Date
in: header
schema:
type: string
required: false
X-Amz-SignedHeaders:
name: X-Amz-SignedHeaders
in: header
schema:
type: string
required: false
X-Amz-Credential:
name: X-Amz-Credential
in: header
schema:
type: string
required: false
X-Amz-Content-Sha256:
name: X-Amz-Content-Sha256
in: header
schema:
type: string
required: false
X-Amz-Algorithm:
name: X-Amz-Algorithm
in: header
schema:
type: string
required: false
X-Amz-Signature:
name: X-Amz-Signature
in: header
schema:
type: string
required: false
X-Amz-Security-Token:
name: X-Amz-Security-Token
in: header
schema:
type: string
required: false
securitySchemes:
hmac:
type: apiKey
name: Authorization
in: header
description: Amazon Signature authorization v4
x-amazon-apigateway-authtype: awsSigv4
externalDocs:
description: Amazon Web Services documentation
url: https://docs.aws.amazon.com/codeguru-reviewer/
x-hasEquivalentPaths: true