Skip to content

create_approval_team async

create_approval_team(
    approval_strategy: ApprovalStrategy,
    approvers: ApprovalTeamRequestApprovers,
    description: Description,
    policies: PoliciesReferences,
    name: ApprovalTeamName,
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    client_token: Optional[Token] = None,
    tags: Optional[Tags] = None,
) -> CreateApprovalTeamResponse

Creates a new approval team. For more information, see Approval team in the Multi-party approval User Guide.

Parameters:

  • client_token (Optional[Token], default: None ) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.

    What is idempotency?

    When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.

    Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.

  • approval_strategy (ApprovalStrategy) –

    An ApprovalStrategy object. Contains details for how the team grants approval.

  • approvers (ApprovalTeamRequestApprovers) –

    An array of ApprovalTeamRequesterApprovers objects. Contains details for the approvers in the team.

  • description (Description) –

    Description for the team.

  • policies (PoliciesReferences) –

    An array of PolicyReference objects. Contains a list of policies that define the permissions for team resources.

  • name (ApprovalTeamName) –

    Name of the team.

  • tags (Optional[Tags], default: None ) –

    Tags you want to attach to the team.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. Check your permissions, and try again.

  • ConflictException –

    The request cannot be completed because it conflicts with the current state of a resource.

  • InternalServerException –

    The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.

  • ServiceQuotaExceededException –

    The request exceeds the service quota for your account. Request a quota increase or reduce your request size.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

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

Source code in docs_src/capo_mpa/_services/async_mpa.py
async def create_approval_team(
    self,
    approval_strategy: "capo_mpa.types.approval_strategy.ApprovalStrategy",
    approvers: "capo_mpa.types.approval_team_request_approvers.ApprovalTeamRequestApprovers",
    description: "capo_mpa.types.description.Description",
    policies: "capo_mpa.types.policies_references.PoliciesReferences",
    name: "capo_mpa.types.approval_team_name.ApprovalTeamName",
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    client_token: Optional["capo_mpa.types.token.Token"] = None,
    tags: Optional["capo_mpa.types.tags.Tags"] = None,
) -> "capo_mpa.types.create_approval_team_response.CreateApprovalTeamResponse":
    """<p>Creates a new approval team. For more information, see <a href="https://docs.aws.amazon.com/mpa/latest/userguide/mpa-concepts.html">Approval team</a> in the <i>Multi-party approval User Guide</i>.</p>

    Args:
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p> <note> <p> <b>What is idempotency?</b> </p> <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p> <p> <i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p> </note>
        approval_strategy: <p>An <code>ApprovalStrategy</code> object. Contains details for how the team grants approval.</p>
        approvers: <p>An array of <code>ApprovalTeamRequesterApprovers</code> objects. Contains details for the approvers in the team.</p>
        description: <p>Description for the team.</p>
        policies: <p>An array of <code>PolicyReference</code> objects. Contains a list of policies that define the permissions for team resources.</p>
        name: <p>Name of the team.</p>
        tags: <p>Tags you want to attach to the team.</p>

    Raises:
        capo_mpa.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. Check your permissions, and try again.</p>
        capo_mpa.errors.conflict_exception.ConflictException: <p>The request cannot be completed because it conflicts with the current state of a resource.</p>
        capo_mpa.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.</p>
        capo_mpa.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds the service quota for your account. Request a quota increase or reduce your request size.</p>
        capo_mpa.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_mpa.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_mpa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mpa.types.create_approval_team_request.CreateApprovalTeamRequest]",
    ) -> AsyncOperationResponse[
        "capo_mpa.types.create_approval_team_response.CreateApprovalTeamResponse"
    ]:
        import capo_mpa._operations.aws_fluffy_core_service.create_approval_team

        (
            output,
            http_response,
        ) = await capo_mpa._operations.aws_fluffy_core_service.create_approval_team.async_create_approval_team(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mpa.types.create_approval_team_request.CreateApprovalTeamRequest",
    ) -> dict[str, Any]:
        import capo_mpa.types.create_approval_team_request

        return capo_mpa.types.create_approval_team_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateApprovalTeam", redact_input=_redact_input),
    )
    input_: capo_mpa.types.create_approval_team_request.CreateApprovalTeamRequest = {
        "approval_strategy": approval_strategy,
        "approvers": approvers,
        "description": description,
        "policies": policies,
        "name": name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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