CodeCommit

Table of Contents

Client

class CodeCommit.Client

A low-level client representing AWS CodeCommit:

client = session.create_client('codecommit')

These are the available methods:

batch_get_repositories(**kwargs)

Returns information about one or more repositories.

Note

The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

See also: AWS API Documentation

Request Syntax

response = client.batch_get_repositories(
    repositoryNames=[
        'string',
    ]
)
Parameters
repositoryNames (list) --

[REQUIRED]

The names of the repositories to get information about.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'repositories': [
        {
            'accountId': 'string',
            'repositoryId': 'string',
            'repositoryName': 'string',
            'repositoryDescription': 'string',
            'defaultBranch': 'string',
            'lastModifiedDate': datetime(2015, 1, 1),
            'creationDate': datetime(2015, 1, 1),
            'cloneUrlHttp': 'string',
            'cloneUrlSsh': 'string',
            'Arn': 'string'
        },
    ],
    'repositoriesNotFound': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Represents the output of a batch get repositories operation.

    • repositories (list) --

      A list of repositories returned by the batch get repositories operation.

      • (dict) --

        Information about a repository.

        • accountId (string) --

          The ID of the AWS account associated with the repository.

        • repositoryId (string) --

          The ID of the repository.

        • repositoryName (string) --

          The repository's name.

        • repositoryDescription (string) --

          A comment or description about the repository.

        • defaultBranch (string) --

          The repository's default branch name.

        • lastModifiedDate (datetime) --

          The date and time the repository was last modified, in timestamp format.

        • creationDate (datetime) --

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp (string) --

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh (string) --

          The URL to use for cloning the repository over SSH.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the repository.

    • repositoriesNotFound (list) --

      Returns a list of repository names for which information could not be found.

      • (string) --
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_branch(**kwargs)

Creates a new branch in a repository and points the branch to a commit.

Note

Calling the create branch operation does not set a repository's default branch. To do this, call the update default branch operation.

See also: AWS API Documentation

Request Syntax

