Skip to content

update_approval_policy

update_approval_policy(
    policy_id: PolicyId,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    name: Optional[PolicyName] = None,
    description: Optional[PolicyDescription] = None,
    actions: Optional[GovernedActionList] = None,
    asset_types: Optional[AssetTypeList] = None,
    applicable_to: Optional[ApplicableTo] = None,
    approval_groups: Optional[ApprovalGroupList] = None,
) -> UpdateApprovalPolicyResponse

Updates an approval policy in Quick Sight.

Parameters:

  • policy_id (PolicyId) –

    The unique identifier of the approval policy to update.

  • name (Optional[PolicyName], default: None ) –

    The name of the approval policy.

  • description (Optional[PolicyDescription], default: None ) –

    A description of the approval policy.

  • actions (Optional[GovernedActionList], default: None ) –

    The list of governed actions that trigger the approval workflow.

  • asset_types (Optional[AssetTypeList], default: None ) –

    The list of asset types that the approval policy applies to.

  • applicable_to (Optional[ApplicableTo], default: None ) –

    The scoping configuration that determines who the approval policy applies to.

  • approval_groups (Optional[ApprovalGroupList], default: None ) –

    The list of group ARNs whose members can approve requests.

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.

  • ConflictException –

    Updating or deleting a resource can cause an inconsistent state.

  • InternalFailureException –

    An internal failure occurred.

  • InvalidParameterValueException –

    One or more parameters has a value that isn't valid.

  • ResourceNotFoundException –

    One or more resources can't be found.

  • ThrottlingException –

    Access is throttled.

  • UnknownServiceError –

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

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def update_approval_policy(
    self,
    policy_id: "capo_quicksight.types.policy_id.PolicyId",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    name: Optional["capo_quicksight.types.policy_name.PolicyName"] = None,
    description: Optional[
        "capo_quicksight.types.policy_description.PolicyDescription"
    ] = None,
    actions: Optional[
        "capo_quicksight.types.governed_action_list.GovernedActionList"
    ] = None,
    asset_types: Optional[
        "capo_quicksight.types.asset_type_list.AssetTypeList"
    ] = None,
    applicable_to: Optional[
        "capo_quicksight.types.applicable_to.ApplicableTo"
    ] = None,
    approval_groups: Optional[
        "capo_quicksight.types.approval_group_list.ApprovalGroupList"
    ] = None,
) -> "capo_quicksight.types.update_approval_policy_response.UpdateApprovalPolicyResponse":
    """<p>Updates an approval policy in Quick Sight.</p>

    Args:
        policy_id: <p>The unique identifier of the approval policy to update.</p>
        name: <p>The name of the approval policy.</p>
        description: <p>A description of the approval policy.</p>
        actions: <p>The list of governed actions that trigger the approval workflow.</p>
        asset_types: <p>The list of asset types that the approval policy applies to.</p>
        applicable_to: <p>The scoping configuration that determines who the approval policy applies to.</p>
        approval_groups: <p>The list of group ARNs whose members can approve requests.</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.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.update_approval_policy_request.UpdateApprovalPolicyRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.update_approval_policy_response.UpdateApprovalPolicyResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.update_approval_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApprovalPolicy")
    )
    input_: capo_quicksight.types.update_approval_policy_request.UpdateApprovalPolicyRequest = {
        "policy_id": policy_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if actions is not None:
        input_["actions"] = actions
    if asset_types is not None:
        input_["asset_types"] = asset_types
    if applicable_to is not None:
        input_["applicable_to"] = applicable_to
    if approval_groups is not None:
        input_["approval_groups"] = approval_groups

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