Skip to content

reject_account_link_invitation async

reject_account_link_invitation(
    link_id: LinkId,
    *,
    config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> RejectAccountLinkInvitationResult

Rejects the account link invitation.

Parameters:

  • link_id (LinkId) –

    The identifier of the account link

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

    The client token of the account link invitation to reject.

Raises:

  • AccessDeniedException –

    The user is not authorized to access a resource.

  • ConflictException –

    The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.

  • InternalServerException –

    An unexpected server error occurred. Retry your request.

  • ResourceNotFoundException –

    The resource could not be found.

  • ValidationException –

    Your request failed validation. Check the error message for the parameter that isn't valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
async def reject_account_link_invitation(
    self,
    link_id: "capo_workspaces.types.link_id.LinkId",
    *,
    config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
    client_token: Optional["capo_workspaces.types.client_token.ClientToken"] = None,
) -> "capo_workspaces.types.reject_account_link_invitation_result.RejectAccountLinkInvitationResult":
    """<p>Rejects the account link invitation.</p>

    Args:
        link_id: <p>The identifier of the account link</p>
        client_token: <p>The client token of the account link invitation to reject.</p>

    Raises:
        capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
        capo_workspaces.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.</p>
        capo_workspaces.errors.internal_server_exception.InternalServerException: <p>An unexpected server error occurred. Retry your request.</p>
        capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_workspaces.errors.validation_exception.ValidationException: <p>Your request failed validation. Check the error message for the parameter that isn't valid.</p>
        capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces.types.reject_account_link_invitation_request.RejectAccountLinkInvitationRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces.types.reject_account_link_invitation_result.RejectAccountLinkInvitationResult"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_workspaces._operations.workspaces_service.aws_json1_1.reject_account_link_invitation

            (
                output,
                http_response,
            ) = await capo_workspaces._operations.workspaces_service.aws_json1_1.reject_account_link_invitation.async_reject_account_link_invitation(
                req.options, req.input
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_workspaces._operations.workspaces_service.rpcv2_cbor.reject_account_link_invitation

            (
                output,
                http_response,
            ) = await capo_workspaces._operations.workspaces_service.rpcv2_cbor.reject_account_link_invitation.async_reject_account_link_invitation(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RejectAccountLinkInvitation")
    )
    input_: capo_workspaces.types.reject_account_link_invitation_request.RejectAccountLinkInvitationRequest = {
        "link_id": link_id
    }
    if client_token is not None:
        input_["client_token"] = client_token

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