# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

import datetime
from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload

from .._utils.model_base import Model as _Model, rest_field

if TYPE_CHECKING:
    from .. import models as _models


class AaaaRecord(_Model):
    """An AAAA record.

    :ivar ipv6_address: The IPv6 address of this AAAA record.
    :vartype ipv6_address: str
    """

    ipv6_address: Optional[str] = rest_field(
        name="ipv6Address", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IPv6 address of this AAAA record."""

    @overload
    def __init__(
        self,
        *,
        ipv6_address: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ARecord(_Model):
    """An A record.

    :ivar ipv4_address: The IPv4 address of this A record.
    :vartype ipv4_address: str
    """

    ipv4_address: Optional[str] = rest_field(
        name="ipv4Address", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IPv4 address of this A record."""

    @overload
    def __init__(
        self,
        *,
        ipv4_address: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CloudError(_Model):
    """An error response from the service.

    :ivar error: Cloud error body.
    :vartype error: ~azure.mgmt.privatedns.models.CloudErrorBody
    """

    error: Optional["_models.CloudErrorBody"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Cloud error body."""

    @overload
    def __init__(
        self,
        *,
        error: Optional["_models.CloudErrorBody"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CloudErrorBody(_Model):
    """An error response from the service.

    :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
     programmatically.
    :vartype code: str
    :ivar message: A message describing the error, intended to be suitable for display in a user
     interface.
    :vartype message: str
    :ivar target: The target of the particular error. For example, the name of the property in
     error.
    :vartype target: str
    :ivar details: A list of additional details about the error.
    :vartype details: list[~azure.mgmt.privatedns.models.CloudErrorBody]
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """An identifier for the error. Codes are invariant and are intended to be consumed
     programmatically."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A message describing the error, intended to be suitable for display in a user interface."""
    target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The target of the particular error. For example, the name of the property in error."""
    details: Optional[list["_models.CloudErrorBody"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of additional details about the error."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        target: Optional[str] = None,
        details: Optional[list["_models.CloudErrorBody"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CnameRecord(_Model):
    """A CNAME record.

    :ivar cname: The canonical name for this CNAME record.
    :vartype cname: str
    """

    cname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The canonical name for this CNAME record."""

    @overload
    def __init__(
        self,
        *,
        cname: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MxRecord(_Model):
    """An MX record.

    :ivar preference: The preference value for this MX record.
    :vartype preference: int
    :ivar exchange: The domain name of the mail host for this MX record.
    :vartype exchange: str
    """

    preference: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The preference value for this MX record."""
    exchange: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The domain name of the mail host for this MX record."""

    @overload
    def __init__(
        self,
        *,
        preference: Optional[int] = None,
        exchange: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Resource(_Model):
    """Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.privatedns.models.SystemData
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the resource."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
     \"Microsoft.Storage/storageAccounts\"."""
    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Azure Resource Manager metadata containing createdBy and modifiedBy information."""


class ProxyResource(Resource):
    """Proxy Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.privatedns.models.SystemData
    """


class PrivateZone(ProxyResource):
    """Describes a Private DNS zone.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.privatedns.models.SystemData
    :ivar properties: Properties of the Private DNS zone.
    :vartype properties: ~azure.mgmt.privatedns.models.PrivateZoneProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The Azure Region where the resource lives.
    :vartype location: str
    :ivar etag: The ETag of the zone.
    :vartype etag: str
    """

    properties: Optional["_models.PrivateZoneProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Private DNS zone."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The Azure Region where the resource lives."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the zone."""

    __flattened_items = [
        "max_number_of_record_sets",
        "number_of_record_sets",
        "max_number_of_virtual_network_links",
        "number_of_virtual_network_links",
        "max_number_of_virtual_network_links_with_registration",
        "number_of_virtual_network_links_with_registration",
        "provisioning_state",
        "internal_id",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PrivateZoneProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        location: Optional[str] = None,
        etag: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PrivateZoneProperties(_Model):
    """Represents the properties of the Private DNS zone.

    :ivar max_number_of_record_sets: The maximum number of record sets that can be created in this
     Private DNS zone. This is a read-only property and any attempt to set this value will be
     ignored.
    :vartype max_number_of_record_sets: int
    :ivar number_of_record_sets: The current number of record sets in this Private DNS zone. This
     is a read-only property and any attempt to set this value will be ignored.
    :vartype number_of_record_sets: int
    :ivar max_number_of_virtual_network_links: The maximum number of virtual networks that can be
     linked to this Private DNS zone. This is a read-only property and any attempt to set this value
     will be ignored.
    :vartype max_number_of_virtual_network_links: int
    :ivar number_of_virtual_network_links: The current number of virtual networks that are linked
     to this Private DNS zone. This is a read-only property and any attempt to set this value will
     be ignored.
    :vartype number_of_virtual_network_links: int
    :ivar max_number_of_virtual_network_links_with_registration: The maximum number of virtual
     networks that can be linked to this Private DNS zone with registration enabled. This is a
     read-only property and any attempt to set this value will be ignored.
    :vartype max_number_of_virtual_network_links_with_registration: int
    :ivar number_of_virtual_network_links_with_registration: The current number of virtual networks
     that are linked to this Private DNS zone with registration enabled. This is a read-only
     property and any attempt to set this value will be ignored.
    :vartype number_of_virtual_network_links_with_registration: int
    :ivar provisioning_state: The provisioning state of the resource. This is a read-only property
     and any attempt to set this value will be ignored. Known values are: "Creating", "Updating",
     "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.privatedns.models.ProvisioningState
    :ivar internal_id: Private zone internal Id.
    :vartype internal_id: str
    """

    max_number_of_record_sets: Optional[int] = rest_field(name="maxNumberOfRecordSets", visibility=["read"])
    """The maximum number of record sets that can be created in this Private DNS zone. This is a
     read-only property and any attempt to set this value will be ignored."""
    number_of_record_sets: Optional[int] = rest_field(name="numberOfRecordSets", visibility=["read"])
    """The current number of record sets in this Private DNS zone. This is a read-only property and
     any attempt to set this value will be ignored."""
    max_number_of_virtual_network_links: Optional[int] = rest_field(
        name="maxNumberOfVirtualNetworkLinks", visibility=["read"]
    )
    """The maximum number of virtual networks that can be linked to this Private DNS zone. This is a
     read-only property and any attempt to set this value will be ignored."""
    number_of_virtual_network_links: Optional[int] = rest_field(name="numberOfVirtualNetworkLinks", visibility=["read"])
    """The current number of virtual networks that are linked to this Private DNS zone. This is a
     read-only property and any attempt to set this value will be ignored."""
    max_number_of_virtual_network_links_with_registration: Optional[int] = rest_field(
        name="maxNumberOfVirtualNetworkLinksWithRegistration", visibility=["read"]
    )
    """The maximum number of virtual networks that can be linked to this Private DNS zone with
     registration enabled. This is a read-only property and any attempt to set this value will be
     ignored."""
    number_of_virtual_network_links_with_registration: Optional[int] = rest_field(
        name="numberOfVirtualNetworkLinksWithRegistration", visibility=["read"]
    )
    """The current number of virtual networks that are linked to this Private DNS zone with
     registration enabled. This is a read-only property and any attempt to set this value will be
     ignored."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource. This is a read-only property and any attempt to set
     this value will be ignored. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""
    internal_id: Optional[str] = rest_field(name="internalId", visibility=["read"])
    """Private zone internal Id."""


class PtrRecord(_Model):
    """A PTR record.

    :ivar ptrdname: The PTR target domain name for this PTR record.
    :vartype ptrdname: str
    """

    ptrdname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The PTR target domain name for this PTR record."""

    @overload
    def __init__(
        self,
        *,
        ptrdname: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RecordSet(ProxyResource):
    """Describes a DNS record set (a collection of DNS records with the same name and type) in a
    Private DNS zone.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.privatedns.models.SystemData
    :ivar properties: The properties of the record set.
    :vartype properties: ~azure.mgmt.privatedns.models.RecordSetProperties
    :ivar etag: The ETag of the record set.
    :vartype etag: str
    """

    properties: Optional["_models.RecordSetProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the record set."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the record set."""

    __flattened_items = [
        "metadata",
        "ttl",
        "fqdn",
        "is_auto_registered",
        "a_records",
        "aaaa_records",
        "cname_record",
        "mx_records",
        "ptr_records",
        "soa_record",
        "srv_records",
        "txt_records",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.RecordSetProperties"] = None,
        etag: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class RecordSetProperties(_Model):
    """Represents the properties of the records in the record set.

    :ivar metadata: The metadata attached to the record set.
    :vartype metadata: dict[str, str]
    :ivar ttl: The TTL (time-to-live) of the records in the record set.
    :vartype ttl: int
    :ivar fqdn: Fully qualified domain name of the record set.
    :vartype fqdn: str
    :ivar is_auto_registered: Is the record set auto-registered in the Private DNS zone through a
     virtual network link?.
    :vartype is_auto_registered: bool
    :ivar a_records: The list of A records in the record set.
    :vartype a_records: list[~azure.mgmt.privatedns.models.ARecord]
    :ivar aaaa_records: The list of AAAA records in the record set.
    :vartype aaaa_records: list[~azure.mgmt.privatedns.models.AaaaRecord]
    :ivar cname_record: The CNAME record in the record set.
    :vartype cname_record: ~azure.mgmt.privatedns.models.CnameRecord
    :ivar mx_records: The list of MX records in the record set.
    :vartype mx_records: list[~azure.mgmt.privatedns.models.MxRecord]
    :ivar ptr_records: The list of PTR records in the record set.
    :vartype ptr_records: list[~azure.mgmt.privatedns.models.PtrRecord]
    :ivar soa_record: The SOA record in the record set.
    :vartype soa_record: ~azure.mgmt.privatedns.models.SoaRecord
    :ivar srv_records: The list of SRV records in the record set.
    :vartype srv_records: list[~azure.mgmt.privatedns.models.SrvRecord]
    :ivar txt_records: The list of TXT records in the record set.
    :vartype txt_records: list[~azure.mgmt.privatedns.models.TxtRecord]
    """

    metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The metadata attached to the record set."""
    ttl: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The TTL (time-to-live) of the records in the record set."""
    fqdn: Optional[str] = rest_field(visibility=["read"])
    """Fully qualified domain name of the record set."""
    is_auto_registered: Optional[bool] = rest_field(name="isAutoRegistered", visibility=["read"])
    """Is the record set auto-registered in the Private DNS zone through a virtual network link?."""
    a_records: Optional[list["_models.ARecord"]] = rest_field(
        name="aRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of A records in the record set."""
    aaaa_records: Optional[list["_models.AaaaRecord"]] = rest_field(
        name="aaaaRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of AAAA records in the record set."""
    cname_record: Optional["_models.CnameRecord"] = rest_field(
        name="cnameRecord", visibility=["read", "create", "update", "delete", "query"]
    )
    """The CNAME record in the record set."""
    mx_records: Optional[list["_models.MxRecord"]] = rest_field(
        name="mxRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of MX records in the record set."""
    ptr_records: Optional[list["_models.PtrRecord"]] = rest_field(
        name="ptrRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of PTR records in the record set."""
    soa_record: Optional["_models.SoaRecord"] = rest_field(
        name="soaRecord", visibility=["read", "create", "update", "delete", "query"]
    )
    """The SOA record in the record set."""
    srv_records: Optional[list["_models.SrvRecord"]] = rest_field(
        name="srvRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of SRV records in the record set."""
    txt_records: Optional[list["_models.TxtRecord"]] = rest_field(
        name="txtRecords", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of TXT records in the record set."""

    @overload
    def __init__(
        self,
        *,
        metadata: Optional[dict[str, str]] = None,
        ttl: Optional[int] = None,
        a_records: Optional[list["_models.ARecord"]] = None,
        aaaa_records: Optional[list["_models.AaaaRecord"]] = None,
        cname_record: Optional["_models.CnameRecord"] = None,
        mx_records: Optional[list["_models.MxRecord"]] = None,
        ptr_records: Optional[list["_models.PtrRecord"]] = None,
        soa_record: Optional["_models.SoaRecord"] = None,
        srv_records: Optional[list["_models.SrvRecord"]] = None,
        txt_records: Optional[list["_models.TxtRecord"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SoaRecord(_Model):
    """An SOA record.

    :ivar host: The domain name of the authoritative name server for this SOA record.
    :vartype host: str
    :ivar email: The email contact for this SOA record.
    :vartype email: str
    :ivar serial_number: The serial number for this SOA record.
    :vartype serial_number: int
    :ivar refresh_time: The refresh value for this SOA record.
    :vartype refresh_time: int
    :ivar retry_time: The retry time for this SOA record.
    :vartype retry_time: int
    :ivar expire_time: The expire time for this SOA record.
    :vartype expire_time: int
    :ivar minimum_ttl: The minimum value for this SOA record. By convention this is used to
     determine the negative caching duration.
    :vartype minimum_ttl: int
    """

    host: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The domain name of the authoritative name server for this SOA record."""
    email: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The email contact for this SOA record."""
    serial_number: Optional[int] = rest_field(
        name="serialNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """The serial number for this SOA record."""
    refresh_time: Optional[int] = rest_field(
        name="refreshTime", visibility=["read", "create", "update", "delete", "query"]
    )
    """The refresh value for this SOA record."""
    retry_time: Optional[int] = rest_field(name="retryTime", visibility=["read", "create", "update", "delete", "query"])
    """The retry time for this SOA record."""
    expire_time: Optional[int] = rest_field(
        name="expireTime", visibility=["read", "create", "update", "delete", "query"]
    )
    """The expire time for this SOA record."""
    minimum_ttl: Optional[int] = rest_field(
        name="minimumTtl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The minimum value for this SOA record. By convention this is used to determine the negative
     caching duration."""

    @overload
    def __init__(
        self,
        *,
        host: Optional[str] = None,
        email: Optional[str] = None,
        serial_number: Optional[int] = None,
        refresh_time: Optional[int] = None,
        retry_time: Optional[int] = None,
        expire_time: Optional[int] = None,
        minimum_ttl: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SrvRecord(_Model):
    """An SRV record.

    :ivar priority: The priority value for this SRV record.
    :vartype priority: int
    :ivar weight: The weight value for this SRV record.
    :vartype weight: int
    :ivar port: The port value for this SRV record.
    :vartype port: int
    :ivar target: The target domain name for this SRV record.
    :vartype target: str
    """

    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The priority value for this SRV record."""
    weight: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The weight value for this SRV record."""
    port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The port value for this SRV record."""
    target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The target domain name for this SRV record."""

    @overload
    def __init__(
        self,
        *,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        port: Optional[int] = None,
        target: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SubResource(_Model):
    """Reference to another subresource.

    :ivar id: Resource ID.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource ID."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SystemData(_Model):
    """Metadata pertaining to creation and last modification of the resource.

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.privatedns.models.CreatedByType
    :ivar created_at: The timestamp of resource creation (UTC).
    :vartype created_at: ~datetime.datetime
    :ivar last_modified_by: The identity that last modified the resource.
    :vartype last_modified_by: str
    :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
     are: "User", "Application", "ManagedIdentity", and "Key".
    :vartype last_modified_by_type: str or ~azure.mgmt.privatedns.models.CreatedByType
    :ivar last_modified_at: The timestamp of resource last modification (UTC).
    :vartype last_modified_at: ~datetime.datetime
    """

    created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"])
    """The identity that created the resource."""
    created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="createdByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that created the resource. Known values are: \"User\", \"Application\",
     \"ManagedIdentity\", and \"Key\"."""
    created_at: Optional[datetime.datetime] = rest_field(
        name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource creation (UTC)."""
    last_modified_by: Optional[str] = rest_field(
        name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity that last modified the resource."""
    last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that last modified the resource. Known values are: \"User\",
     \"Application\", \"ManagedIdentity\", and \"Key\"."""
    last_modified_at: Optional[datetime.datetime] = rest_field(
        name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource last modification (UTC)."""

    @overload
    def __init__(
        self,
        *,
        created_by: Optional[str] = None,
        created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        created_at: Optional[datetime.datetime] = None,
        last_modified_by: Optional[str] = None,
        last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        last_modified_at: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TxtRecord(_Model):
    """A TXT record.

    :ivar value: The text value of this TXT record.
    :vartype value: list[str]
    """

    value: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The text value of this TXT record."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class VirtualNetworkLink(ProxyResource):
    """Describes a link to virtual network for a Private DNS zone.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.privatedns.models.SystemData
    :ivar properties: Properties of the virtual network link to the Private DNS zone.
    :vartype properties: ~azure.mgmt.privatedns.models.VirtualNetworkLinkProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The Azure Region where the resource lives.
    :vartype location: str
    :ivar etag: The ETag of the virtual network link.
    :vartype etag: str
    """

    properties: Optional["_models.VirtualNetworkLinkProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the virtual network link to the Private DNS zone."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The Azure Region where the resource lives."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the virtual network link."""

    __flattened_items = [
        "virtual_network",
        "registration_enabled",
        "resolution_policy",
        "virtual_network_link_state",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.VirtualNetworkLinkProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        location: Optional[str] = None,
        etag: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class VirtualNetworkLinkProperties(_Model):
    """Represents the properties of the Private DNS zone.

    :ivar virtual_network: The reference of the virtual network.
    :vartype virtual_network: ~azure.mgmt.privatedns.models.SubResource
    :ivar registration_enabled: Is auto-registration of virtual machine records in the virtual
     network in the Private DNS zone enabled?.
    :vartype registration_enabled: bool
    :ivar resolution_policy: The resolution policy on the virtual network link. Only applicable for
     virtual network links to privatelink zones, and for A,AAAA,CNAME queries. When set to
     'NxDomainRedirect', Azure DNS resolver falls back to public resolution if private dns query
     resolution results in non-existent domain response. Known values are: "Default" and
     "NxDomainRedirect".
    :vartype resolution_policy: str or ~azure.mgmt.privatedns.models.ResolutionPolicy
    :ivar virtual_network_link_state: The status of the virtual network link to the Private DNS
     zone. Possible values are 'InProgress' and 'Done'. This is a read-only property and any attempt
     to set this value will be ignored. Known values are: "InProgress" and "Completed".
    :vartype virtual_network_link_state: str or
     ~azure.mgmt.privatedns.models.VirtualNetworkLinkState
    :ivar provisioning_state: The provisioning state of the resource. This is a read-only property
     and any attempt to set this value will be ignored. Known values are: "Creating", "Updating",
     "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.privatedns.models.ProvisioningState
    """

    virtual_network: Optional["_models.SubResource"] = rest_field(
        name="virtualNetwork", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference of the virtual network."""
    registration_enabled: Optional[bool] = rest_field(
        name="registrationEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Is auto-registration of virtual machine records in the virtual network in the Private DNS zone
     enabled?."""
    resolution_policy: Optional[Union[str, "_models.ResolutionPolicy"]] = rest_field(
        name="resolutionPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resolution policy on the virtual network link. Only applicable for virtual network links to
     privatelink zones, and for A,AAAA,CNAME queries. When set to 'NxDomainRedirect', Azure DNS
     resolver falls back to public resolution if private dns query resolution results in
     non-existent domain response. Known values are: \"Default\" and \"NxDomainRedirect\"."""
    virtual_network_link_state: Optional[Union[str, "_models.VirtualNetworkLinkState"]] = rest_field(
        name="virtualNetworkLinkState", visibility=["read"]
    )
    """The status of the virtual network link to the Private DNS zone. Possible values are
     'InProgress' and 'Done'. This is a read-only property and any attempt to set this value will be
     ignored. Known values are: \"InProgress\" and \"Completed\"."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource. This is a read-only property and any attempt to set
     this value will be ignored. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        virtual_network: Optional["_models.SubResource"] = None,
        registration_enabled: Optional[bool] = None,
        resolution_policy: Optional[Union[str, "_models.ResolutionPolicy"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
