Skip to content

create_approval_policy async

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

Creates an approval policy in Quick Sight.

Parameters:

  • policy_id (PolicyId) –

    The unique identifier to assign to the approval policy. You cannot change this value after you create the policy.

  • name (PolicyName) –

    The name of the approval policy.

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

    A description of the approval policy.

  • actions (GovernedActionList) –

    The list of governed actions that trigger the approval workflow.

  • asset_types (AssetTypeList) –

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

  • applicable_to (ApplicableTo) –

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

  • approval_groups (ApprovalGroupList) –

    The list of group ARNs whose members can approve requests.

Raises:

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

    Args:
        policy_id: <p>The unique identifier to assign to the approval policy. You cannot change this value after you create the policy.</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.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_quicksight.types.create_approval_policy_request.CreateApprovalPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_quicksight.types.create_approval_policy_response.CreateApprovalPolicyResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_approval_policy

        (
            output,
            http_response,
        ) = await capo_quicksight._operations.quick_sight_20180401.create_approval_policy.async_create_approval_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output