# This file was auto-generated by Fern from our API Definition.

from ......core.unchecked_base_model import UncheckedBaseModel
import typing
from .autonomous_system import AutonomousSystem
import pydantic
from ...base.types.timestamp import Timestamp
import datetime as dt
from .whois_dnssec_status_id import WhoisDnssecStatusId
from .domain_contact import DomainContact
from ...base.types.email_address import EmailAddress
from ...base.types.subnet import Subnet
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class Whois(UncheckedBaseModel):
    """
    The resources of a WHOIS record for a given domain. This can include domain names, IP address blocks, autonomous system information, and/or contact and registration information for a domain.
    """

    autonomous_system: typing.Optional[AutonomousSystem] = pydantic.Field(default=None)
    """
    The autonomous system information associated with a domain.
    """

    created_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    When the domain was registered or WHOIS entry was created.
    """

    created_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the domain was registered or WHOIS entry was created.
    """

    dnssec_status: typing.Optional[str] = pydantic.Field(default=None)
    """
    The normalized value of dnssec_status_id.
    """

    dnssec_status_id: typing.Optional[WhoisDnssecStatusId] = pydantic.Field(
        default=None
    )
    """
    Describes the normalized status of DNS Security Extensions (DNSSEC) for a domain.
    """

    domain: typing.Optional[str] = pydantic.Field(default=None)
    """
    The domain name corresponding to the WHOIS record.
    """

    domain_contacts: typing.Optional[typing.List[DomainContact]] = pydantic.Field(
        default=None
    )
    """
    An array of <code>Domain Contact</code> objects.
    """

    email_addr: typing.Optional[EmailAddress] = pydantic.Field(default=None)
    """
    The email address for the registrar's abuse contact
    """

    isp: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the Internet Service Provider (ISP).
    """

    isp_org: typing.Optional[str] = pydantic.Field(default=None)
    """
    The organization name of the Internet Service Provider (ISP). This represents the parent organization or company that owns/operates the ISP. For example, Comcast Corporation would be the ISP org for Xfinity internet service. This attribute helps identify the ultimate provider when ISPs operate under different brand names.
    """

    last_seen_time: typing.Optional[Timestamp] = pydantic.Field(default=None)
    """
    When the WHOIS record was last updated or seen at.
    """

    last_seen_time_dt: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the WHOIS record was last updated or seen at.
    """

    name_servers: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A collection of name servers related to a domain registration or other record.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The phone number for the registrar's abuse contact
    """

    registrar: typing.Optional[str] = pydantic.Field(default=None)
    """
    The domain registrar.
    """

    status: typing.Optional[str] = pydantic.Field(default=None)
    """
    The status of a domain and its ability to be transferred, e.g., <code>clientTransferProhibited</code>.
    """

    subdomains: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    An array of subdomain strings. Can be used to collect several subdomains such as those from Domain Generation Algorithms (DGAs).
    """

    subnet: typing.Optional[Subnet] = pydantic.Field(default=None)
    """
    The IP address block (CIDR) associated with a domain.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
