CodeGuruReviewer

Client

class CodeGuruReviewer.Client

A low-level client representing Amazon CodeGuru Reviewer (CodeGuruReviewer)

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 .

import boto3

client = boto3.client('codeguru-reviewer')

These are the available methods:

associate_repository(**kwargs)

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.

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.

See also: AWS API Documentation

Request Syntax

response = client.associate_repository(
    Repository={
        'CodeCommit': {
            'Name': 'string'
        },
        'Bitbucket': {
            'Name': 'string',
            'ConnectionArn': 'string',
            'Owner': 'string'
        },
        'GitHubEnterpriseServer': {
            'Name': 'string',
            'ConnectionArn': 'string',
            'Owner': 'string'
        },
        'S3Bucket': {
            'Name': 'string',
            'BucketName': 'string'
        }
    },
    ClientRequestToken='string',
    Tags={
        'string': 'string'
    },
    KMSKeyDetails={
        'KMSKeyId': 'string',
        'EncryptionOption': 'AWS_OWNED_CMK'|'CUSTOMER_MANAGED_CMK'
    }
)
Parameters
  • Repository (dict) --

    [REQUIRED]

    The repository to associate.

    • CodeCommit (dict) --

      Information about an AWS CodeCommit repository.

      • Name (string) -- [REQUIRED]

        The name of the AWS CodeCommit repository. For more information, see repositoryName in the AWS CodeCommit API Reference .

    • Bitbucket (dict) --

      Information about a Bitbucket repository.

      • Name (string) -- [REQUIRED]

        The name of the third party source repository.

      • ConnectionArn (string) -- [REQUIRED]

        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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

      • Owner (string) -- [REQUIRED]

        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.

    • GitHubEnterpriseServer (dict) --

      Information about a GitHub Enterprise Server repository.

      • Name (string) -- [REQUIRED]

        The name of the third party source repository.

      • ConnectionArn (string) -- [REQUIRED]

        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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

      • Owner (string) -- [REQUIRED]

        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.

    • S3Bucket (dict) --

      Information about a repository in an S3 bucket.

      • Name (string) -- [REQUIRED]

        The name of the repository in the S3 bucket.

      • BucketName (string) -- [REQUIRED]

        The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

  • ClientRequestToken (string) --

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

    This field is autopopulated if not provided.

  • Tags (dict) --

    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.
    • (string) --
      • (string) --
  • KMSKeyDetails (dict) --

    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.
    • KMSKeyId (string) --

      The ID of the AWS KMS key that is associated with a respository association.

    • EncryptionOption (string) --

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

Return type

dict

Returns

Response Syntax

{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'ConnectionArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'KMSKeyDetails': {
            'KMSKeyId': 'string',
            'EncryptionOption': 'AWS_OWNED_CMK'|'CUSTOMER_MANAGED_CMK'
        },
        'S3RepositoryDetails': {
            'BucketName': 'string',
            'CodeArtifacts': {
                'SourceCodeArtifactsObjectKey': 'string',
                'BuildArtifactsObjectKey': 'string'
            }
        }
    },
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • RepositoryAssociation (dict) --

      Information about the repository association.

      • AssociationId (string) --

        The ID of the repository association.

      • AssociationArn (string) --

        The Amazon Resource Name (ARN) identifying the repository association.

      • ConnectionArn (string) --

        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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        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.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

        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 .

      • StateReason (string) --

        A description of why the repository association is in the current state.

      • LastUpdatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was last updated.

      • CreatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was created.

      • KMSKeyDetails (dict) --

        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.
        • KMSKeyId (string) --

          The ID of the AWS KMS key that is associated with a respository association.

        • EncryptionOption (string) --

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

      • S3RepositoryDetails (dict) --

        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.

        • BucketName (string) --

          The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

        • CodeArtifacts (dict) --

          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.

          • SourceCodeArtifactsObjectKey (string) --

            The S3 object key for a source code .zip file. This is required for all code reviews.

          • BuildArtifactsObjectKey (string) --

            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 security analysis in the Amazon CodeGuru Reviewer User Guide .

    • Tags (dict) --

      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.
      • (string) --
        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ConflictException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_code_review(**kwargs)

Use to create a code review with a ` CodeReviewType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html`__ 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.

See also: AWS API Documentation

Request Syntax

