update_pull_request_approval_rule_content
¶
update_pull_request_approval_rule_content(
pull_request_id: PullRequestId,
approval_rule_name: ApprovalRuleName,
new_rule_content: ApprovalRuleContent,
*,
config_overrides: Optional[CodeCommitClientConfig] = None,
existing_rule_content_sha256: Optional[RuleContentSha256] = None,
) -> UpdatePullRequestApprovalRuleContentOutput
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.
Parameters:
-
pull_request_id(PullRequestId) –The system-generated ID of the pull request.
-
approval_rule_name(ApprovalRuleName) –The name of the approval rule you want to update.
-
existing_rule_content_sha256(Optional[RuleContentSha256], default:None) –The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.
-
new_rule_content(ApprovalRuleContent) –The updated content for the approval rule.
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 Amazon Web Services 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 Amazon Web Services 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.
-
Raises:
-
ApprovalRuleContentRequiredException–The content for the approval rule is empty. You must provide some content for an approval rule. The content cannot be null.
-
ApprovalRuleDoesNotExistException–The specified approval rule does not exist.
-
ApprovalRuleNameRequiredException–An approval rule name is required, but was not specified.
-
CannotModifyApprovalRuleFromTemplateException–The approval rule cannot be modified for the pull request because it was created by an approval rule template and applied to the pull request automatically.
-
EncryptionIntegrityChecksFailedException–An encryption integrity check failed.
-
EncryptionKeyAccessDeniedException–An encryption key could not be accessed.
-
EncryptionKeyDisabledException–The encryption key is disabled.
-
EncryptionKeyNotFoundException–No encryption key was found.
-
EncryptionKeyUnavailableException–The encryption key is not available.
-
InvalidApprovalRuleContentException–The content for the approval rule is not valid.
-
InvalidApprovalRuleNameException–The name for the approval rule is not valid.
-
InvalidPullRequestIdException–The pull request ID is not valid. Make sure that you have provided the full ID and that the pull request is in the specified repository, and then try again.
-
InvalidRuleContentSha256Exception–The SHA-256 hash signature for the rule content is not valid.
-
PullRequestAlreadyClosedException–The pull request status cannot be updated because it is already closed.
-
PullRequestDoesNotExistException–The pull request ID could not be found. Make sure that you have specified the correct repository name and pull request ID, and then try again.
-
PullRequestIdRequiredException–A pull request ID is required, but none was provided.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codecommit/_services/code_commit.py
5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 | |