response = client.create_branch(
    repositoryName='string',
    branchName='string',
    commitId='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository in which you want to create the new branch.

  • branchName (string) --

    [REQUIRED]

    The name of the new branch to create.

  • commitId (string) --

    [REQUIRED]

    The ID of the commit to point the new branch to.

Returns

None

create_pull_request(**kwargs)

Creates a pull request in the specified repository.

See also: AWS API Documentation

Request Syntax

response = client.create_pull_request(
    title='string',
    description='string',
    targets=[
        {
            'repositoryName': 'string',
            'sourceReference': 'string',
            'destinationReference': 'string'
        },
    ],
    clientRequestToken='string'
)
Parameters
  • title (string) --

    [REQUIRED]

    The title of the pull request. This title will be used to identify the pull request to other users in the repository.

  • description (string) -- A description of the pull request.
  • targets (list) --

    [REQUIRED]

    The targets for the pull request, including the source of the code to be reviewed (the source branch), and the destination where the creator of the pull request intends the code to be merged after the pull request is closed (the destination branch).

    • (dict) --

      Returns information about a target for a pull request.

      • repositoryName (string) -- [REQUIRED]

        The name of the repository that contains the pull request.

      • sourceReference (string) -- [REQUIRED]

        The branch of the repository that contains the changes for the pull request. Also known as the source branch.

      • destinationReference (string) --

        The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

  • clientRequestToken (string) --

    A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    Note

    The AWS SDKs prepopulate client request tokens. If using an AWS SDK, you do not have to generate an idempotency token, as this will be done for you.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the newly created pull request.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

create_repository(**kwargs)

Creates a new, empty repository.

See also: AWS API Documentation

Request Syntax

response = client.create_repository(
    repositoryName='string',
    repositoryDescription='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the new repository to be created.

    Note

    The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide. The suffix ".git" is prohibited.

  • repositoryDescription (string) --

    A comment or description about the new repository.

    Note

    The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

Return type

dict

Returns

Response Syntax

{
    'repositoryMetadata': {
        'accountId': 'string',
        'repositoryId': 'string',
        'repositoryName': 'string',
        'repositoryDescription': 'string',
        'defaultBranch': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'cloneUrlHttp': 'string',
        'cloneUrlSsh': 'string',
        'Arn': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a create repository operation.

    • repositoryMetadata (dict) --

      Information about the newly created repository.

      • accountId (string) --

        The ID of the AWS account associated with the repository.

      • repositoryId (string) --

        The ID of the repository.

      • repositoryName (string) --

        The repository's name.

      • repositoryDescription (string) --

        A comment or description about the repository.

      • defaultBranch (string) --

        The repository's default branch name.

      • lastModifiedDate (datetime) --

        The date and time the repository was last modified, in timestamp format.

      • creationDate (datetime) --

        The date and time the repository was created, in timestamp format.

      • cloneUrlHttp (string) --

        The URL to use for cloning the repository over HTTPS.

      • cloneUrlSsh (string) --

        The URL to use for cloning the repository over SSH.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the repository.

delete_branch(**kwargs)

Deletes a branch from a repository, unless that branch is the default branch for the repository.

See also: AWS API Documentation

Request Syntax

response = client.delete_branch(
    repositoryName='string',
    branchName='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository that contains the branch to be deleted.

  • branchName (string) --

    [REQUIRED]

    The name of the branch to delete.

Return type

dict

Returns

Response Syntax

{
    'deletedBranch': {
        'branchName': 'string',
        'commitId': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a delete branch operation.

    • deletedBranch (dict) --

      Information about the branch deleted by the operation, including the branch name and the commit ID that was the tip of the branch.

      • branchName (string) --

        The name of the branch.

      • commitId (string) --

        The ID of the last commit made to the branch.

delete_comment_content(**kwargs)

Deletes the content of a comment made on a change, file, or commit in a repository.

See also: AWS API Documentation

Request Syntax

response = client.delete_comment_content(
    commentId='string'
)
Parameters
commentId (string) --

[REQUIRED]

The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest .

Return type
dict
Returns
Response Syntax
{
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --
    • comment (dict) --

      Information about the comment you just deleted.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

delete_repository(**kwargs)

Deletes a repository. If a specified repository was already deleted, a null repository ID will be returned.

Warning

Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository will fail.

See also: AWS API Documentation

Request Syntax

response = client.delete_repository(
    repositoryName='string'
)
Parameters
repositoryName (string) --

[REQUIRED]

The name of the repository to delete.

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

Response Structure

  • (dict) --

    Represents the output of a delete repository operation.

    • repositoryId (string) --

      The ID of the repository that was deleted.

describe_pull_request_events(**kwargs)

Returns information about one or more pull request events.

See also: AWS API Documentation

Request Syntax

response = client.describe_pull_request_events(
    pullRequestId='string',
    pullRequestEventType='PULL_REQUEST_CREATED'|'PULL_REQUEST_STATUS_CHANGED'|'PULL_REQUEST_SOURCE_REFERENCE_UPDATED'|'PULL_REQUEST_MERGE_STATE_CHANGED',
    actorArn='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • pullRequestEventType (string) -- Optional. The pull request event type about which you want to return information.
  • actorArn (string) -- The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with additional commits or changing the status of a pull request.
  • nextToken (string) -- An enumeration token that when provided in a request, returns the next batch of the results.
  • maxResults (integer) -- A non-negative integer used to limit the number of returned results. The default is 100 events, which is also the maximum number of events that can be returned in a result.
Return type

dict

Returns

Response Syntax

{
    'pullRequestEvents': [
        {
            'pullRequestId': 'string',
            'eventDate': datetime(2015, 1, 1),
            'pullRequestEventType': 'PULL_REQUEST_CREATED'|'PULL_REQUEST_STATUS_CHANGED'|'PULL_REQUEST_SOURCE_REFERENCE_UPDATED'|'PULL_REQUEST_MERGE_STATE_CHANGED',
            'actorArn': 'string',
            'pullRequestStatusChangedEventMetadata': {
                'pullRequestStatus': 'OPEN'|'CLOSED'
            },
            'pullRequestSourceReferenceUpdatedEventMetadata': {
                'repositoryName': 'string',
                'beforeCommitId': 'string',
                'afterCommitId': 'string'
            },
            'pullRequestMergedStateChangedEventMetadata': {
                'repositoryName': 'string',
                'destinationReference': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • pullRequestEvents (list) --

      Information about the pull request events.

      • (dict) --

        Returns information about a pull request event.

        • pullRequestId (string) --

          The system-generated ID of the pull request.

        • eventDate (datetime) --

          The day and time of the pull request event, in timestamp format.

        • pullRequestEventType (string) --

          The type of the pull request event, for example a status change event (PULL_REQUEST_STATUS_CHANGED) or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED).

        • actorArn (string) --

          The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with additional commits or changing the status of a pull request.

        • pullRequestStatusChangedEventMetadata (dict) --

          Information about the change in status for the pull request event.

          • pullRequestStatus (string) --

            The changed status of the pull request.

        • pullRequestSourceReferenceUpdatedEventMetadata (dict) --

          Information about the updated source branch for the pull request event.

          • repositoryName (string) --

            The name of the repository where the pull request was updated.

          • beforeCommitId (string) --

            The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.

          • afterCommitId (string) --

            The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.

        • pullRequestMergedStateChangedEventMetadata (dict) --

          Information about the change in mergability state for the pull request event.

          • repositoryName (string) --

            The name of the repository where the pull request was created.

          • destinationReference (string) --

            The name of the branch that the pull request will be merged into.

          • mergeMetadata (dict) --

            Information about the merge state change event.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

    • nextToken (string) --

      An enumeration token that can be used in a request to return the next batch of the results.

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

Returns the base-64 encoded content of an individual blob within a repository.

See also: AWS API Documentation

Request Syntax

response = client.get_blob(
    repositoryName='string',
    blobId='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository that contains the blob.

  • blobId (string) --

    [REQUIRED]

    The ID of the blob, which is its SHA-1 pointer.

Return type

dict

Returns

Response Syntax

{
    'content': b'bytes'
}

Response Structure

  • (dict) --

    Represents the output of a get blob operation.

    • content (bytes) --

      The content of the blob, usually a file.

get_branch(**kwargs)

Returns information about a repository branch, including its name and the last commit ID.

See also: AWS API Documentation

Request Syntax

response = client.get_branch(
    repositoryName='string',
    branchName='string'
)
Parameters
  • repositoryName (string) -- The name of the repository that contains the branch for which you want to retrieve information.
  • branchName (string) -- The name of the branch for which you want to retrieve information.
Return type

dict

Returns

Response Syntax

{
    'branch': {
        'branchName': 'string',
        'commitId': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a get branch operation.

    • branch (dict) --

      The name of the branch.

      • branchName (string) --

        The name of the branch.

      • commitId (string) --

        The ID of the last commit made to the branch.

get_comment(**kwargs)

Returns the content of a comment made on a change, file, or commit in a repository.

See also: AWS API Documentation

Request Syntax

response = client.get_comment(
    commentId='string'
)
Parameters
commentId (string) --

[REQUIRED]

The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest .

Return type
dict
Returns
Response Syntax
{
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --
    • comment (dict) --

      The contents of the comment.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

get_comments_for_compared_commit(**kwargs)

Returns information about comments made on the comparison between two commits.

See also: AWS API Documentation

Request Syntax

response = client.get_comments_for_compared_commit(
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to compare commits.

  • beforeCommitId (string) -- To establish the directionality of the comparison, the full commit ID of the 'before' commit.
  • afterCommitId (string) --

    [REQUIRED]

    To establish the directionality of the comparison, the full commit ID of the 'after' commit.

  • nextToken (string) -- An enumeration token that when provided in a request, returns the next batch of the results.
  • maxResults (integer) -- A non-negative integer used to limit the number of returned results. The default is 100 comments, and is configurable up to 500.
Return type

dict

Returns

Response Syntax

{
    'commentsForComparedCommitData': [
        {
            'repositoryName': 'string',
            'beforeCommitId': 'string',
            'afterCommitId': 'string',
            'beforeBlobId': 'string',
            'afterBlobId': 'string',
            'location': {
                'filePath': 'string',
                'filePosition': 123,
                'relativeFileVersion': 'BEFORE'|'AFTER'
            },
            'comments': [
                {
                    'commentId': 'string',
                    'content': 'string',
                    'inReplyTo': 'string',
                    'creationDate': datetime(2015, 1, 1),
                    'lastModifiedDate': datetime(2015, 1, 1),
                    'authorArn': 'string',
                    'deleted': True|False,
                    'clientRequestToken': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • commentsForComparedCommitData (list) --

      A list of comment objects on the compared commit.

      • (dict) --

        Returns information about comments on the comparison between two commits.

        • repositoryName (string) --

          The name of the repository that contains the compared commits.

        • beforeCommitId (string) --

          The full commit ID of the commit used to establish the 'before' of the comparison.

        • afterCommitId (string) --

          The full commit ID of the commit used to establish the 'after' of the comparison.

        • beforeBlobId (string) --

          The full blob ID of the commit used to establish the 'before' of the comparison.

        • afterBlobId (string) --

          The full blob ID of the commit used to establish the 'after' of the comparison.

        • location (dict) --

          Location information about the comment on the comparison, including the file name, line number, and whether the version of the file where the comment was made is 'BEFORE' or 'AFTER'.

          • filePath (string) --

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition (integer) --

            The position of a change within a compared file, in line number format.

          • relativeFileVersion (string) --

            In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

        • comments (list) --

          An array of comment objects. Each comment object contains information about a comment on the comparison between commits.

          • (dict) --

            Returns information about a specific comment.

            • commentId (string) --

              The system-generated comment ID.

            • content (string) --

              The content of the comment.

            • inReplyTo (string) --

              The ID of the comment for which this comment is a reply, if any.

            • creationDate (datetime) --

              The date and time the comment was created, in timestamp format.

            • lastModifiedDate (datetime) --

              The date and time the comment was most recently modified, in timestamp format.

            • authorArn (string) --

              The Amazon Resource Name (ARN) of the person who posted the comment.

            • deleted (boolean) --

              A Boolean value indicating whether the comment has been deleted.

            • clientRequestToken (string) --

              A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    • nextToken (string) --

      An enumeration token that can be used in a request to return the next batch of the results.

get_comments_for_pull_request(**kwargs)

Returns comments made on a pull request.

See also: AWS API Documentation

Request Syntax

response = client.get_comments_for_pull_request(
    pullRequestId='string',
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • repositoryName (string) -- The name of the repository that contains the pull request.
  • beforeCommitId (string) -- The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created.
  • afterCommitId (string) -- The full commit ID of the commit in the source branch that was the tip of the branch at the time the comment was made.
  • nextToken (string) -- An enumeration token that when provided in a request, returns the next batch of the results.
  • maxResults (integer) -- A non-negative integer used to limit the number of returned results. The default is 100 comments. You can return up to 500 comments with a single request.
Return type

dict

Returns

Response Syntax

{
    'commentsForPullRequestData': [
        {
            'pullRequestId': 'string',
            'repositoryName': 'string',
            'beforeCommitId': 'string',
            'afterCommitId': 'string',
            'beforeBlobId': 'string',
            'afterBlobId': 'string',
            'location': {
                'filePath': 'string',
                'filePosition': 123,
                'relativeFileVersion': 'BEFORE'|'AFTER'
            },
            'comments': [
                {
                    'commentId': 'string',
                    'content': 'string',
                    'inReplyTo': 'string',
                    'creationDate': datetime(2015, 1, 1),
                    'lastModifiedDate': datetime(2015, 1, 1),
                    'authorArn': 'string',
                    'deleted': True|False,
                    'clientRequestToken': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • commentsForPullRequestData (list) --

      An array of comment objects on the pull request.

      • (dict) --

        Returns information about comments on a pull request.

        • pullRequestId (string) --

          The system-generated ID of the pull request.

        • repositoryName (string) --

          The name of the repository that contains the pull request.

        • beforeCommitId (string) --

          The full commit ID of the commit that was the tip of the destination branch when the pull request was created. This commit will be superceded by the after commit in the source branch when and if you merge the source branch into the destination branch.

        • afterCommitId (string) --

          he full commit ID of the commit that was the tip of the source branch at the time the comment was made.

        • beforeBlobId (string) --

          The full blob ID of the file on which you want to comment on the destination commit.

        • afterBlobId (string) --

          The full blob ID of the file on which you want to comment on the source commit.

        • location (dict) --

          Location information about the comment on the pull request, including the file name, line number, and whether the version of the file where the comment was made is 'BEFORE' (destination branch) or 'AFTER' (source branch).

          • filePath (string) --

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition (integer) --

            The position of a change within a compared file, in line number format.

          • relativeFileVersion (string) --

            In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

        • comments (list) --

          An array of comment objects. Each comment object contains information about a comment on the pull request.

          • (dict) --

            Returns information about a specific comment.

            • commentId (string) --

              The system-generated comment ID.

            • content (string) --

              The content of the comment.

            • inReplyTo (string) --

              The ID of the comment for which this comment is a reply, if any.

            • creationDate (datetime) --

              The date and time the comment was created, in timestamp format.

            • lastModifiedDate (datetime) --

              The date and time the comment was most recently modified, in timestamp format.

            • authorArn (string) --

              The Amazon Resource Name (ARN) of the person who posted the comment.

            • deleted (boolean) --

              A Boolean value indicating whether the comment has been deleted.

            • clientRequestToken (string) --

              A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    • nextToken (string) --

      An enumeration token that can be used in a request to return the next batch of the results.

get_commit(**kwargs)

Returns information about a commit, including commit message and committer information.

See also: AWS API Documentation

Request Syntax

response = client.get_commit(
    repositoryName='string',
    commitId='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository to which the commit was made.

  • commitId (string) --

    [REQUIRED]

    The commit ID. Commit IDs are the full SHA of the commit.

Return type

dict

Returns

Response Syntax

{
    'commit': {
        'commitId': 'string',
        'treeId': 'string',
        'parents': [
            'string',
        ],
        'message': 'string',
        'author': {
            'name': 'string',
            'email': 'string',
            'date': 'string'
        },
        'committer': {
            'name': 'string',
            'email': 'string',
            'date': 'string'
        },
        'additionalData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a get commit operation.

    • commit (dict) --

      A commit data type object that contains information about the specified commit.

      • commitId (string) --

        The full SHA of the specified commit.

      • treeId (string) --

        Tree information for the specified commit.

      • parents (list) --

        A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.

        • (string) --
      • message (string) --

        The commit message associated with the specified commit.

      • author (dict) --

        Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.

        • name (string) --

          The name of the user who made the specified commit.

        • email (string) --

          The email address associated with the user who made the commit, if any.

        • date (string) --

          The date when the specified commit was commited, in timestamp format with GMT offset.

      • committer (dict) --

        Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.

        For more information about the difference between an author and a committer in Git, see Viewing the Commit History in Pro Git by Scott Chacon and Ben Straub.

        • name (string) --

          The name of the user who made the specified commit.

        • email (string) --

          The email address associated with the user who made the commit, if any.

        • date (string) --

          The date when the specified commit was commited, in timestamp format with GMT offset.

      • additionalData (string) --

        Any additional data associated with the specified commit.

get_differences(**kwargs)

Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID or other fully qualified reference). Results can be limited to a specified path.

See also: AWS API Documentation

Request Syntax

response = client.get_differences(
    repositoryName='string',
    beforeCommitSpecifier='string',
    afterCommitSpecifier='string',
    beforePath='string',
    afterPath='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to get differences.

  • beforeCommitSpecifier (string) -- The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, the full commit ID. Optional. If not specified, all changes prior to the afterCommitSpecifier value will be shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults .
  • afterCommitSpecifier (string) --

    [REQUIRED]

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

  • beforePath (string) -- The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences will be shown for all paths.
  • afterPath (string) -- The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences will be shown for all paths.
  • MaxResults (integer) -- A non-negative integer used to limit the number of returned results.
  • NextToken (string) -- An enumeration token that when provided in a request, returns the next batch of the results.
Return type

dict

Returns

Response Syntax

{
    'differences': [
        {
            'beforeBlob': {
                'blobId': 'string',
                'path': 'string',
                'mode': 'string'
            },
            'afterBlob': {
                'blobId': 'string',
                'path': 'string',
                'mode': 'string'
            },
            'changeType': 'A'|'M'|'D'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • differences (list) --

      A differences data type object that contains information about the differences, including whether the difference is added, modified, or deleted (A, D, M).

      • (dict) --

        Returns information about a set of differences for a commit specifier.

        • beforeBlob (dict) --

          Information about a beforeBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write
            • 100755 indicates read/write/execute
            • 160000 indicates a submodule
            • 120000 indicates a symlink
        • afterBlob (dict) --

          Information about an afterBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write
            • 100755 indicates read/write/execute
            • 160000 indicates a submodule
            • 120000 indicates a symlink
        • changeType (string) --

          Whether the change type of the difference is an addition (A), deletion (D), or modification (M).

    • NextToken (string) --

      An enumeration token that can be used in a request to return the next batch of the results.

get_merge_conflicts(**kwargs)

Returns information about merge conflicts between the before and after commit IDs for a pull request in a repository.

See also: AWS API Documentation

Request Syntax

response = client.get_merge_conflicts(
    repositoryName='string',
    destinationCommitSpecifier='string',
    sourceCommitSpecifier='string',
    mergeOption='FAST_FORWARD_MERGE'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where the pull request was created.

  • destinationCommitSpecifier (string) --

    [REQUIRED]

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, a branch name or a full commit ID.

  • sourceCommitSpecifier (string) --

    [REQUIRED]

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, a branch name or a full commit ID.

  • mergeOption (string) --

    [REQUIRED]

    The merge option or strategy you want to use to merge the code. The only valid value is FAST_FORWARD_MERGE.

Return type

dict

Returns

Response Syntax

{
    'mergeable': True|False,
    'destinationCommitId': 'string',
    'sourceCommitId': 'string'
}

Response Structure

  • (dict) --

    • mergeable (boolean) --

      A Boolean value that indicates whether the code is mergable by the specified merge option.

    • destinationCommitId (string) --

      The commit ID of the destination commit specifier that was used in the merge evaluation.

    • sourceCommitId (string) --

      The commit ID of the source commit specifier that was used in the merge evaluation.

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

Gets information about a pull request in a specified repository.

See also: AWS API Documentation

Request Syntax

response = client.get_pull_request(
    pullRequestId='string'
)
Parameters
pullRequestId (string) --

[REQUIRED]

The system-generated ID of the pull request. To get this ID, use ListPullRequests .

Return type
dict
Returns
Response Syntax
{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --
    • pullRequest (dict) --

      Information about the specified pull request.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

get_repository(**kwargs)

Returns information about a repository.

Note

The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

See also: AWS API Documentation

Request Syntax

response = client.get_repository(
    repositoryName='string'
)
Parameters
repositoryName (string) --

[REQUIRED]

The name of the repository to get information about.

Return type
dict
Returns
Response Syntax
{
    'repositoryMetadata': {
        'accountId': 'string',
        'repositoryId': 'string',
        'repositoryName': 'string',
        'repositoryDescription': 'string',
        'defaultBranch': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'cloneUrlHttp': 'string',
        'cloneUrlSsh': 'string',
        'Arn': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a get repository operation.

    • repositoryMetadata (dict) --

      Information about the repository.

      • accountId (string) --

        The ID of the AWS account associated with the repository.

      • repositoryId (string) --

        The ID of the repository.

      • repositoryName (string) --

        The repository's name.

      • repositoryDescription (string) --

        A comment or description about the repository.

      • defaultBranch (string) --

        The repository's default branch name.

      • lastModifiedDate (datetime) --

        The date and time the repository was last modified, in timestamp format.

      • creationDate (datetime) --

        The date and time the repository was created, in timestamp format.

      • cloneUrlHttp (string) --

        The URL to use for cloning the repository over HTTPS.

      • cloneUrlSsh (string) --

        The URL to use for cloning the repository over SSH.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the repository.

get_repository_triggers(**kwargs)

Gets information about triggers configured for a repository.

See also: AWS API Documentation

Request Syntax

response = client.get_repository_triggers(
    repositoryName='string'
)
Parameters
repositoryName (string) --

[REQUIRED]

The name of the repository for which the trigger is configured.

Return type
dict
Returns
Response Syntax
{
    'configurationId': 'string',
    'triggers': [
        {
            'name': 'string',
            'destinationArn': 'string',
            'customData': 'string',
            'branches': [
                'string',
            ],
            'events': [
                'all'|'updateReference'|'createReference'|'deleteReference',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    Represents the output of a get repository triggers operation.

    • configurationId (string) --

      The system-generated unique ID for the trigger.

    • triggers (list) --

      The JSON block of configuration information for each trigger.

      • (dict) --

        Information about a trigger for a repository.

        • name (string) --

          The name of the trigger.

        • destinationArn (string) --

          The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

        • customData (string) --

          Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

        • branches (list) --

          The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

          Note

          While no content is required in the array, you must include the array itself.

          • (string) --
        • events (list) --

          The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

          Note

          The valid value "all" cannot be used with any other values.

          • (string) --
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_branches(**kwargs)

Gets information about one or more branches in a repository.

See also: AWS API Documentation

Request Syntax

response = client.list_branches(
    repositoryName='string',
    nextToken='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository that contains the branches.

  • nextToken (string) -- An enumeration token that allows the operation to batch the results.
Return type

dict

Returns

Response Syntax

{
    'branches': [
        'string',
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a list branches operation.

    • branches (list) --

      The list of branch names.

      • (string) --
    • nextToken (string) --

      An enumeration token that returns the batch of the results.

list_pull_requests(**kwargs)

Returns a list of pull requests for a specified repository. The return list can be refined by pull request status or pull request author ARN.

See also: AWS API Documentation

Request Syntax

response = client.list_pull_requests(
    repositoryName='string',
    authorArn='string',
    pullRequestStatus='OPEN'|'CLOSED',
    nextToken='string',
    maxResults=123
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository for which you want to list pull requests.

  • authorArn (string) -- Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results to pull requests created by that user.
  • pullRequestStatus (string) -- Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.
  • nextToken (string) -- An enumeration token that when provided in a request, returns the next batch of the results.
  • maxResults (integer) -- A non-negative integer used to limit the number of returned results.
Return type

dict

Returns

Response Syntax

{
    'pullRequestIds': [
        'string',
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • pullRequestIds (list) --

      The system-generated IDs of the pull requests.

      • (string) --
    • nextToken (string) --

      An enumeration token that when provided in a request, returns the next batch of the results.

list_repositories(**kwargs)

Gets information about one or more repositories.

See also: AWS API Documentation

Request Syntax

response = client.list_repositories(
    nextToken='string',
    sortBy='repositoryName'|'lastModifiedDate',
    order='ascending'|'descending'
)
Parameters
  • nextToken (string) -- An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.
  • sortBy (string) -- The criteria used to sort the results of a list repositories operation.
  • order (string) -- The order in which to sort the results of a list repositories operation.
Return type

dict

Returns

Response Syntax

{
    'repositories': [
        {
            'repositoryName': 'string',
            'repositoryId': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a list repositories operation.

    • repositories (list) --

      Lists the repositories called by the list repositories operation.

      • (dict) --

        Information about a repository name and ID.

        • repositoryName (string) --

          The name associated with the repository.

        • repositoryId (string) --

          The ID associated with the repository.

    • nextToken (string) --

      An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

merge_pull_request_by_fast_forward(**kwargs)

Closes a pull request and attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the fast-forward merge option.

See also: AWS API Documentation

Request Syntax

response = client.merge_pull_request_by_fast_forward(
    pullRequestId='string',
    repositoryName='string',
    sourceCommitId='string'
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where the pull request was created.

  • sourceCommitId (string) -- The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.
Return type

dict

Returns

Response Syntax

{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the specified pull request, including information about the merge.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

post_comment_for_compared_commit(**kwargs)

Posts a comment on the comparison between two commits.

See also: AWS API Documentation

Request Syntax

response = client.post_comment_for_compared_commit(
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    location={
        'filePath': 'string',
        'filePosition': 123,
        'relativeFileVersion': 'BEFORE'|'AFTER'
    },
    content='string',
    clientRequestToken='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to post a comment on the comparison between commits.

  • beforeCommitId (string) -- To establish the directionality of the comparison, the full commit ID of the 'before' commit.
  • afterCommitId (string) --

    [REQUIRED]

    To establish the directionality of the comparison, the full commit ID of the 'after' commit.

  • location (dict) --

    The location of the comparison where you want to comment.

    • filePath (string) --

      The name of the file being compared, including its extension and subdirectory, if any.

    • filePosition (integer) --

      The position of a change within a compared file, in line number format.

    • relativeFileVersion (string) --

      In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

  • content (string) --

    [REQUIRED]

    The content of the comment you want to make.

  • clientRequestToken (string) --

    A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'repositoryName': 'string',
    'beforeCommitId': 'string',
    'afterCommitId': 'string',
    'beforeBlobId': 'string',
    'afterBlobId': 'string',
    'location': {
        'filePath': 'string',
        'filePosition': 123,
        'relativeFileVersion': 'BEFORE'|'AFTER'
    },
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • repositoryName (string) --

      The name of the repository where you posted a comment on the comparison between commits.

    • beforeCommitId (string) --

      In the directionality you established, the full commit ID of the 'before' commit.

    • afterCommitId (string) --

      In the directionality you established, the full commit ID of the 'after' commit.

    • beforeBlobId (string) --

      In the directionality you established, the blob ID of the 'before' blob.

    • afterBlobId (string) --

      In the directionality you established, the blob ID of the 'after' blob.

    • location (dict) --

      The location of the comment in the comparison between the two commits.

      • filePath (string) --

        The name of the file being compared, including its extension and subdirectory, if any.

      • filePosition (integer) --

        The position of a change within a compared file, in line number format.

      • relativeFileVersion (string) --

        In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

    • comment (dict) --

      The content of the comment you posted.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

post_comment_for_pull_request(**kwargs)

Posts a comment on a pull request.

See also: AWS API Documentation

Request Syntax

response = client.post_comment_for_pull_request(
    pullRequestId='string',
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    location={
        'filePath': 'string',
        'filePosition': 123,
        'relativeFileVersion': 'BEFORE'|'AFTER'
    },
    content='string',
    clientRequestToken='string'
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to post a comment on a pull request.

  • beforeCommitId (string) --

    [REQUIRED]

    The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created.

  • afterCommitId (string) --

    [REQUIRED]

    The full commit ID of the commit in the source branch that is the current tip of the branch for the pull request when you post the comment.

  • location (dict) --

    The location of the change where you want to post your comment. If no location is provided, the comment will be posted as a general comment on the pull request difference between the before commit ID and the after commit ID.

    • filePath (string) --

      The name of the file being compared, including its extension and subdirectory, if any.

    • filePosition (integer) --

      The position of a change within a compared file, in line number format.

    • relativeFileVersion (string) --

      In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

  • content (string) --

    [REQUIRED]

    The content of your comment on the change.

  • clientRequestToken (string) --

    A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'repositoryName': 'string',
    'pullRequestId': 'string',
    'beforeCommitId': 'string',
    'afterCommitId': 'string',
    'beforeBlobId': 'string',
    'afterBlobId': 'string',
    'location': {
        'filePath': 'string',
        'filePosition': 123,
        'relativeFileVersion': 'BEFORE'|'AFTER'
    },
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • repositoryName (string) --

      The name of the repository where you posted a comment on a pull request.

    • pullRequestId (string) --

      The system-generated ID of the pull request.

    • beforeCommitId (string) --

      The full commit ID of the commit in the source branch used to create the pull request, or in the case of an updated pull request, the full commit ID of the commit used to update the pull request.

    • afterCommitId (string) --

      The full commit ID of the commit in the destination branch where the pull request will be merged.

    • beforeBlobId (string) --

      In the directionality of the pull request, the blob ID of the 'before' blob.

    • afterBlobId (string) --

      In the directionality of the pull request, the blob ID of the 'after' blob.

    • location (dict) --

      The location of the change where you posted your comment.

      • filePath (string) --

        The name of the file being compared, including its extension and subdirectory, if any.

      • filePosition (integer) --

        The position of a change within a compared file, in line number format.

      • relativeFileVersion (string) --

        In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

    • comment (dict) --

      The content of the comment you posted.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

post_comment_reply(**kwargs)

Posts a comment in reply to an existing comment on a comparison between commits or a pull request.

See also: AWS API Documentation

Request Syntax

response = client.post_comment_reply(
    inReplyTo='string',
    clientRequestToken='string',
    content='string'
)
Parameters
  • inReplyTo (string) --

    [REQUIRED]

    The system-generated ID of the comment to which you want to reply. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest .

  • clientRequestToken (string) --

    A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    This field is autopopulated if not provided.

  • content (string) --

    [REQUIRED]

    The contents of your reply to a comment.

Return type

dict

Returns

Response Syntax

{
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • comment (dict) --

      Information about the reply to a comment.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

put_file(**kwargs)

Adds or updates a file in an AWS CodeCommit repository.

See also: AWS API Documentation

Request Syntax

response = client.put_file(
    repositoryName='string',
    branchName='string',
    fileContent=b'bytes',
    filePath='string',
    fileMode='EXECUTABLE'|'NORMAL'|'SYMLINK',
    parentCommitId='string',
    commitMessage='string',
    name='string',
    email='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to add or update the file.

  • branchName (string) --

    [REQUIRED]

    The name of the branch where you want to add or update the file.

  • fileContent (bytes) --

    [REQUIRED]

    The content of the file, in binary object format.

  • filePath (string) --

    [REQUIRED]

    The name of the file you want to add or update, including the relative path to the file in the repository.

    Note

    If the path does not currently exist in the repository, the path will be created as part of adding the file.

  • fileMode (string) -- The file mode permissions of the blob. Valid file mode permissions are listed below.
  • parentCommitId (string) -- The full commit ID of the head commit in the branch where you want to add or update the file. If the commit ID does not match the ID of the head commit at the time of the operation, an error will occur, and the file will not be added or updated.
  • commitMessage (string) -- A message about why this file was added or updated. While optional, adding a message is strongly encouraged in order to provide a more useful commit history for your repository.
  • name (string) -- The name of the person adding or updating the file. While optional, adding a name is strongly encouraged in order to provide a more useful commit history for your repository.
  • email (string) -- An email address for the person adding or updating the file.
Return type

dict

Returns

Response Syntax

{
    'commitId': 'string',
    'blobId': 'string',
    'treeId': 'string'
}

Response Structure

  • (dict) --

    • commitId (string) --

      The full SHA of the commit that contains this file change.

    • blobId (string) --

      The ID of the blob, which is its SHA-1 pointer.

    • treeId (string) --

      Tree information for the commit that contains this file change.

put_repository_triggers(**kwargs)

Replaces all triggers for a repository. This can be used to create or delete triggers.

See also: AWS API Documentation

Request Syntax

response = client.put_repository_triggers(
    repositoryName='string',
    triggers=[
        {
            'name': 'string',
            'destinationArn': 'string',
            'customData': 'string',
            'branches': [
                'string',
            ],
            'events': [
                'all'|'updateReference'|'createReference'|'deleteReference',
            ]
        },
    ]
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to create or update the trigger.

  • triggers (list) --

    [REQUIRED]

    The JSON block of configuration information for each trigger.

    • (dict) --

      Information about a trigger for a repository.

      • name (string) -- [REQUIRED]

        The name of the trigger.

      • destinationArn (string) -- [REQUIRED]

        The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

      • customData (string) --

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches (list) --

        The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

        Note

        While no content is required in the array, you must include the array itself.

        • (string) --
      • events (list) -- [REQUIRED]

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

        Note

        The valid value "all" cannot be used with any other values.

        • (string) --
Return type

dict

Returns

Response Syntax

{
    'configurationId': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a put repository triggers operation.

    • configurationId (string) --

      The system-generated unique ID for the create or update operation.

test_repository_triggers(**kwargs)

Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test will send data from the last commit. If no data is available, sample data will be generated.

See also: AWS API Documentation

Request Syntax

response = client.test_repository_triggers(
    repositoryName='string',
    triggers=[
        {
            'name': 'string',
            'destinationArn': 'string',
            'customData': 'string',
            'branches': [
                'string',
            ],
            'events': [
                'all'|'updateReference'|'createReference'|'deleteReference',
            ]
        },
    ]
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository in which to test the triggers.

  • triggers (list) --

    [REQUIRED]

    The list of triggers to test.

    • (dict) --

      Information about a trigger for a repository.

      • name (string) -- [REQUIRED]

        The name of the trigger.

      • destinationArn (string) -- [REQUIRED]

        The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

      • customData (string) --

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches (list) --

        The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

        Note

        While no content is required in the array, you must include the array itself.

        • (string) --
      • events (list) -- [REQUIRED]

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

        Note

        The valid value "all" cannot be used with any other values.

        • (string) --
Return type

dict

Returns

Response Syntax

{
    'successfulExecutions': [
        'string',
    ],
    'failedExecutions': [
        {
            'trigger': 'string',
            'failureMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the output of a test repository triggers operation.

    • successfulExecutions (list) --

      The list of triggers that were successfully tested. This list provides the names of the triggers that were successfully tested, separated by commas.

      • (string) --
    • failedExecutions (list) --

      The list of triggers that were not able to be tested. This list provides the names of the triggers that could not be tested, separated by commas.

      • (dict) --

        A trigger failed to run.

        • trigger (string) --

          The name of the trigger that did not run.

        • failureMessage (string) --

          Additional message information about the trigger that did not run.

update_comment(**kwargs)

Replaces the contents of a comment.

See also: AWS API Documentation

Request Syntax

response = client.update_comment(
    commentId='string',
    content='string'
)
Parameters
  • commentId (string) --

    [REQUIRED]

    The system-generated ID of the comment you want to update. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest .

  • content (string) --

    [REQUIRED]

    The updated content with which you want to replace the existing content of the comment.

Return type

dict

Returns

Response Syntax

{
    'comment': {
        'commentId': 'string',
        'content': 'string',
        'inReplyTo': 'string',
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedDate': datetime(2015, 1, 1),
        'authorArn': 'string',
        'deleted': True|False,
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • comment (dict) --

      Information about the updated comment.

      • commentId (string) --

        The system-generated comment ID.

      • content (string) --

        The content of the comment.

      • inReplyTo (string) --

        The ID of the comment for which this comment is a reply, if any.

      • creationDate (datetime) --

        The date and time the comment was created, in timestamp format.

      • lastModifiedDate (datetime) --

        The date and time the comment was most recently modified, in timestamp format.

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the person who posted the comment.

      • deleted (boolean) --

        A Boolean value indicating whether the comment has been deleted.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

update_default_branch(**kwargs)

Sets or changes the default branch name for the specified repository.

Note

If you use this operation to change the default branch name to the current default branch name, a success message is returned even though the default branch did not change.

See also: AWS API Documentation

Request Syntax

response = client.update_default_branch(
    repositoryName='string',
    defaultBranchName='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository to set or change the default branch for.

  • defaultBranchName (string) --

    [REQUIRED]

    The name of the branch to set as the default.

Returns

None

update_pull_request_description(**kwargs)

Replaces the contents of the description of a pull request.

See also: AWS API Documentation

Request Syntax

response = client.update_pull_request_description(
    pullRequestId='string',
    description='string'
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • description (string) --

    [REQUIRED]

    The updated content of the description for the pull request. This content will replace the existing description.

Return type

dict

Returns

Response Syntax

{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the updated pull request.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

update_pull_request_status(**kwargs)

Updates the status of a pull request.

See also: AWS API Documentation

Request Syntax

response = client.update_pull_request_status(
    pullRequestId='string',
    pullRequestStatus='OPEN'|'CLOSED'
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • pullRequestStatus (string) --

    [REQUIRED]

    The status of the pull request. The only valid operations are to update the status from OPEN to OPEN , OPEN to CLOSED or from from CLOSED to CLOSED .

Return type

dict

Returns

Response Syntax

{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the pull request.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

update_pull_request_title(**kwargs)

Replaces the title of a pull request.

See also: AWS API Documentation

Request Syntax

response = client.update_pull_request_title(
    pullRequestId='string',
    title='string'
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • title (string) --

    [REQUIRED]

    The updated title of the pull request. This will replace the existing title.

Return type

dict

Returns

Response Syntax

{
    'pullRequest': {
        'pullRequestId': 'string',
        'title': 'string',
        'description': 'string',
        'lastActivityDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'pullRequestStatus': 'OPEN'|'CLOSED',
        'authorArn': 'string',
        'pullRequestTargets': [
            {
                'repositoryName': 'string',
                'sourceReference': 'string',
                'destinationReference': 'string',
                'destinationCommit': 'string',
                'sourceCommit': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            },
        ],
        'clientRequestToken': 'string'
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the updated pull request.

      • pullRequestId (string) --

        The system-generated ID of the pull request.

      • title (string) --

        The user-defined title of the pull request. This title is displayed in the list of pull requests to other users of the repository.

      • description (string) --

        The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

      • lastActivityDate (datetime) --

        The day and time of the last user or system activity on the pull request, in timestamp format.

      • creationDate (datetime) --

        The date and time the pull request was originally created, in timestamp format.

      • pullRequestStatus (string) --

        The status of the pull request. Pull request status can only change from OPEN to CLOSED .

      • authorArn (string) --

        The Amazon Resource Name (ARN) of the user who created the pull request.

      • pullRequestTargets (list) --

        The targets of the pull request, including the source branch and destination branch for the pull request.

        • (dict) --

          Returns information about a pull request target.

          • repositoryName (string) --

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference (string) --

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference (string) --

            The branch of the repository where the pull request changes will be merged into. Also known as the destination branch.

          • destinationCommit (string) --

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit (string) --

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID will change to reflect the new tip of the branch.

          • mergeMetadata (dict) --

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

      • clientRequestToken (string) --

        A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

update_repository_description(**kwargs)

Sets or changes the comment or description for a repository.

Note

The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

See also: AWS API Documentation

Request Syntax

response = client.update_repository_description(
    repositoryName='string',
    repositoryDescription='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository to set or change the comment or description for.

  • repositoryDescription (string) -- The new comment or description for the specified repository. Repository descriptions are limited to 1,000 characters.
Returns

None

update_repository_name(**kwargs)

Renames a repository. The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix ".git" is prohibited. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide.

See also: AWS API Documentation

Request Syntax

response = client.update_repository_name(
    oldName='string',
    newName='string'
)
Parameters
  • oldName (string) --

    [REQUIRED]

    The existing name of the repository.

  • newName (string) --

    [REQUIRED]

    The new name for the repository.

Returns

None

Paginators

The available paginators are:

class CodeCommit.Paginator.DescribePullRequestEvents
paginator = client.get_paginator('describe_pull_request_events')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.describe_pull_request_events().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    pullRequestId='string',
    pullRequestEventType='PULL_REQUEST_CREATED'|'PULL_REQUEST_STATUS_CHANGED'|'PULL_REQUEST_SOURCE_REFERENCE_UPDATED'|'PULL_REQUEST_MERGE_STATE_CHANGED',
    actorArn='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • pullRequestEventType (string) -- Optional. The pull request event type about which you want to return information.
  • actorArn (string) -- The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with additional commits or changing the status of a pull request.
  • 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

{
    'pullRequestEvents': [
        {
            'pullRequestId': 'string',
            'eventDate': datetime(2015, 1, 1),
            'pullRequestEventType': 'PULL_REQUEST_CREATED'|'PULL_REQUEST_STATUS_CHANGED'|'PULL_REQUEST_SOURCE_REFERENCE_UPDATED'|'PULL_REQUEST_MERGE_STATE_CHANGED',
            'actorArn': 'string',
            'pullRequestStatusChangedEventMetadata': {
                'pullRequestStatus': 'OPEN'|'CLOSED'
            },
            'pullRequestSourceReferenceUpdatedEventMetadata': {
                'repositoryName': 'string',
                'beforeCommitId': 'string',
                'afterCommitId': 'string'
            },
            'pullRequestMergedStateChangedEventMetadata': {
                'repositoryName': 'string',
                'destinationReference': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string'
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • pullRequestEvents (list) --

      Information about the pull request events.

      • (dict) --

        Returns information about a pull request event.

        • pullRequestId (string) --

          The system-generated ID of the pull request.

        • eventDate (datetime) --

          The day and time of the pull request event, in timestamp format.

        • pullRequestEventType (string) --

          The type of the pull request event, for example a status change event (PULL_REQUEST_STATUS_CHANGED) or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED).

        • actorArn (string) --

          The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with additional commits or changing the status of a pull request.

        • pullRequestStatusChangedEventMetadata (dict) --

          Information about the change in status for the pull request event.

          • pullRequestStatus (string) --

            The changed status of the pull request.

        • pullRequestSourceReferenceUpdatedEventMetadata (dict) --

          Information about the updated source branch for the pull request event.

          • repositoryName (string) --

            The name of the repository where the pull request was updated.

          • beforeCommitId (string) --

            The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.

          • afterCommitId (string) --

            The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.

        • pullRequestMergedStateChangedEventMetadata (dict) --

          Information about the change in mergability state for the pull request event.

          • repositoryName (string) --

            The name of the repository where the pull request was created.

          • destinationReference (string) --

            The name of the branch that the pull request will be merged into.

          • mergeMetadata (dict) --

            Information about the merge state change event.

            • isMerged (boolean) --

              A Boolean value indicating whether the merge has been made.

            • mergedBy (string) --

              The Amazon Resource Name (ARN) of the user who merged the branches.

    • NextToken (string) --

      A token to resume pagination.

class CodeCommit.Paginator.GetCommentsForComparedCommit
paginator = client.get_paginator('get_comments_for_compared_commit')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.get_comments_for_compared_commit().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to compare commits.

  • beforeCommitId (string) -- To establish the directionality of the comparison, the full commit ID of the 'before' commit.
  • afterCommitId (string) --

    [REQUIRED]

    To establish the directionality of the comparison, the full commit ID of the 'after' commit.

  • 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

{
    'commentsForComparedCommitData': [
        {
            'repositoryName': 'string',
            'beforeCommitId': 'string',
            'afterCommitId': 'string',
            'beforeBlobId': 'string',
            'afterBlobId': 'string',
            'location': {
                'filePath': 'string',
                'filePosition': 123,
                'relativeFileVersion': 'BEFORE'|'AFTER'
            },
            'comments': [
                {
                    'commentId': 'string',
                    'content': 'string',
                    'inReplyTo': 'string',
                    'creationDate': datetime(2015, 1, 1),
                    'lastModifiedDate': datetime(2015, 1, 1),
                    'authorArn': 'string',
                    'deleted': True|False,
                    'clientRequestToken': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • commentsForComparedCommitData (list) --

      A list of comment objects on the compared commit.

      • (dict) --

        Returns information about comments on the comparison between two commits.

        • repositoryName (string) --

          The name of the repository that contains the compared commits.

        • beforeCommitId (string) --

          The full commit ID of the commit used to establish the 'before' of the comparison.

        • afterCommitId (string) --

          The full commit ID of the commit used to establish the 'after' of the comparison.

        • beforeBlobId (string) --

          The full blob ID of the commit used to establish the 'before' of the comparison.

        • afterBlobId (string) --

          The full blob ID of the commit used to establish the 'after' of the comparison.

        • location (dict) --

          Location information about the comment on the comparison, including the file name, line number, and whether the version of the file where the comment was made is 'BEFORE' or 'AFTER'.

          • filePath (string) --

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition (integer) --

            The position of a change within a compared file, in line number format.

          • relativeFileVersion (string) --

            In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

        • comments (list) --

          An array of comment objects. Each comment object contains information about a comment on the comparison between commits.

          • (dict) --

            Returns information about a specific comment.

            • commentId (string) --

              The system-generated comment ID.

            • content (string) --

              The content of the comment.

            • inReplyTo (string) --

              The ID of the comment for which this comment is a reply, if any.

            • creationDate (datetime) --

              The date and time the comment was created, in timestamp format.

            • lastModifiedDate (datetime) --

              The date and time the comment was most recently modified, in timestamp format.

            • authorArn (string) --

              The Amazon Resource Name (ARN) of the person who posted the comment.

            • deleted (boolean) --

              A Boolean value indicating whether the comment has been deleted.

            • clientRequestToken (string) --

              A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    • NextToken (string) --

      A token to resume pagination.

class CodeCommit.Paginator.GetCommentsForPullRequest
paginator = client.get_paginator('get_comments_for_pull_request')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.get_comments_for_pull_request().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    pullRequestId='string',
    repositoryName='string',
    beforeCommitId='string',
    afterCommitId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • pullRequestId (string) --

    [REQUIRED]

    The system-generated ID of the pull request. To get this ID, use ListPullRequests .

  • repositoryName (string) -- The name of the repository that contains the pull request.
  • beforeCommitId (string) -- The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created.
  • afterCommitId (string) -- The full commit ID of the commit in the source branch that was the tip of the branch at the time the comment was made.
  • 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

{
    'commentsForPullRequestData': [
        {
            'pullRequestId': 'string',
            'repositoryName': 'string',
            'beforeCommitId': 'string',
            'afterCommitId': 'string',
            'beforeBlobId': 'string',
            'afterBlobId': 'string',
            'location': {
                'filePath': 'string',
                'filePosition': 123,
                'relativeFileVersion': 'BEFORE'|'AFTER'
            },
            'comments': [
                {
                    'commentId': 'string',
                    'content': 'string',
                    'inReplyTo': 'string',
                    'creationDate': datetime(2015, 1, 1),
                    'lastModifiedDate': datetime(2015, 1, 1),
                    'authorArn': 'string',
                    'deleted': True|False,
                    'clientRequestToken': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • commentsForPullRequestData (list) --

      An array of comment objects on the pull request.

      • (dict) --

        Returns information about comments on a pull request.

        • pullRequestId (string) --

          The system-generated ID of the pull request.

        • repositoryName (string) --

          The name of the repository that contains the pull request.

        • beforeCommitId (string) --

          The full commit ID of the commit that was the tip of the destination branch when the pull request was created. This commit will be superceded by the after commit in the source branch when and if you merge the source branch into the destination branch.

        • afterCommitId (string) --

          he full commit ID of the commit that was the tip of the source branch at the time the comment was made.

        • beforeBlobId (string) --

          The full blob ID of the file on which you want to comment on the destination commit.

        • afterBlobId (string) --

          The full blob ID of the file on which you want to comment on the source commit.

        • location (dict) --

          Location information about the comment on the pull request, including the file name, line number, and whether the version of the file where the comment was made is 'BEFORE' (destination branch) or 'AFTER' (source branch).

          • filePath (string) --

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition (integer) --

            The position of a change within a compared file, in line number format.

          • relativeFileVersion (string) --

            In a comparison of commits or a pull request, whether the change is in the 'before' or 'after' of that comparison.

        • comments (list) --

          An array of comment objects. Each comment object contains information about a comment on the pull request.

          • (dict) --

            Returns information about a specific comment.

            • commentId (string) --

              The system-generated comment ID.

            • content (string) --

              The content of the comment.

            • inReplyTo (string) --

              The ID of the comment for which this comment is a reply, if any.

            • creationDate (datetime) --

              The date and time the comment was created, in timestamp format.

            • lastModifiedDate (datetime) --

              The date and time the comment was most recently modified, in timestamp format.

            • authorArn (string) --

              The Amazon Resource Name (ARN) of the person who posted the comment.

            • deleted (boolean) --

              A Boolean value indicating whether the comment has been deleted.

            • clientRequestToken (string) --

              A unique, client-generated idempotency token that when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request will return information about the initial request that used that token.

    • NextToken (string) --

      A token to resume pagination.

class CodeCommit.Paginator.GetDifferences
paginator = client.get_paginator('get_differences')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.get_differences().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    repositoryName='string',
    beforeCommitSpecifier='string',
    afterCommitSpecifier='string',
    beforePath='string',
    afterPath='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository where you want to get differences.

  • beforeCommitSpecifier (string) -- The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, the full commit ID. Optional. If not specified, all changes prior to the afterCommitSpecifier value will be shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults .
  • afterCommitSpecifier (string) --

    [REQUIRED]

    The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

  • beforePath (string) -- The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences will be shown for all paths.
  • afterPath (string) -- The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences will be shown for all paths.
  • 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

{
    'differences': [
        {
            'beforeBlob': {
                'blobId': 'string',
                'path': 'string',
                'mode': 'string'
            },
            'afterBlob': {
                'blobId': 'string',
                'path': 'string',
                'mode': 'string'
            },
            'changeType': 'A'|'M'|'D'
        },
    ],

}

Response Structure

  • (dict) --

    • differences (list) --

      A differences data type object that contains information about the differences, including whether the difference is added, modified, or deleted (A, D, M).

      • (dict) --

        Returns information about a set of differences for a commit specifier.

        • beforeBlob (dict) --

          Information about a beforeBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write
            • 100755 indicates read/write/execute
            • 160000 indicates a submodule
            • 120000 indicates a symlink
        • afterBlob (dict) --

          Information about an afterBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write
            • 100755 indicates read/write/execute
            • 160000 indicates a submodule
            • 120000 indicates a symlink
        • changeType (string) --

          Whether the change type of the difference is an addition (A), deletion (D), or modification (M).

class CodeCommit.Paginator.ListBranches
paginator = client.get_paginator('list_branches')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.list_branches().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    repositoryName='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository that contains the branches.

  • 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

{
    'branches': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a list branches operation.

    • branches (list) --

      The list of branch names.

      • (string) --
    • NextToken (string) --

      A token to resume pagination.

class CodeCommit.Paginator.ListPullRequests
paginator = client.get_paginator('list_pull_requests')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.list_pull_requests().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    repositoryName='string',
    authorArn='string',
    pullRequestStatus='OPEN'|'CLOSED',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository for which you want to list pull requests.

  • authorArn (string) -- Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results to pull requests created by that user.
  • pullRequestStatus (string) -- Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.
  • 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

{
    'pullRequestIds': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • pullRequestIds (list) --

      The system-generated IDs of the pull requests.

      • (string) --
    • NextToken (string) --

      A token to resume pagination.

class CodeCommit.Paginator.ListRepositories
paginator = client.get_paginator('list_repositories')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeCommit.Client.list_repositories().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    sortBy='repositoryName'|'lastModifiedDate',
    order='ascending'|'descending',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • sortBy (string) -- The criteria used to sort the results of a list repositories operation.
  • order (string) -- The order in which to sort the results of a list repositories operation.
  • 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

{
    'repositories': [
        {
            'repositoryName': 'string',
            'repositoryId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a list repositories operation.

    • repositories (list) --

      Lists the repositories called by the list repositories operation.

      • (dict) --

        Information about a repository name and ID.

        • repositoryName (string) --

          The name associated with the repository.

        • repositoryId (string) --

          The ID associated with the repository.

    • NextToken (string) --

      A token to resume pagination.