AWS CodeCommit

2019/11/20 - AWS CodeCommit - 21 new 9 updated api methods

Changes  This release adds support for creating pull request approval rules and pull request approval rule templates in AWS CodeCommit. This allows developers to block merges of pull requests, contingent on the approval rules being satisfiied.

UpdatePullRequestApprovalRuleContent (new) Link ¶

Updates the structure of an approval rule created specifically for a pull request. For example, you can change the number of required approvers and the approval pool for approvers.

See also: AWS API Documentation

Request Syntax

client.update_pull_request_approval_rule_content(
    pullRequestId='string',
    approvalRuleName='string',
    existingRuleContentSha256='string',
    newRuleContent='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request.

type approvalRuleName

string

param approvalRuleName

[REQUIRED]

The name of the approval rule you want to update.

type existingRuleContentSha256

string

param existingRuleContentSha256

The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.

type newRuleContent

string

param newRuleContent

[REQUIRED]

The updated content for the approval rule.

Note

When you update the content of the approval rule, you can specify approvers in an approval pool in one of two ways:

  • CodeCommitApprovers : This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major , all of the following are counted as approvals coming from that user:

    • An IAM user in the account (arn:aws:iam::123456789012 :user/Mary_Major )

    • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012 :federated-user/Mary_Major )

This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012 :assumed-role/CodeCommitReview/Mary_Major ) unless you include a wildcard (*Mary_Major).

  • Fully qualified ARN : This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.

For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide .

rtype

dict

returns

Response Syntax

