Skip to content

create_invitations async

create_invitations(
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    account_ids: Optional[__listOf__string] = None,
    disable_email_notification: Optional[__boolean] = None,
    message: Optional[__string] = None,
) -> CreateInvitationsResponse

Sends an Amazon Macie membership invitation to one or more accounts.

Parameters:

  • account_ids (Optional[__listOf__string], default: None ) –

    An array that lists Amazon Web Services account IDs, one for each account to send the invitation to.

  • disable_email_notification (Optional[__boolean], default: None ) –

    Specifies whether to send the invitation as an email message. If this value is false, Amazon Macie sends the invitation (as an email message) to the email address that you specified for the recipient's account when you associated the account with your account. The default value is false.

  • message (Optional[__string], default: None ) –

    Custom text to include in the email message that contains the invitation. The text can contain as many as 80 alphanumeric characters.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • ConflictException –

    Provides information about an error that occurred due to a versioning conflict for a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ServiceQuotaExceededException –

    Provides information about an error that occurred due to one or more service quotas for an account.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

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

Source code in docs_src/capo_macie2/_services/async_macie2.py
async def create_invitations(
    self,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    account_ids: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    disable_email_notification: Optional[
        "capo_macie2.types.__boolean.__boolean"
    ] = None,
    message: Optional["capo_macie2.types.__string.__string"] = None,
) -> "capo_macie2.types.create_invitations_response.CreateInvitationsResponse":
    """<p>Sends an Amazon Macie membership invitation to one or more accounts.</p>

    Args:
        account_ids: <p>An array that lists Amazon Web Services account IDs, one for each account to send the invitation to.</p>
        disable_email_notification: <p>Specifies whether to send the invitation as an email message. If this value is false, Amazon Macie sends the invitation (as an email message) to the email address that you specified for the recipient's account when you associated the account with your account. The default value is false.</p>
        message: <p>Custom text to include in the email message that contains the invitation. The text can contain as many as 80 alphanumeric characters.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.conflict_exception.ConflictException: <p>Provides information about an error that occurred due to a versioning conflict for a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_macie2.types.create_invitations_request.CreateInvitationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.create_invitations_response.CreateInvitationsResponse"
    ]:
        import capo_macie2._operations.macie2.create_invitations

        (
            output,
            http_response,
        ) = await capo_macie2._operations.macie2.create_invitations.async_create_invitations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateInvitations")
    )
    input_: capo_macie2.types.create_invitations_request.CreateInvitationsRequest = {}
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if disable_email_notification is not None:
        input_["disable_email_notification"] = disable_email_notification
    if message is not None:
        input_["message"] = message

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