r"""
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Trusthub
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
"""


from typing import Any, Dict, Optional
from twilio.base import values

from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.version import Version


class ComplianceTollfreeInquiriesInstance(InstanceResource):

    """
    :ivar inquiry_id: The unique ID used to start an embedded compliance registration session.
    :ivar inquiry_session_token: The session token used to start an embedded compliance registration session.
    :ivar registration_id: The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing.
    :ivar url: The URL of this resource.
    """

    def __init__(self, version: Version, payload: Dict[str, Any]):
        super().__init__(version)

        self.inquiry_id: Optional[str] = payload.get("inquiry_id")
        self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token")
        self.registration_id: Optional[str] = payload.get("registration_id")
        self.url: Optional[str] = payload.get("url")

    def __repr__(self) -> str:
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        """

        return "<Twilio.Trusthub.V1.ComplianceTollfreeInquiriesInstance>"


class ComplianceTollfreeInquiriesList(ListResource):
    def __init__(self, version: Version):
        """
        Initialize the ComplianceTollfreeInquiriesList

        :param version: Version that contains the resource

        """
        super().__init__(version)

        self._uri = "/ComplianceInquiries/Tollfree/Initialize"

    def create(
        self, tollfree_phone_number: str, notification_email: str
    ) -> ComplianceTollfreeInquiriesInstance:
        """
        Create the ComplianceTollfreeInquiriesInstance

        :param tollfree_phone_number: The Tollfree phone number to be verified
        :param notification_email: The notification email to be triggered when verification status is changed

        :returns: The created ComplianceTollfreeInquiriesInstance
        """
        data = values.of(
            {
                "TollfreePhoneNumber": tollfree_phone_number,
                "NotificationEmail": notification_email,
            }
        )

        payload = self._version.create(
            method="POST",
            uri=self._uri,
            data=data,
        )

        return ComplianceTollfreeInquiriesInstance(self._version, payload)

    async def create_async(
        self, tollfree_phone_number: str, notification_email: str
    ) -> ComplianceTollfreeInquiriesInstance:
        """
        Asynchronously create the ComplianceTollfreeInquiriesInstance

        :param tollfree_phone_number: The Tollfree phone number to be verified
        :param notification_email: The notification email to be triggered when verification status is changed

        :returns: The created ComplianceTollfreeInquiriesInstance
        """
        data = values.of(
            {
                "TollfreePhoneNumber": tollfree_phone_number,
                "NotificationEmail": notification_email,
            }
        )

        payload = await self._version.create_async(
            method="POST",
            uri=self._uri,
            data=data,
        )

        return ComplianceTollfreeInquiriesInstance(self._version, payload)

    def __repr__(self) -> str:
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        """
        return "<Twilio.Trusthub.V1.ComplianceTollfreeInquiriesList>"