{
    'approvalRule': {
        'approvalRuleId': 'string',
        'approvalRuleName': 'string',
        'approvalRuleContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string',
        'originApprovalRuleTemplate': {
            'approvalRuleTemplateId': 'string',
            'approvalRuleTemplateName': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • approvalRule (dict) --

      Information about the updated approval rule.

      • approvalRuleId (string) --

        The system-generated ID of the approval rule.

      • approvalRuleName (string) --

        The name of the approval rule.

      • approvalRuleContent (string) --

        The content of the approval rule.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule.

      • lastModifiedDate (datetime) --

        The date the approval rule was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

      • originApprovalRuleTemplate (dict) --

        The approval rule template used to create the rule.

        • approvalRuleTemplateId (string) --

          The ID of the template that created the approval rule.

        • approvalRuleTemplateName (string) --

          The name of the template that created the approval rule.

EvaluatePullRequestApprovalRules (new) Link ¶

Evaluates whether a pull request has met all the conditions specified in its associated approval rules.

See also: AWS API Documentation

Request Syntax

client.evaluate_pull_request_approval_rules(
    pullRequestId='string',
    revisionId='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request you want to evaluate.

type revisionId

string

param revisionId

[REQUIRED]

The system-generated ID for the pull request revision. To retrieve the most recent revision ID for a pull request, use GetPullRequest.

rtype

dict

returns

Response Syntax

{
    'evaluation': {
        'approved': True|False,
        'overridden': True|False,
        'approvalRulesSatisfied': [
            'string',
        ],
        'approvalRulesNotSatisfied': [
            'string',
        ]
    }
}

Response Structure

  • (dict) --

    • evaluation (dict) --

      The result of the evaluation, including the names of the rules whose conditions have been met (if any), the names of the rules whose conditions have not been met (if any), whether the pull request is in the approved state, and whether the pull request approval rule has been set aside by an override.

      • approved (boolean) --

        Whether the state of the pull request is approved.

      • overridden (boolean) --

        Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.

      • approvalRulesSatisfied (list) --

        The names of the approval rules that have had their conditions met.

        • (string) --

      • approvalRulesNotSatisfied (list) --

        The names of the approval rules that have not had their conditions met.

        • (string) --

GetPullRequestOverrideState (new) Link ¶

Returns information about whether approval rules have been set aside (overridden) for a pull request, and if so, the Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.

See also: AWS API Documentation

Request Syntax

client.get_pull_request_override_state(
    pullRequestId='string',
    revisionId='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The ID of the pull request for which you want to get information about whether approval rules have been set aside (overridden).

type revisionId

string

param revisionId

[REQUIRED]

The system-generated ID of the revision for the pull request. To retrieve the most recent revision ID, use GetPullRequest.

rtype

dict

returns

Response Syntax

{
    'overridden': True|False,
    'overrider': 'string'
}

Response Structure

  • (dict) --

    • overridden (boolean) --

      A Boolean value that indicates whether a pull request has had its rules set aside (TRUE) or whether all approval rules still apply (FALSE).

    • overrider (string) --

      The Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.

CreateApprovalRuleTemplate (new) Link ¶

Creates a template for approval rules that can then be associated with one or more repositories in your AWS account. When you associate a template with a repository, AWS CodeCommit creates an approval rule that matches the conditions of the template for all pull requests that meet the conditions of the template. For more information, see AssociateApprovalRuleTemplateWithRepository.

See also: AWS API Documentation

Request Syntax

client.create_approval_rule_template(
    approvalRuleTemplateName='string',
    approvalRuleTemplateContent='string',
    approvalRuleTemplateDescription='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template. Provide descriptive names, because this name is applied to the approval rules created automatically in associated repositories.

type approvalRuleTemplateContent

string

param approvalRuleTemplateContent

[REQUIRED]

The content of the approval rule that is created on pull requests in associated repositories. If you specify one or more destination references (branches), approval rules are created in an associated repository only if their destination references (branches) match those specified in the template.

Note

When you create the content of the approval rule template, you can specify approvers in an approval pool in one of two ways:

  • CodeCommitApprovers : This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major , all of the following are counted as approvals coming from that user:

    • An IAM user in the account (arn:aws:iam::123456789012 :user/Mary_Major )

    • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012 :federated-user/Mary_Major )

This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012 :assumed-role/CodeCommitReview/Mary_Major ) unless you include a wildcard (*Mary_Major).

  • Fully qualified ARN : This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.

For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide .

type approvalRuleTemplateDescription

string

param approvalRuleTemplateDescription

The description of the approval rule template. Consider providing a description that explains what this template does and when it might be appropriate to associate it with repositories.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplate': {
        'approvalRuleTemplateId': 'string',
        'approvalRuleTemplateName': 'string',
        'approvalRuleTemplateDescription': 'string',
        'approvalRuleTemplateContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string'
    }
}

Response Structure

  • (dict) --

    • approvalRuleTemplate (dict) --

      The content and structure of the created approval rule template.

      • approvalRuleTemplateId (string) --

        The system-generated ID of the approval rule template.

      • approvalRuleTemplateName (string) --

        The name of the approval rule template.

      • approvalRuleTemplateDescription (string) --

        The description of the approval rule template.

      • approvalRuleTemplateContent (string) --

        The content of the approval rule template.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule template.

      • lastModifiedDate (datetime) --

        The date the approval rule template was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule template was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

OverridePullRequestApprovalRules (new) Link ¶

Sets aside (overrides) all approval rule requirements for a specified pull request.

See also: AWS API Documentation

Request Syntax

client.override_pull_request_approval_rules(
    pullRequestId='string',
    revisionId='string',
    overrideStatus='OVERRIDE'|'REVOKE'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request for which you want to override all approval rule requirements. To get this information, use GetPullRequest.

type revisionId

string

param revisionId

[REQUIRED]

The system-generated ID of the most recent revision of the pull request. You cannot override approval rules for anything but the most recent revision of a pull request. To get the revision ID, use GetPullRequest.

type overrideStatus

string

param overrideStatus

[REQUIRED]

Whether you want to set aside approval rule requirements for the pull request (OVERRIDE) or revoke a previous override and apply approval rule requirements (REVOKE). REVOKE status is not stored.

returns

None

UpdateApprovalRuleTemplateName (new) Link ¶

Updates the name of a specified approval rule template.

See also: AWS API Documentation

Request Syntax

client.update_approval_rule_template_name(
    oldApprovalRuleTemplateName='string',
    newApprovalRuleTemplateName='string'
)
type oldApprovalRuleTemplateName

string

param oldApprovalRuleTemplateName

[REQUIRED]

The current name of the approval rule template.

type newApprovalRuleTemplateName

string

param newApprovalRuleTemplateName

[REQUIRED]

The new name you want to apply to the approval rule template.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplate': {
        'approvalRuleTemplateId': 'string',
        'approvalRuleTemplateName': 'string',
        'approvalRuleTemplateDescription': 'string',
        'approvalRuleTemplateContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string'
    }
}

Response Structure

  • (dict) --

    • approvalRuleTemplate (dict) --

      The structure and content of the updated approval rule template.

      • approvalRuleTemplateId (string) --

        The system-generated ID of the approval rule template.

      • approvalRuleTemplateName (string) --

        The name of the approval rule template.

      • approvalRuleTemplateDescription (string) --

        The description of the approval rule template.

      • approvalRuleTemplateContent (string) --

        The content of the approval rule template.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule template.

      • lastModifiedDate (datetime) --

        The date the approval rule template was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule template was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

UpdateApprovalRuleTemplateContent (new) Link ¶

Updates the content of an approval rule template. You can change the number of required approvals, the membership of the approval rule, and whether an approval pool is defined.

See also: AWS API Documentation

Request Syntax

client.update_approval_rule_template_content(
    approvalRuleTemplateName='string',
    newRuleContent='string',
    existingRuleContentSha256='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template where you want to update the content of the rule.

type newRuleContent

string

param newRuleContent

[REQUIRED]

The content that replaces the existing content of the rule. Content statements must be complete. You cannot provide only the changes.

type existingRuleContentSha256

string

param existingRuleContentSha256

The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplate': {
        'approvalRuleTemplateId': 'string',
        'approvalRuleTemplateName': 'string',
        'approvalRuleTemplateDescription': 'string',
        'approvalRuleTemplateContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string'
    }
}

