Skip to content

batch_delete_policy_assignment_by_policy

batch_delete_policy_assignment_by_policy(
    account_id: AwsAccountId,
    policy_arn: PolicyArn,
    principal_arns: BatchDeletePolicyAssignmentByPolicyRequestPrincipalArnsList,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
) -> BatchDeletePolicyAssignmentByPolicyResponse

Removes a governance policy from multiple Amazon Quick Sight principals in a single request. A principal that doesn't have the policy is reported as a success.

Each entry succeeds or fails independently. Check the Errors list in the response for entries that failed.

Parameters:

  • account_id (AwsAccountId) –

    The ID of the Amazon Web Services account that contains the policy and the principals.

  • policy_arn (PolicyArn) –

    The ARN of the policy to remove. For each principal, the operation removes the assignment only if the principal currently has this policy.

  • principal_arns (BatchDeletePolicyAssignmentByPolicyRequestPrincipalArnsList) –

    A list of 1–50 principal ARNs to remove the policy from. Each ARN must be unique within the request.

Raises:

  • AccessDeniedException –

    You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.

  • InternalFailureException –

    An internal failure occurred.

  • ResourceNotFoundException –

    One or more resources can't be found.

  • ThrottlingException –

    Access is throttled.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def batch_delete_policy_assignment_by_policy(
    self,
    account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    policy_arn: "capo_quicksight.types.policy_arn.PolicyArn",
    principal_arns: "capo_quicksight.types.batch_delete_policy_assignment_by_policy_request_principal_arns_list.BatchDeletePolicyAssignmentByPolicyRequestPrincipalArnsList",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
) -> "capo_quicksight.types.batch_delete_policy_assignment_by_policy_response.BatchDeletePolicyAssignmentByPolicyResponse":
    """<p>Removes a governance policy from multiple Amazon Quick Sight principals in a single request. A principal that doesn't have the policy is reported as a success.</p> <p>Each entry succeeds or fails independently. Check the <code>Errors</code> list in the response for entries that failed.</p>

    Args:
        account_id: <p>The ID of the Amazon Web Services account that contains the policy and the principals.</p>
        policy_arn: <p>The ARN of the policy to remove. For each principal, the operation removes the assignment only if the principal currently has this policy.</p>
        principal_arns: <p>A list of 1–50 principal ARNs to remove the policy from. Each ARN must be unique within the request.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.batch_delete_policy_assignment_by_policy_request.BatchDeletePolicyAssignmentByPolicyRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.batch_delete_policy_assignment_by_policy_response.BatchDeletePolicyAssignmentByPolicyResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.batch_delete_policy_assignment_by_policy

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.batch_delete_policy_assignment_by_policy.batch_delete_policy_assignment_by_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchDeletePolicyAssignmentByPolicy")
    )
    input_: capo_quicksight.types.batch_delete_policy_assignment_by_policy_request.BatchDeletePolicyAssignmentByPolicyRequest = {
        "account_id": account_id,
        "policy_arn": policy_arn,
        "principal_arns": principal_arns,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output