update_pull_request_approval_rule_content
async
¶
update_pull_request_approval_rule_content(
pull_request_id: PullRequestId,
approval_rule_name: ApprovalRuleName,
new_rule_content: ApprovalRuleContent,
*,
config_overrides: Optional[AsyncCodeCommitClientConfig] = 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/async_code_commit.py
5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 | |