Response Structure

  • (dict) --

    • approvalRuleTemplate (dict) --

      Returns information about an approval rule template.

      • approvalRuleTemplateId (string) --

        The system-generated ID of the approval rule template.

      • approvalRuleTemplateName (string) --

        The name of the approval rule template.

      • approvalRuleTemplateDescription (string) --

        The description of the approval rule template.

      • approvalRuleTemplateContent (string) --

        The content of the approval rule template.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule template.

      • lastModifiedDate (datetime) --

        The date the approval rule template was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule template was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

AssociateApprovalRuleTemplateWithRepository (new) Link ¶

Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.

See also: AWS API Documentation

Request Syntax

client.associate_approval_rule_template_with_repository(
    approvalRuleTemplateName='string',
    repositoryName='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name for the approval rule template.

type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository that you want to associate with the template.

returns

None

ListAssociatedApprovalRuleTemplatesForRepository (new) Link ¶

Lists all approval rule templates that are associated with a specified repository.

See also: AWS API Documentation

Request Syntax

client.list_associated_approval_rule_templates_for_repository(
    repositoryName='string',
    nextToken='string',
    maxResults=123
)
type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository for which you want to list all associated approval rule templates.

type nextToken

string

param nextToken

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

type maxResults

integer

param maxResults

A non-zero, non-negative integer used to limit the number of returned results.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • approvalRuleTemplateNames (list) --

      The names of all approval rule templates associated with the repository.

      • (string) --

    • nextToken (string) --

      An enumeration token that allows the operation to batch the next results of the operation.

GetApprovalRuleTemplate (new) Link ¶

Returns information about a specified approval rule template.

See also: AWS API Documentation

Request Syntax

client.get_approval_rule_template(
    approvalRuleTemplateName='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template for which you want to get information.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplate': {
        'approvalRuleTemplateId': 'string',
        'approvalRuleTemplateName': 'string',
        'approvalRuleTemplateDescription': 'string',
        'approvalRuleTemplateContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string'
    }
}

Response Structure

  • (dict) --

    • approvalRuleTemplate (dict) --

      The content and structure of the approval rule template.

      • approvalRuleTemplateId (string) --

        The system-generated ID of the approval rule template.

      • approvalRuleTemplateName (string) --

        The name of the approval rule template.

      • approvalRuleTemplateDescription (string) --

        The description of the approval rule template.

      • approvalRuleTemplateContent (string) --

        The content of the approval rule template.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule template.

      • lastModifiedDate (datetime) --

        The date the approval rule template was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule template was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

CreatePullRequestApprovalRule (new) Link ¶

Creates an approval rule for a pull request.

See also: AWS API Documentation

Request Syntax

client.create_pull_request_approval_rule(
    pullRequestId='string',
    approvalRuleName='string',
    approvalRuleContent='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request for which you want to create the approval rule.

type approvalRuleName

string

param approvalRuleName

[REQUIRED]

The name for the approval rule.

type approvalRuleContent

string

param approvalRuleContent

[REQUIRED]

The content of the approval rule, including the number of approvals needed and the structure of an approval pool defined for approvals, if any. For more information about approval pools, see the AWS CodeCommit User Guide.

Note

When you create the content of the approval rule, you can specify approvers in an approval pool in one of two ways:

  • CodeCommitApprovers : This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major , all of the following would be counted as approvals coming from that user:

    • An IAM user in the account (arn:aws:iam::123456789012 :user/Mary_Major )

    • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012 :federated-user/Mary_Major )

This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012 :assumed-role/CodeCommitReview/Mary_Major ) unless you include a wildcard (*Mary_Major).

  • Fully qualified ARN : This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.

For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide .

rtype

dict

returns

Response Syntax

