Skip to content

accept_invitation

accept_invitation(
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    administrator_account_id: Optional[__string] = None,
    invitation_id: Optional[__string] = None,
    master_account: Optional[__string] = None,
) -> AcceptInvitationResponse

Accepts an Amazon Macie membership invitation that was received from a specific account.

Parameters:

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

    The Amazon Web Services account ID for the account that sent the invitation.

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

    The unique identifier for the invitation to accept.

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

    (Deprecated) The Amazon Web Services account ID for the account that sent the invitation. This property has been replaced by the administratorAccountId property and is retained only for backward compatibility.

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/macie2.py
def accept_invitation(
    self,
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    administrator_account_id: Optional[
        "capo_macie2.types.__string.__string"
    ] = None,
    invitation_id: Optional["capo_macie2.types.__string.__string"] = None,
    master_account: Optional["capo_macie2.types.__string.__string"] = None,
) -> "capo_macie2.types.accept_invitation_response.AcceptInvitationResponse":
    """<p>Accepts an Amazon Macie membership invitation that was received from a specific account.</p>

    Args:
        administrator_account_id: <p>The Amazon Web Services account ID for the account that sent the invitation.</p>
        invitation_id: <p>The unique identifier for the invitation to accept.</p>
        master_account: <p>(Deprecated) The Amazon Web Services account ID for the account that sent the invitation. This property has been replaced by the administratorAccountId property and is retained only for backward compatibility.</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.
    """

    def _handler(
        req: "OperationRequest[capo_macie2.types.accept_invitation_request.AcceptInvitationRequest]",
    ) -> OperationResponse[
        "capo_macie2.types.accept_invitation_response.AcceptInvitationResponse"
    ]:
        import capo_macie2._operations.macie2.accept_invitation

        output, http_response = (
            capo_macie2._operations.macie2.accept_invitation.accept_invitation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptInvitation")
    )
    input_: capo_macie2.types.accept_invitation_request.AcceptInvitationRequest = {}
    if administrator_account_id is not None:
        input_["administrator_account_id"] = administrator_account_id
    if invitation_id is not None:
        input_["invitation_id"] = invitation_id
    if master_account is not None:
        input_["master_account"] = master_account

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