Skip to content

activate_email_contact

activate_email_contact(
    arn: EmailContactArn,
    code: Token,
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = None,
) -> ActivateEmailContactResponse

Activates an email contact using an activation code. This code is in the activation email sent to the email address associated with this email contact.

Parameters:

  • arn (EmailContactArn) –

    The Amazon Resource Name (ARN) of the resource.

  • code (Token) –

    The activation code for this email contact.

    An email contact has a maximum of five activation attempts. Activation codes expire after 12 hours and are generated by the SendActivationCode API action.

Raises:

Source code in docs_src/capo_notificationscontacts/_services/notifications_contacts.py
def activate_email_contact(
    self,
    arn: "capo_notificationscontacts.types.email_contact_arn.EmailContactArn",
    code: "capo_notificationscontacts.types.token.Token",
    *,
    config_overrides: Optional[NotificationsContactsClientConfig] = None,
) -> "capo_notificationscontacts.types.activate_email_contact_response.ActivateEmailContactResponse":
    """<p>Activates an email contact using an activation code. This code is in the activation email sent to the email address associated with this email contact.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
        code: <p>The activation code for this email contact.</p> <p>An email contact has a maximum of five activation attempts. Activation codes expire after 12 hours and are generated by the <a href="https://docs.aws.amazon.com/notificationscontacts/latest/APIReference/API_SendActivationCode.html">SendActivationCode</a> API action.</p>

    Raises:
        capo_notificationscontacts.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_notificationscontacts.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_notificationscontacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_notificationscontacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Your request references a resource which does not exist. </p>
        capo_notificationscontacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_notificationscontacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_notificationscontacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_notificationscontacts.types.activate_email_contact_request.ActivateEmailContactRequest]",
    ) -> OperationResponse[
        "capo_notificationscontacts.types.activate_email_contact_response.ActivateEmailContactResponse"
    ]:
        import capo_notificationscontacts._operations.notifications_contacts.activate_email_contact

        output, http_response = (
            capo_notificationscontacts._operations.notifications_contacts.activate_email_contact.activate_email_contact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_notificationscontacts.types.activate_email_contact_request.ActivateEmailContactRequest",
    ) -> dict[str, Any]:
        import capo_notificationscontacts.types.activate_email_contact_request

        return capo_notificationscontacts.types.activate_email_contact_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ActivateEmailContact", redact_input=_redact_input),
    )
    input_: capo_notificationscontacts.types.activate_email_contact_request.ActivateEmailContactRequest = {
        "arn": arn,
        "code": code,
    }

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