{
    'approvalRule': {
        'approvalRuleId': 'string',
        'approvalRuleName': 'string',
        'approvalRuleContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string',
        'originApprovalRuleTemplate': {
            'approvalRuleTemplateId': 'string',
            'approvalRuleTemplateName': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • approvalRule (dict) --

      Information about the created approval rule.

      • approvalRuleId (string) --

        The system-generated ID of the approval rule.

      • approvalRuleName (string) --

        The name of the approval rule.

      • approvalRuleContent (string) --

        The content of the approval rule.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule.

      • lastModifiedDate (datetime) --

        The date the approval rule was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

      • originApprovalRuleTemplate (dict) --

        The approval rule template used to create the rule.

        • approvalRuleTemplateId (string) --

          The ID of the template that created the approval rule.

        • approvalRuleTemplateName (string) --

          The name of the template that created the approval rule.

UpdateApprovalRuleTemplateDescription (new) Link ¶

Updates the description for a specified approval rule template.

See also: AWS API Documentation

Request Syntax

client.update_approval_rule_template_description(
    approvalRuleTemplateName='string',
    approvalRuleTemplateDescription='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the template for which you want to update the description.

type approvalRuleTemplateDescription

string

param approvalRuleTemplateDescription

[REQUIRED]

The updated description of the approval rule template.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplate': {
        'approvalRuleTemplateId': 'string',
        'approvalRuleTemplateName': 'string',
        'approvalRuleTemplateDescription': 'string',
        'approvalRuleTemplateContent': 'string',
        'ruleContentSha256': 'string',
        'lastModifiedDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1),
        'lastModifiedUser': 'string'
    }
}

Response Structure

  • (dict) --

    • approvalRuleTemplate (dict) --

      The structure and content of the updated approval rule template.

      • approvalRuleTemplateId (string) --

        The system-generated ID of the approval rule template.

      • approvalRuleTemplateName (string) --

        The name of the approval rule template.

      • approvalRuleTemplateDescription (string) --

        The description of the approval rule template.

      • approvalRuleTemplateContent (string) --

        The content of the approval rule template.

      • ruleContentSha256 (string) --

        The SHA-256 hash signature for the content of the approval rule template.

      • lastModifiedDate (datetime) --

        The date the approval rule template was most recently changed, in timestamp format.

      • creationDate (datetime) --

        The date the approval rule template was created, in timestamp format.

      • lastModifiedUser (string) --

        The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

UpdatePullRequestApprovalState (new) Link ¶

Updates the state of a user's approval on a pull request. The user is derived from the signed-in account when the request is made.

See also: AWS API Documentation

Request Syntax

client.update_pull_request_approval_state(
    pullRequestId='string',
    revisionId='string',
    approvalState='APPROVE'|'REVOKE'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request.

type revisionId

string

param revisionId

[REQUIRED]

The system-generated ID of the revision.

type approvalState

string

param approvalState

[REQUIRED]

The approval state to associate with the user on the pull request.

returns

None

DeleteApprovalRuleTemplate (new) Link ¶

Deletes a specified approval rule template. Deleting a template does not remove approval rules on pull requests already created with the template.

See also: AWS API Documentation

Request Syntax

client.delete_approval_rule_template(
    approvalRuleTemplateName='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template to delete.

rtype

dict

returns

Response Syntax

{
    'approvalRuleTemplateId': 'string'
}

Response Structure

  • (dict) --

    • approvalRuleTemplateId (string) --

      The system-generated ID of the deleted approval rule template. If the template has been previously deleted, the only response is a 200 OK.

DisassociateApprovalRuleTemplateFromRepository (new) Link ¶

Removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository. This does not delete any approval rules previously created for pull requests through the template association.

See also: AWS API Documentation

Request Syntax

client.disassociate_approval_rule_template_from_repository(
    approvalRuleTemplateName='string',
    repositoryName='string'
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template to disassociate from a specified repository.

type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository you want to disassociate from the template.

returns

None

DeletePullRequestApprovalRule (new) Link ¶

Deletes an approval rule from a specified pull request. Approval rules can be deleted from a pull request only if the pull request is open, and if the approval rule was created specifically for a pull request and not generated from an approval rule template associated with the repository where the pull request was created. You cannot delete an approval rule from a merged or closed pull request.

See also: AWS API Documentation

Request Syntax

client.delete_pull_request_approval_rule(
    pullRequestId='string',
    approvalRuleName='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID of the pull request that contains the approval rule you want to delete.

type approvalRuleName

string

param approvalRuleName

[REQUIRED]

The name of the approval rule you want to delete.

rtype

dict

returns

Response Syntax

{
    'approvalRuleId': 'string'
}

Response Structure

  • (dict) --

    • approvalRuleId (string) --

      The ID of the deleted approval rule.

      Note

      If the approval rule was deleted in an earlier API call, the response is 200 OK without content.

BatchDisassociateApprovalRuleTemplateFromRepositories (new) Link ¶

Removes the association between an approval rule template and one or more specified repositories.

See also: AWS API Documentation

Request Syntax

client.batch_disassociate_approval_rule_template_from_repositories(
    approvalRuleTemplateName='string',
    repositoryNames=[
        'string',
    ]
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the template that you want to disassociate from one or more repositories.

type repositoryNames

list

param repositoryNames

[REQUIRED]

The repository names that you want to disassociate from the approval rule template.

Note

The length constraint limit is for each string in the array. The array itself can be empty.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'disassociatedRepositoryNames': [
        'string',
    ],
    'errors': [
        {
            'repositoryName': 'string',
            'errorCode': 'string',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • disassociatedRepositoryNames (list) --

      A list of repository names that have had their association with the template removed.

      • (string) --

    • errors (list) --

      A list of any errors that might have occurred while attempting to remove the association between the template and the repositories.

      • (dict) --

        Returns information about errors in a BatchDisassociateApprovalRuleTemplateFromRepositories operation.

        • repositoryName (string) --

          The name of the repository where the association with the template was not able to be removed.

        • errorCode (string) --

          An error code that specifies whether the repository name was not valid or not found.

        • errorMessage (string) --

          An error message that provides details about why the repository name was either not found or not valid.

ListRepositoriesForApprovalRuleTemplate (new) Link ¶

Lists all repositories associated with the specified approval rule template.

See also: AWS API Documentation

Request Syntax

client.list_repositories_for_approval_rule_template(
    approvalRuleTemplateName='string',
    nextToken='string',
    maxResults=123
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the approval rule template for which you want to list repositories that are associated with that template.

type nextToken

string

param nextToken

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

type maxResults

integer

param maxResults

A non-zero, non-negative integer used to limit the number of returned results.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • repositoryNames (list) --

      A list of repository names that are associated with the specified approval rule template.

      • (string) --

    • nextToken (string) --

      An enumeration token that allows the operation to batch the next results of the operation.

BatchAssociateApprovalRuleTemplateWithRepositories (new) Link ¶

Creates an association between an approval rule template and one or more specified repositories.

See also: AWS API Documentation

Request Syntax

client.batch_associate_approval_rule_template_with_repositories(
    approvalRuleTemplateName='string',
    repositoryNames=[
        'string',
    ]
)
type approvalRuleTemplateName

string

param approvalRuleTemplateName

[REQUIRED]

The name of the template you want to associate with one or more repositories.

type repositoryNames

list

param repositoryNames

[REQUIRED]

The names of the repositories you want to associate with the template.

Note

The length constraint limit is for each string in the array. The array itself can be empty.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'associatedRepositoryNames': [
        'string',
    ],
    'errors': [
        {
            'repositoryName': 'string',
            'errorCode': 'string',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • associatedRepositoryNames (list) --

      A list of names of the repositories that have been associated with the template.

      • (string) --

    • errors (list) --

      A list of any errors that might have occurred while attempting to create the association between the template and the repositories.

      • (dict) --

        Returns information about errors in a BatchAssociateApprovalRuleTemplateWithRepositories operation.

        • repositoryName (string) --

          The name of the repository where the association was not made.

        • errorCode (string) --

          An error code that specifies whether the repository name was not valid or not found.

        • errorMessage (string) --

          An error message that provides details about why the repository name was not found or not valid.

GetPullRequestApprovalStates (new) Link ¶

Gets information about the approval states for a specified pull request. Approval states only apply to pull requests that have one or more approval rules applied to them.

See also: AWS API Documentation

Request Syntax

client.get_pull_request_approval_states(
    pullRequestId='string',
    revisionId='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

The system-generated ID for the pull request.

type revisionId

string

param revisionId

[REQUIRED]

The system-generated ID for the pull request revision.

rtype

dict

returns

Response Syntax

{
    'approvals': [
        {
            'userArn': 'string',
            'approvalState': 'APPROVE'|'REVOKE'
        },
    ]
}

Response Structure

  • (dict) --

    • approvals (list) --

      Information about users who have approved the pull request.

      • (dict) --

        Returns information about a specific approval on a pull request.

        • userArn (string) --

          The Amazon Resource Name (ARN) of the user.

        • approvalState (string) --

          The state of the approval, APPROVE or REVOKE. REVOKE states are not stored.

ListApprovalRuleTemplates (new) Link ¶

Lists all approval rule templates in the specified AWS Region in your AWS account. If an AWS Region is not specified, the AWS Region where you are signed in is used.

See also: AWS API Documentation

Request Syntax

client.list_approval_rule_templates(
    nextToken='string',
    maxResults=123
)
type nextToken

string

param nextToken

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

type maxResults

integer

param maxResults

A non-zero, non-negative integer used to limit the number of returned results.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • approvalRuleTemplateNames (list) --

      The names of all the approval rule templates found in the AWS Region for your AWS account.

      • (string) --

    • nextToken (string) --

      An enumeration token that allows the operation to batch the next results of the operation.

CreatePullRequest (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

Creates a pull request in the specified repository.

See also: AWS API Documentation

Request Syntax

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

string

param title

[REQUIRED]

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

type description

string

param description

A description of the pull request.

type targets

list

param targets

[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 are merged. Also known as the destination branch.

type clientRequestToken

string

param clientRequestToken

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 returns information about the initial request that used that token.

Note

The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, an idempotency token is created for you.

This field is autopopulated if not provided.

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': '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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

DescribePullRequestEvents (updated) Link ¶
Changes (request, response)
Request
{'pullRequestEventType': {'PULL_REQUEST_APPROVAL_RULE_CREATED',
                          'PULL_REQUEST_APPROVAL_RULE_DELETED',
                          'PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN',
                          'PULL_REQUEST_APPROVAL_RULE_UPDATED',
                          'PULL_REQUEST_APPROVAL_STATE_CHANGED'}}
Response
{'pullRequestEvents': {'approvalRuleEventMetadata': {'approvalRuleContent': 'string',
                                                     'approvalRuleId': 'string',
                                                     'approvalRuleName': 'string'},
                       'approvalRuleOverriddenEventMetadata': {'overrideStatus': 'OVERRIDE '
                                                                                 '| '
                                                                                 'REVOKE',
                                                               'revisionId': 'string'},
                       'approvalStateChangedEventMetadata': {'approvalStatus': 'APPROVE '
                                                                               '| '
                                                                               'REVOKE',
                                                             'revisionId': 'string'},
                       'pullRequestEventType': {'PULL_REQUEST_APPROVAL_RULE_CREATED',
                                                'PULL_REQUEST_APPROVAL_RULE_DELETED',
                                                'PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN',
                                                'PULL_REQUEST_APPROVAL_RULE_UPDATED',
                                                'PULL_REQUEST_APPROVAL_STATE_CHANGED'}}}

Returns information about one or more pull request events.

See also: AWS API Documentation

Request Syntax

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'|'PULL_REQUEST_APPROVAL_RULE_CREATED'|'PULL_REQUEST_APPROVAL_RULE_UPDATED'|'PULL_REQUEST_APPROVAL_RULE_DELETED'|'PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN'|'PULL_REQUEST_APPROVAL_STATE_CHANGED',
    actorArn='string',
    nextToken='string',
    maxResults=123
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type pullRequestEventType

string

param pullRequestEventType

Optional. The pull request event type about which you want to return information.

type actorArn

string

param actorArn

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

type nextToken

string

param nextToken

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

type maxResults

integer

param maxResults

A non-zero, 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.

rtype

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'|'PULL_REQUEST_APPROVAL_RULE_CREATED'|'PULL_REQUEST_APPROVAL_RULE_UPDATED'|'PULL_REQUEST_APPROVAL_RULE_DELETED'|'PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN'|'PULL_REQUEST_APPROVAL_STATE_CHANGED',
            'actorArn': 'string',
            'pullRequestCreatedEventMetadata': {
                'repositoryName': 'string',
                'sourceCommitId': 'string',
                'destinationCommitId': 'string',
                'mergeBase': 'string'
            },
            'pullRequestStatusChangedEventMetadata': {
                'pullRequestStatus': 'OPEN'|'CLOSED'
            },
            'pullRequestSourceReferenceUpdatedEventMetadata': {
                'repositoryName': 'string',
                'beforeCommitId': 'string',
                'afterCommitId': 'string',
                'mergeBase': 'string'
            },
            'pullRequestMergedStateChangedEventMetadata': {
                'repositoryName': 'string',
                'destinationReference': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
            'approvalRuleEventMetadata': {
                'approvalRuleName': 'string',
                'approvalRuleId': 'string',
                'approvalRuleContent': 'string'
            },
            'approvalStateChangedEventMetadata': {
                'revisionId': 'string',
                'approvalStatus': 'APPROVE'|'REVOKE'
            },
            'approvalRuleOverriddenEventMetadata': {
                'revisionId': 'string',
                'overrideStatus': 'OVERRIDE'|'REVOKE'
            }
        },
    ],
    '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 more commits or changing the status of a pull request.

        • pullRequestCreatedEventMetadata (dict) --

          Information about the source and destination branches for the pull request.

          • repositoryName (string) --

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

          • sourceCommitId (string) --

            The commit ID on the source branch used when the pull request was created.

          • destinationCommitId (string) --

            The commit ID of the tip of the branch specified as the destination branch when the pull request was created.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

        • approvalRuleEventMetadata (dict) --

          Information about a pull request event.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

        • approvalStateChangedEventMetadata (dict) --

          Information about an approval state change for a pull request.

          • revisionId (string) --

            The revision ID of the pull request when the approval state changed.

          • approvalStatus (string) --

            The approval status for the pull request.

        • approvalRuleOverriddenEventMetadata (dict) --

          Information about an approval rule override event for a pull request.

          • revisionId (string) --

            The revision ID of the pull request when the override event occurred.

          • overrideStatus (string) --

            The status of the override event.

    • nextToken (string) --

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

GetPullRequest (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

Gets information about a pull request in a specified repository.

See also: AWS API Documentation

Request Syntax

client.get_pull_request(
    pullRequestId='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': '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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

MergePullRequestByFastForward (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

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 strategy. If the merge is successful, it closes the pull request.

See also: AWS API Documentation

Request Syntax

client.merge_pull_request_by_fast_forward(
    pullRequestId='string',
    repositoryName='string',
    sourceCommitId='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type repositoryName

string

param repositoryName

[REQUIRED]

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

type sourceCommitId

string

param sourceCommitId

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.

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': 'string'
                }
            },
        ]
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Information about the specified pull request, including 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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

MergePullRequestBySquash (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

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 squash merge strategy. If the merge is successful, it closes the pull request.

See also: AWS API Documentation

Request Syntax

client.merge_pull_request_by_squash(
    pullRequestId='string',
    repositoryName='string',
    sourceCommitId='string',
    conflictDetailLevel='FILE_LEVEL'|'LINE_LEVEL',
    conflictResolutionStrategy='NONE'|'ACCEPT_SOURCE'|'ACCEPT_DESTINATION'|'AUTOMERGE',
    commitMessage='string',
    authorName='string',
    email='string',
    keepEmptyFolders=True|False,
    conflictResolution={
        'replaceContents': [
            {
                'filePath': 'string',
                'replacementType': 'KEEP_BASE'|'KEEP_SOURCE'|'KEEP_DESTINATION'|'USE_NEW_CONTENT',
                'content': b'bytes',
                'fileMode': 'EXECUTABLE'|'NORMAL'|'SYMLINK'
            },
        ],
        'deleteFiles': [
            {
                'filePath': 'string'
            },
        ],
        'setFileModes': [
            {
                'filePath': 'string',
                'fileMode': 'EXECUTABLE'|'NORMAL'|'SYMLINK'
            },
        ]
    }
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type repositoryName

string

param repositoryName

[REQUIRED]

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

type sourceCommitId

string

param sourceCommitId

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.

type conflictDetailLevel

string

param conflictDetailLevel

The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

type conflictResolutionStrategy

string

param conflictResolutionStrategy

Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

type commitMessage

string

param commitMessage

The commit message to include in the commit information for the merge.

type authorName

string

param authorName

The name of the author who created the commit. This information is used as both the author and committer for the commit.

type email

string

param email

The email address of the person merging the branches. This information is used in the commit information for the merge.

type keepEmptyFolders

boolean

param keepEmptyFolders

If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a .gitkeep file is created for empty folders. The default is false.

type conflictResolution

dict

param conflictResolution

If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

  • replaceContents (list) --

    Files to have content replaced as part of the merge conflict resolution.

    • (dict) --

      Information about a replacement content entry in the conflict of a merge or pull request operation.

      • filePath (string) -- [REQUIRED]

        The path of the conflicting file.

      • replacementType (string) -- [REQUIRED]

        The replacement type to use when determining how to resolve the conflict.

      • content (bytes) --

        The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

      • fileMode (string) --

        The file mode to apply during conflict resoltion.

  • deleteFiles (list) --

    Files to be deleted as part of the merge conflict resolution.

    • (dict) --

      A file that is deleted as part of a commit.

      • filePath (string) -- [REQUIRED]

        The full path of the file to be deleted, including the name of the file.

  • setFileModes (list) --

    File modes that are set as part of the merge conflict resolution.

    • (dict) --

      Information about the file mode changes.

      • filePath (string) -- [REQUIRED]

        The full path to the file, including the name of the file.

      • fileMode (string) -- [REQUIRED]

        The file mode for the file.

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': 'string'
                }
            },
        ]
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Returns information about a 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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

MergePullRequestByThreeWay (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

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 three-way merge strategy. If the merge is successful, it closes the pull request.

See also: AWS API Documentation

Request Syntax

client.merge_pull_request_by_three_way(
    pullRequestId='string',
    repositoryName='string',
    sourceCommitId='string',
    conflictDetailLevel='FILE_LEVEL'|'LINE_LEVEL',
    conflictResolutionStrategy='NONE'|'ACCEPT_SOURCE'|'ACCEPT_DESTINATION'|'AUTOMERGE',
    commitMessage='string',
    authorName='string',
    email='string',
    keepEmptyFolders=True|False,
    conflictResolution={
        'replaceContents': [
            {
                'filePath': 'string',
                'replacementType': 'KEEP_BASE'|'KEEP_SOURCE'|'KEEP_DESTINATION'|'USE_NEW_CONTENT',
                'content': b'bytes',
                'fileMode': 'EXECUTABLE'|'NORMAL'|'SYMLINK'
            },
        ],
        'deleteFiles': [
            {
                'filePath': 'string'
            },
        ],
        'setFileModes': [
            {
                'filePath': 'string',
                'fileMode': 'EXECUTABLE'|'NORMAL'|'SYMLINK'
            },
        ]
    }
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type repositoryName

string

param repositoryName

[REQUIRED]

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

type sourceCommitId

string

param sourceCommitId

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.

type conflictDetailLevel

string

param conflictDetailLevel

The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

type conflictResolutionStrategy

string

param conflictResolutionStrategy

Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

type commitMessage

string

param commitMessage

The commit message to include in the commit information for the merge.

type authorName

string

param authorName

The name of the author who created the commit. This information is used as both the author and committer for the commit.

type email

string

param email

The email address of the person merging the branches. This information is used in the commit information for the merge.

type keepEmptyFolders

boolean

param keepEmptyFolders

If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a .gitkeep file is created for empty folders. The default is false.

type conflictResolution

dict

param conflictResolution

If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

  • replaceContents (list) --

    Files to have content replaced as part of the merge conflict resolution.

    • (dict) --

      Information about a replacement content entry in the conflict of a merge or pull request operation.

      • filePath (string) -- [REQUIRED]

        The path of the conflicting file.

      • replacementType (string) -- [REQUIRED]

        The replacement type to use when determining how to resolve the conflict.

      • content (bytes) --

        The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

      • fileMode (string) --

        The file mode to apply during conflict resoltion.

  • deleteFiles (list) --

    Files to be deleted as part of the merge conflict resolution.

    • (dict) --

      A file that is deleted as part of a commit.

      • filePath (string) -- [REQUIRED]

        The full path of the file to be deleted, including the name of the file.

  • setFileModes (list) --

    File modes that are set as part of the merge conflict resolution.

    • (dict) --

      Information about the file mode changes.

      • filePath (string) -- [REQUIRED]

        The full path to the file, including the name of the file.

      • fileMode (string) -- [REQUIRED]

        The file mode for the file.

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': 'string'
                }
            },
        ]
    }
}

Response Structure

  • (dict) --

    • pullRequest (dict) --

      Returns information about a 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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

UpdatePullRequestDescription (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

Replaces the contents of the description of a pull request.

See also: AWS API Documentation

Request Syntax

client.update_pull_request_description(
    pullRequestId='string',
    description='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type description

string

param description

[REQUIRED]

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

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': '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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

UpdatePullRequestStatus (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

Updates the status of a pull request.

See also: AWS API Documentation

Request Syntax

client.update_pull_request_status(
    pullRequestId='string',
    pullRequestStatus='OPEN'|'CLOSED'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type pullRequestStatus

string

param pullRequestStatus

[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 CLOSED to CLOSED .

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': '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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.

UpdatePullRequestTitle (updated) Link ¶
Changes (response)
{'pullRequest': {'approvalRules': [{'approvalRuleContent': 'string',
                                    'approvalRuleId': 'string',
                                    'approvalRuleName': 'string',
                                    'creationDate': 'timestamp',
                                    'lastModifiedDate': 'timestamp',
                                    'lastModifiedUser': 'string',
                                    'originApprovalRuleTemplate': {'approvalRuleTemplateId': 'string',
                                                                   'approvalRuleTemplateName': 'string'},
                                    'ruleContentSha256': 'string'}],
                 'revisionId': 'string'}}

Replaces the title of a pull request.

See also: AWS API Documentation

Request Syntax

client.update_pull_request_title(
    pullRequestId='string',
    title='string'
)
type pullRequestId

string

param pullRequestId

[REQUIRED]

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

type title

string

param title

[REQUIRED]

The updated title of the pull request. This replaces the existing title.

rtype

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',
                'mergeBase': 'string',
                'mergeMetadata': {
                    'isMerged': True|False,
                    'mergedBy': 'string',
                    'mergeCommitId': 'string',
                    'mergeOption': 'FAST_FORWARD_MERGE'|'SQUASH_MERGE'|'THREE_WAY_MERGE'
                }
            },
        ],
        'clientRequestToken': 'string',
        'revisionId': 'string',
        'approvalRules': [
            {
                'approvalRuleId': 'string',
                'approvalRuleName': 'string',
                'approvalRuleContent': 'string',
                'ruleContentSha256': 'string',
                'lastModifiedDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1),
                'lastModifiedUser': 'string',
                'originApprovalRuleTemplate': {
                    'approvalRuleTemplateId': 'string',
                    'approvalRuleTemplateName': '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 repository users.

      • 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 are merged. 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 changes to reflect the new tip of the branch.

          • mergeBase (string) --

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

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

            • mergeCommitId (string) --

              The commit ID for the merge commit, if any.

            • mergeOption (string) --

              The merge strategy used in the merge.

      • 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 returns information about the initial request that used that token.

      • revisionId (string) --

        The system-generated revision ID for the pull request.

      • approvalRules (list) --

        The approval rules applied to the pull request.

        • (dict) --

          Returns information about an approval rule.

          • approvalRuleId (string) --

            The system-generated ID of the approval rule.

          • approvalRuleName (string) --

            The name of the approval rule.

          • approvalRuleContent (string) --

            The content of the approval rule.

          • ruleContentSha256 (string) --

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate (datetime) --

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate (datetime) --

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser (string) --

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate (dict) --

            The approval rule template used to create the rule.

            • approvalRuleTemplateId (string) --

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName (string) --

              The name of the template that created the approval rule.