# 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 Address(_Model):
    """Address information for domain registration.

    :ivar address1: First line of an Address. Required.
    :vartype address1: str
    :ivar address2: The second line of the Address. Optional.
    :vartype address2: str
    :ivar city: The city for the address. Required.
    :vartype city: str
    :ivar country: The country for the address. Required.
    :vartype country: str
    :ivar postal_code: The postal code for the address. Required.
    :vartype postal_code: str
    :ivar state: The state or province for the address. Required.
    :vartype state: str
    """

    address1: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """First line of an Address. Required."""
    address2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The second line of the Address. Optional."""
    city: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The city for the address. Required."""
    country: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The country for the address. Required."""
    postal_code: str = rest_field(name="postalCode", visibility=["read", "create", "update", "delete", "query"])
    """The postal code for the address. Required."""
    state: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The state or province for the address. Required."""

    @overload
    def __init__(
        self,
        *,
        address1: str,
        city: str,
        country: str,
        postal_code: str,
        state: str,
        address2: 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 Contact(_Model):
    """Contact information for domain registration. If 'Domain Privacy' option is not selected then
    the contact information is made publicly available through the Whois directories as per ICANN
    requirements.

    :ivar address_mailing: Mailing address.
    :vartype address_mailing: ~azure.mgmt.domainregistration.models.Address
    :ivar email: Email address. Required.
    :vartype email: str
    :ivar fax: Fax number.
    :vartype fax: str
    :ivar job_title: Job title.
    :vartype job_title: str
    :ivar name_first: First name. Required.
    :vartype name_first: str
    :ivar name_last: Last name. Required.
    :vartype name_last: str
    :ivar name_middle: Middle name.
    :vartype name_middle: str
    :ivar organization: Organization contact belongs to.
    :vartype organization: str
    :ivar phone: Phone number. Required.
    :vartype phone: str
    """

    address_mailing: Optional["_models.Address"] = rest_field(
        name="addressMailing", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mailing address."""
    email: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Email address. Required."""
    fax: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Fax number."""
    job_title: Optional[str] = rest_field(name="jobTitle", visibility=["read", "create", "update", "delete", "query"])
    """Job title."""
    name_first: str = rest_field(name="nameFirst", visibility=["read", "create", "update", "delete", "query"])
    """First name. Required."""
    name_last: str = rest_field(name="nameLast", visibility=["read", "create", "update", "delete", "query"])
    """Last name. Required."""
    name_middle: Optional[str] = rest_field(
        name="nameMiddle", visibility=["read", "create", "update", "delete", "query"]
    )
    """Middle name."""
    organization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Organization contact belongs to."""
    phone: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Phone number. Required."""

    @overload
    def __init__(
        self,
        *,
        email: str,
        name_first: str,
        name_last: str,
        phone: str,
        address_mailing: Optional["_models.Address"] = None,
        fax: Optional[str] = None,
        job_title: Optional[str] = None,
        name_middle: Optional[str] = None,
        organization: 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 CsmOperationDescription(_Model):
    """Description of an operation available for Microsoft.Web resource provider.

    :ivar name: Operation name, e.g. Microsoft.Web/sites/write.
    :vartype name: str
    :ivar is_data_action: Operation display name.
    :vartype is_data_action: bool
    :ivar display: Meta data about operation used for display in portal.
    :vartype display: ~azure.mgmt.domainregistration.models.CsmOperationDisplay
    :ivar origin: Origin of the operation, e.g. "system" or "user".
    :vartype origin: str
    :ivar properties: Properties available for a Microsoft.Web resource provider operation.
    :vartype properties: ~azure.mgmt.domainregistration.models.CsmOperationDescriptionProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation name, e.g. Microsoft.Web/sites/write."""
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Operation display name."""
    display: Optional["_models.CsmOperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Meta data about operation used for display in portal."""
    origin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin of the operation, e.g. \"system\" or \"user\"."""
    properties: Optional["_models.CsmOperationDescriptionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties available for a Microsoft.Web resource provider operation."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        is_data_action: Optional[bool] = None,
        display: Optional["_models.CsmOperationDisplay"] = None,
        origin: Optional[str] = None,
        properties: Optional["_models.CsmOperationDescriptionProperties"] = 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 CsmOperationDescriptionProperties(_Model):
    """Properties available for a Microsoft.Web resource provider operation.

    :ivar service_specification: Resource metrics service provided by Microsoft.Insights resource
     provider.
    :vartype service_specification: ~azure.mgmt.domainregistration.models.ServiceSpecification
    """

    service_specification: Optional["_models.ServiceSpecification"] = rest_field(
        name="serviceSpecification", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metrics service provided by Microsoft.Insights resource provider."""

    @overload
    def __init__(
        self,
        *,
        service_specification: Optional["_models.ServiceSpecification"] = 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 CsmOperationDisplay(_Model):
    """Meta data about operation used for display in portal.

    :ivar provider: Provider name.
    :vartype provider: str
    :ivar resource: Resource type.
    :vartype resource: str
    :ivar operation: Operation name.
    :vartype operation: str
    :ivar description: Operation description.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Provider name."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource type."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation name."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation description."""

    @overload
    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        resource: Optional[str] = None,
        operation: Optional[str] = None,
        description: 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 DefaultErrorResponse(_Model):
    """App Service error response.

    :ivar error: Error model.
    :vartype error: ~azure.mgmt.domainregistration.models.DefaultErrorResponseError
    """

    error: Optional["_models.DefaultErrorResponseError"] = rest_field(visibility=["read"])
    """Error model."""


class DefaultErrorResponseError(_Model):
    """Error model.

    :ivar code: Standardized string to programmatically identify the error.
    :vartype code: str
    :ivar message: Detailed error description and debugging information.
    :vartype message: str
    :ivar target: Detailed error description and debugging information.
    :vartype target: str
    :ivar details: Error details.
    :vartype details:
     list[~azure.mgmt.domainregistration.models.DefaultErrorResponseErrorDetailsItem]
    :ivar innererror: More information to debug error.
    :vartype innererror: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Standardized string to programmatically identify the error."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Detailed error description and debugging information."""
    target: Optional[str] = rest_field(visibility=["read"])
    """Detailed error description and debugging information."""
    details: Optional[list["_models.DefaultErrorResponseErrorDetailsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Error details."""
    innererror: Optional[str] = rest_field(visibility=["read"])
    """More information to debug error."""

    @overload
    def __init__(
        self,
        *,
        details: Optional[list["_models.DefaultErrorResponseErrorDetailsItem"]] = 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 DefaultErrorResponseErrorDetailsItem(_Model):
    """Detailed errors.

    :ivar code: Standardized string to programmatically identify the error.
    :vartype code: str
    :ivar message: Detailed error description and debugging information.
    :vartype message: str
    :ivar target: Detailed error description and debugging information.
    :vartype target: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Standardized string to programmatically identify the error."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Detailed error description and debugging information."""
    target: Optional[str] = rest_field(visibility=["read"])
    """Detailed error description and debugging information."""


class Dimension(_Model):
    """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where
    instance name is dimension of the metric HTTP request.

    :ivar name: Name of the dimension.
    :vartype name: str
    :ivar display_name: Display name of the dimension.
    :vartype display_name: str
    :ivar internal_name: Dimension of the internal name.
    :vartype internal_name: str
    :ivar to_be_exported_for_shoebox: Dimension to be exported for shoebox.
    :vartype to_be_exported_for_shoebox: bool
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the dimension."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the dimension."""
    internal_name: Optional[str] = rest_field(
        name="internalName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Dimension of the internal name."""
    to_be_exported_for_shoebox: Optional[bool] = rest_field(
        name="toBeExportedForShoebox", visibility=["read", "create", "update", "delete", "query"]
    )
    """Dimension to be exported for shoebox."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        internal_name: Optional[str] = None,
        to_be_exported_for_shoebox: Optional[bool] = 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.domainregistration.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 TrackedResource(Resource):
    """Tracked 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.domainregistration.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: str = rest_field(visibility=["read", "create"])
    """The geo-location where the resource lives. Required."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, 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 Domain(TrackedResource):
    """Information about a domain.

    :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.domainregistration.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar properties: Domain resource specific properties.
    :vartype properties: ~azure.mgmt.domainregistration.models.DomainProperties
    :ivar kind: Kind of resource.
    :vartype kind: str
    """

    properties: Optional["_models.DomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Domain resource specific properties."""
    kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Kind of resource."""

    __flattened_items = [
        "contact_admin",
        "contact_billing",
        "contact_registrant",
        "contact_tech",
        "registration_status",
        "provisioning_state",
        "name_servers",
        "privacy",
        "created_time",
        "expiration_time",
        "last_renewed_time",
        "auto_renew",
        "ready_for_dns_record_management",
        "managed_host_names",
        "consent",
        "domain_not_renewable_reasons",
        "dns_type",
        "dns_zone_id",
        "target_dns_type",
        "auth_code",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.DomainProperties"] = None,
        kind: 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 DomainAvailabilityCheckResult(_Model):
    """Domain availability check result.

    :ivar name: Name of the domain.
    :vartype name: str
    :ivar available: <code>true</code> if domain can be purchased using CreateDomain API;
     otherwise, <code>false</code>.
    :vartype available: bool
    :ivar domain_type: Valid values are Regular domain: Azure will charge the full price of domain
     registration, SoftDeleted: Purchasing this domain will simply restore it and this operation
     will not cost anything. Known values are: "Regular" and "SoftDeleted".
    :vartype domain_type: str or ~azure.mgmt.domainregistration.models.DomainType
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the domain."""
    available: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """<code>true</code> if domain can be purchased using CreateDomain API; otherwise,
     <code>false</code>."""
    domain_type: Optional[Union[str, "_models.DomainType"]] = rest_field(
        name="domainType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Valid values are Regular domain: Azure will charge the full price of domain registration,
     SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost
     anything. Known values are: \"Regular\" and \"SoftDeleted\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        available: Optional[bool] = None,
        domain_type: Optional[Union[str, "_models.DomainType"]] = 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 DomainControlCenterSsoRequest(_Model):
    """Single sign-on request information for domain management.

    :ivar url: URL where the single sign-on request is to be made.
    :vartype url: str
    :ivar post_parameter_key: Post parameter key.
    :vartype post_parameter_key: str
    :ivar post_parameter_value: Post parameter value. Client should use
     'application/x-www-form-urlencoded' encoding for this value.
    :vartype post_parameter_value: str
    """

    url: Optional[str] = rest_field(visibility=["read"])
    """URL where the single sign-on request is to be made."""
    post_parameter_key: Optional[str] = rest_field(name="postParameterKey", visibility=["read"])
    """Post parameter key."""
    post_parameter_value: Optional[str] = rest_field(name="postParameterValue", visibility=["read"])
    """Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this
     value."""


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.domainregistration.models.SystemData
    """


class DomainOwnershipIdentifier(ProxyResource):
    """Domain ownership Identifier.

    :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.domainregistration.models.SystemData
    :ivar properties: DomainOwnershipIdentifier resource specific properties.
    :vartype properties: ~azure.mgmt.domainregistration.models.DomainOwnershipIdentifierProperties
    :ivar kind: Kind of resource.
    :vartype kind: str
    """

    properties: Optional["_models.DomainOwnershipIdentifierProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """DomainOwnershipIdentifier resource specific properties."""
    kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Kind of resource."""

    __flattened_items = ["ownership_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.DomainOwnershipIdentifierProperties"] = None,
        kind: 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 DomainOwnershipIdentifierProperties(_Model):
    """DomainOwnershipIdentifier resource specific properties.

    :ivar ownership_id: Ownership Id.
    :vartype ownership_id: str
    """

    ownership_id: Optional[str] = rest_field(
        name="ownershipId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Ownership Id."""

    @overload
    def __init__(
        self,
        *,
        ownership_id: 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 ProxyOnlyResource(_Model):
    """Azure proxy only resource. This resource is not tracked by Azure Resource Manager.

    :ivar id: Resource Id.
    :vartype id: str
    :ivar name: Resource Name.
    :vartype name: str
    :ivar kind: Kind of resource.
    :vartype kind: str
    :ivar type: Resource type.
    :vartype type: str
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Resource Id."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Resource Name."""
    kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Kind of resource."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Resource type."""

    @overload
    def __init__(
        self,
        *,
        kind: 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 DomainPatchResource(ProxyOnlyResource):
    """ARM resource for a domain.

    :ivar id: Resource Id.
    :vartype id: str
    :ivar name: Resource Name.
    :vartype name: str
    :ivar kind: Kind of resource.
    :vartype kind: str
    :ivar type: Resource type.
    :vartype type: str
    :ivar properties: DomainPatchResource resource specific properties.
    :vartype properties: ~azure.mgmt.domainregistration.models.DomainPatchResourceProperties
    """

    properties: Optional["_models.DomainPatchResourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """DomainPatchResource resource specific properties."""

    __flattened_items = [
        "contact_admin",
        "contact_billing",
        "contact_registrant",
        "contact_tech",
        "registration_status",
        "provisioning_state",
        "name_servers",
        "privacy",
        "created_time",
        "expiration_time",
        "last_renewed_time",
        "auto_renew",
        "ready_for_dns_record_management",
        "managed_host_names",
        "consent",
        "domain_not_renewable_reasons",
        "dns_type",
        "dns_zone_id",
        "target_dns_type",
        "auth_code",
    ]

    @overload
    def __init__(
        self,
        *,
        kind: Optional[str] = None,
        properties: Optional["_models.DomainPatchResourceProperties"] = 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 DomainPatchResourceProperties(_Model):
    """DomainPatchResource resource specific properties.

    :ivar contact_admin: Administrative contact. Required.
    :vartype contact_admin: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_billing: Billing contact. Required.
    :vartype contact_billing: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_registrant: Registrant contact. Required.
    :vartype contact_registrant: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_tech: Technical contact. Required.
    :vartype contact_tech: ~azure.mgmt.domainregistration.models.Contact
    :ivar registration_status: Domain registration status. Known values are: "Active", "Awaiting",
     "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", "Locked",
     "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", "Unlocked",
     "Unparked", "Updated", and "JsonConverterFailed".
    :vartype registration_status: str or ~azure.mgmt.domainregistration.models.DomainStatus
    :ivar provisioning_state: Domain provisioning state. Known values are: "Succeeded", "Failed",
     "Canceled", "InProgress", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.domainregistration.models.ProvisioningState
    :ivar name_servers: Name servers.
    :vartype name_servers: list[str]
    :ivar privacy: <code>true</code> if domain privacy is enabled for this domain; otherwise,
     <code>false</code>.
    :vartype privacy: bool
    :ivar created_time: Domain creation timestamp.
    :vartype created_time: ~datetime.datetime
    :ivar expiration_time: Domain expiration timestamp.
    :vartype expiration_time: ~datetime.datetime
    :ivar last_renewed_time: Timestamp when the domain was renewed last time.
    :vartype last_renewed_time: ~datetime.datetime
    :ivar auto_renew: <code>true</code> if the domain should be automatically renewed; otherwise,
     <code>false</code>.
    :vartype auto_renew: bool
    :ivar ready_for_dns_record_management: <code>true</code> if Azure can assign this domain to App
     Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain
     registration status is active and \\n it is hosted on name servers Azure has programmatic
     access to.
    :vartype ready_for_dns_record_management: bool
    :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure
     resources.
    :vartype managed_host_names: list[~azure.mgmt.domainregistration.models.HostName]
    :ivar consent: Legal agreement consent. Required.
    :vartype consent: ~azure.mgmt.domainregistration.models.DomainPurchaseConsent
    :ivar domain_not_renewable_reasons: Reasons why domain is not renewable.
    :vartype domain_not_renewable_reasons: list[str or
     ~azure.mgmt.domainregistration.models.ResourceNotRenewableReason]
    :ivar dns_type: Current DNS type. Known values are: "AzureDns" and "DefaultDomainRegistrarDns".
    :vartype dns_type: str or ~azure.mgmt.domainregistration.models.DnsType
    :ivar dns_zone_id: Azure DNS Zone to use.
    :vartype dns_zone_id: str
    :ivar target_dns_type: Target DNS type (would be used for migration). Known values are:
     "AzureDns" and "DefaultDomainRegistrarDns".
    :vartype target_dns_type: str or ~azure.mgmt.domainregistration.models.DnsType
    :ivar auth_code: Authorization code for the domain.
    :vartype auth_code: str
    """

    contact_admin: "_models.Contact" = rest_field(name="contactAdmin", visibility=["create"])
    """Administrative contact. Required."""
    contact_billing: "_models.Contact" = rest_field(name="contactBilling", visibility=["create"])
    """Billing contact. Required."""
    contact_registrant: "_models.Contact" = rest_field(name="contactRegistrant", visibility=["create"])
    """Registrant contact. Required."""
    contact_tech: "_models.Contact" = rest_field(name="contactTech", visibility=["create"])
    """Technical contact. Required."""
    registration_status: Optional[Union[str, "_models.DomainStatus"]] = rest_field(
        name="registrationStatus", visibility=["read"]
    )
    """Domain registration status. Known values are: \"Active\", \"Awaiting\", \"Cancelled\",
     \"Confiscated\", \"Disabled\", \"Excluded\", \"Expired\", \"Failed\", \"Held\", \"Locked\",
     \"Parked\", \"Pending\", \"Reserved\", \"Reverted\", \"Suspended\", \"Transferred\",
     \"Unknown\", \"Unlocked\", \"Unparked\", \"Updated\", and \"JsonConverterFailed\"."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Domain provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"InProgress\", and \"Deleting\"."""
    name_servers: Optional[list[str]] = rest_field(name="nameServers", visibility=["read"])
    """Name servers."""
    privacy: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """<code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>."""
    created_time: Optional[datetime.datetime] = rest_field(name="createdTime", visibility=["read"], format="rfc3339")
    """Domain creation timestamp."""
    expiration_time: Optional[datetime.datetime] = rest_field(
        name="expirationTime", visibility=["read"], format="rfc3339"
    )
    """Domain expiration timestamp."""
    last_renewed_time: Optional[datetime.datetime] = rest_field(
        name="lastRenewedTime", visibility=["read"], format="rfc3339"
    )
    """Timestamp when the domain was renewed last time."""
    auto_renew: Optional[bool] = rest_field(
        name="autoRenew", visibility=["read", "create", "update", "delete", "query"]
    )
    """<code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>."""
    ready_for_dns_record_management: Optional[bool] = rest_field(
        name="readyForDnsRecordManagement", visibility=["read"]
    )
    """<code>true</code> if Azure can assign this domain to App Service apps; otherwise,
     <code>false</code>. This value will be <code>true</code> if domain registration status is
     active and \n it is hosted on name servers Azure has programmatic access to."""
    managed_host_names: Optional[list["_models.HostName"]] = rest_field(name="managedHostNames", visibility=["read"])
    """All hostnames derived from the domain and assigned to Azure resources."""
    consent: "_models.DomainPurchaseConsent" = rest_field(visibility=["create"])
    """Legal agreement consent. Required."""
    domain_not_renewable_reasons: Optional[list[Union[str, "_models.ResourceNotRenewableReason"]]] = rest_field(
        name="domainNotRenewableReasons", visibility=["read"]
    )
    """Reasons why domain is not renewable."""
    dns_type: Optional[Union[str, "_models.DnsType"]] = rest_field(
        name="dnsType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current DNS type. Known values are: \"AzureDns\" and \"DefaultDomainRegistrarDns\"."""
    dns_zone_id: Optional[str] = rest_field(
        name="dnsZoneId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure DNS Zone to use."""
    target_dns_type: Optional[Union[str, "_models.DnsType"]] = rest_field(
        name="targetDnsType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target DNS type (would be used for migration). Known values are: \"AzureDns\" and
     \"DefaultDomainRegistrarDns\"."""
    auth_code: Optional[str] = rest_field(name="authCode", visibility=["read", "create"])
    """Authorization code for the domain."""

    @overload
    def __init__(
        self,
        *,
        contact_admin: "_models.Contact",
        contact_billing: "_models.Contact",
        contact_registrant: "_models.Contact",
        contact_tech: "_models.Contact",
        consent: "_models.DomainPurchaseConsent",
        privacy: Optional[bool] = None,
        auto_renew: Optional[bool] = None,
        dns_type: Optional[Union[str, "_models.DnsType"]] = None,
        dns_zone_id: Optional[str] = None,
        target_dns_type: Optional[Union[str, "_models.DnsType"]] = None,
        auth_code: 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 DomainProperties(_Model):
    """Domain resource specific properties.

    :ivar contact_admin: Administrative contact. Required.
    :vartype contact_admin: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_billing: Billing contact. Required.
    :vartype contact_billing: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_registrant: Registrant contact. Required.
    :vartype contact_registrant: ~azure.mgmt.domainregistration.models.Contact
    :ivar contact_tech: Technical contact. Required.
    :vartype contact_tech: ~azure.mgmt.domainregistration.models.Contact
    :ivar registration_status: Domain registration status. Known values are: "Active", "Awaiting",
     "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", "Locked",
     "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", "Unlocked",
     "Unparked", "Updated", and "JsonConverterFailed".
    :vartype registration_status: str or ~azure.mgmt.domainregistration.models.DomainStatus
    :ivar provisioning_state: Domain provisioning state. Known values are: "Succeeded", "Failed",
     "Canceled", "InProgress", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.domainregistration.models.ProvisioningState
    :ivar name_servers: Name servers.
    :vartype name_servers: list[str]
    :ivar privacy: <code>true</code> if domain privacy is enabled for this domain; otherwise,
     <code>false</code>.
    :vartype privacy: bool
    :ivar created_time: Domain creation timestamp.
    :vartype created_time: ~datetime.datetime
    :ivar expiration_time: Domain expiration timestamp.
    :vartype expiration_time: ~datetime.datetime
    :ivar last_renewed_time: Timestamp when the domain was renewed last time.
    :vartype last_renewed_time: ~datetime.datetime
    :ivar auto_renew: <code>true</code> if the domain should be automatically renewed; otherwise,
     <code>false</code>.
    :vartype auto_renew: bool
    :ivar ready_for_dns_record_management: <code>true</code> if Azure can assign this domain to App
     Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain
     registration status is active and \\n it is hosted on name servers Azure has programmatic
     access to.
    :vartype ready_for_dns_record_management: bool
    :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure
     resources.
    :vartype managed_host_names: list[~azure.mgmt.domainregistration.models.HostName]
    :ivar consent: Legal agreement consent. Required.
    :vartype consent: ~azure.mgmt.domainregistration.models.DomainPurchaseConsent
    :ivar domain_not_renewable_reasons: Reasons why domain is not renewable.
    :vartype domain_not_renewable_reasons: list[str or
     ~azure.mgmt.domainregistration.models.ResourceNotRenewableReason]
    :ivar dns_type: Current DNS type. Known values are: "AzureDns" and "DefaultDomainRegistrarDns".
    :vartype dns_type: str or ~azure.mgmt.domainregistration.models.DnsType
    :ivar dns_zone_id: Azure DNS Zone to use.
    :vartype dns_zone_id: str
    :ivar target_dns_type: Target DNS type (would be used for migration). Known values are:
     "AzureDns" and "DefaultDomainRegistrarDns".
    :vartype target_dns_type: str or ~azure.mgmt.domainregistration.models.DnsType
    :ivar auth_code: Authorization code for the domain.
    :vartype auth_code: str
    """

    contact_admin: "_models.Contact" = rest_field(name="contactAdmin", visibility=["create"])
    """Administrative contact. Required."""
    contact_billing: "_models.Contact" = rest_field(name="contactBilling", visibility=["create"])
    """Billing contact. Required."""
    contact_registrant: "_models.Contact" = rest_field(name="contactRegistrant", visibility=["create"])
    """Registrant contact. Required."""
    contact_tech: "_models.Contact" = rest_field(name="contactTech", visibility=["create"])
    """Technical contact. Required."""
    registration_status: Optional[Union[str, "_models.DomainStatus"]] = rest_field(
        name="registrationStatus", visibility=["read"]
    )
    """Domain registration status. Known values are: \"Active\", \"Awaiting\", \"Cancelled\",
     \"Confiscated\", \"Disabled\", \"Excluded\", \"Expired\", \"Failed\", \"Held\", \"Locked\",
     \"Parked\", \"Pending\", \"Reserved\", \"Reverted\", \"Suspended\", \"Transferred\",
     \"Unknown\", \"Unlocked\", \"Unparked\", \"Updated\", and \"JsonConverterFailed\"."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Domain provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"InProgress\", and \"Deleting\"."""
    name_servers: Optional[list[str]] = rest_field(name="nameServers", visibility=["read"])
    """Name servers."""
    privacy: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """<code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>."""
    created_time: Optional[datetime.datetime] = rest_field(name="createdTime", visibility=["read"], format="rfc3339")
    """Domain creation timestamp."""
    expiration_time: Optional[datetime.datetime] = rest_field(
        name="expirationTime", visibility=["read"], format="rfc3339"
    )
    """Domain expiration timestamp."""
    last_renewed_time: Optional[datetime.datetime] = rest_field(
        name="lastRenewedTime", visibility=["read"], format="rfc3339"
    )
    """Timestamp when the domain was renewed last time."""
    auto_renew: Optional[bool] = rest_field(
        name="autoRenew", visibility=["read", "create", "update", "delete", "query"]
    )
    """<code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>."""
    ready_for_dns_record_management: Optional[bool] = rest_field(
        name="readyForDnsRecordManagement", visibility=["read"]
    )
    """<code>true</code> if Azure can assign this domain to App Service apps; otherwise,
     <code>false</code>. This value will be <code>true</code> if domain registration status is
     active and \n it is hosted on name servers Azure has programmatic access to."""
    managed_host_names: Optional[list["_models.HostName"]] = rest_field(name="managedHostNames", visibility=["read"])
    """All hostnames derived from the domain and assigned to Azure resources."""
    consent: "_models.DomainPurchaseConsent" = rest_field(visibility=["create"])
    """Legal agreement consent. Required."""
    domain_not_renewable_reasons: Optional[list[Union[str, "_models.ResourceNotRenewableReason"]]] = rest_field(
        name="domainNotRenewableReasons", visibility=["read"]
    )
    """Reasons why domain is not renewable."""
    dns_type: Optional[Union[str, "_models.DnsType"]] = rest_field(
        name="dnsType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current DNS type. Known values are: \"AzureDns\" and \"DefaultDomainRegistrarDns\"."""
    dns_zone_id: Optional[str] = rest_field(
        name="dnsZoneId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure DNS Zone to use."""
    target_dns_type: Optional[Union[str, "_models.DnsType"]] = rest_field(
        name="targetDnsType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target DNS type (would be used for migration). Known values are: \"AzureDns\" and
     \"DefaultDomainRegistrarDns\"."""
    auth_code: Optional[str] = rest_field(name="authCode", visibility=["read", "create"])
    """Authorization code for the domain."""

    @overload
    def __init__(
        self,
        *,
        contact_admin: "_models.Contact",
        contact_billing: "_models.Contact",
        contact_registrant: "_models.Contact",
        contact_tech: "_models.Contact",
        consent: "_models.DomainPurchaseConsent",
        privacy: Optional[bool] = None,
        auto_renew: Optional[bool] = None,
        dns_type: Optional[Union[str, "_models.DnsType"]] = None,
        dns_zone_id: Optional[str] = None,
        target_dns_type: Optional[Union[str, "_models.DnsType"]] = None,
        auth_code: 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 DomainPurchaseConsent(_Model):
    """Domain purchase consent object, representing acceptance of applicable legal agreements.

    :ivar agreement_keys: List of applicable legal agreement keys. This list can be retrieved using
     ListLegalAgreements API under <code>TopLevelDomain</code> resource.
    :vartype agreement_keys: list[str]
    :ivar agreed_by: Client IP address.
    :vartype agreed_by: str
    :ivar agreed_at: Timestamp when the agreements were accepted.
    :vartype agreed_at: ~datetime.datetime
    """

    agreement_keys: Optional[list[str]] = rest_field(
        name="agreementKeys", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements
     API under <code>TopLevelDomain</code> resource."""
    agreed_by: Optional[str] = rest_field(name="agreedBy", visibility=["read", "create", "update", "delete", "query"])
    """Client IP address."""
    agreed_at: Optional[datetime.datetime] = rest_field(
        name="agreedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Timestamp when the agreements were accepted."""

    @overload
    def __init__(
        self,
        *,
        agreement_keys: Optional[list[str]] = None,
        agreed_by: Optional[str] = None,
        agreed_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 DomainRecommendationSearchParameters(_Model):
    """Domain recommendation search parameters.

    :ivar keywords: Keywords to be used for generating domain recommendations.
    :vartype keywords: str
    :ivar max_domain_recommendations: Maximum number of recommendations.
    :vartype max_domain_recommendations: int
    """

    keywords: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Keywords to be used for generating domain recommendations."""
    max_domain_recommendations: Optional[int] = rest_field(
        name="maxDomainRecommendations", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum number of recommendations."""

    @overload
    def __init__(
        self,
        *,
        keywords: Optional[str] = None,
        max_domain_recommendations: 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 HostName(_Model):
    """Details of a hostname derived from a domain.

    :ivar name: Name of the hostname.
    :vartype name: str
    :ivar site_names: List of apps the hostname is assigned to. This list will have more than one
     app only if the hostname is pointing to a Traffic Manager.
    :vartype site_names: list[str]
    :ivar azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is
     assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the
     app name.
    :vartype azure_resource_name: str
    :ivar azure_resource_type: Type of the Azure resource the hostname is assigned to. Known values
     are: "Website" and "TrafficManager".
    :vartype azure_resource_type: str or ~azure.mgmt.domainregistration.models.AzureResourceType
    :ivar custom_host_name_dns_record_type: Type of the DNS record. Known values are: "CName" and
     "A".
    :vartype custom_host_name_dns_record_type: str or
     ~azure.mgmt.domainregistration.models.CustomHostNameDnsRecordType
    :ivar host_name_type: Type of the hostname. Known values are: "Verified" and "Managed".
    :vartype host_name_type: str or ~azure.mgmt.domainregistration.models.HostNameType
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the hostname."""
    site_names: Optional[list[str]] = rest_field(
        name="siteNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of apps the hostname is assigned to. This list will have more than one app only if the
     hostname is pointing to a Traffic Manager."""
    azure_resource_name: Optional[str] = rest_field(
        name="azureResourceName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager
     then it will be the Traffic Manager name otherwise it will be the app name."""
    azure_resource_type: Optional[Union[str, "_models.AzureResourceType"]] = rest_field(
        name="azureResourceType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Azure resource the hostname is assigned to. Known values are: \"Website\" and
     \"TrafficManager\"."""
    custom_host_name_dns_record_type: Optional[Union[str, "_models.CustomHostNameDnsRecordType"]] = rest_field(
        name="customHostNameDnsRecordType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the DNS record. Known values are: \"CName\" and \"A\"."""
    host_name_type: Optional[Union[str, "_models.HostNameType"]] = rest_field(
        name="hostNameType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the hostname. Known values are: \"Verified\" and \"Managed\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        site_names: Optional[list[str]] = None,
        azure_resource_name: Optional[str] = None,
        azure_resource_type: Optional[Union[str, "_models.AzureResourceType"]] = None,
        custom_host_name_dns_record_type: Optional[Union[str, "_models.CustomHostNameDnsRecordType"]] = None,
        host_name_type: Optional[Union[str, "_models.HostNameType"]] = 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 LogSpecification(_Model):
    """Log Definition of a single resource metric.

    :ivar name: Name of the log.
    :vartype name: str
    :ivar display_name: Display name of the log.
    :vartype display_name: str
    :ivar blob_duration: Blob duration of the log.
    :vartype blob_duration: str
    :ivar log_filter_pattern: Log filtered pattern of the log.
    :vartype log_filter_pattern: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the log."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the log."""
    blob_duration: Optional[str] = rest_field(
        name="blobDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Blob duration of the log."""
    log_filter_pattern: Optional[str] = rest_field(
        name="logFilterPattern", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log filtered pattern of the log."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        blob_duration: Optional[str] = None,
        log_filter_pattern: 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 MetricAvailability(_Model):
    """Retention policy of a resource metric.

    :ivar time_grain: Metric availability time grain.
    :vartype time_grain: str
    :ivar blob_duration: Metric availability blob duration.
    :vartype blob_duration: str
    """

    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Metric availability time grain."""
    blob_duration: Optional[str] = rest_field(
        name="blobDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric availability blob duration."""

    @overload
    def __init__(
        self,
        *,
        time_grain: Optional[str] = None,
        blob_duration: 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 MetricSpecification(_Model):
    """Definition of a single resource metric.

    :ivar name: Name of the resource metric.
    :vartype name: str
    :ivar display_name: Display name of the resource metric.
    :vartype display_name: str
    :ivar display_description: Description of the resource metric.
    :vartype display_description: str
    :ivar unit: Resource metric unit.
    :vartype unit: str
    :ivar aggregation_type: Resource metric aggregation type.
    :vartype aggregation_type: str
    :ivar supports_instance_level_aggregation: Resource metric supported aggregation types.
    :vartype supports_instance_level_aggregation: bool
    :ivar enable_regional_mdm_account: Resource metric supported time grain types.
    :vartype enable_regional_mdm_account: bool
    :ivar source_mdm_account: Resource metric source MDM account.
    :vartype source_mdm_account: str
    :ivar source_mdm_namespace: Resource metric source MDM namespace.
    :vartype source_mdm_namespace: str
    :ivar metric_filter_pattern: Resource metric filter pattern.
    :vartype metric_filter_pattern: str
    :ivar fill_gap_with_zero: Resource metric fill gap with zero.
    :vartype fill_gap_with_zero: bool
    :ivar is_internal: Resource metric is internal.
    :vartype is_internal: bool
    :ivar dimensions: Resource metric dimensions.
    :vartype dimensions: list[~azure.mgmt.domainregistration.models.Dimension]
    :ivar category: Resource metric category.
    :vartype category: str
    :ivar availabilities: Resource metric availability.
    :vartype availabilities: list[~azure.mgmt.domainregistration.models.MetricAvailability]
    :ivar supported_time_grain_types: Resource metric supported time grain types.
    :vartype supported_time_grain_types: list[str]
    :ivar supported_aggregation_types: Resource metric supported aggregation types.
    :vartype supported_aggregation_types: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the resource metric."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the resource metric."""
    display_description: Optional[str] = rest_field(
        name="displayDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """Description of the resource metric."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource metric unit."""
    aggregation_type: Optional[str] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric aggregation type."""
    supports_instance_level_aggregation: Optional[bool] = rest_field(
        name="supportsInstanceLevelAggregation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric supported aggregation types."""
    enable_regional_mdm_account: Optional[bool] = rest_field(
        name="enableRegionalMdmAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric supported time grain types."""
    source_mdm_account: Optional[str] = rest_field(
        name="sourceMdmAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric source MDM account."""
    source_mdm_namespace: Optional[str] = rest_field(
        name="sourceMdmNamespace", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric source MDM namespace."""
    metric_filter_pattern: Optional[str] = rest_field(
        name="metricFilterPattern", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric filter pattern."""
    fill_gap_with_zero: Optional[bool] = rest_field(
        name="fillGapWithZero", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric fill gap with zero."""
    is_internal: Optional[bool] = rest_field(
        name="isInternal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric is internal."""
    dimensions: Optional[list["_models.Dimension"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric dimensions."""
    category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource metric category."""
    availabilities: Optional[list["_models.MetricAvailability"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric availability."""
    supported_time_grain_types: Optional[list[str]] = rest_field(
        name="supportedTimeGrainTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric supported time grain types."""
    supported_aggregation_types: Optional[list[str]] = rest_field(
        name="supportedAggregationTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metric supported aggregation types."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        display_description: Optional[str] = None,
        unit: Optional[str] = None,
        aggregation_type: Optional[str] = None,
        supports_instance_level_aggregation: Optional[bool] = None,
        enable_regional_mdm_account: Optional[bool] = None,
        source_mdm_account: Optional[str] = None,
        source_mdm_namespace: Optional[str] = None,
        metric_filter_pattern: Optional[str] = None,
        fill_gap_with_zero: Optional[bool] = None,
        is_internal: Optional[bool] = None,
        dimensions: Optional[list["_models.Dimension"]] = None,
        category: Optional[str] = None,
        availabilities: Optional[list["_models.MetricAvailability"]] = None,
        supported_time_grain_types: Optional[list[str]] = None,
        supported_aggregation_types: 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 NameIdentifier(_Model):
    """Identifies an object.

    :ivar name: Name of the object.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the object."""

    @overload
    def __init__(
        self,
        *,
        name: 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 ServiceSpecification(_Model):
    """Resource metrics service provided by Microsoft.Insights resource provider.

    :ivar metric_specifications: Resource metrics service name.
    :vartype metric_specifications: list[~azure.mgmt.domainregistration.models.MetricSpecification]
    :ivar log_specifications: Resource logs service provided by Microsoft.Insights resource
     provider.
    :vartype log_specifications: list[~azure.mgmt.domainregistration.models.LogSpecification]
    """

    metric_specifications: Optional[list["_models.MetricSpecification"]] = rest_field(
        name="metricSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource metrics service name."""
    log_specifications: Optional[list["_models.LogSpecification"]] = rest_field(
        name="logSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource logs service provided by Microsoft.Insights resource provider."""

    @overload
    def __init__(
        self,
        *,
        metric_specifications: Optional[list["_models.MetricSpecification"]] = None,
        log_specifications: Optional[list["_models.LogSpecification"]] = 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 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.domainregistration.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.domainregistration.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 TldLegalAgreement(_Model):
    """Legal agreement for a top level domain.

    :ivar agreement_key: Unique identifier for the agreement. Required.
    :vartype agreement_key: str
    :ivar title: Agreement title. Required.
    :vartype title: str
    :ivar content: Agreement details. Required.
    :vartype content: str
    :ivar url: URL where a copy of the agreement details is hosted.
    :vartype url: str
    """

    agreement_key: str = rest_field(name="agreementKey", visibility=["read", "create", "update", "delete", "query"])
    """Unique identifier for the agreement. Required."""
    title: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Agreement title. Required."""
    content: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Agreement details. Required."""
    url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """URL where a copy of the agreement details is hosted."""

    @overload
    def __init__(
        self,
        *,
        agreement_key: str,
        title: str,
        content: str,
        url: 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 TopLevelDomain(ProxyResource):
    """A top level domain object.

    :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.domainregistration.models.SystemData
    :ivar properties: TopLevelDomain resource specific properties.
    :vartype properties: ~azure.mgmt.domainregistration.models.TopLevelDomainProperties
    :ivar kind: Kind of resource.
    :vartype kind: str
    """

    properties: Optional["_models.TopLevelDomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """TopLevelDomain resource specific properties."""
    kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Kind of resource."""

    __flattened_items = ["privacy"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TopLevelDomainProperties"] = None,
        kind: 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 TopLevelDomainAgreementOption(_Model):
    """Options for retrieving the list of top level domain legal agreements.

    :ivar include_privacy: If <code>true</code>, then the list of agreements will include
     agreements for domain privacy as well; otherwise, <code>false</code>.
    :vartype include_privacy: bool
    :ivar for_transfer: If <code>true</code>, then the list of agreements will include agreements
     for domain transfer as well; otherwise, <code>false</code>.
    :vartype for_transfer: bool
    """

    include_privacy: Optional[bool] = rest_field(
        name="includePrivacy", visibility=["read", "create", "update", "delete", "query"]
    )
    """If <code>true</code>, then the list of agreements will include agreements for domain privacy as
     well; otherwise, <code>false</code>."""
    for_transfer: Optional[bool] = rest_field(
        name="forTransfer", visibility=["read", "create", "update", "delete", "query"]
    )
    """If <code>true</code>, then the list of agreements will include agreements for domain transfer
     as well; otherwise, <code>false</code>."""

    @overload
    def __init__(
        self,
        *,
        include_privacy: Optional[bool] = None,
        for_transfer: Optional[bool] = 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 TopLevelDomainProperties(_Model):
    """TopLevelDomain resource specific properties.

    :ivar privacy: If <code>true</code>, then the top level domain supports domain privacy;
     otherwise, <code>false</code>.
    :vartype privacy: bool
    """

    privacy: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """If <code>true</code>, then the top level domain supports domain privacy; otherwise,
     <code>false</code>."""

    @overload
    def __init__(
        self,
        *,
        privacy: Optional[bool] = 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)
