CodeGuruReviewer

Table of Contents

Client

class CodeGuruReviewer.Client

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

client = session.create_client('codeguru-reviewer')

These are the available methods:

associate_repository(**kwargs)

Associates an AWS CodeCommit repository with Amazon CodeGuru Reviewer. When you associate an AWS CodeCommit repository with Amazon CodeGuru Reviewer, Amazon CodeGuru Reviewer will provide recommendations for each pull request. You can view recommendations in the AWS CodeCommit repository.

You can associate a GitHub repository using the Amazon CodeGuru Reviewer console.

See also: AWS API Documentation

Request Syntax

response = client.associate_repository(
    Repository={
        'CodeCommit': {
            'Name': 'string'
        }
    },
    ClientRequestToken='string'
)
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.

  • ClientRequestToken (string) --

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    If you want to add a new repository association, this parameter specifies a unique identifier for the new repository association that helps ensure idempotency.

    If you use the AWS CLI or one of the AWS SDK to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes that in the request. If you don't use the SDK and instead generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a ClientRequestToken yourself for new versions and include that value in the request.

    You typically only need to interact with this value if you implement your own retry logic and want to ensure that a given repository association is not created twice. We recommend that you generate a UUID-type value to ensure uniqueness within the specified repository association.

    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.

Return type

dict

Returns

Response Syntax

{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1)
    }
}

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.

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        The owner of the repository.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

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

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.
describe_repository_association(**kwargs)

Describes a 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) identifying the association.

Return type
dict
Returns
Response Syntax
{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1)
    }
}

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.

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        The owner of the repository.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

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

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) identifying the association.

Return type
dict
Returns
Response Syntax
{
    'RepositoryAssociation': {
        'AssociationId': 'string',
        'AssociationArn': 'string',
        'Name': 'string',
        'Owner': 'string',
        'ProviderType': 'CodeCommit'|'GitHub',
        'State': 'Associated'|'Associating'|'Failed'|'Disassociating',
        'StateReason': 'string',
        'LastUpdatedTimeStamp': datetime(2015, 1, 1),
        'CreatedTimeStamp': datetime(2015, 1, 1)
    }
}

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.

      • Name (string) --

        The name of the repository.

      • Owner (string) --

        The owner of the repository.

      • ProviderType (string) --

        The provider type of the repository association.

      • State (string) --

        The state of the repository association.

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

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_repository_associations(**kwargs)

Lists repository associations. You can optionally filter on one or more of the following recommendation properties: provider types, states, names, and owners.

See also: AWS API Documentation

Request Syntax

response = client.list_repository_associations(
    ProviderTypes=[
        'CodeCommit'|'GitHub',
    ],
    States=[
        'Associated'|'Associating'|'Failed'|'Disassociating',
    ],
    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 states to use as a filter.

    • (string) --
  • Names (list) --

    List of names to use as a filter.

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

    List of owners to use as a filter. For AWS CodeCommit, the owner is the AWS account id. For GitHub, it is the GitHub account name.

    • (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 along 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, then 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

    This token should be treated 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',
            'LastUpdatedTimeStamp': datetime(2015, 1, 1),
            'AssociationId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'ProviderType': 'CodeCommit'|'GitHub',
            'State': 'Associated'|'Associating'|'Failed'|'Disassociating'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RepositoryAssociationSummaries (list) --

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

      • (dict) --

        Information about a repository association.

        • AssociationArn (string) --

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

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

        • ProviderType (string) --

          The provider type of the repository association.

        • State (string) --

          The state of the repository association.

          Associated

          Amazon CodeGuru Reviewer is associated with the repository.

          Associating

          The association is in progress.

          Failed

          The association failed. For more information about troubleshooting (or why it failed), see [troubleshooting topic].

          Disassociating

          Amazon CodeGuru Reviewer is in the process of disassociating with the repository.

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

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',
    ],
    States=[
        'Associated'|'Associating'|'Failed'|'Disassociating',
    ],
    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 states to use as a filter.

    • (string) --
  • Names (list) --

    List of names to use as a filter.

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

    List of owners to use as a filter. For AWS CodeCommit, the owner is the AWS account id. For GitHub, it is the GitHub account name.

    • (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',
            'LastUpdatedTimeStamp': datetime(2015, 1, 1),
            'AssociationId': 'string',
            'Name': 'string',
            'Owner': 'string',
            'ProviderType': 'CodeCommit'|'GitHub',
            'State': 'Associated'|'Associating'|'Failed'|'Disassociating'
        },
    ],

}

Response Structure

  • (dict) --

    • RepositoryAssociationSummaries (list) --

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

      • (dict) --

        Information about a repository association.

        • AssociationArn (string) --

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

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

        • ProviderType (string) --

          The provider type of the repository association.

        • State (string) --

          The state of the repository association.

          Associated

          Amazon CodeGuru Reviewer is associated with the repository.

          Associating

          The association is in progress.

          Failed

          The association failed. For more information about troubleshooting (or why it failed), see [troubleshooting topic].

          Disassociating

          Amazon CodeGuru Reviewer is in the process of disassociating with the repository.