response = client.create_code_review(
    Name='string',
    RepositoryAssociationArn='string',
    Type={
        'RepositoryAnalysis': {
            'RepositoryHead': {
                'BranchName': 'string'
            },
            'SourceCodeType': {
                'CommitDiff': {
                    'SourceCommit': 'string',
                    'DestinationCommit': 'string',
                    'MergeBaseCommit': 'string'
                },
                'RepositoryHead': {
                    'BranchName': 'string'
                },
                'BranchDiff': {
                    'SourceBranchName': 'string',
                    'DestinationBranchName': 'string'
                },
                'S3BucketRepository': {
                    'Name': 'string',
                    'Details': {
                        'BucketName': 'string',
                        'CodeArtifacts': {
                            'SourceCodeArtifactsObjectKey': 'string',
                            'BuildArtifactsObjectKey': 'string'
                        }
                    }
                },
                'RequestMetadata': {
                    'RequestId': 'string',
                    'Requester': 'string',
                    'EventInfo': {
                        'Name': 'string',
                        'State': 'string'
                    },
                    'VendorName': 'GitHub'|'GitLab'|'NativeS3'
                }
            }
        },
        'AnalysisTypes': [
            'Security'|'CodeQuality',
        ]
    },
    ClientRequestToken='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

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

  • RepositoryAssociationArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

    A code review can only be created on an associated repository. This is the ARN of the associated repository.

  • Type (dict) --

    [REQUIRED]

    The type of code review to create. This is specified using a ` CodeReviewType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html`__ object. You can create a code review only of type RepositoryAnalysis .

    • RepositoryAnalysis (dict) -- [REQUIRED]

      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 https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview`__ .

      • RepositoryHead (dict) --

        A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

        • BranchName (string) -- [REQUIRED]

          The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

      • SourceCodeType (dict) --

        Specifies the source code that is analyzed in a code review.

        • CommitDiff (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a commit diff created by a pull request on an associated repository.

          • SourceCommit (string) --

            The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.

          • DestinationCommit (string) --

            The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.

          • MergeBaseCommit (string) --

            The SHA of the merge base of a commit.

        • RepositoryHead (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

          • BranchName (string) -- [REQUIRED]

            The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

        • BranchDiff (dict) --

          A type of ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a source branch name and a destination branch name in an associated repository.

          • SourceBranchName (string) -- [REQUIRED]

            The source branch for a diff in an associated repository.

          • DestinationBranchName (string) -- [REQUIRED]

            The destination branch for a diff in an associated repository.

        • S3BucketRepository (dict) --

          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 https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ for S3BucketRepository based code reviews.

          • Name (string) -- [REQUIRED]

            The name of the repository when the ProviderType is S3Bucket .

          • Details (dict) --

            An S3RepositoryDetails object that specifies the name of an S3 bucket and a CodeArtifacts object. The CodeArtifacts object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.

            • BucketName (string) --

              The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

            • CodeArtifacts (dict) --

              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.

              • SourceCodeArtifactsObjectKey (string) -- [REQUIRED]

                The S3 object key for a source code .zip file. This is required for all code reviews.

              • BuildArtifactsObjectKey (string) --

                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 security analysis in the Amazon CodeGuru Reviewer User Guide .

        • RequestMetadata (dict) --

          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.

          • RequestId (string) --

            The ID of the request. This is required for a pull request code review.

          • Requester (string) --

            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.

          • EventInfo (dict) --

            Information about the event associated with a code review.

            • Name (string) --

              The name of the event. The possible names are pull_request , workflow_dispatch , schedule , and push

            • State (string) --

              The state of an event. The state might be open, closed, or another state.

          • VendorName (string) --

            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 .

    • AnalysisTypes (list) --

      They types of analysis performed during a repository analysis or a pull request review. You can specify either Security , CodeQuality , or both.

      • (string) --
  • ClientRequestToken (string) --

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

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'CodeReview': {
        'Name': 'string',
        'CodeReviewArn': 'string',
        'RepositoryName': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
        'State': 'Completed'|'Pending'|'Failed'|'Deleting',
        'StateReason': 'string',
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'Type': 'PullRequest'|'RepositoryAnalysis',
        'PullRequestId': 'string',
        'SourceCodeType': {
            'CommitDiff': {
                'SourceCommit': 'string',
                'DestinationCommit': 'string',
                'MergeBaseCommit': 'string'
            },
            'RepositoryHead': {
                'BranchName': 'string'
            },
            'BranchDiff': {
                'SourceBranchName': 'string',
                'DestinationBranchName': 'string'
            },
            'S3BucketRepository': {
                'Name': 'string',
                'Details': {
                    'BucketName': 'string',
                    'CodeArtifacts': {
                        'SourceCodeArtifactsObjectKey': 'string',
                        'BuildArtifactsObjectKey': 'string'
                    }
                }
            },
            'RequestMetadata': {
                'RequestId': 'string',
                'Requester': 'string',
                'EventInfo': {
                    'Name': 'string',
                    'State': 'string'
                },
                'VendorName': 'GitHub'|'GitLab'|'NativeS3'
            }
        },
        'AssociationArn': 'string',
        'Metrics': {
            'MeteredLinesOfCodeCount': 123,
            'FindingsCount': 123
        },
        'AnalysisTypes': [
            'Security'|'CodeQuality',
        ]
    }
}

Response Structure

  • (dict) --

    • CodeReview (dict) --

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

      • Name (string) --

        The name of the code review.

      • CodeReviewArn (string) --

        The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

      • RepositoryName (string) --

        The name of the repository.

      • Owner (string) --

        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.

      • ProviderType (string) --

        The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).

      • State (string) --

        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.
      • StateReason (string) --

        The reason for the state of the code review.

      • CreatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the code review was created.

      • LastUpdatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the code review was last updated.

      • Type (string) --

        The type of code review.

      • PullRequestId (string) --

        The pull request ID for the code review.

      • SourceCodeType (dict) --

        The type of the source code for the code review.

        • CommitDiff (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a commit diff created by a pull request on an associated repository.

          • SourceCommit (string) --

            The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.

          • DestinationCommit (string) --

            The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.

          • MergeBaseCommit (string) --

            The SHA of the merge base of a commit.

        • RepositoryHead (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

          • BranchName (string) --

            The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

        • BranchDiff (dict) --

          A type of ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a source branch name and a destination branch name in an associated repository.

          • SourceBranchName (string) --

            The source branch for a diff in an associated repository.

          • DestinationBranchName (string) --

            The destination branch for a diff in an associated repository.

        • S3BucketRepository (dict) --

          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 https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ for S3BucketRepository based code reviews.

          • Name (string) --

            The name of the repository when the ProviderType is S3Bucket .

          • Details (dict) --

            An S3RepositoryDetails object that specifies the name of an S3 bucket and a CodeArtifacts object. The CodeArtifacts object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.

            • BucketName (string) --

              The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

            • CodeArtifacts (dict) --

              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.

              • SourceCodeArtifactsObjectKey (string) --

                The S3 object key for a source code .zip file. This is required for all code reviews.

              • BuildArtifactsObjectKey (string) --

                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 security analysis in the Amazon CodeGuru Reviewer User Guide .

        • RequestMetadata (dict) --

          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.

          • RequestId (string) --

            The ID of the request. This is required for a pull request code review.

          • Requester (string) --

            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.

          • EventInfo (dict) --

            Information about the event associated with a code review.

            • Name (string) --

              The name of the event. The possible names are pull_request , workflow_dispatch , schedule , and push

            • State (string) --

              The state of an event. The state might be open, closed, or another state.

          • VendorName (string) --

            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 .

      • AssociationArn (string) --

        The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ that contains the reviewed source code. You can retrieve associated repository ARNs by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

      • Metrics (dict) --

        The statistics from the code review.

        • MeteredLinesOfCodeCount (integer) --

          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.

        • FindingsCount (integer) --

          Total number of recommendations found in the code review.

      • AnalysisTypes (list) --

        They types of analysis performed during a repository analysis or a pull request review. You can specify either Security , CodeQuality , or both.

        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ConflictException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
describe_code_review(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.describe_code_review(
    CodeReviewArn='string'
)
Parameters
CodeReviewArn (string) --

[REQUIRED]

The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

Return type
dict
Returns
Response Syntax
{
    'CodeReview': {
        'Name': 'string',
        'CodeReviewArn': 'string',
        'RepositoryName': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
        'State': 'Completed'|'Pending'|'Failed'|'Deleting',
        'StateReason': 'string',
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'Type': 'PullRequest'|'RepositoryAnalysis',
        'PullRequestId': 'string',
        'SourceCodeType': {
            'CommitDiff': {
                'SourceCommit': 'string',
                'DestinationCommit': 'string',
                'MergeBaseCommit': 'string'
            },
            'RepositoryHead': {
                'BranchName': 'string'
            },
            'BranchDiff': {
                'SourceBranchName': 'string',
                'DestinationBranchName': 'string'
            },
            'S3BucketRepository': {
                'Name': 'string',
                'Details': {
                    'BucketName': 'string',
                    'CodeArtifacts': {
                        'SourceCodeArtifactsObjectKey': 'string',
                        'BuildArtifactsObjectKey': 'string'
                    }
                }
            },
            'RequestMetadata': {
                'RequestId': 'string',
                'Requester': 'string',
                'EventInfo': {
                    'Name': 'string',
                    'State': 'string'
                },
                'VendorName': 'GitHub'|'GitLab'|'NativeS3'
            }
        },
        'AssociationArn': 'string',
        'Metrics': {
            'MeteredLinesOfCodeCount': 123,
            'FindingsCount': 123
        },
        'AnalysisTypes': [
            'Security'|'CodeQuality',
        ]
    }
}

Response Structure

  • (dict) --
    • CodeReview (dict) --

      Information about the code review.

      • Name (string) --

        The name of the code review.

      • CodeReviewArn (string) --

        The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

      • RepositoryName (string) --

        The name of the repository.

      • Owner (string) --

        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.

      • ProviderType (string) --

        The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).

      • State (string) --

        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.
      • StateReason (string) --

        The reason for the state of the code review.

      • CreatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the code review was created.

      • LastUpdatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the code review was last updated.

      • Type (string) --

        The type of code review.

      • PullRequestId (string) --

        The pull request ID for the code review.

      • SourceCodeType (dict) --

        The type of the source code for the code review.

        • CommitDiff (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a commit diff created by a pull request on an associated repository.

          • SourceCommit (string) --

            The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.

          • DestinationCommit (string) --

            The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.

          • MergeBaseCommit (string) --

            The SHA of the merge base of a commit.

        • RepositoryHead (dict) --

          A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

          • BranchName (string) --

            The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

        • BranchDiff (dict) --

          A type of ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a source branch name and a destination branch name in an associated repository.

          • SourceBranchName (string) --

            The source branch for a diff in an associated repository.

          • DestinationBranchName (string) --

            The destination branch for a diff in an associated repository.

        • S3BucketRepository (dict) --

          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 https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ for S3BucketRepository based code reviews.

          • Name (string) --

            The name of the repository when the ProviderType is S3Bucket .

          • Details (dict) --

            An S3RepositoryDetails object that specifies the name of an S3 bucket and a CodeArtifacts object. The CodeArtifacts object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.

            • BucketName (string) --

              The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

            • CodeArtifacts (dict) --

              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.

              • SourceCodeArtifactsObjectKey (string) --

                The S3 object key for a source code .zip file. This is required for all code reviews.

              • BuildArtifactsObjectKey (string) --

                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 security analysis in the Amazon CodeGuru Reviewer User Guide .

        • RequestMetadata (dict) --

          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.

          • RequestId (string) --

            The ID of the request. This is required for a pull request code review.

          • Requester (string) --

            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.

          • EventInfo (dict) --

            Information about the event associated with a code review.

            • Name (string) --

              The name of the event. The possible names are pull_request , workflow_dispatch , schedule , and push

            • State (string) --

              The state of an event. The state might be open, closed, or another state.

          • VendorName (string) --

            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 .

      • AssociationArn (string) --

        The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ that contains the reviewed source code. You can retrieve associated repository ARNs by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

      • Metrics (dict) --

        The statistics from the code review.

        • MeteredLinesOfCodeCount (integer) --

          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.

        • FindingsCount (integer) --

          Total number of recommendations found in the code review.

      • AnalysisTypes (list) --

        They types of analysis performed during a repository analysis or a pull request review. You can specify either Security , CodeQuality , or both.

        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
describe_recommendation_feedback(**kwargs)

Describes the customer feedback for a CodeGuru Reviewer recommendation.

See also: AWS API Documentation

Request Syntax

response = client.describe_recommendation_feedback(
    CodeReviewArn='string',
    RecommendationId='string',
    UserId='string'
)
Parameters
  • CodeReviewArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

  • RecommendationId (string) --

    [REQUIRED]

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

  • UserId (string) --

    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 .

Return type

dict

Returns

Response Syntax

{
    'RecommendationFeedback': {
        'CodeReviewArn': 'string',
        'RecommendationId': 'string',
        'Reactions': [
            'ThumbsUp'|'ThumbsDown',
        ],
        'UserId': 'string',
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'LastUpdatedTimeStamp': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • RecommendationFeedback (dict) --

      The recommendation feedback given by the user.

      • CodeReviewArn (string) --

        The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

      • RecommendationId (string) --

        The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

      • Reactions (list) --

        List for storing reactions. Reactions are utf-8 text code for emojis. You can send an empty list to clear off all your feedback.

        • (string) --
      • UserId (string) --

        The ID of the user that made the API call.

        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 .

      • CreatedTimeStamp (datetime) --

        The time at which the feedback was created.

      • LastUpdatedTimeStamp (datetime) --

        The time at which the feedback was last updated.

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
describe_repository_association(**kwargs)

Returns a ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object that contains information about the requested repository association.

See also: AWS API Documentation

Request Syntax

response = client.describe_repository_association(
    AssociationArn='string'
)
Parameters
AssociationArn (string) --

[REQUIRED]

The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

Return type
dict
Returns
Response Syntax
{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'ConnectionArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'KMSKeyDetails': {
            'KMSKeyId': 'string',
            'EncryptionOption': 'AWS_OWNED_CMK'|'CUSTOMER_MANAGED_CMK'
        },
        'S3RepositoryDetails': {
            'BucketName': 'string',
            'CodeArtifacts': {
                'SourceCodeArtifactsObjectKey': 'string',
                'BuildArtifactsObjectKey': 'string'
            }
        }
    },
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • RepositoryAssociation (dict) --

      Information about the repository association.

      • AssociationId (string) --

        The ID of the repository association.

      • AssociationArn (string) --

        The Amazon Resource Name (ARN) identifying the repository association.

      • ConnectionArn (string) --

        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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        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.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

        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 .
      • StateReason (string) --

        A description of why the repository association is in the current state.

      • LastUpdatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was last updated.

      • CreatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was created.

      • KMSKeyDetails (dict) --

        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.
        • KMSKeyId (string) --

          The ID of the AWS KMS key that is associated with a respository association.

        • EncryptionOption (string) --

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

      • S3RepositoryDetails (dict) --

        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.

        • BucketName (string) --

          The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

        • CodeArtifacts (dict) --

          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.

          • SourceCodeArtifactsObjectKey (string) --

            The S3 object key for a source code .zip file. This is required for all code reviews.

          • BuildArtifactsObjectKey (string) --

            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 security analysis in the Amazon CodeGuru Reviewer User Guide .

    • Tags (dict) --

      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.
      • (string) --
        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.NotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
disassociate_repository(**kwargs)

Removes the association between Amazon CodeGuru Reviewer and a repository.

See also: AWS API Documentation

Request Syntax

response = client.disassociate_repository(
    AssociationArn='string'
)
Parameters
AssociationArn (string) --

[REQUIRED]

The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

Return type
dict
Returns
Response Syntax
{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'ConnectionArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1),
        'KMSKeyDetails': {
            'KMSKeyId': 'string',
            'EncryptionOption': 'AWS_OWNED_CMK'|'CUSTOMER_MANAGED_CMK'
        },
        'S3RepositoryDetails': {
            'BucketName': 'string',
            'CodeArtifacts': {
                'SourceCodeArtifactsObjectKey': 'string',
                'BuildArtifactsObjectKey': 'string'
            }
        }
    },
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • RepositoryAssociation (dict) --

      Information about the disassociated repository.

      • AssociationId (string) --

        The ID of the repository association.

      • AssociationArn (string) --

        The Amazon Resource Name (ARN) identifying the repository association.

      • ConnectionArn (string) --

        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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        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.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

        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 .
      • StateReason (string) --

        A description of why the repository association is in the current state.

      • LastUpdatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was last updated.

      • CreatedTimeStamp (datetime) --

        The time, in milliseconds since the epoch, when the repository association was created.

      • KMSKeyDetails (dict) --

        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.
        • KMSKeyId (string) --

          The ID of the AWS KMS key that is associated with a respository association.

        • EncryptionOption (string) --

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

      • S3RepositoryDetails (dict) --

        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.

        • BucketName (string) --

          The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

        • CodeArtifacts (dict) --

          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.

          • SourceCodeArtifactsObjectKey (string) --

            The S3 object key for a source code .zip file. This is required for all code reviews.

          • BuildArtifactsObjectKey (string) --

            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 security analysis in the Amazon CodeGuru Reviewer User Guide .

    • Tags (dict) --

      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.
      • (string) --
        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.NotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ConflictException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_code_reviews(**kwargs)

Lists all the code reviews that the customer has created in the past 90 days.

See also: AWS API Documentation

Request Syntax

response = client.list_code_reviews(
    ProviderTypes=[
        'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
    ],
    States=[
        'Completed'|'Pending'|'Failed'|'Deleting',
    ],
    RepositoryNames=[
        'string',
    ],
    Type='PullRequest'|'RepositoryAnalysis',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • ProviderTypes (list) --

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

    • (string) --
  • States (list) --

    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.
    • (string) --
  • RepositoryNames (list) --

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

    • (string) --
  • Type (string) --

    [REQUIRED]

    The type of code reviews to list in the response.

  • MaxResults (integer) -- The maximum number of results that are returned per call. The default is 100.
  • NextToken (string) -- 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.
Return type

dict

Returns

Response Syntax

{
    'CodeReviewSummaries': [
        {
            'Name': 'string',
            'CodeReviewArn': 'string',
            'RepositoryName': 'string',
            'Owner': 'string',
            'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
            'State': 'Completed'|'Pending'|'Failed'|'Deleting',
            'CreatedTimeStamp': datetime(2015, 1, 1),
            'LastUpdatedTimeStamp': datetime(2015, 1, 1),
            'Type': 'PullRequest'|'RepositoryAnalysis',
            'PullRequestId': 'string',
            'MetricsSummary': {
                'MeteredLinesOfCodeCount': 123,
                'FindingsCount': 123
            },
            'SourceCodeType': {
                'CommitDiff': {
                    'SourceCommit': 'string',
                    'DestinationCommit': 'string',
                    'MergeBaseCommit': 'string'
                },
                'RepositoryHead': {
                    'BranchName': 'string'
                },
                'BranchDiff': {
                    'SourceBranchName': 'string',
                    'DestinationBranchName': 'string'
                },
                'S3BucketRepository': {
                    'Name': 'string',
                    'Details': {
                        'BucketName': 'string',
                        'CodeArtifacts': {
                            'SourceCodeArtifactsObjectKey': 'string',
                            'BuildArtifactsObjectKey': 'string'
                        }
                    }
                },
                'RequestMetadata': {
                    'RequestId': 'string',
                    'Requester': 'string',
                    'EventInfo': {
                        'Name': 'string',
                        'State': 'string'
                    },
                    'VendorName': 'GitHub'|'GitLab'|'NativeS3'
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CodeReviewSummaries (list) --

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

      • (dict) --

        Information about the summary of the code review.

        • Name (string) --

          The name of the code review.

        • CodeReviewArn (string) --

          The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

        • RepositoryName (string) --

          The name of the repository.

        • Owner (string) --

          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.

        • ProviderType (string) --

          The provider type of the repository association.

        • State (string) --

          The state of the code review.

          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.
        • CreatedTimeStamp (datetime) --

          The time, in milliseconds since the epoch, when the code review was created.

        • LastUpdatedTimeStamp (datetime) --

          The time, in milliseconds since the epoch, when the code review was last updated.

        • Type (string) --

          The type of the code review.

        • PullRequestId (string) --

          The pull request ID for the code review.

        • MetricsSummary (dict) --

          The statistics from the code review.

          • MeteredLinesOfCodeCount (integer) --

            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.

          • FindingsCount (integer) --

            Total number of recommendations found in the code review.

        • SourceCodeType (dict) --

          Specifies the source code that is analyzed in a code review.

          • CommitDiff (dict) --

            A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a commit diff created by a pull request on an associated repository.

            • SourceCommit (string) --

              The SHA of the source commit used to generate a commit diff. This field is required for a pull request code review.

            • DestinationCommit (string) --

              The SHA of the destination commit used to generate a commit diff. This field is required for a pull request code review.

            • MergeBaseCommit (string) --

              The SHA of the merge base of a commit.

          • RepositoryHead (dict) --

            A ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies the tip of a branch in an associated repository.

            • BranchName (string) --

              The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.

          • BranchDiff (dict) --

            A type of ` SourceCodeType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ that specifies a source branch name and a destination branch name in an associated repository.

            • SourceBranchName (string) --

              The source branch for a diff in an associated repository.

            • DestinationBranchName (string) --

              The destination branch for a diff in an associated repository.

          • S3BucketRepository (dict) --

            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 https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType`__ for S3BucketRepository based code reviews.

            • Name (string) --

              The name of the repository when the ProviderType is S3Bucket .

            • Details (dict) --

              An S3RepositoryDetails object that specifies the name of an S3 bucket and a CodeArtifacts object. The CodeArtifacts object includes the S3 object keys for a source code .zip file and for a build artifacts .zip file.

              • BucketName (string) --

                The name of the S3 bucket used for associating a new S3 repository. It must begin with codeguru-reviewer- .

              • CodeArtifacts (dict) --

                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.

                • SourceCodeArtifactsObjectKey (string) --

                  The S3 object key for a source code .zip file. This is required for all code reviews.

                • BuildArtifactsObjectKey (string) --

                  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 security analysis in the Amazon CodeGuru Reviewer User Guide .

          • RequestMetadata (dict) --

            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.

            • RequestId (string) --

              The ID of the request. This is required for a pull request code review.

            • Requester (string) --

              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.

            • EventInfo (dict) --

              Information about the event associated with a code review.

              • Name (string) --

                The name of the event. The possible names are pull_request , workflow_dispatch , schedule , and push

              • State (string) --

                The state of an event. The state might be open, closed, or another state.

            • VendorName (string) --

              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 .

    • NextToken (string) --

      Pagination token.

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
list_recommendation_feedback(**kwargs)

Returns a list of ` RecommendationFeedbackSummary https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RecommendationFeedbackSummary.html`__ objects that contain customer recommendation feedback for all CodeGuru Reviewer users.

See also: AWS API Documentation

Request Syntax

response = client.list_recommendation_feedback(
    NextToken='string',
    MaxResults=123,
    CodeReviewArn='string',
    UserIds=[
        'string',
    ],
    RecommendationIds=[
        'string',
    ]
)
Parameters
  • NextToken (string) -- 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.
  • MaxResults (integer) -- The maximum number of results that are returned per call. The default is 100.
  • CodeReviewArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

  • UserIds (list) --

    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 .

    • (string) --
  • RecommendationIds (list) --

    Used to query the recommendation feedback for a given recommendation.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'RecommendationFeedbackSummaries': [
        {
            'RecommendationId': 'string',
            'Reactions': [
                'ThumbsUp'|'ThumbsDown',
            ],
            'UserId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RecommendationFeedbackSummaries (list) --

      Recommendation feedback summaries corresponding to the code review ARN.

      • (dict) --

        Information about recommendation feedback summaries.

        • RecommendationId (string) --

          The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

        • Reactions (list) --

          List for storing reactions. Reactions are utf-8 text code for emojis.

          • (string) --
        • UserId (string) --

          The ID of the user that gave the feedback.

          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 .

    • NextToken (string) --

      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.

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
list_recommendations(**kwargs)

Returns the list of all recommendations for a completed code review.

See also: AWS API Documentation

Request Syntax

response = client.list_recommendations(
    NextToken='string',
    MaxResults=123,
    CodeReviewArn='string'
)
Parameters
Return type

dict

Returns

Response Syntax

{
    'RecommendationSummaries': [
        {
            'FilePath': 'string',
            'RecommendationId': 'string',
            'StartLine': 123,
            'EndLine': 123,
            'Description': 'string',
            'RecommendationCategory': 'AWSBestPractices'|'AWSCloudFormationIssues'|'DuplicateCode'|'CodeMaintenanceIssues'|'ConcurrencyIssues'|'InputValidations'|'PythonBestPractices'|'JavaBestPractices'|'ResourceLeaks'|'SecurityIssues'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RecommendationSummaries (list) --

      List of recommendations for the requested code review.

      • (dict) --

        Information about recommendations.

        • FilePath (string) --

          Name of the file on which a recommendation is provided.

        • RecommendationId (string) --

          The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.

        • StartLine (integer) --

          Start line from where the recommendation is applicable in the source commit or source branch.

        • EndLine (integer) --

          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.

        • Description (string) --

          A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line and the end line.

        • RecommendationCategory (string) --

          The type of a recommendation.

    • NextToken (string) --

      Pagination token.

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
list_repository_associations(**kwargs)

Returns a list of ` RepositoryAssociationSummary https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html`__ objects that contain summary information about a repository association. You can filter the returned list by ` ProviderType https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-ProviderType`__ , ` Name https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name`__ , ` State https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State`__ , and ` Owner https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner`__ .

See also: AWS API Documentation

Request Syntax

response = client.list_repository_associations(
    ProviderTypes=[
        'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
    ],
    States=[
        'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated',
    ],
    Names=[
        'string',
    ],
    Owners=[
        'string',
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters
  • ProviderTypes (list) --

    List of provider types to use as a filter.

    • (string) --
  • States (list) --

    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 .
    • (string) --
  • Names (list) --

    List of repository names to use as a filter.

    • (string) --
  • Owners (list) --

    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.

    • (string) --
  • MaxResults (integer) -- 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.
  • NextToken (string) --

    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.

    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.

Return type

dict

Returns

Response Syntax

{
    'RepositoryAssociationSummaries': [
        {
            'AssociationArn': 'string',
            'ConnectionArn': 'string',
            'LastUpdatedTimeStamp': datetime(2015, 1, 1),
            'AssociationId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
            'State': 'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RepositoryAssociationSummaries (list) --

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

      • (dict) --

        Summary information about a repository association. The ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ operation returns a list of RepositoryAssociationSummary objects.

        • AssociationArn (string) --

          The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

        • ConnectionArn (string) --

          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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

        • LastUpdatedTimeStamp (datetime) --

          The time, in milliseconds since the epoch, since the repository association was last updated.

        • AssociationId (string) --

          The repository association ID.

        • Name (string) --

          The name of the repository association.

        • Owner (string) --

          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.

        • ProviderType (string) --

          The provider type of the repository association.

        • State (string) --

          The state of the repository association.

          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 .

    • NextToken (string) --

      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.

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
list_tags_for_resource(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    resourceArn='string'
)
Parameters
resourceArn (string) --

[REQUIRED]

The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

Return type
dict
Returns
Response Syntax
{
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • Tags (dict) --

      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.
      • (string) --
        • (string) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
put_recommendation_feedback(**kwargs)

Stores customer feedback for a CodeGuru Reviewer recommendation. When this API is called again with different reactions the previous feedback is overwritten.

See also: AWS API Documentation

Request Syntax

response = client.put_recommendation_feedback(
    CodeReviewArn='string',
    RecommendationId='string',
    Reactions=[
        'ThumbsUp'|'ThumbsDown',
    ]
)
Parameters
  • CodeReviewArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

  • RecommendationId (string) --

    [REQUIRED]

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

  • Reactions (list) --

    [REQUIRED]

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

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.AccessDeniedException
  • CodeGuruReviewer.Client.exceptions.ThrottlingException
tag_resource(**kwargs)

Adds one or more tags to an associated repository.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    resourceArn='string',
    Tags={
        'string': 'string'
    }
)
Parameters
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException
untag_resource(**kwargs)

Removes a tag from an associated repository.

See also: AWS API Documentation

Request Syntax

response = client.untag_resource(
    resourceArn='string',
    TagKeys=[
        'string',
    ]
)
Parameters
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • CodeGuruReviewer.Client.exceptions.InternalServerException
  • CodeGuruReviewer.Client.exceptions.ValidationException
  • CodeGuruReviewer.Client.exceptions.ResourceNotFoundException

Paginators

The available paginators are:

class CodeGuruReviewer.Paginator.ListRepositoryAssociations
paginator = client.get_paginator('list_repository_associations')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeGuruReviewer.Client.list_repository_associations().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    ProviderTypes=[
        'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
    ],
    States=[
        'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated',
    ],
    Names=[
        'string',
    ],
    Owners=[
        'string',
    ],
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • ProviderTypes (list) --

    List of provider types to use as a filter.

    • (string) --
  • States (list) --

    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 .
    • (string) --
  • Names (list) --

    List of repository names to use as a filter.

    • (string) --
  • Owners (list) --

    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.

    • (string) --
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'RepositoryAssociationSummaries': [
        {
            'AssociationArn': 'string',
            'ConnectionArn': 'string',
            'LastUpdatedTimeStamp': datetime(2015, 1, 1),
            'AssociationId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'ProviderType': 'CodeCommit'|'GitHub'|'Bitbucket'|'GitHubEnterpriseServer'|'S3Bucket',
            'State': 'Associated'|'Associating'|'Failed'|'Disassociating'|'Disassociated'
        },
    ],

}

Response Structure

  • (dict) --

    • RepositoryAssociationSummaries (list) --

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

      • (dict) --

        Summary information about a repository association. The ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ operation returns a list of RepositoryAssociationSummary objects.

        • AssociationArn (string) --

          The Amazon Resource Name (ARN) of the ` RepositoryAssociation https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html`__ object. You can retrieve this ARN by calling ` ListRepositoryAssociations https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html`__ .

        • ConnectionArn (string) --

          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 https://docs.aws.amazon.com/codestar-connections/latest/APIReference/API_Connection.html`__ in the AWS CodeStar Connections API Reference .

        • LastUpdatedTimeStamp (datetime) --

          The time, in milliseconds since the epoch, since the repository association was last updated.

        • AssociationId (string) --

          The repository association ID.

        • Name (string) --

          The name of the repository association.

        • Owner (string) --

          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.

        • ProviderType (string) --

          The provider type of the repository association.

        • State (string) --

          The state of the repository association.

          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 .

Waiters

The available waiters are:

class CodeGuruReviewer.Waiter.CodeReviewCompleted
waiter = client.get_waiter('code_review_completed')
wait(**kwargs)

Polls CodeGuruReviewer.Client.describe_code_review() every 10 seconds until a successful state is reached. An error is returned after 60 failed checks.

See also: AWS API Documentation

Request Syntax

waiter.wait(
    CodeReviewArn='string',
    WaiterConfig={
        'Delay': 123,
        'MaxAttempts': 123
    }
)
Parameters
  • CodeReviewArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the ` CodeReview https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html`__ object.

  • WaiterConfig (dict) --

    A dictionary that provides parameters to control waiting behavior.

    • Delay (integer) --

      The amount of time in seconds to wait between attempts. Default: 10

    • MaxAttempts (integer) --

      The maximum number of attempts to be made. Default: 60

Returns

None

class CodeGuruReviewer.Waiter.RepositoryAssociationSucceeded
waiter = client.get_waiter('repository_association_succeeded')
wait(**kwargs)

Polls CodeGuruReviewer.Client.describe_repository_association() every 10 seconds until a successful state is reached. An error is returned after 20 failed checks.

See also: AWS API Documentation

Request Syntax

waiter.wait(
    AssociationArn='string',
    WaiterConfig={
        'Delay': 123,
        'MaxAttempts': 123
    }
)
Parameters
Returns

None