# 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 ActivationProperties(_Model):
    """The activation properties of the connected registry.

    :ivar status: The activation status of the connected registry. Known values are: "Active" and
     "Inactive".
    :vartype status: str or ~azure.mgmt.containerregistry.models.ActivationStatus
    """

    status: Optional[Union[str, "_models.ActivationStatus"]] = rest_field(visibility=["read"])
    """The activation status of the connected registry. Known values are: \"Active\" and \"Inactive\"."""


class Actor(_Model):
    """The agent that initiated the event. For most situations, this could be from the authorization
    context of the request.

    :ivar name: The subject or username associated with the request context that generated the
     event.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The subject or username associated with the request context that generated the event."""

    @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 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 private link 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.containerregistry.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 private link 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 private link 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.containerregistry.models.SystemData
    """


class Archive(ProxyResource):
    """An object that represents a archive for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the archive.
    :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveProperties
    """

    properties: Optional["_models.ArchiveProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the archive."""

    __flattened_items = [
        "package_source",
        "published_version",
        "repository_endpoint_prefix",
        "repository_endpoint",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ArchiveProperties"] = 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 ArchivePackageSourceProperties(_Model):
    """The properties of the archive package source.

    :ivar type: The type of package source for a archive. "remote"
    :vartype type: str or ~azure.mgmt.containerregistry.models.PackageSourceType
    :ivar url: The external repository url.
    :vartype url: str
    """

    type: Optional[Union[str, "_models.PackageSourceType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of package source for a archive. \"remote\""""
    url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The external repository url."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.PackageSourceType"]] = None,
        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 ArchiveProperties(_Model):
    """The properties of a archive.

    :ivar package_source: The package source of the archive.
    :vartype package_source: ~azure.mgmt.containerregistry.models.ArchivePackageSourceProperties
    :ivar published_version: The published version of the archive.
    :vartype published_version: str
    :ivar repository_endpoint_prefix:
    :vartype repository_endpoint_prefix: str
    :ivar repository_endpoint:
    :vartype repository_endpoint: str
    :ivar provisioning_state: The provisioning state of the archive at the time the operation was
     called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    package_source: Optional["_models.ArchivePackageSourceProperties"] = rest_field(
        name="packageSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """The package source of the archive."""
    published_version: Optional[str] = rest_field(
        name="publishedVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The published version of the archive."""
    repository_endpoint_prefix: Optional[str] = rest_field(
        name="repositoryEndpointPrefix", visibility=["read", "create", "update", "delete", "query"]
    )
    repository_endpoint: Optional[str] = rest_field(name="repositoryEndpoint", visibility=["read"])
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the archive at the time the operation was called. Known values are:
     \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        package_source: Optional["_models.ArchivePackageSourceProperties"] = None,
        published_version: Optional[str] = None,
        repository_endpoint_prefix: 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 ArchiveUpdateParameters(_Model):
    """The parameters for updating a archive.

    :ivar properties: The properties of the connected registry update parameters.
    :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveUpdateProperties
    """

    properties: Optional["_models.ArchiveUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the connected registry update parameters."""

    __flattened_items = ["published_version"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ArchiveUpdateProperties"] = 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 ArchiveUpdateProperties(_Model):
    """The properties of a archive.

    :ivar published_version: The published version of the archive.
    :vartype published_version: str
    """

    published_version: Optional[str] = rest_field(
        name="publishedVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The published version of the archive."""

    @overload
    def __init__(
        self,
        *,
        published_version: 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 ArchiveVersion(ProxyResource):
    """An object that represents an export pipeline for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the archive.
    :vartype properties: ~azure.mgmt.containerregistry.models.ArchiveVersionProperties
    """

    properties: Optional["_models.ArchiveVersionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the archive."""

    __flattened_items = ["provisioning_state", "archive_version_error_message"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ArchiveVersionProperties"] = 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 ArchiveVersionProperties(_Model):
    """The properties of an archive version.

    :ivar provisioning_state: The provisioning state of the archive at the time the operation was
     called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar archive_version_error_message: The detailed error message for the archive version in the
     case of failure.
    :vartype archive_version_error_message: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the archive at the time the operation was called. Known values are:
     \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""
    archive_version_error_message: Optional[str] = rest_field(
        name="archiveVersionErrorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The detailed error message for the archive version in the case of failure."""

    @overload
    def __init__(
        self,
        *,
        archive_version_error_message: 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 AuthCredential(_Model):
    """Authentication credential stored for an upstream.

    :ivar name: The name of the credential. "Credential1"
    :vartype name: str or ~azure.mgmt.containerregistry.models.CredentialName
    :ivar username_secret_identifier: KeyVault Secret URI for accessing the username.
    :vartype username_secret_identifier: str
    :ivar password_secret_identifier: KeyVault Secret URI for accessing the password.
    :vartype password_secret_identifier: str
    :ivar credential_health: This provides data pertaining to the health of the auth credential.
    :vartype credential_health: ~azure.mgmt.containerregistry.models.CredentialHealth
    """

    name: Optional[Union[str, "_models.CredentialName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the credential. \"Credential1\""""
    username_secret_identifier: Optional[str] = rest_field(
        name="usernameSecretIdentifier", visibility=["read", "create", "update", "delete", "query"]
    )
    """KeyVault Secret URI for accessing the username."""
    password_secret_identifier: Optional[str] = rest_field(
        name="passwordSecretIdentifier", visibility=["read", "create", "update", "delete", "query"]
    )
    """KeyVault Secret URI for accessing the password."""
    credential_health: Optional["_models.CredentialHealth"] = rest_field(name="credentialHealth", visibility=["read"])
    """This provides data pertaining to the health of the auth credential."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[Union[str, "_models.CredentialName"]] = None,
        username_secret_identifier: Optional[str] = None,
        password_secret_identifier: 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 AzureADAuthenticationAsArmPolicy(_Model):
    """The policy for using Azure Resource Manager audience token for a container registry.

    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or
     ~azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicyStatus
    """

    status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.AzureADAuthenticationAsArmPolicyStatus"]] = 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 CacheRule(ProxyResource):
    """An object that represents a cache rule for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the cache rule.
    :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleProperties
    :ivar identity: The identity of the cache rule.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.CacheRuleProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the cache rule."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the cache rule."""

    __flattened_items = [
        "credential_set_resource_id",
        "source_repository",
        "target_repository",
        "creation_date",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CacheRuleProperties"] = None,
        identity: Optional["_models.IdentityProperties"] = 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 CacheRuleProperties(_Model):
    """The properties of a cache rule.

    :ivar credential_set_resource_id: The ARM resource ID of the credential store which is
     associated with the cache rule.
    :vartype credential_set_resource_id: str
    :ivar source_repository: Source repository pulled from upstream.
    :vartype source_repository: str
    :ivar target_repository: Target repository specified in docker pull command. Eg: docker pull
     myregistry.azurecr.io/{targetRepository}:{tag}.
    :vartype target_repository: str
    :ivar creation_date: The creation date of the cache rule.
    :vartype creation_date: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    credential_set_resource_id: Optional[str] = rest_field(
        name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ARM resource ID of the credential store which is associated with the cache rule."""
    source_repository: Optional[str] = rest_field(
        name="sourceRepository", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source repository pulled from upstream."""
    target_repository: Optional[str] = rest_field(
        name="targetRepository", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target repository specified in docker pull command. Eg: docker pull
     myregistry.azurecr.io/{targetRepository}:{tag}."""
    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The creation date of the cache rule."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        credential_set_resource_id: Optional[str] = None,
        source_repository: Optional[str] = None,
        target_repository: 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 CacheRuleUpdateParameters(_Model):
    """The parameters for updating a cache rule.

    :ivar properties: The properties of the cache rule update parameters.
    :vartype properties: ~azure.mgmt.containerregistry.models.CacheRuleUpdateProperties
    :ivar identity: The identity of the cache rule.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.CacheRuleUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the cache rule update parameters."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the cache rule."""

    __flattened_items = ["credential_set_resource_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CacheRuleUpdateProperties"] = None,
        identity: Optional["_models.IdentityProperties"] = 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 CacheRuleUpdateProperties(_Model):
    """The parameters for updating cache rule properties.

    :ivar credential_set_resource_id: The ARM resource ID of the credential store which is
     associated with the Cache rule.
    :vartype credential_set_resource_id: str
    """

    credential_set_resource_id: Optional[str] = rest_field(
        name="credentialSetResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ARM resource ID of the credential store which is associated with the Cache rule."""

    @overload
    def __init__(
        self,
        *,
        credential_set_resource_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 CallbackConfig(_Model):
    """The configuration of service URI and custom headers for the webhook.

    :ivar service_uri: The service URI for the webhook to post notifications. Required.
    :vartype service_uri: str
    :ivar custom_headers: Custom headers that will be added to the webhook notifications.
    :vartype custom_headers: dict[str, str]
    """

    service_uri: str = rest_field(name="serviceUri", visibility=["read", "create", "update", "delete", "query"])
    """The service URI for the webhook to post notifications. Required."""
    custom_headers: Optional[dict[str, str]] = rest_field(
        name="customHeaders", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom headers that will be added to the webhook notifications."""

    @overload
    def __init__(
        self,
        *,
        service_uri: str,
        custom_headers: 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 ConnectedRegistry(ProxyResource):
    """An object that represents a connected registry for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the connected registry.
    :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryProperties
    """

    properties: Optional["_models.ConnectedRegistryProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the connected registry."""

    __flattened_items = [
        "provisioning_state",
        "mode",
        "version",
        "connection_state",
        "last_activity_time",
        "activation",
        "parent",
        "client_token_ids",
        "login_server",
        "logging",
        "status_details",
        "notifications_list",
        "garbage_collection",
        "registry_sync_result",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ConnectedRegistryProperties"] = 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 ConnectedRegistryProperties(_Model):
    """The properties of a connected registry.

    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar mode: The mode of the connected registry resource that indicates the permissions of the
     registry. Required. Known values are: "ReadWrite", "ReadOnly", "Registry", and "Mirror".
    :vartype mode: str or ~azure.mgmt.containerregistry.models.ConnectedRegistryMode
    :ivar version: The current version of ACR runtime on the connected registry.
    :vartype version: str
    :ivar connection_state: The current connection state of the connected registry. Known values
     are: "Online", "Offline", "Syncing", and "Unhealthy".
    :vartype connection_state: str or ~azure.mgmt.containerregistry.models.ConnectionState
    :ivar last_activity_time: The last activity time of the connected registry.
    :vartype last_activity_time: ~datetime.datetime
    :ivar activation: The activation properties of the connected registry.
    :vartype activation: ~azure.mgmt.containerregistry.models.ActivationProperties
    :ivar parent: The parent of the connected registry. Required.
    :vartype parent: ~azure.mgmt.containerregistry.models.ParentProperties
    :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to
     the connected registry.
    :vartype client_token_ids: list[str]
    :ivar login_server: The login server properties of the connected registry.
    :vartype login_server: ~azure.mgmt.containerregistry.models.LoginServerProperties
    :ivar logging: The logging properties of the connected registry.
    :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties
    :ivar status_details: The list of current statuses of the connected registry.
    :vartype status_details: list[~azure.mgmt.containerregistry.models.StatusDetailProperties]
    :ivar notifications_list: The list of notifications subscription information for the connected
     registry.
    :vartype notifications_list: list[str]
    :ivar garbage_collection: The garbage collection properties of the connected registry.
    :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties
    :ivar registry_sync_result: The result of the connected registry's most recent sync with its
     parent.
    :vartype registry_sync_result: ~azure.mgmt.containerregistry.models.RegistrySyncResult
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""
    mode: Union[str, "_models.ConnectedRegistryMode"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The mode of the connected registry resource that indicates the permissions of the registry.
     Required. Known values are: \"ReadWrite\", \"ReadOnly\", \"Registry\", and \"Mirror\"."""
    version: Optional[str] = rest_field(visibility=["read"])
    """The current version of ACR runtime on the connected registry."""
    connection_state: Optional[Union[str, "_models.ConnectionState"]] = rest_field(
        name="connectionState", visibility=["read"]
    )
    """The current connection state of the connected registry. Known values are: \"Online\",
     \"Offline\", \"Syncing\", and \"Unhealthy\"."""
    last_activity_time: Optional[datetime.datetime] = rest_field(
        name="lastActivityTime", visibility=["read"], format="rfc3339"
    )
    """The last activity time of the connected registry."""
    activation: Optional["_models.ActivationProperties"] = rest_field(visibility=["read"])
    """The activation properties of the connected registry."""
    parent: "_models.ParentProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The parent of the connected registry. Required."""
    client_token_ids: Optional[list[str]] = rest_field(
        name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of the ACR token resource IDs used to authenticate clients to the connected registry."""
    login_server: Optional["_models.LoginServerProperties"] = rest_field(
        name="loginServer", visibility=["read", "create", "update", "delete", "query"]
    )
    """The login server properties of the connected registry."""
    logging: Optional["_models.LoggingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The logging properties of the connected registry."""
    status_details: Optional[list["_models.StatusDetailProperties"]] = rest_field(
        name="statusDetails", visibility=["read"]
    )
    """The list of current statuses of the connected registry."""
    notifications_list: Optional[list[str]] = rest_field(
        name="notificationsList", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of notifications subscription information for the connected registry."""
    garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field(
        name="garbageCollection", visibility=["read", "create", "update", "delete", "query"]
    )
    """The garbage collection properties of the connected registry."""
    registry_sync_result: Optional["_models.RegistrySyncResult"] = rest_field(
        name="registrySyncResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """The result of the connected registry's most recent sync with its parent."""

    @overload
    def __init__(
        self,
        *,
        mode: Union[str, "_models.ConnectedRegistryMode"],
        parent: "_models.ParentProperties",
        client_token_ids: Optional[list[str]] = None,
        login_server: Optional["_models.LoginServerProperties"] = None,
        logging: Optional["_models.LoggingProperties"] = None,
        notifications_list: Optional[list[str]] = None,
        garbage_collection: Optional["_models.GarbageCollectionProperties"] = None,
        registry_sync_result: Optional["_models.RegistrySyncResult"] = 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 ConnectedRegistryUpdateParameters(_Model):
    """The parameters for updating a connected registry.

    :ivar properties: The properties of the connected registry update parameters.
    :vartype properties: ~azure.mgmt.containerregistry.models.ConnectedRegistryUpdateProperties
    """

    properties: Optional["_models.ConnectedRegistryUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the connected registry update parameters."""

    __flattened_items = ["sync_properties", "logging", "client_token_ids", "notifications_list", "garbage_collection"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ConnectedRegistryUpdateProperties"] = 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 ConnectedRegistryUpdateProperties(_Model):
    """The parameters for updating token properties.

    :ivar sync_properties: The sync properties of the connected registry with its parent.
    :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncUpdateProperties
    :ivar logging: The logging properties of the connected registry.
    :vartype logging: ~azure.mgmt.containerregistry.models.LoggingProperties
    :ivar client_token_ids: The list of the ACR token resource IDs used to authenticate clients to
     the connected registry.
    :vartype client_token_ids: list[str]
    :ivar notifications_list: The list of notifications subscription information for the connected
     registry.
    :vartype notifications_list: list[str]
    :ivar garbage_collection: The garbage collection properties of the connected registry.
    :vartype garbage_collection: ~azure.mgmt.containerregistry.models.GarbageCollectionProperties
    """

    sync_properties: Optional["_models.SyncUpdateProperties"] = rest_field(
        name="syncProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The sync properties of the connected registry with its parent."""
    logging: Optional["_models.LoggingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The logging properties of the connected registry."""
    client_token_ids: Optional[list[str]] = rest_field(
        name="clientTokenIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of the ACR token resource IDs used to authenticate clients to the connected registry."""
    notifications_list: Optional[list[str]] = rest_field(
        name="notificationsList", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of notifications subscription information for the connected registry."""
    garbage_collection: Optional["_models.GarbageCollectionProperties"] = rest_field(
        name="garbageCollection", visibility=["read", "create", "update", "delete", "query"]
    )
    """The garbage collection properties of the connected registry."""

    @overload
    def __init__(
        self,
        *,
        sync_properties: Optional["_models.SyncUpdateProperties"] = None,
        logging: Optional["_models.LoggingProperties"] = None,
        client_token_ids: Optional[list[str]] = None,
        notifications_list: Optional[list[str]] = None,
        garbage_collection: Optional["_models.GarbageCollectionProperties"] = 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 CredentialHealth(_Model):
    """The health of the auth credential.

    :ivar status: The health status of credential. Known values are: "Healthy" and "Unhealthy".
    :vartype status: str or ~azure.mgmt.containerregistry.models.CredentialHealthStatus
    :ivar error_code: Error code representing the health check error.
    :vartype error_code: str
    :ivar error_message: Descriptive message representing the health check error.
    :vartype error_message: str
    """

    status: Optional[Union[str, "_models.CredentialHealthStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The health status of credential. Known values are: \"Healthy\" and \"Unhealthy\"."""
    error_code: Optional[str] = rest_field(name="errorCode", visibility=["read", "create", "update", "delete", "query"])
    """Error code representing the health check error."""
    error_message: Optional[str] = rest_field(
        name="errorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Descriptive message representing the health check error."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.CredentialHealthStatus"]] = None,
        error_code: Optional[str] = None,
        error_message: 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 CredentialSet(ProxyResource):
    """An object that represents a credential set resource for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the credential set.
    :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetProperties
    :ivar identity: Identities associated with the resource. This is used to access the KeyVault
     secrets.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.CredentialSetProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the credential set."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identities associated with the resource. This is used to access the KeyVault secrets."""

    __flattened_items = ["login_server", "auth_credentials", "creation_date", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CredentialSetProperties"] = None,
        identity: Optional["_models.IdentityProperties"] = 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 CredentialSetProperties(_Model):
    """The properties of a credential set resource.

    :ivar login_server: The credentials are stored for this upstream or login server.
    :vartype login_server: str
    :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually
     consists of a primary and an optional secondary credential.
    :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential]
    :ivar creation_date: The creation date of credential store resource.
    :vartype creation_date: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    login_server: Optional[str] = rest_field(
        name="loginServer", visibility=["read", "create", "update", "delete", "query"]
    )
    """The credentials are stored for this upstream or login server."""
    auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field(
        name="authCredentials", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of authentication credentials stored for an upstream. Usually consists of a primary and an
     optional secondary credential."""
    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The creation date of credential store resource."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        login_server: Optional[str] = None,
        auth_credentials: Optional[list["_models.AuthCredential"]] = 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 CredentialSetUpdateParameters(_Model):
    """The parameters for updating a credential set.

    :ivar properties: The properties of the credential set update parameters.
    :vartype properties: ~azure.mgmt.containerregistry.models.CredentialSetUpdateProperties
    :ivar identity: Identities associated with the resource. This is used to access the KeyVault
     secrets.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.CredentialSetUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the credential set update parameters."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identities associated with the resource. This is used to access the KeyVault secrets."""

    __flattened_items = ["auth_credentials"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CredentialSetUpdateProperties"] = None,
        identity: Optional["_models.IdentityProperties"] = 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 CredentialSetUpdateProperties(_Model):
    """The parameters for updating credential set properties.

    :ivar auth_credentials: List of authentication credentials stored for an upstream. Usually
     consists of a primary and an optional secondary credential.
    :vartype auth_credentials: list[~azure.mgmt.containerregistry.models.AuthCredential]
    """

    auth_credentials: Optional[list["_models.AuthCredential"]] = rest_field(
        name="authCredentials", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of authentication credentials stored for an upstream. Usually consists of a primary and an
     optional secondary credential."""

    @overload
    def __init__(
        self,
        *,
        auth_credentials: Optional[list["_models.AuthCredential"]] = 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 EncryptionProperty(_Model):
    """EncryptionProperty.

    :ivar status: Indicates whether or not the encryption is enabled for container registry. Known
     values are: "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.EncryptionStatus
    :ivar key_vault_properties: Key vault properties.
    :vartype key_vault_properties: ~azure.mgmt.containerregistry.models.KeyVaultProperties
    """

    status: Optional[Union[str, "_models.EncryptionStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether or not the encryption is enabled for container registry. Known values are:
     \"enabled\" and \"disabled\"."""
    key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field(
        name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key vault properties."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.EncryptionStatus"]] = None,
        key_vault_properties: Optional["_models.KeyVaultProperties"] = 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 ErrorAdditionalInfo(_Model):
    """The resource management error additional info.

    :ivar type: The additional info type.
    :vartype type: str
    :ivar info: The additional info.
    :vartype info: any
    """

    type: Optional[str] = rest_field(visibility=["read"])
    """The additional info type."""
    info: Optional[Any] = rest_field(visibility=["read"])
    """The additional info."""


class ErrorDetail(_Model):
    """The error detail.

    :ivar code: The error code.
    :vartype code: str
    :ivar message: The error message.
    :vartype message: str
    :ivar target: The error target.
    :vartype target: str
    :ivar details: The error details.
    :vartype details: list[~azure.mgmt.containerregistry.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.containerregistry.models.ErrorAdditionalInfo]
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """The error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    target: Optional[str] = rest_field(visibility=["read"])
    """The error target."""
    details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"])
    """The error details."""
    additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field(
        name="additionalInfo", visibility=["read"]
    )
    """The error additional info."""


class ErrorResponse(_Model):
    """Error response.

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.containerregistry.models.ErrorDetail
    """

    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error object."""

    @overload
    def __init__(
        self,
        *,
        error: Optional["_models.ErrorDetail"] = 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 EventInfo(_Model):
    """The basic information of an event.

    :ivar id: The event ID.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The event 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 Event(EventInfo):
    """The event for a webhook.

    :ivar id: The event ID.
    :vartype id: str
    :ivar event_request_message: The event request message sent to the service URI.
    :vartype event_request_message: ~azure.mgmt.containerregistry.models.EventRequestMessage
    :ivar event_response_message: The event response message received from the service URI.
    :vartype event_response_message: ~azure.mgmt.containerregistry.models.EventResponseMessage
    """

    event_request_message: Optional["_models.EventRequestMessage"] = rest_field(
        name="eventRequestMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event request message sent to the service URI."""
    event_response_message: Optional["_models.EventResponseMessage"] = rest_field(
        name="eventResponseMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event response message received from the service URI."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        event_request_message: Optional["_models.EventRequestMessage"] = None,
        event_response_message: Optional["_models.EventResponseMessage"] = 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 EventContent(_Model):
    """The content of the event request message.

    :ivar id: The event ID.
    :vartype id: str
    :ivar timestamp: The time at which the event occurred.
    :vartype timestamp: ~datetime.datetime
    :ivar action: The action that encompasses the provided event.
    :vartype action: str
    :ivar target: The target of the event.
    :vartype target: ~azure.mgmt.containerregistry.models.Target
    :ivar request: The request that generated the event.
    :vartype request: ~azure.mgmt.containerregistry.models.Request
    :ivar actor: The agent that initiated the event. For most situations, this could be from the
     authorization context of the request.
    :vartype actor: ~azure.mgmt.containerregistry.models.Actor
    :ivar source: The registry node that generated the event. Put differently, while the actor
     initiates the event, the source generates it.
    :vartype source: ~azure.mgmt.containerregistry.models.Source
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The event ID."""
    timestamp: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time at which the event occurred."""
    action: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The action that encompasses the provided event."""
    target: Optional["_models.Target"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The target of the event."""
    request: Optional["_models.Request"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The request that generated the event."""
    actor: Optional["_models.Actor"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The agent that initiated the event. For most situations, this could be from the authorization
     context of the request."""
    source: Optional["_models.Source"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The registry node that generated the event. Put differently, while the actor initiates the
     event, the source generates it."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        timestamp: Optional[datetime.datetime] = None,
        action: Optional[str] = None,
        target: Optional["_models.Target"] = None,
        request: Optional["_models.Request"] = None,
        actor: Optional["_models.Actor"] = None,
        source: Optional["_models.Source"] = 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 EventRequestMessage(_Model):
    """The event request message sent to the service URI.

    :ivar content: The content of the event request message.
    :vartype content: ~azure.mgmt.containerregistry.models.EventContent
    :ivar headers: The headers of the event request message.
    :vartype headers: dict[str, str]
    :ivar method: The HTTP method used to send the event request message.
    :vartype method: str
    :ivar request_uri: The URI used to send the event request message.
    :vartype request_uri: str
    :ivar version: The HTTP message version.
    :vartype version: str
    """

    content: Optional["_models.EventContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The content of the event request message."""
    headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The headers of the event request message."""
    method: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The HTTP method used to send the event request message."""
    request_uri: Optional[str] = rest_field(
        name="requestUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URI used to send the event request message."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The HTTP message version."""

    @overload
    def __init__(
        self,
        *,
        content: Optional["_models.EventContent"] = None,
        headers: Optional[dict[str, str]] = None,
        method: Optional[str] = None,
        request_uri: Optional[str] = None,
        version: 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 EventResponseMessage(_Model):
    """The event response message received from the service URI.

    :ivar content: The content of the event response message.
    :vartype content: str
    :ivar headers: The headers of the event response message.
    :vartype headers: dict[str, str]
    :ivar reason_phrase: The reason phrase of the event response message.
    :vartype reason_phrase: str
    :ivar status_code: The status code of the event response message.
    :vartype status_code: str
    :ivar version: The HTTP message version.
    :vartype version: str
    """

    content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The content of the event response message."""
    headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The headers of the event response message."""
    reason_phrase: Optional[str] = rest_field(
        name="reasonPhrase", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reason phrase of the event response message."""
    status_code: Optional[str] = rest_field(
        name="statusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """The status code of the event response message."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The HTTP message version."""

    @overload
    def __init__(
        self,
        *,
        content: Optional[str] = None,
        headers: Optional[dict[str, str]] = None,
        reason_phrase: Optional[str] = None,
        status_code: Optional[str] = None,
        version: 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 ExportPipeline(ProxyResource):
    """An object that represents an export pipeline for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the export pipeline.
    :vartype properties: ~azure.mgmt.containerregistry.models.ExportPipelineProperties
    :ivar location: The location of the export pipeline.
    :vartype location: str
    :ivar identity: The identity of the export pipeline.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.ExportPipelineProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the export pipeline."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The location of the export pipeline."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the export pipeline."""

    __flattened_items = ["target", "options", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ExportPipelineProperties"] = None,
        location: Optional[str] = None,
        identity: Optional["_models.IdentityProperties"] = 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 ExportPipelineProperties(_Model):
    """The properties of an export pipeline.

    :ivar target: The target properties of the export pipeline. Required.
    :vartype target: ~azure.mgmt.containerregistry.models.ExportPipelineTargetProperties
    :ivar options: The list of all options configured for the pipeline.
    :vartype options: list[str or ~azure.mgmt.containerregistry.models.PipelineOptions]
    :ivar provisioning_state: The provisioning state of the pipeline at the time the operation was
     called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    target: "_models.ExportPipelineTargetProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The target properties of the export pipeline. Required."""
    options: Optional[list[Union[str, "_models.PipelineOptions"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of all options configured for the pipeline."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the pipeline at the time the operation was called. Known values are:
     \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        target: "_models.ExportPipelineTargetProperties",
        options: Optional[list[Union[str, "_models.PipelineOptions"]]] = 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 ExportPipelineTargetProperties(_Model):
    """The properties of the export pipeline target.

    :ivar type: The type of target for the export pipeline.
    :vartype type: str
    :ivar uri: The target uri of the export pipeline. When 'AzureStorageBlob':
     "`https://accountName.blob.core.windows.net/containerName/blobName
     <https://accountName.blob.core.windows.net/containerName/blobName>`_" When
     'AzureStorageBlobContainer':  "`https://accountName.blob.core.windows.net/containerName
     <https://accountName.blob.core.windows.net/containerName>`_".
    :vartype uri: str
    :ivar key_vault_uri: They key vault secret uri to obtain the target storage SAS token.
    :vartype key_vault_uri: str
    :ivar storage_access_mode: The storage access mode used for the customer storage account. Known
     values are: "ManagedIdentity" and "SasToken".
    :vartype storage_access_mode: str or ~azure.mgmt.containerregistry.models.StorageAccessMode
    """

    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of target for the export pipeline."""
    uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The target uri of the export pipeline. When 'AzureStorageBlob':
     \"`https://accountName.blob.core.windows.net/containerName/blobName
     <https://accountName.blob.core.windows.net/containerName/blobName>`_\" When
     'AzureStorageBlobContainer':  \"`https://accountName.blob.core.windows.net/containerName
     <https://accountName.blob.core.windows.net/containerName>`_\"."""
    key_vault_uri: Optional[str] = rest_field(
        name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """They key vault secret uri to obtain the target storage SAS token."""
    storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = rest_field(
        name="storageAccessMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """The storage access mode used for the customer storage account. Known values are:
     \"ManagedIdentity\" and \"SasToken\"."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[str] = None,
        uri: Optional[str] = None,
        key_vault_uri: Optional[str] = None,
        storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = 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 ExportPolicy(_Model):
    """The export policy for a container registry.

    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.ExportPolicyStatus
    """

    status: Optional[Union[str, "_models.ExportPolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.ExportPolicyStatus"]] = 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 GarbageCollectionProperties(_Model):
    """The garbage collection properties of the connected registry.

    :ivar enabled: Indicates whether garbage collection is enabled for the connected registry.
    :vartype enabled: bool
    :ivar schedule: The cron expression indicating the schedule that the connected registry will
     run garbage collection.
    :vartype schedule: str
    """

    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Indicates whether garbage collection is enabled for the connected registry."""
    schedule: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The cron expression indicating the schedule that the connected registry will run garbage
     collection."""

    @overload
    def __init__(
        self,
        *,
        enabled: Optional[bool] = None,
        schedule: 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 GenerateCredentialsParameters(_Model):
    """The parameters used to generate credentials for a specified token or user of a container
    registry.

    :ivar token_id: The resource ID of the token for which credentials have to be generated.
    :vartype token_id: str
    :ivar expiry: The expiry date of the generated credentials after which the credentials become
     invalid.
    :vartype expiry: ~datetime.datetime
    :ivar name: Specifies name of the password which should be regenerated if any -- password1 or
     password2. Known values are: "password1" and "password2".
    :vartype name: str or ~azure.mgmt.containerregistry.models.TokenPasswordName
    """

    token_id: Optional[str] = rest_field(name="tokenId", visibility=["read", "create", "update", "delete", "query"])
    """The resource ID of the token for which credentials have to be generated."""
    expiry: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The expiry date of the generated credentials after which the credentials become invalid."""
    name: Optional[Union[str, "_models.TokenPasswordName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies name of the password which should be regenerated if any -- password1 or password2.
     Known values are: \"password1\" and \"password2\"."""

    @overload
    def __init__(
        self,
        *,
        token_id: Optional[str] = None,
        expiry: Optional[datetime.datetime] = None,
        name: Optional[Union[str, "_models.TokenPasswordName"]] = 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 GenerateCredentialsResult(_Model):
    """The response from the GenerateCredentials operation.

    :ivar username: The username for a container registry.
    :vartype username: str
    :ivar passwords: The list of passwords for a container registry.
    :vartype passwords: list[~azure.mgmt.containerregistry.models.TokenPassword]
    """

    username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The username for a container registry."""
    passwords: Optional[list["_models.TokenPassword"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of passwords for a container registry."""

    @overload
    def __init__(
        self,
        *,
        username: Optional[str] = None,
        passwords: Optional[list["_models.TokenPassword"]] = 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 IdentityProperties(_Model):
    """Managed identity for the resource.

    :ivar principal_id: The principal ID of resource identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant ID of resource.
    :vartype tenant_id: str
    :ivar type: The identity type. Known values are: "SystemAssigned", "UserAssigned",
     "SystemAssigned, UserAssigned", and "None".
    :vartype type: str or ~azure.mgmt.containerregistry.models.ResourceIdentityType
    :ivar user_assigned_identities: The list of user identities associated with the resource. The
     user identity dictionary key references will be ARM resource ids in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.containerregistry.models.UserIdentityProperties]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal ID of resource identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant ID of resource."""
    type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity type. Known values are: \"SystemAssigned\", \"UserAssigned\", \"SystemAssigned,
     UserAssigned\", and \"None\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserIdentityProperties"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of user identities associated with the resource. The user identity dictionary key
     references will be ARM resource ids in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[dict[str, "_models.UserIdentityProperties"]] = 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 ImportImageParameters(_Model):
    """ImportImageParameters.

    :ivar source: The source of the image. Required.
    :vartype source: ~azure.mgmt.containerregistry.models.ImportSource
    :ivar target_tags: List of strings of the form repo[:tag]. When tag is omitted the source will
     be used (or 'latest' if source tag is also omitted).
    :vartype target_tags: list[str]
    :ivar untagged_target_repositories: List of strings of repository names to do a manifest only
     copy. No tag will be created.
    :vartype untagged_target_repositories: list[str]
    :ivar mode: When Force, any existing target tags will be overwritten. When NoForce, any
     existing target tags will fail the operation before any copying begins. Known values are:
     "NoForce" and "Force".
    :vartype mode: str or ~azure.mgmt.containerregistry.models.ImportMode
    """

    source: "_models.ImportSource" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The source of the image. Required."""
    target_tags: Optional[list[str]] = rest_field(
        name="targetTags", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of strings of the form repo[:tag]. When tag is omitted the source will be used (or
     'latest' if source tag is also omitted)."""
    untagged_target_repositories: Optional[list[str]] = rest_field(
        name="untaggedTargetRepositories", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of strings of repository names to do a manifest only copy. No tag will be created."""
    mode: Optional[Union[str, "_models.ImportMode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """When Force, any existing target tags will be overwritten. When NoForce, any existing target
     tags will fail the operation before any copying begins. Known values are: \"NoForce\" and
     \"Force\"."""

    @overload
    def __init__(
        self,
        *,
        source: "_models.ImportSource",
        target_tags: Optional[list[str]] = None,
        untagged_target_repositories: Optional[list[str]] = None,
        mode: Optional[Union[str, "_models.ImportMode"]] = 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 ImportPipeline(ProxyResource):
    """An object that represents an import pipeline for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the import pipeline.
    :vartype properties: ~azure.mgmt.containerregistry.models.ImportPipelineProperties
    :ivar location: The location of the import pipeline.
    :vartype location: str
    :ivar identity: The identity of the import pipeline.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.ImportPipelineProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the import pipeline."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The location of the import pipeline."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the import pipeline."""

    __flattened_items = ["source", "trigger", "options", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ImportPipelineProperties"] = None,
        location: Optional[str] = None,
        identity: Optional["_models.IdentityProperties"] = 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 ImportPipelineProperties(_Model):
    """The properties of an import pipeline.

    :ivar source: The source properties of the import pipeline. Required.
    :vartype source: ~azure.mgmt.containerregistry.models.ImportPipelineSourceProperties
    :ivar trigger: The properties that describe the trigger of the import pipeline.
    :vartype trigger: ~azure.mgmt.containerregistry.models.PipelineTriggerProperties
    :ivar options: The list of all options configured for the pipeline.
    :vartype options: list[str or ~azure.mgmt.containerregistry.models.PipelineOptions]
    :ivar provisioning_state: The provisioning state of the pipeline at the time the operation was
     called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    source: "_models.ImportPipelineSourceProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The source properties of the import pipeline. Required."""
    trigger: Optional["_models.PipelineTriggerProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties that describe the trigger of the import pipeline."""
    options: Optional[list[Union[str, "_models.PipelineOptions"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of all options configured for the pipeline."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the pipeline at the time the operation was called. Known values are:
     \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        source: "_models.ImportPipelineSourceProperties",
        trigger: Optional["_models.PipelineTriggerProperties"] = None,
        options: Optional[list[Union[str, "_models.PipelineOptions"]]] = 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 ImportPipelineSourceProperties(_Model):
    """The properties of the import pipeline source.

    :ivar type: The type of source for the import pipeline. "AzureStorageBlobContainer"
    :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineSourceType
    :ivar uri: The source uri of the import pipeline. When 'AzureStorageBlob':
     "`https://accountName.blob.core.windows.net/containerName/blobName
     <https://accountName.blob.core.windows.net/containerName/blobName>`_" When
     'AzureStorageBlobContainer': "`https://accountName.blob.core.windows.net/containerName
     <https://accountName.blob.core.windows.net/containerName>`_".
    :vartype uri: str
    :ivar key_vault_uri: They key vault secret uri to obtain the source storage SAS token.
    :vartype key_vault_uri: str
    :ivar storage_access_mode: The storage access mode used for the customer storage account. Known
     values are: "ManagedIdentity" and "SasToken".
    :vartype storage_access_mode: str or ~azure.mgmt.containerregistry.models.StorageAccessMode
    """

    type: Optional[Union[str, "_models.PipelineSourceType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of source for the import pipeline. \"AzureStorageBlobContainer\""""
    uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The source uri of the import pipeline. When 'AzureStorageBlob':
     \"`https://accountName.blob.core.windows.net/containerName/blobName
     <https://accountName.blob.core.windows.net/containerName/blobName>`_\" When
     'AzureStorageBlobContainer': \"`https://accountName.blob.core.windows.net/containerName
     <https://accountName.blob.core.windows.net/containerName>`_\"."""
    key_vault_uri: Optional[str] = rest_field(
        name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """They key vault secret uri to obtain the source storage SAS token."""
    storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = rest_field(
        name="storageAccessMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """The storage access mode used for the customer storage account. Known values are:
     \"ManagedIdentity\" and \"SasToken\"."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.PipelineSourceType"]] = None,
        uri: Optional[str] = None,
        key_vault_uri: Optional[str] = None,
        storage_access_mode: Optional[Union[str, "_models.StorageAccessMode"]] = 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 ImportSource(_Model):
    """ImportSource.

    :ivar resource_id: The resource identifier of the source Azure Container Registry.
    :vartype resource_id: str
    :ivar registry_uri: The address of the source registry (e.g. 'mcr.microsoft.com').
    :vartype registry_uri: str
    :ivar credentials: Credentials used when importing from a registry uri.
    :vartype credentials: ~azure.mgmt.containerregistry.models.ImportSourceCredentials
    :ivar source_image: Repository name of the source image. Specify an image by repository
     ('hello-world'). This will use the 'latest' tag. Specify an image by tag
     ('hello-world:latest'). Specify an image by sha256-based manifest digest
     ('hello-world@sha256:abc123'). Required.
    :vartype source_image: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource identifier of the source Azure Container Registry."""
    registry_uri: Optional[str] = rest_field(
        name="registryUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The address of the source registry (e.g. 'mcr.microsoft.com')."""
    credentials: Optional["_models.ImportSourceCredentials"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Credentials used when importing from a registry uri."""
    source_image: str = rest_field(name="sourceImage", visibility=["read", "create", "update", "delete", "query"])
    """Repository name of the source image. Specify an image by repository ('hello-world'). This will
     use the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an image by
     sha256-based manifest digest ('hello-world@sha256:abc123'). Required."""

    @overload
    def __init__(
        self,
        *,
        source_image: str,
        resource_id: Optional[str] = None,
        registry_uri: Optional[str] = None,
        credentials: Optional["_models.ImportSourceCredentials"] = 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 ImportSourceCredentials(_Model):
    """ImportSourceCredentials.

    :ivar username: The username to authenticate with the source registry.
    :vartype username: str
    :ivar password: The password used to authenticate with the source registry. Required.
    :vartype password: str
    """

    username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The username to authenticate with the source registry."""
    password: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The password used to authenticate with the source registry. Required."""

    @overload
    def __init__(
        self,
        *,
        password: str,
        username: 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 IPRule(_Model):
    """IP rule with specific IP or IP range in CIDR format.

    :ivar action: The action of IP ACL rule. "Allow"
    :vartype action: str or ~azure.mgmt.containerregistry.models.Action
    :ivar ip_address_or_range: Specifies the IP or IP range in CIDR format. Only IPV4 address is
     allowed. Required.
    :vartype ip_address_or_range: str
    """

    action: Optional[Union[str, "_models.Action"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The action of IP ACL rule. \"Allow\""""
    ip_address_or_range: str = rest_field(name="value", visibility=["read", "create", "update", "delete", "query"])
    """Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. Required."""

    @overload
    def __init__(
        self,
        *,
        ip_address_or_range: str,
        action: Optional[Union[str, "_models.Action"]] = 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 KeyVaultProperties(_Model):
    """KeyVaultProperties.

    :ivar key_identifier: Key vault uri to access the encryption key.
    :vartype key_identifier: str
    :ivar versioned_key_identifier: The fully qualified key identifier that includes the version of
     the key that is actually used for encryption.
    :vartype versioned_key_identifier: str
    :ivar identity: The client id of the identity which will be used to access key vault.
    :vartype identity: str
    :ivar key_rotation_enabled: Auto key rotation status for a CMK enabled registry.
    :vartype key_rotation_enabled: bool
    :ivar last_key_rotation_timestamp: Timestamp of the last successful key rotation.
    :vartype last_key_rotation_timestamp: ~datetime.datetime
    """

    key_identifier: Optional[str] = rest_field(
        name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key vault uri to access the encryption key."""
    versioned_key_identifier: Optional[str] = rest_field(name="versionedKeyIdentifier", visibility=["read"])
    """The fully qualified key identifier that includes the version of the key that is actually used
     for encryption."""
    identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The client id of the identity which will be used to access key vault."""
    key_rotation_enabled: Optional[bool] = rest_field(name="keyRotationEnabled", visibility=["read"])
    """Auto key rotation status for a CMK enabled registry."""
    last_key_rotation_timestamp: Optional[datetime.datetime] = rest_field(
        name="lastKeyRotationTimestamp", visibility=["read"], format="rfc3339"
    )
    """Timestamp of the last successful key rotation."""

    @overload
    def __init__(
        self,
        *,
        key_identifier: Optional[str] = None,
        identity: 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 LoggingProperties(_Model):
    """The logging properties of the connected registry.

    :ivar log_level: The verbosity of logs persisted on the connected registry. Known values are:
     "Debug", "Information", "Warning", "Error", and "None".
    :vartype log_level: str or ~azure.mgmt.containerregistry.models.LogLevel
    :ivar audit_log_status: Indicates whether audit logs are enabled on the connected registry.
     Known values are: "Enabled" and "Disabled".
    :vartype audit_log_status: str or ~azure.mgmt.containerregistry.models.AuditLogStatus
    """

    log_level: Optional[Union[str, "_models.LogLevel"]] = rest_field(
        name="logLevel", visibility=["read", "create", "update", "delete", "query"]
    )
    """The verbosity of logs persisted on the connected registry. Known values are: \"Debug\",
     \"Information\", \"Warning\", \"Error\", and \"None\"."""
    audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = rest_field(
        name="auditLogStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether audit logs are enabled on the connected registry. Known values are:
     \"Enabled\" and \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        log_level: Optional[Union[str, "_models.LogLevel"]] = None,
        audit_log_status: Optional[Union[str, "_models.AuditLogStatus"]] = 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 LoginServerProperties(_Model):
    """The login server properties of the connected registry.

    :ivar host: The host of the connected registry. Can be FQDN or IP.
    :vartype host: str
    :ivar tls: The TLS properties of the connected registry login server.
    :vartype tls: ~azure.mgmt.containerregistry.models.TlsProperties
    """

    host: Optional[str] = rest_field(visibility=["read"])
    """The host of the connected registry. Can be FQDN or IP."""
    tls: Optional["_models.TlsProperties"] = rest_field(visibility=["read"])
    """The TLS properties of the connected registry login server."""


class NetworkRuleSet(_Model):
    """The network rule set for a container registry.

    :ivar default_action: The default action of allow or deny when no other rules match. Required.
     Known values are: "Allow" and "Deny".
    :vartype default_action: str or ~azure.mgmt.containerregistry.models.DefaultAction
    :ivar ip_rules: The IP ACL rules.
    :vartype ip_rules: list[~azure.mgmt.containerregistry.models.IPRule]
    """

    default_action: Union[str, "_models.DefaultAction"] = rest_field(
        name="defaultAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """The default action of allow or deny when no other rules match. Required. Known values are:
     \"Allow\" and \"Deny\"."""
    ip_rules: Optional[list["_models.IPRule"]] = rest_field(
        name="ipRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IP ACL rules."""

    @overload
    def __init__(
        self,
        *,
        default_action: Union[str, "_models.DefaultAction"],
        ip_rules: Optional[list["_models.IPRule"]] = 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 OperationDefinition(_Model):
    """The definition of a container registry operation.

    :ivar origin: The origin information of the container registry operation.
    :vartype origin: str
    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: The display information for the container registry operation.
    :vartype display: ~azure.mgmt.containerregistry.models.OperationDisplayDefinition
    :ivar properties: The properties information for the container registry operation.
    :vartype properties: ~azure.mgmt.containerregistry.models.OperationPropertiesDefinition
    :ivar is_data_action: This property indicates if the operation is an action or a data action
     ref:
     `https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations
     <https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations>`_.
    :vartype is_data_action: bool
    """

    origin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The origin information of the container registry operation."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation name: {provider}/{resource}/{operation}."""
    display: Optional["_models.OperationDisplayDefinition"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The display information for the container registry operation."""
    properties: Optional["_models.OperationPropertiesDefinition"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties information for the container registry operation."""
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property indicates if the operation is an action or a data action ref:
     `https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations
     <https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations>`_."""

    __flattened_items = ["service_specification"]

    @overload
    def __init__(
        self,
        *,
        origin: Optional[str] = None,
        name: Optional[str] = None,
        display: Optional["_models.OperationDisplayDefinition"] = None,
        properties: Optional["_models.OperationPropertiesDefinition"] = None,
        is_data_action: 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:
        _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 OperationDisplayDefinition(_Model):
    """The display information for a container registry operation.

    :ivar provider: The resource provider name: Microsoft.ContainerRegistry.
    :vartype provider: str
    :ivar resource: The resource on which the operation is performed.
    :vartype resource: str
    :ivar operation: The operation that users can perform.
    :vartype operation: str
    :ivar description: The description for the operation.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource provider name: Microsoft.ContainerRegistry."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource on which the operation is performed."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The operation that users can perform."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description for the operation."""

    @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 OperationLogSpecificationDefinition(_Model):
    """The definition of Azure Monitoring log.

    :ivar name: Log name.
    :vartype name: str
    :ivar display_name: Log display name.
    :vartype display_name: str
    :ivar blob_duration: Log blob duration.
    :vartype blob_duration: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Log name."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log display name."""
    blob_duration: Optional[str] = rest_field(
        name="blobDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log blob duration."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: 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 OperationMetricSpecificationDefinition(_Model):
    """The definition of Azure Monitoring metric.

    :ivar name: Metric name.
    :vartype name: str
    :ivar display_name: Metric display name.
    :vartype display_name: str
    :ivar display_description: Metric description.
    :vartype display_description: str
    :ivar unit: Metric unit.
    :vartype unit: str
    :ivar aggregation_type: Metric aggregation type.
    :vartype aggregation_type: str
    :ivar internal_metric_name: Internal metric name.
    :vartype internal_metric_name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Metric name."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric display name."""
    display_description: Optional[str] = rest_field(
        name="displayDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric description."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Metric unit."""
    aggregation_type: Optional[str] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric aggregation type."""
    internal_metric_name: Optional[str] = rest_field(
        name="internalMetricName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Internal metric name."""

    @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,
        internal_metric_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 OperationPropertiesDefinition(_Model):
    """The definition of Azure Monitoring properties.

    :ivar service_specification: The definition of Azure Monitoring service.
    :vartype service_specification:
     ~azure.mgmt.containerregistry.models.OperationServiceSpecificationDefinition
    """

    service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = rest_field(
        name="serviceSpecification", visibility=["read", "create", "update", "delete", "query"]
    )
    """The definition of Azure Monitoring service."""

    @overload
    def __init__(
        self,
        *,
        service_specification: Optional["_models.OperationServiceSpecificationDefinition"] = 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 OperationServiceSpecificationDefinition(_Model):
    """The definition of Azure Monitoring list.

    :ivar metric_specifications: A list of Azure Monitoring metrics definition.
    :vartype metric_specifications:
     list[~azure.mgmt.containerregistry.models.OperationMetricSpecificationDefinition]
    :ivar log_specifications: A list of Azure Monitoring log definitions.
    :vartype log_specifications:
     list[~azure.mgmt.containerregistry.models.OperationLogSpecificationDefinition]
    """

    metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = rest_field(
        name="metricSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of Azure Monitoring metrics definition."""
    log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = rest_field(
        name="logSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of Azure Monitoring log definitions."""

    @overload
    def __init__(
        self,
        *,
        metric_specifications: Optional[list["_models.OperationMetricSpecificationDefinition"]] = None,
        log_specifications: Optional[list["_models.OperationLogSpecificationDefinition"]] = 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 ParentProperties(_Model):
    """The properties of the connected registry parent.

    :ivar id: The resource ID of the parent to which the connected registry will be associated.
    :vartype id: str
    :ivar sync_properties: The sync properties of the connected registry with its parent. Required.
    :vartype sync_properties: ~azure.mgmt.containerregistry.models.SyncProperties
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource ID of the parent to which the connected registry will be associated."""
    sync_properties: "_models.SyncProperties" = rest_field(
        name="syncProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The sync properties of the connected registry with its parent. Required."""

    @overload
    def __init__(
        self,
        *,
        sync_properties: "_models.SyncProperties",
        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 PipelineRun(ProxyResource):
    """An object that represents a pipeline run for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of a pipeline run.
    :vartype properties: ~azure.mgmt.containerregistry.models.PipelineRunProperties
    """

    properties: Optional["_models.PipelineRunProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a pipeline run."""

    __flattened_items = ["provisioning_state", "request", "response", "force_update_tag"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PipelineRunProperties"] = 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 PipelineRunProperties(_Model):
    """The properties of a pipeline run.

    :ivar provisioning_state: The provisioning state of a pipeline run. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar request: The request parameters for a pipeline run.
    :vartype request: ~azure.mgmt.containerregistry.models.PipelineRunRequest
    :ivar response: The response of a pipeline run.
    :vartype response: ~azure.mgmt.containerregistry.models.PipelineRunResponse
    :ivar force_update_tag: How the pipeline run should be forced to recreate even if the pipeline
     run configuration has not changed.
    :vartype force_update_tag: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of a pipeline run. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""
    request: Optional["_models.PipelineRunRequest"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The request parameters for a pipeline run."""
    response: Optional["_models.PipelineRunResponse"] = rest_field(visibility=["read"])
    """The response of a pipeline run."""
    force_update_tag: Optional[str] = rest_field(
        name="forceUpdateTag", visibility=["read", "create", "update", "delete", "query"]
    )
    """How the pipeline run should be forced to recreate even if the pipeline run configuration has
     not changed."""

    @overload
    def __init__(
        self,
        *,
        request: Optional["_models.PipelineRunRequest"] = None,
        force_update_tag: 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 PipelineRunRequest(_Model):
    """The request properties provided for a pipeline run.

    :ivar pipeline_resource_id: The resource ID of the pipeline to run.
    :vartype pipeline_resource_id: str
    :ivar artifacts: List of source artifacts to be transferred by the pipeline. Specify an image
     by repository ('hello-world'). This will use the 'latest' tag. Specify an image by tag
     ('hello-world:latest'). Specify an image by sha256-based manifest digest
     ('hello-world@sha256:abc123').
    :vartype artifacts: list[str]
    :ivar source: The source properties of the pipeline run.
    :vartype source: ~azure.mgmt.containerregistry.models.PipelineRunSourceProperties
    :ivar target: The target properties of the pipeline run.
    :vartype target: ~azure.mgmt.containerregistry.models.PipelineRunTargetProperties
    :ivar catalog_digest: The digest of the tar used to transfer the artifacts.
    :vartype catalog_digest: str
    """

    pipeline_resource_id: Optional[str] = rest_field(
        name="pipelineResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource ID of the pipeline to run."""
    artifacts: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of source artifacts to be transferred by the pipeline. Specify an image by repository
     ('hello-world'). This will use the 'latest' tag. Specify an image by tag
     ('hello-world:latest'). Specify an image by sha256-based manifest digest
     ('hello-world@sha256:abc123')."""
    source: Optional["_models.PipelineRunSourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The source properties of the pipeline run."""
    target: Optional["_models.PipelineRunTargetProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The target properties of the pipeline run."""
    catalog_digest: Optional[str] = rest_field(
        name="catalogDigest", visibility=["read", "create", "update", "delete", "query"]
    )
    """The digest of the tar used to transfer the artifacts."""

    @overload
    def __init__(
        self,
        *,
        pipeline_resource_id: Optional[str] = None,
        artifacts: Optional[list[str]] = None,
        source: Optional["_models.PipelineRunSourceProperties"] = None,
        target: Optional["_models.PipelineRunTargetProperties"] = None,
        catalog_digest: 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 PipelineRunResponse(_Model):
    """The response properties returned for a pipeline run.

    :ivar status: The current status of the pipeline run.
    :vartype status: str
    :ivar imported_artifacts: The artifacts imported in the pipeline run.
    :vartype imported_artifacts: list[str]
    :ivar progress: The current progress of the copy operation.
    :vartype progress: ~azure.mgmt.containerregistry.models.ProgressProperties
    :ivar start_time: The time the pipeline run started.
    :vartype start_time: ~datetime.datetime
    :ivar finish_time: The time the pipeline run finished.
    :vartype finish_time: ~datetime.datetime
    :ivar source: The source of the pipeline run.
    :vartype source: ~azure.mgmt.containerregistry.models.ImportPipelineSourceProperties
    :ivar target: The target of the pipeline run.
    :vartype target: ~azure.mgmt.containerregistry.models.ExportPipelineTargetProperties
    :ivar catalog_digest: The digest of the tar used to transfer the artifacts.
    :vartype catalog_digest: str
    :ivar trigger: The trigger that caused the pipeline run.
    :vartype trigger: ~azure.mgmt.containerregistry.models.PipelineTriggerDescriptor
    :ivar pipeline_run_error_message: The detailed error message for the pipeline run in the case
     of failure.
    :vartype pipeline_run_error_message: str
    """

    status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The current status of the pipeline run."""
    imported_artifacts: Optional[list[str]] = rest_field(
        name="importedArtifacts", visibility=["read", "create", "update", "delete", "query"]
    )
    """The artifacts imported in the pipeline run."""
    progress: Optional["_models.ProgressProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The current progress of the copy operation."""
    start_time: Optional[datetime.datetime] = rest_field(
        name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time the pipeline run started."""
    finish_time: Optional[datetime.datetime] = rest_field(
        name="finishTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time the pipeline run finished."""
    source: Optional["_models.ImportPipelineSourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The source of the pipeline run."""
    target: Optional["_models.ExportPipelineTargetProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The target of the pipeline run."""
    catalog_digest: Optional[str] = rest_field(
        name="catalogDigest", visibility=["read", "create", "update", "delete", "query"]
    )
    """The digest of the tar used to transfer the artifacts."""
    trigger: Optional["_models.PipelineTriggerDescriptor"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The trigger that caused the pipeline run."""
    pipeline_run_error_message: Optional[str] = rest_field(
        name="pipelineRunErrorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The detailed error message for the pipeline run in the case of failure."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[str] = None,
        imported_artifacts: Optional[list[str]] = None,
        progress: Optional["_models.ProgressProperties"] = None,
        start_time: Optional[datetime.datetime] = None,
        finish_time: Optional[datetime.datetime] = None,
        source: Optional["_models.ImportPipelineSourceProperties"] = None,
        target: Optional["_models.ExportPipelineTargetProperties"] = None,
        catalog_digest: Optional[str] = None,
        trigger: Optional["_models.PipelineTriggerDescriptor"] = None,
        pipeline_run_error_message: 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 PipelineRunSourceProperties(_Model):
    """The pipeline run source properties.

    :ivar type: The type of the source. "AzureStorageBlob"
    :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineRunSourceType
    :ivar name: The name of the source.
    :vartype name: str
    """

    type: Optional[Union[str, "_models.PipelineRunSourceType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the source. \"AzureStorageBlob\""""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the source."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.PipelineRunSourceType"]] = None,
        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 PipelineRunTargetProperties(_Model):
    """The pipeline run target properties.

    :ivar type: The type of the target. "AzureStorageBlob"
    :vartype type: str or ~azure.mgmt.containerregistry.models.PipelineRunTargetType
    :ivar name: The name of the target.
    :vartype name: str
    """

    type: Optional[Union[str, "_models.PipelineRunTargetType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the target. \"AzureStorageBlob\""""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the target."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.PipelineRunTargetType"]] = None,
        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 PipelineSourceTriggerDescriptor(_Model):
    """The pipeline source trigger descriptor.

    :ivar timestamp: The timestamp when the source update happened.
    :vartype timestamp: ~datetime.datetime
    """

    timestamp: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp when the source update happened."""

    @overload
    def __init__(
        self,
        *,
        timestamp: 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 PipelineSourceTriggerProperties(_Model):
    """The source trigger properties of the import pipeline.

    :ivar status: The current status of the source trigger. Required. Known values are: "Enabled"
     and "Disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.TriggerStatus
    """

    status: Union[str, "_models.TriggerStatus"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The current status of the source trigger. Required. Known values are: \"Enabled\" and
     \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        status: Union[str, "_models.TriggerStatus"],
    ) -> 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 PipelineTriggerDescriptor(_Model):
    """The pipeline trigger descriptor.

    :ivar source_trigger: The source trigger that caused the pipeline run.
    :vartype source_trigger: ~azure.mgmt.containerregistry.models.PipelineSourceTriggerDescriptor
    """

    source_trigger: Optional["_models.PipelineSourceTriggerDescriptor"] = rest_field(
        name="sourceTrigger", visibility=["read", "create", "update", "delete", "query"]
    )
    """The source trigger that caused the pipeline run."""

    @overload
    def __init__(
        self,
        *,
        source_trigger: Optional["_models.PipelineSourceTriggerDescriptor"] = 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 PipelineTriggerProperties(_Model):
    """The trigger properties of the import pipeline.

    :ivar source_trigger: The source trigger properties of the pipeline.
    :vartype source_trigger: ~azure.mgmt.containerregistry.models.PipelineSourceTriggerProperties
    """

    source_trigger: Optional["_models.PipelineSourceTriggerProperties"] = rest_field(
        name="sourceTrigger", visibility=["read", "create", "update", "delete", "query"]
    )
    """The source trigger properties of the pipeline."""

    @overload
    def __init__(
        self,
        *,
        source_trigger: Optional["_models.PipelineSourceTriggerProperties"] = 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 Policies(_Model):
    """The policies for a container registry.

    :ivar quarantine_policy: The quarantine policy for a container registry.
    :vartype quarantine_policy: ~azure.mgmt.containerregistry.models.QuarantinePolicy
    :ivar trust_policy: The content trust policy for a container registry.
    :vartype trust_policy: ~azure.mgmt.containerregistry.models.TrustPolicy
    :ivar retention_policy: The retention policy for a container registry.
    :vartype retention_policy: ~azure.mgmt.containerregistry.models.RetentionPolicy
    :ivar export_policy: The export policy for a container registry.
    :vartype export_policy: ~azure.mgmt.containerregistry.models.ExportPolicy
    :ivar azure_ad_authentication_as_arm_policy: The policy for using Azure Resource Manager
     audience token for a container registry.
    :vartype azure_ad_authentication_as_arm_policy:
     ~azure.mgmt.containerregistry.models.AzureADAuthenticationAsArmPolicy
    :ivar soft_delete_policy: The soft delete policy for a container registry.
    :vartype soft_delete_policy: ~azure.mgmt.containerregistry.models.SoftDeletePolicy
    """

    quarantine_policy: Optional["_models.QuarantinePolicy"] = rest_field(
        name="quarantinePolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The quarantine policy for a container registry."""
    trust_policy: Optional["_models.TrustPolicy"] = rest_field(
        name="trustPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The content trust policy for a container registry."""
    retention_policy: Optional["_models.RetentionPolicy"] = rest_field(
        name="retentionPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The retention policy for a container registry."""
    export_policy: Optional["_models.ExportPolicy"] = rest_field(
        name="exportPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The export policy for a container registry."""
    azure_ad_authentication_as_arm_policy: Optional["_models.AzureADAuthenticationAsArmPolicy"] = rest_field(
        name="azureADAuthenticationAsArmPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy for using Azure Resource Manager audience token for a container registry."""
    soft_delete_policy: Optional["_models.SoftDeletePolicy"] = rest_field(
        name="softDeletePolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The soft delete policy for a container registry."""

    @overload
    def __init__(
        self,
        *,
        quarantine_policy: Optional["_models.QuarantinePolicy"] = None,
        trust_policy: Optional["_models.TrustPolicy"] = None,
        retention_policy: Optional["_models.RetentionPolicy"] = None,
        export_policy: Optional["_models.ExportPolicy"] = None,
        azure_ad_authentication_as_arm_policy: Optional["_models.AzureADAuthenticationAsArmPolicy"] = None,
        soft_delete_policy: Optional["_models.SoftDeletePolicy"] = 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 PrivateEndpoint(_Model):
    """The Private Endpoint resource.

    :ivar id: This is private endpoint resource created with Microsoft.Network resource provider.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """This is private endpoint resource created with Microsoft.Network resource provider."""

    @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 PrivateEndpointConnection(ProxyResource):
    """An object that represents a private endpoint connection for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of a private endpoint connection.
    :vartype properties: ~azure.mgmt.containerregistry.models.PrivateEndpointConnectionProperties
    """

    properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a private endpoint connection."""

    __flattened_items = ["private_endpoint", "private_link_service_connection_state", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PrivateEndpointConnectionProperties"] = 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 PrivateEndpointConnectionProperties(_Model):
    """The properties of a private endpoint connection.

    :ivar private_endpoint: The resource of private endpoint.
    :vartype private_endpoint: ~azure.mgmt.containerregistry.models.PrivateEndpoint
    :ivar private_link_service_connection_state: A collection of information about the state of the
     connection between service consumer and provider.
    :vartype private_link_service_connection_state:
     ~azure.mgmt.containerregistry.models.PrivateLinkServiceConnectionState
    :ivar provisioning_state: The provisioning state of private endpoint connection resource. Known
     values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field(
        name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource of private endpoint."""
    private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = rest_field(
        name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"]
    )
    """A collection of information about the state of the connection between service consumer and
     provider."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of private endpoint connection resource. Known values are: \"Creating\",
     \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        private_endpoint: Optional["_models.PrivateEndpoint"] = None,
        private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = 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 PrivateLinkResource(Resource):
    """A private link 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 private link 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.containerregistry.models.SystemData
    :ivar properties: A resource that supports private link capabilities.
    :vartype properties: ~azure.mgmt.containerregistry.models.PrivateLinkResourceProperties
    """

    properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A resource that supports private link capabilities."""

    __flattened_items = ["group_id", "required_members", "required_zone_names"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PrivateLinkResourceProperties"] = 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 PrivateLinkResourceProperties(_Model):
    """Properties of a private link resource.

    :ivar group_id: The private link resource group id.
    :vartype group_id: str
    :ivar required_members: The private link resource required member names.
    :vartype required_members: list[str]
    :ivar required_zone_names: The private link resource private link DNS zone name.
    :vartype required_zone_names: list[str]
    """

    group_id: Optional[str] = rest_field(name="groupId", visibility=["read"])
    """The private link resource group id."""
    required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"])
    """The private link resource required member names."""
    required_zone_names: Optional[list[str]] = rest_field(
        name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The private link resource private link DNS zone name."""

    @overload
    def __init__(
        self,
        *,
        required_zone_names: 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 PrivateLinkServiceConnectionState(_Model):
    """The state of a private link service connection.

    :ivar status: The private link service connection status. Known values are: "Approved",
     "Pending", "Rejected", and "Disconnected".
    :vartype status: str or ~azure.mgmt.containerregistry.models.ConnectionStatus
    :ivar description: The description for connection status. For example if connection is rejected
     it can indicate reason for rejection.
    :vartype description: str
    :ivar actions_required: A message indicating if changes on the service provider require any
     updates on the consumer. Known values are: "None" and "Recreate".
    :vartype actions_required: str or ~azure.mgmt.containerregistry.models.ActionsRequired
    """

    status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The private link service connection status. Known values are: \"Approved\", \"Pending\",
     \"Rejected\", and \"Disconnected\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description for connection status. For example if connection is rejected it can indicate
     reason for rejection."""
    actions_required: Optional[Union[str, "_models.ActionsRequired"]] = rest_field(
        name="actionsRequired", visibility=["read", "create", "update", "delete", "query"]
    )
    """A message indicating if changes on the service provider require any updates on the consumer.
     Known values are: \"None\" and \"Recreate\"."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.ConnectionStatus"]] = None,
        description: Optional[str] = None,
        actions_required: Optional[Union[str, "_models.ActionsRequired"]] = 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 ProgressProperties(_Model):
    """The progress properties.

    :ivar percentage: The percentage complete of the copy operation.
    :vartype percentage: str
    """

    percentage: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The percentage complete of the copy operation."""

    @overload
    def __init__(
        self,
        *,
        percentage: 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 QuarantinePolicy(_Model):
    """The quarantine policy for a container registry.

    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.PolicyStatus
    """

    status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.PolicyStatus"]] = 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 RegenerateCredentialParameters(_Model):
    """The parameters used to regenerate the login credential.

    :ivar name: Specifies name of the password which should be regenerated -- password or
     password2. Required. Known values are: "password" and "password2".
    :vartype name: str or ~azure.mgmt.containerregistry.models.PasswordName
    """

    name: Union[str, "_models.PasswordName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Specifies name of the password which should be regenerated -- password or password2. Required.
     Known values are: \"password\" and \"password2\"."""

    @overload
    def __init__(
        self,
        *,
        name: Union[str, "_models.PasswordName"],
    ) -> 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 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 private link 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.containerregistry.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 Registry(TrackedResource):
    """An object that represents a container registry.

    :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 private link 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.containerregistry.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: The properties of the container registry.
    :vartype properties: ~azure.mgmt.containerregistry.models.RegistryProperties
    :ivar sku: The SKU of the container registry. Required.
    :vartype sku: ~azure.mgmt.containerregistry.models.Sku
    :ivar identity: The identity of the container registry.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    """

    properties: Optional["_models.RegistryProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the container registry."""
    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the container registry. Required."""
    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the container registry."""

    __flattened_items = [
        "login_server",
        "creation_date",
        "provisioning_state",
        "status",
        "admin_user_enabled",
        "network_rule_set",
        "policies",
        "encryption",
        "data_endpoint_enabled",
        "data_endpoint_host_names",
        "regional_endpoints",
        "regional_endpoint_host_names",
        "endpoint_protocol",
        "private_endpoint_connections",
        "public_network_access",
        "network_rule_bypass_options",
        "network_rule_bypass_allowed_for_tasks",
        "zone_redundancy",
        "anonymous_pull_enabled",
        "metadata_search",
        "auto_generated_domain_name_label_scope",
        "role_assignment_mode",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        sku: "_models.Sku",
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.RegistryProperties"] = None,
        identity: Optional["_models.IdentityProperties"] = 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 RegistryListCredentialsResult(_Model):
    """The response from the ListCredentials operation.

    :ivar username: The username for a container registry.
    :vartype username: str
    :ivar passwords: The list of passwords for a container registry.
    :vartype passwords: list[~azure.mgmt.containerregistry.models.RegistryPassword]
    """

    username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The username for a container registry."""
    passwords: Optional[list["_models.RegistryPassword"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of passwords for a container registry."""

    @overload
    def __init__(
        self,
        *,
        username: Optional[str] = None,
        passwords: Optional[list["_models.RegistryPassword"]] = 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 RegistryNameCheckRequest(_Model):
    """A request to check whether a container registry name is available.

    :ivar name: The name of the container registry. Required.
    :vartype name: str
    :ivar type: The resource type of the container registry. This field must be set to
     'Microsoft.ContainerRegistry/registries'. Required. "Microsoft.ContainerRegistry/registries"
    :vartype type: str or ~azure.mgmt.containerregistry.models.ContainerRegistryResourceType
    :ivar resource_group_name: The resource group name of the container registry.
    :vartype resource_group_name: str
    :ivar auto_generated_domain_name_label_scope: The auto generated domain name label of the
     container registry. This value defaults to "Unsecure". Known values are: "Unsecure",
     "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "NoReuse".
    :vartype auto_generated_domain_name_label_scope: str or
     ~azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the container registry. Required."""
    type: Union[str, "_models.ContainerRegistryResourceType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource type of the container registry. This field must be set to
     'Microsoft.ContainerRegistry/registries'. Required. \"Microsoft.ContainerRegistry/registries\""""
    resource_group_name: Optional[str] = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource group name of the container registry."""
    auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = (
        rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"])
    )
    """The auto generated domain name label of the container registry. This value defaults to
     \"Unsecure\". Known values are: \"Unsecure\", \"TenantReuse\", \"SubscriptionReuse\",
     \"ResourceGroupReuse\", and \"NoReuse\"."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        type: Union[str, "_models.ContainerRegistryResourceType"],
        resource_group_name: Optional[str] = None,
        auto_generated_domain_name_label_scope: Optional[
            Union[str, "_models.AutoGeneratedDomainNameLabelScope"]
        ] = 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 RegistryNameStatus(_Model):
    """The result of a request to check the availability of a container registry name.

    :ivar available_login_server_name: The complete login server name with domain name label (DNL)
     hash, if available.
    :vartype available_login_server_name: str
    :ivar name_available: The value that indicates whether the name is available.
    :vartype name_available: bool
    :ivar reason: If any, the reason that the name is not available.
    :vartype reason: str
    :ivar message: If any, the error message that provides more detail for the reason that the name
     is not available.
    :vartype message: str
    """

    available_login_server_name: Optional[str] = rest_field(
        name="availableLoginServerName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The complete login server name with domain name label (DNL) hash, if available."""
    name_available: Optional[bool] = rest_field(
        name="nameAvailable", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the name is available."""
    reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """If any, the reason that the name is not available."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """If any, the error message that provides more detail for the reason that the name is not
     available."""

    @overload
    def __init__(
        self,
        *,
        available_login_server_name: Optional[str] = None,
        name_available: Optional[bool] = None,
        reason: Optional[str] = None,
        message: 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 RegistryPassword(_Model):
    """The login password for the container registry.

    :ivar name: The password name. Known values are: "password" and "password2".
    :vartype name: str or ~azure.mgmt.containerregistry.models.PasswordName
    :ivar value: The password value.
    :vartype value: str
    """

    name: Optional[Union[str, "_models.PasswordName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The password name. Known values are: \"password\" and \"password2\"."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The password value."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[Union[str, "_models.PasswordName"]] = None,
        value: 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 RegistryProperties(_Model):
    """The properties of a container registry.

    :ivar login_server: The URL that can be used to log into the container registry.
    :vartype login_server: str
    :ivar creation_date: The creation date of the container registry in ISO8601 format.
    :vartype creation_date: ~datetime.datetime
    :ivar provisioning_state: The provisioning state of the container registry at the time the
     operation was called. Known values are: "Creating", "Updating", "Deleting", "Succeeded",
     "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar status: The status of the container registry at the time the operation was called.
    :vartype status: ~azure.mgmt.containerregistry.models.Status
    :ivar admin_user_enabled: The value that indicates whether the admin user is enabled.
    :vartype admin_user_enabled: bool
    :ivar network_rule_set: The network rule set for a container registry.
    :vartype network_rule_set: ~azure.mgmt.containerregistry.models.NetworkRuleSet
    :ivar policies: The policies for a container registry.
    :vartype policies: ~azure.mgmt.containerregistry.models.Policies
    :ivar encryption: The encryption settings of container registry.
    :vartype encryption: ~azure.mgmt.containerregistry.models.EncryptionProperty
    :ivar data_endpoint_enabled: Enable a single data endpoint per region for serving data.
    :vartype data_endpoint_enabled: bool
    :ivar data_endpoint_host_names: List of host names that will serve data when
     dataEndpointEnabled is true.
    :vartype data_endpoint_host_names: list[str]
    :ivar regional_endpoints: Enable per-region endpoints for accessing registry. Known values are:
     "Enabled" and "Disabled".
    :vartype regional_endpoints: str or ~azure.mgmt.containerregistry.models.RegionalEndpoints
    :ivar regional_endpoint_host_names: List of host names that will serve registry when
     RegionalEndpoints is enabled.
    :vartype regional_endpoint_host_names: list[str]
    :ivar endpoint_protocol: The connectivity protocol for the registry, such as IPv4 or dual stack
     (IPv4 and IPv6). Known values are: "IPv4" and "IPv4AndIPv6".
    :vartype endpoint_protocol: str or ~azure.mgmt.containerregistry.models.EndpointProtocol
    :ivar private_endpoint_connections: List of private endpoint connections for a container
     registry.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.containerregistry.models.PrivateEndpointConnection]
    :ivar public_network_access: Whether or not public network access is allowed for the container
     registry. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.containerregistry.models.PublicNetworkAccess
    :ivar network_rule_bypass_options: Whether to allow trusted Azure services to access a network
     restricted registry. Known values are: "AzureServices" and "None".
    :vartype network_rule_bypass_options: str or
     ~azure.mgmt.containerregistry.models.NetworkRuleBypassOptions
    :ivar network_rule_bypass_allowed_for_tasks: Whether or not Tasks allowed to bypass the network
     rules for this container registry.
    :vartype network_rule_bypass_allowed_for_tasks: bool
    :ivar zone_redundancy: Whether or not zone redundancy is enabled for this container registry.
     Known values are: "Enabled" and "Disabled".
    :vartype zone_redundancy: str or ~azure.mgmt.containerregistry.models.ZoneRedundancy
    :ivar anonymous_pull_enabled: Enables registry-wide pull from unauthenticated clients.
    :vartype anonymous_pull_enabled: bool
    :ivar metadata_search: Determines whether registry artifacts are indexed for metadata search.
     Known values are: "Enabled" and "Disabled".
    :vartype metadata_search: str or ~azure.mgmt.containerregistry.models.MetadataSearch
    :ivar auto_generated_domain_name_label_scope: Determines the domain name label reuse scope.
     Known values are: "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and
     "NoReuse".
    :vartype auto_generated_domain_name_label_scope: str or
     ~azure.mgmt.containerregistry.models.AutoGeneratedDomainNameLabelScope
    :ivar role_assignment_mode: Determines registry role assignment mode. Known values are:
     "AbacRepositoryPermissions" and "LegacyRegistryPermissions".
    :vartype role_assignment_mode: str or ~azure.mgmt.containerregistry.models.RoleAssignmentMode
    """

    login_server: Optional[str] = rest_field(name="loginServer", visibility=["read"])
    """The URL that can be used to log into the container registry."""
    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The creation date of the container registry in ISO8601 format."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the container registry at the time the operation was called. Known
     values are: \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and
     \"Canceled\"."""
    status: Optional["_models.Status"] = rest_field(visibility=["read"])
    """The status of the container registry at the time the operation was called."""
    admin_user_enabled: Optional[bool] = rest_field(
        name="adminUserEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the admin user is enabled."""
    network_rule_set: Optional["_models.NetworkRuleSet"] = rest_field(
        name="networkRuleSet", visibility=["read", "create", "update", "delete", "query"]
    )
    """The network rule set for a container registry."""
    policies: Optional["_models.Policies"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The policies for a container registry."""
    encryption: Optional["_models.EncryptionProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The encryption settings of container registry."""
    data_endpoint_enabled: Optional[bool] = rest_field(
        name="dataEndpointEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable a single data endpoint per region for serving data."""
    data_endpoint_host_names: Optional[list[str]] = rest_field(name="dataEndpointHostNames", visibility=["read"])
    """List of host names that will serve data when dataEndpointEnabled is true."""
    regional_endpoints: Optional[Union[str, "_models.RegionalEndpoints"]] = rest_field(
        name="regionalEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable per-region endpoints for accessing registry. Known values are: \"Enabled\" and
     \"Disabled\"."""
    regional_endpoint_host_names: Optional[list[str]] = rest_field(
        name="regionalEndpointHostNames", visibility=["read"]
    )
    """List of host names that will serve registry when RegionalEndpoints is enabled."""
    endpoint_protocol: Optional[Union[str, "_models.EndpointProtocol"]] = rest_field(
        name="endpointProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connectivity protocol for the registry, such as IPv4 or dual stack (IPv4 and IPv6). Known
     values are: \"IPv4\" and \"IPv4AndIPv6\"."""
    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """List of private endpoint connections for a container registry."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not public network access is allowed for the container registry. Known values are:
     \"Enabled\" and \"Disabled\"."""
    network_rule_bypass_options: Optional[Union[str, "_models.NetworkRuleBypassOptions"]] = rest_field(
        name="networkRuleBypassOptions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to allow trusted Azure services to access a network restricted registry. Known values
     are: \"AzureServices\" and \"None\"."""
    network_rule_bypass_allowed_for_tasks: Optional[bool] = rest_field(
        name="networkRuleBypassAllowedForTasks", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not Tasks allowed to bypass the network rules for this container registry."""
    zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = rest_field(
        name="zoneRedundancy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not zone redundancy is enabled for this container registry. Known values are:
     \"Enabled\" and \"Disabled\"."""
    anonymous_pull_enabled: Optional[bool] = rest_field(
        name="anonymousPullEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enables registry-wide pull from unauthenticated clients."""
    metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = rest_field(
        name="metadataSearch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Determines whether registry artifacts are indexed for metadata search. Known values are:
     \"Enabled\" and \"Disabled\"."""
    auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = (
        rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"])
    )
    """Determines the domain name label reuse scope. Known values are: \"Unsecure\", \"TenantReuse\",
     \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"NoReuse\"."""
    role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = rest_field(
        name="roleAssignmentMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Determines registry role assignment mode. Known values are: \"AbacRepositoryPermissions\" and
     \"LegacyRegistryPermissions\"."""

    @overload
    def __init__(
        self,
        *,
        admin_user_enabled: Optional[bool] = None,
        network_rule_set: Optional["_models.NetworkRuleSet"] = None,
        policies: Optional["_models.Policies"] = None,
        encryption: Optional["_models.EncryptionProperty"] = None,
        data_endpoint_enabled: Optional[bool] = None,
        regional_endpoints: Optional[Union[str, "_models.RegionalEndpoints"]] = None,
        endpoint_protocol: Optional[Union[str, "_models.EndpointProtocol"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        network_rule_bypass_options: Optional[Union[str, "_models.NetworkRuleBypassOptions"]] = None,
        network_rule_bypass_allowed_for_tasks: Optional[bool] = None,
        zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = None,
        anonymous_pull_enabled: Optional[bool] = None,
        metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = None,
        auto_generated_domain_name_label_scope: Optional[
            Union[str, "_models.AutoGeneratedDomainNameLabelScope"]
        ] = None,
        role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = 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 RegistryPropertiesUpdateParameters(_Model):
    """The parameters for updating the properties of a container registry.

    :ivar admin_user_enabled: The value that indicates whether the admin user is enabled.
    :vartype admin_user_enabled: bool
    :ivar network_rule_set: The network rule set for a container registry.
    :vartype network_rule_set: ~azure.mgmt.containerregistry.models.NetworkRuleSet
    :ivar policies: The policies for a container registry.
    :vartype policies: ~azure.mgmt.containerregistry.models.Policies
    :ivar encryption: The encryption settings of container registry.
    :vartype encryption: ~azure.mgmt.containerregistry.models.EncryptionProperty
    :ivar data_endpoint_enabled: Enable a single data endpoint per region for serving data.
    :vartype data_endpoint_enabled: bool
    :ivar regional_endpoints: Enable per-region endpoints for accessing registry. Known values are:
     "Enabled" and "Disabled".
    :vartype regional_endpoints: str or ~azure.mgmt.containerregistry.models.RegionalEndpoints
    :ivar endpoint_protocol: The connectivity protocol for the registry, such as IPv4 or dual stack
     (IPv4 and IPv6). Known values are: "IPv4" and "IPv4AndIPv6".
    :vartype endpoint_protocol: str or ~azure.mgmt.containerregistry.models.EndpointProtocol
    :ivar public_network_access: Whether or not public network access is allowed for the container
     registry. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.containerregistry.models.PublicNetworkAccess
    :ivar network_rule_bypass_options: Whether to allow trusted Azure services to access a network
     restricted registry. Known values are: "AzureServices" and "None".
    :vartype network_rule_bypass_options: str or
     ~azure.mgmt.containerregistry.models.NetworkRuleBypassOptions
    :ivar network_rule_bypass_allowed_for_tasks: Whether to allow ACR Tasks service to access a
     network restricted registry.
    :vartype network_rule_bypass_allowed_for_tasks: bool
    :ivar anonymous_pull_enabled: Enables registry-wide pull from unauthenticated clients.
    :vartype anonymous_pull_enabled: bool
    :ivar metadata_search: Determines whether registry artifacts are indexed for metadata search.
     Known values are: "Enabled" and "Disabled".
    :vartype metadata_search: str or ~azure.mgmt.containerregistry.models.MetadataSearch
    :ivar role_assignment_mode: Determines registry role assignment mode. Known values are:
     "AbacRepositoryPermissions" and "LegacyRegistryPermissions".
    :vartype role_assignment_mode: str or ~azure.mgmt.containerregistry.models.RoleAssignmentMode
    """

    admin_user_enabled: Optional[bool] = rest_field(
        name="adminUserEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the admin user is enabled."""
    network_rule_set: Optional["_models.NetworkRuleSet"] = rest_field(
        name="networkRuleSet", visibility=["read", "create", "update", "delete", "query"]
    )
    """The network rule set for a container registry."""
    policies: Optional["_models.Policies"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The policies for a container registry."""
    encryption: Optional["_models.EncryptionProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The encryption settings of container registry."""
    data_endpoint_enabled: Optional[bool] = rest_field(
        name="dataEndpointEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable a single data endpoint per region for serving data."""
    regional_endpoints: Optional[Union[str, "_models.RegionalEndpoints"]] = rest_field(
        name="regionalEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable per-region endpoints for accessing registry. Known values are: \"Enabled\" and
     \"Disabled\"."""
    endpoint_protocol: Optional[Union[str, "_models.EndpointProtocol"]] = rest_field(
        name="endpointProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connectivity protocol for the registry, such as IPv4 or dual stack (IPv4 and IPv6). Known
     values are: \"IPv4\" and \"IPv4AndIPv6\"."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not public network access is allowed for the container registry. Known values are:
     \"Enabled\" and \"Disabled\"."""
    network_rule_bypass_options: Optional[Union[str, "_models.NetworkRuleBypassOptions"]] = rest_field(
        name="networkRuleBypassOptions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to allow trusted Azure services to access a network restricted registry. Known values
     are: \"AzureServices\" and \"None\"."""
    network_rule_bypass_allowed_for_tasks: Optional[bool] = rest_field(
        name="networkRuleBypassAllowedForTasks", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to allow ACR Tasks service to access a network restricted registry."""
    anonymous_pull_enabled: Optional[bool] = rest_field(
        name="anonymousPullEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enables registry-wide pull from unauthenticated clients."""
    metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = rest_field(
        name="metadataSearch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Determines whether registry artifacts are indexed for metadata search. Known values are:
     \"Enabled\" and \"Disabled\"."""
    role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = rest_field(
        name="roleAssignmentMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Determines registry role assignment mode. Known values are: \"AbacRepositoryPermissions\" and
     \"LegacyRegistryPermissions\"."""

    @overload
    def __init__(
        self,
        *,
        admin_user_enabled: Optional[bool] = None,
        network_rule_set: Optional["_models.NetworkRuleSet"] = None,
        policies: Optional["_models.Policies"] = None,
        encryption: Optional["_models.EncryptionProperty"] = None,
        data_endpoint_enabled: Optional[bool] = None,
        regional_endpoints: Optional[Union[str, "_models.RegionalEndpoints"]] = None,
        endpoint_protocol: Optional[Union[str, "_models.EndpointProtocol"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        network_rule_bypass_options: Optional[Union[str, "_models.NetworkRuleBypassOptions"]] = None,
        network_rule_bypass_allowed_for_tasks: Optional[bool] = None,
        anonymous_pull_enabled: Optional[bool] = None,
        metadata_search: Optional[Union[str, "_models.MetadataSearch"]] = None,
        role_assignment_mode: Optional[Union[str, "_models.RoleAssignmentMode"]] = 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 RegistrySyncResult(_Model):
    """The registry sync result of the connected registry.

    :ivar sync_trigger: The action that triggered the most recent registry sync. Required. Known
     values are: "SyncTokenUpdate", "InitialSync", "ManualResync", and "RecoveryService".
    :vartype sync_trigger: str or ~azure.mgmt.containerregistry.models.SyncTrigger
    :ivar sync_state: The status of the connected registry's most recent sync. Required. Known
     values are: "NotActivated", "Syncing", "Failed", "Succeeded", "TimedOut", and "Pending".
    :vartype sync_state: str or ~azure.mgmt.containerregistry.models.SyncState
    :ivar last_sync_start_time: The time that the connected registry's most recent sync started.
    :vartype last_sync_start_time: ~datetime.datetime
    :ivar last_sync_end_time: The time that the connected registry's most recent sync ended.
    :vartype last_sync_end_time: ~datetime.datetime
    :ivar last_successful_sync_end_time: The time that the connected registry's most recent
     successful sync ended.
    :vartype last_successful_sync_end_time: ~datetime.datetime
    """

    sync_trigger: Union[str, "_models.SyncTrigger"] = rest_field(name="syncTrigger", visibility=["read"])
    """The action that triggered the most recent registry sync. Required. Known values are:
     \"SyncTokenUpdate\", \"InitialSync\", \"ManualResync\", and \"RecoveryService\"."""
    sync_state: Union[str, "_models.SyncState"] = rest_field(name="syncState", visibility=["read"])
    """The status of the connected registry's most recent sync. Required. Known values are:
     \"NotActivated\", \"Syncing\", \"Failed\", \"Succeeded\", \"TimedOut\", and \"Pending\"."""
    last_sync_start_time: Optional[datetime.datetime] = rest_field(
        name="lastSyncStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time that the connected registry's most recent sync started."""
    last_sync_end_time: Optional[datetime.datetime] = rest_field(
        name="lastSyncEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time that the connected registry's most recent sync ended."""
    last_successful_sync_end_time: Optional[datetime.datetime] = rest_field(
        name="lastSuccessfulSyncEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time that the connected registry's most recent successful sync ended."""

    @overload
    def __init__(
        self,
        *,
        last_sync_start_time: Optional[datetime.datetime] = None,
        last_sync_end_time: Optional[datetime.datetime] = None,
        last_successful_sync_end_time: 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 RegistryUpdateParameters(_Model):
    """The parameters for updating a container registry.

    :ivar identity: The identity of the container registry.
    :vartype identity: ~azure.mgmt.containerregistry.models.IdentityProperties
    :ivar tags: The tags for the container registry.
    :vartype tags: dict[str, str]
    :ivar sku: The SKU of the container registry.
    :vartype sku: ~azure.mgmt.containerregistry.models.Sku
    :ivar properties: The properties that the container registry will be updated with.
    :vartype properties: ~azure.mgmt.containerregistry.models.RegistryPropertiesUpdateParameters
    """

    identity: Optional["_models.IdentityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the container registry."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags for the container registry."""
    sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the container registry."""
    properties: Optional["_models.RegistryPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties that the container registry will be updated with."""

    __flattened_items = [
        "admin_user_enabled",
        "network_rule_set",
        "policies",
        "encryption",
        "data_endpoint_enabled",
        "regional_endpoints",
        "endpoint_protocol",
        "public_network_access",
        "network_rule_bypass_options",
        "network_rule_bypass_allowed_for_tasks",
        "anonymous_pull_enabled",
        "metadata_search",
        "role_assignment_mode",
    ]

    @overload
    def __init__(
        self,
        *,
        identity: Optional["_models.IdentityProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        sku: Optional["_models.Sku"] = None,
        properties: Optional["_models.RegistryPropertiesUpdateParameters"] = 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 RegistryUsage(_Model):
    """The quota usage for a container registry.

    :ivar name: The name of the usage.
    :vartype name: str
    :ivar limit: The limit of the usage.
    :vartype limit: int
    :ivar current_value: The current value of the usage.
    :vartype current_value: int
    :ivar unit: The unit of measurement. Known values are: "Count" and "Bytes".
    :vartype unit: str or ~azure.mgmt.containerregistry.models.RegistryUsageUnit
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the usage."""
    limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The limit of the usage."""
    current_value: Optional[int] = rest_field(
        name="currentValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The current value of the usage."""
    unit: Optional[Union[str, "_models.RegistryUsageUnit"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The unit of measurement. Known values are: \"Count\" and \"Bytes\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        limit: Optional[int] = None,
        current_value: Optional[int] = None,
        unit: Optional[Union[str, "_models.RegistryUsageUnit"]] = 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 RegistryUsageListResult(_Model):
    """The result of a request to get container registry quota usages.

    :ivar value: The list of container registry quota usages.
    :vartype value: list[~azure.mgmt.containerregistry.models.RegistryUsage]
    """

    value: Optional[list["_models.RegistryUsage"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of container registry quota usages."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.RegistryUsage"]] = 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 Replication(TrackedResource):
    """An object that represents a replication for a container registry.

    :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 private link 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.containerregistry.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: The properties of the replication.
    :vartype properties: ~azure.mgmt.containerregistry.models.ReplicationProperties
    """

    properties: Optional["_models.ReplicationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the replication."""

    __flattened_items = ["provisioning_state", "status", "region_endpoint_enabled", "zone_redundancy"]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.ReplicationProperties"] = 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 ReplicationProperties(_Model):
    """The properties of a replication.

    :ivar provisioning_state: The provisioning state of the replication at the time the operation
     was called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar status: The status of the replication at the time the operation was called.
    :vartype status: ~azure.mgmt.containerregistry.models.Status
    :ivar region_endpoint_enabled: Specifies whether the replication's regional endpoint is
     enabled. Requests will not be routed to a replication whose regional endpoint is disabled,
     however its data will continue to be synced with other replications.
    :vartype region_endpoint_enabled: bool
    :ivar zone_redundancy: Whether or not zone redundancy is enabled for this container registry
     replication. Known values are: "Enabled" and "Disabled".
    :vartype zone_redundancy: str or ~azure.mgmt.containerregistry.models.ZoneRedundancy
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the replication at the time the operation was called. Known values
     are: \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""
    status: Optional["_models.Status"] = rest_field(visibility=["read"])
    """The status of the replication at the time the operation was called."""
    region_endpoint_enabled: Optional[bool] = rest_field(
        name="regionEndpointEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the replication's regional endpoint is enabled. Requests will not be routed
     to a replication whose regional endpoint is disabled, however its data will continue to be
     synced with other replications."""
    zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = rest_field(
        name="zoneRedundancy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not zone redundancy is enabled for this container registry replication. Known values
     are: \"Enabled\" and \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        region_endpoint_enabled: Optional[bool] = None,
        zone_redundancy: Optional[Union[str, "_models.ZoneRedundancy"]] = 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 ReplicationUpdateParameters(_Model):
    """The parameters for updating a replication.

    :ivar tags: The tags for the replication.
    :vartype tags: dict[str, str]
    :ivar properties: The parameters for updating a replication's properties.
    :vartype properties: ~azure.mgmt.containerregistry.models.ReplicationUpdateParametersProperties
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags for the replication."""
    properties: Optional["_models.ReplicationUpdateParametersProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The parameters for updating a replication's properties."""

    __flattened_items = ["region_endpoint_enabled"]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.ReplicationUpdateParametersProperties"] = 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 ReplicationUpdateParametersProperties(_Model):
    """ReplicationUpdateParametersProperties.

    :ivar region_endpoint_enabled: Specifies whether the replication's regional endpoint is
     enabled. Requests will not be routed to a replication whose regional endpoint is disabled,
     however its data will continue to be synced with other replications.
    :vartype region_endpoint_enabled: bool
    """

    region_endpoint_enabled: Optional[bool] = rest_field(
        name="regionEndpointEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the replication's regional endpoint is enabled. Requests will not be routed
     to a replication whose regional endpoint is disabled, however its data will continue to be
     synced with other replications."""

    @overload
    def __init__(
        self,
        *,
        region_endpoint_enabled: 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 Request(_Model):
    """The request that generated the event.

    :ivar id: The ID of the request that initiated the event.
    :vartype id: str
    :ivar addr: The IP or hostname and possibly port of the client connection that initiated the
     event. This is the RemoteAddr from the standard http request.
    :vartype addr: str
    :ivar host: The externally accessible hostname of the registry instance, as specified by the
     http host header on incoming requests.
    :vartype host: str
    :ivar method: The request method that generated the event.
    :vartype method: str
    :ivar useragent: The user agent header of the request.
    :vartype useragent: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ID of the request that initiated the event."""
    addr: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The IP or hostname and possibly port of the client connection that initiated the event. This is
     the RemoteAddr from the standard http request."""
    host: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The externally accessible hostname of the registry instance, as specified by the http host
     header on incoming requests."""
    method: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The request method that generated the event."""
    useragent: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The user agent header of the request."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        addr: Optional[str] = None,
        host: Optional[str] = None,
        method: Optional[str] = None,
        useragent: 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 RetentionPolicy(_Model):
    """The retention policy for a container registry.

    :ivar days: The number of days to retain an untagged manifest after which it gets purged.
    :vartype days: int
    :ivar last_updated_time: The timestamp when the policy was last updated.
    :vartype last_updated_time: ~datetime.datetime
    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.PolicyStatus
    """

    days: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of days to retain an untagged manifest after which it gets purged."""
    last_updated_time: Optional[datetime.datetime] = rest_field(
        name="lastUpdatedTime", visibility=["read"], format="rfc3339"
    )
    """The timestamp when the policy was last updated."""
    status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        days: Optional[int] = None,
        status: Optional[Union[str, "_models.PolicyStatus"]] = 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 ScopeMap(ProxyResource):
    """An object that represents a scope map for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the scope map.
    :vartype properties: ~azure.mgmt.containerregistry.models.ScopeMapProperties
    """

    properties: Optional["_models.ScopeMapProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the scope map."""

    __flattened_items = ["description", "type", "creation_date", "provisioning_state", "actions"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ScopeMapProperties"] = 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 ScopeMapProperties(_Model):
    """The properties of a scope map.

    :ivar description: The user friendly description of the scope map.
    :vartype description: str
    :ivar type: The type of the scope map. E.g. BuildIn scope map.
    :vartype type: str
    :ivar creation_date: The creation date of scope map.
    :vartype creation_date: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar actions: The list of scoped permissions for registry artifacts. E.g.
     repositories/repository-name/content/read, repositories/repository-name/metadata/write.
     Required.
    :vartype actions: list[str]
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The user friendly description of the scope map."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The type of the scope map. E.g. BuildIn scope map."""
    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The creation date of scope map."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""
    actions: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of scoped permissions for registry artifacts. E.g.
     repositories/repository-name/content/read, repositories/repository-name/metadata/write.
     Required."""

    @overload
    def __init__(
        self,
        *,
        actions: list[str],
        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 ScopeMapPropertiesUpdateParameters(_Model):
    """The update parameters for scope map properties.

    :ivar description: The user friendly description of the scope map.
    :vartype description: str
    :ivar actions: The list of scope permissions for registry artifacts. E.g.
     repositories/repository-name/pull, repositories/repository-name/delete.
    :vartype actions: list[str]
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The user friendly description of the scope map."""
    actions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of scope permissions for registry artifacts. E.g. repositories/repository-name/pull,
     repositories/repository-name/delete."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        actions: 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 ScopeMapUpdateParameters(_Model):
    """The properties for updating the scope map.

    :ivar properties: The update parameters for scope map properties.
    :vartype properties: ~azure.mgmt.containerregistry.models.ScopeMapPropertiesUpdateParameters
    """

    properties: Optional["_models.ScopeMapPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The update parameters for scope map properties."""

    __flattened_items = ["description", "actions"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ScopeMapPropertiesUpdateParameters"] = 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 Sku(_Model):
    """The SKU of a container registry.

    :ivar name: The SKU name of the container registry. Required for registry creation. Required.
     Known values are: "Classic", "Basic", "Standard", and "Premium".
    :vartype name: str or ~azure.mgmt.containerregistry.models.SkuName
    :ivar tier: The SKU tier based on the SKU name. Known values are: "Classic", "Basic",
     "Standard", and "Premium".
    :vartype tier: str or ~azure.mgmt.containerregistry.models.SkuTier
    """

    name: Union[str, "_models.SkuName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU name of the container registry. Required for registry creation. Required. Known values
     are: \"Classic\", \"Basic\", \"Standard\", and \"Premium\"."""
    tier: Optional[Union[str, "_models.SkuTier"]] = rest_field(visibility=["read"])
    """The SKU tier based on the SKU name. Known values are: \"Classic\", \"Basic\", \"Standard\", and
     \"Premium\"."""

    @overload
    def __init__(
        self,
        *,
        name: Union[str, "_models.SkuName"],
    ) -> 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 SoftDeletePolicy(_Model):
    """The soft delete policy for a container registry.

    :ivar retention_days: The number of days after which a soft-deleted item is permanently
     deleted.
    :vartype retention_days: int
    :ivar last_updated_time: The timestamp when the policy was last updated.
    :vartype last_updated_time: ~datetime.datetime
    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.PolicyStatus
    """

    retention_days: Optional[int] = rest_field(
        name="retentionDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of days after which a soft-deleted item is permanently deleted."""
    last_updated_time: Optional[datetime.datetime] = rest_field(
        name="lastUpdatedTime", visibility=["read"], format="rfc3339"
    )
    """The timestamp when the policy was last updated."""
    status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        retention_days: Optional[int] = None,
        status: Optional[Union[str, "_models.PolicyStatus"]] = 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 Source(_Model):
    """The registry node that generated the event. Put differently, while the actor initiates the
    event, the source generates it.

    :ivar addr: The IP or hostname and the port of the registry node that generated the event.
     Generally, this will be resolved by os.Hostname() along with the running port.
    :vartype addr: str
    :ivar instance_id: The running instance of an application. Changes after each restart.
    :vartype instance_id: str
    """

    addr: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The IP or hostname and the port of the registry node that generated the event. Generally, this
     will be resolved by os.Hostname() along with the running port."""
    instance_id: Optional[str] = rest_field(
        name="instanceID", visibility=["read", "create", "update", "delete", "query"]
    )
    """The running instance of an application. Changes after each restart."""

    @overload
    def __init__(
        self,
        *,
        addr: Optional[str] = None,
        instance_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 Status(_Model):
    """The status of an Azure resource at the time the operation was called.

    :ivar display_status: The short label for the status.
    :vartype display_status: str
    :ivar message: The detailed message for the status, including alerts and error messages.
    :vartype message: str
    :ivar timestamp: The timestamp when the status was changed to the current value.
    :vartype timestamp: ~datetime.datetime
    """

    display_status: Optional[str] = rest_field(name="displayStatus", visibility=["read"])
    """The short label for the status."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The detailed message for the status, including alerts and error messages."""
    timestamp: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """The timestamp when the status was changed to the current value."""


class StatusDetailProperties(_Model):
    """The status detail properties of the connected registry.

    :ivar type: The component of the connected registry corresponding to the status.
    :vartype type: str
    :ivar code: The HTTP status code.
    :vartype code: str
    :ivar description: The description of the status.
    :vartype description: str
    :ivar timestamp: The timestamp of the status.
    :vartype timestamp: ~datetime.datetime
    :ivar correlation_id: The correlation ID of the status.
    :vartype correlation_id: str
    """

    type: Optional[str] = rest_field(visibility=["read"])
    """The component of the connected registry corresponding to the status."""
    code: Optional[str] = rest_field(visibility=["read"])
    """The HTTP status code."""
    description: Optional[str] = rest_field(visibility=["read"])
    """The description of the status."""
    timestamp: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """The timestamp of the status."""
    correlation_id: Optional[str] = rest_field(name="correlationId", visibility=["read"])
    """The correlation ID of the status."""


class SyncProperties(_Model):
    """The sync properties of the connected registry with its parent.

    :ivar token_id: The resource ID of the ACR token used to authenticate the connected registry to
     its parent during sync. Required.
    :vartype token_id: str
    :ivar schedule: The cron expression indicating the schedule that the connected registry will
     sync with its parent.
    :vartype schedule: str
    :ivar sync_window: The time window during which sync is enabled for each schedule occurrence.
     Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601.
    :vartype sync_window: ~datetime.timedelta
    :ivar message_ttl: The period of time for which a message is available to sync before it is
     expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601.
     Required.
    :vartype message_ttl: ~datetime.timedelta
    :ivar last_sync_time: The last time a sync occurred between the connected registry and its
     parent.
    :vartype last_sync_time: ~datetime.datetime
    :ivar gateway_endpoint: The gateway endpoint used by the connected registry to communicate with
     its parent.
    :vartype gateway_endpoint: str
    """

    token_id: str = rest_field(name="tokenId", visibility=["read", "create", "update", "delete", "query"])
    """The resource ID of the ACR token used to authenticate the connected registry to its parent
     during sync. Required."""
    schedule: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The cron expression indicating the schedule that the connected registry will sync with its
     parent."""
    sync_window: Optional[datetime.timedelta] = rest_field(
        name="syncWindow", visibility=["read", "create", "update", "delete", "query"]
    )
    """The time window during which sync is enabled for each schedule occurrence. Specify the duration
     using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601."""
    message_ttl: datetime.timedelta = rest_field(
        name="messageTtl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The period of time for which a message is available to sync before it is expired. Specify the
     duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. Required."""
    last_sync_time: Optional[datetime.datetime] = rest_field(name="lastSyncTime", visibility=["read"], format="rfc3339")
    """The last time a sync occurred between the connected registry and its parent."""
    gateway_endpoint: Optional[str] = rest_field(name="gatewayEndpoint", visibility=["read"])
    """The gateway endpoint used by the connected registry to communicate with its parent."""

    @overload
    def __init__(
        self,
        *,
        token_id: str,
        message_ttl: datetime.timedelta,
        schedule: Optional[str] = None,
        sync_window: Optional[datetime.timedelta] = 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 SyncUpdateProperties(_Model):
    """The parameters for updating the sync properties of the connected registry with its parent.

    :ivar schedule: The cron expression indicating the schedule that the connected registry will
     sync with its parent.
    :vartype schedule: str
    :ivar sync_window: The time window during which sync is enabled for each schedule occurrence.
     Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601.
    :vartype sync_window: ~datetime.timedelta
    :ivar message_ttl: The period of time for which a message is available to sync before it is
     expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601.
    :vartype message_ttl: ~datetime.timedelta
    """

    schedule: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The cron expression indicating the schedule that the connected registry will sync with its
     parent."""
    sync_window: Optional[datetime.timedelta] = rest_field(
        name="syncWindow", visibility=["read", "create", "update", "delete", "query"]
    )
    """The time window during which sync is enabled for each schedule occurrence. Specify the duration
     using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601."""
    message_ttl: Optional[datetime.timedelta] = rest_field(
        name="messageTtl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The period of time for which a message is available to sync before it is expired. Specify the
     duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601."""

    @overload
    def __init__(
        self,
        *,
        schedule: Optional[str] = None,
        sync_window: Optional[datetime.timedelta] = None,
        message_ttl: Optional[datetime.timedelta] = 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.containerregistry.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.containerregistry.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 Target(_Model):
    """The target of the event.

    :ivar media_type: The MIME type of the referenced object.
    :vartype media_type: str
    :ivar size: The number of bytes of the content. Same as Length field.
    :vartype size: int
    :ivar digest: The digest of the content, as defined by the Registry V2 HTTP API Specification.
    :vartype digest: str
    :ivar length: The number of bytes of the content. Same as Size field.
    :vartype length: int
    :ivar repository: The repository name.
    :vartype repository: str
    :ivar url: The direct URL to the content.
    :vartype url: str
    :ivar tag: The tag name.
    :vartype tag: str
    :ivar name: The name of the artifact.
    :vartype name: str
    :ivar version: The version of the artifact.
    :vartype version: str
    """

    media_type: Optional[str] = rest_field(name="mediaType", visibility=["read", "create", "update", "delete", "query"])
    """The MIME type of the referenced object."""
    size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of bytes of the content. Same as Length field."""
    digest: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The digest of the content, as defined by the Registry V2 HTTP API Specification."""
    length: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of bytes of the content. Same as Size field."""
    repository: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The repository name."""
    url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The direct URL to the content."""
    tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tag name."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the artifact."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The version of the artifact."""

    @overload
    def __init__(
        self,
        *,
        media_type: Optional[str] = None,
        size: Optional[int] = None,
        digest: Optional[str] = None,
        length: Optional[int] = None,
        repository: Optional[str] = None,
        url: Optional[str] = None,
        tag: Optional[str] = None,
        name: Optional[str] = None,
        version: 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 TlsCertificateProperties(_Model):
    """The TLS certificate properties of the connected registry login server.

    :ivar type: The type of certificate location. "LocalDirectory"
    :vartype type: str or ~azure.mgmt.containerregistry.models.CertificateType
    :ivar location: Indicates the location of the certificates.
    :vartype location: str
    """

    type: Optional[Union[str, "_models.CertificateType"]] = rest_field(visibility=["read"])
    """The type of certificate location. \"LocalDirectory\""""
    location: Optional[str] = rest_field(visibility=["read"])
    """Indicates the location of the certificates."""


class TlsProperties(_Model):
    """The TLS properties of the connected registry login server.

    :ivar status: Indicates whether HTTPS is enabled for the login server. Known values are:
     "Enabled" and "Disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.TlsStatus
    :ivar certificate: The certificate used to configure HTTPS for the login server.
    :vartype certificate: ~azure.mgmt.containerregistry.models.TlsCertificateProperties
    """

    status: Optional[Union[str, "_models.TlsStatus"]] = rest_field(visibility=["read"])
    """Indicates whether HTTPS is enabled for the login server. Known values are: \"Enabled\" and
     \"Disabled\"."""
    certificate: Optional["_models.TlsCertificateProperties"] = rest_field(visibility=["read"])
    """The certificate used to configure HTTPS for the login server."""


class Token(ProxyResource):
    """An object that represents a token for a container registry.

    :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 private link 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.containerregistry.models.SystemData
    :ivar properties: The properties of the token.
    :vartype properties: ~azure.mgmt.containerregistry.models.TokenProperties
    """

    properties: Optional["_models.TokenProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the token."""

    __flattened_items = ["creation_date", "provisioning_state", "scope_map_id", "credentials", "status"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TokenProperties"] = 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 TokenCertificate(_Model):
    """The properties of a certificate used for authenticating a token.

    :ivar name: Known values are: "certificate1" and "certificate2".
    :vartype name: str or ~azure.mgmt.containerregistry.models.TokenCertificateName
    :ivar expiry: The expiry datetime of the certificate.
    :vartype expiry: ~datetime.datetime
    :ivar thumbprint: The thumbprint of the certificate.
    :vartype thumbprint: str
    :ivar encoded_pem_certificate: Base 64 encoded string of the public certificate1 in PEM format
     that will be used for authenticating the token.
    :vartype encoded_pem_certificate: str
    """

    name: Optional[Union[str, "_models.TokenCertificateName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"certificate1\" and \"certificate2\"."""
    expiry: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The expiry datetime of the certificate."""
    thumbprint: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The thumbprint of the certificate."""
    encoded_pem_certificate: Optional[str] = rest_field(
        name="encodedPemCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Base 64 encoded string of the public certificate1 in PEM format that will be used for
     authenticating the token."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[Union[str, "_models.TokenCertificateName"]] = None,
        expiry: Optional[datetime.datetime] = None,
        thumbprint: Optional[str] = None,
        encoded_pem_certificate: 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 TokenCredentialsProperties(_Model):
    """The properties of the credentials that can be used for authenticating the token.

    :ivar certificates:
    :vartype certificates: list[~azure.mgmt.containerregistry.models.TokenCertificate]
    :ivar passwords:
    :vartype passwords: list[~azure.mgmt.containerregistry.models.TokenPassword]
    """

    certificates: Optional[list["_models.TokenCertificate"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    passwords: Optional[list["_models.TokenPassword"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        certificates: Optional[list["_models.TokenCertificate"]] = None,
        passwords: Optional[list["_models.TokenPassword"]] = 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 TokenPassword(_Model):
    """The password that will be used for authenticating the token of a container registry.

    :ivar creation_time: The creation datetime of the password.
    :vartype creation_time: ~datetime.datetime
    :ivar expiry: The expiry datetime of the password.
    :vartype expiry: ~datetime.datetime
    :ivar name: The password name "password1" or "password2". Known values are: "password1" and
     "password2".
    :vartype name: str or ~azure.mgmt.containerregistry.models.TokenPasswordName
    :ivar value: The password value.
    :vartype value: str
    """

    creation_time: Optional[datetime.datetime] = rest_field(
        name="creationTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The creation datetime of the password."""
    expiry: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The expiry datetime of the password."""
    name: Optional[Union[str, "_models.TokenPasswordName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The password name \"password1\" or \"password2\". Known values are: \"password1\" and
     \"password2\"."""
    value: Optional[str] = rest_field(visibility=["read"])
    """The password value."""

    @overload
    def __init__(
        self,
        *,
        creation_time: Optional[datetime.datetime] = None,
        expiry: Optional[datetime.datetime] = None,
        name: Optional[Union[str, "_models.TokenPasswordName"]] = 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 TokenProperties(_Model):
    """The properties of a token.

    :ivar creation_date: The creation date of scope map.
    :vartype creation_date: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    :ivar scope_map_id: The resource ID of the scope map to which the token will be associated
     with.
    :vartype scope_map_id: str
    :ivar credentials: The credentials that can be used for authenticating the token.
    :vartype credentials: ~azure.mgmt.containerregistry.models.TokenCredentialsProperties
    :ivar status: The status of the token example enabled or disabled. Known values are: "enabled"
     and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.TokenStatus
    """

    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The creation date of scope map."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the resource. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""
    scope_map_id: Optional[str] = rest_field(
        name="scopeMapId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource ID of the scope map to which the token will be associated with."""
    credentials: Optional["_models.TokenCredentialsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The credentials that can be used for authenticating the token."""
    status: Optional[Union[str, "_models.TokenStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the token example enabled or disabled. Known values are: \"enabled\" and
     \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        scope_map_id: Optional[str] = None,
        credentials: Optional["_models.TokenCredentialsProperties"] = None,
        status: Optional[Union[str, "_models.TokenStatus"]] = 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 TokenUpdateParameters(_Model):
    """The parameters for updating a token.

    :ivar properties: The properties of the token update parameters.
    :vartype properties: ~azure.mgmt.containerregistry.models.TokenUpdateProperties
    """

    properties: Optional["_models.TokenUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the token update parameters."""

    __flattened_items = ["scope_map_id", "status", "credentials"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TokenUpdateProperties"] = 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 TokenUpdateProperties(_Model):
    """The parameters for updating token properties.

    :ivar scope_map_id: The resource ID of the scope map to which the token will be associated
     with.
    :vartype scope_map_id: str
    :ivar status: The status of the token example enabled or disabled. Known values are: "enabled"
     and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.TokenStatus
    :ivar credentials: The credentials that can be used for authenticating the token.
    :vartype credentials: ~azure.mgmt.containerregistry.models.TokenCredentialsProperties
    """

    scope_map_id: Optional[str] = rest_field(
        name="scopeMapId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource ID of the scope map to which the token will be associated with."""
    status: Optional[Union[str, "_models.TokenStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the token example enabled or disabled. Known values are: \"enabled\" and
     \"disabled\"."""
    credentials: Optional["_models.TokenCredentialsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The credentials that can be used for authenticating the token."""

    @overload
    def __init__(
        self,
        *,
        scope_map_id: Optional[str] = None,
        status: Optional[Union[str, "_models.TokenStatus"]] = None,
        credentials: Optional["_models.TokenCredentialsProperties"] = 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 TrustPolicy(_Model):
    """The content trust policy for a container registry.

    :ivar type: The type of trust policy. "Notary"
    :vartype type: str or ~azure.mgmt.containerregistry.models.TrustPolicyType
    :ivar status: The value that indicates whether the policy is enabled or not. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.PolicyStatus
    """

    type: Optional[Union[str, "_models.TrustPolicyType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of trust policy. \"Notary\""""
    status: Optional[Union[str, "_models.PolicyStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The value that indicates whether the policy is enabled or not. Known values are: \"enabled\"
     and \"disabled\"."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.TrustPolicyType"]] = None,
        status: Optional[Union[str, "_models.PolicyStatus"]] = 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 UserIdentityProperties(_Model):
    """UserIdentityProperties.

    :ivar principal_id: The principal id of user assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client id of user assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal id of user assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])
    """The client id of user assigned identity."""


class Webhook(TrackedResource):
    """An object that represents a webhook for a container registry.

    :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 private link 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.containerregistry.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: The properties of the webhook.
    :vartype properties: ~azure.mgmt.containerregistry.models.WebhookProperties
    """

    properties: Optional["_models.WebhookProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the webhook."""

    __flattened_items = ["status", "scope", "actions", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.WebhookProperties"] = 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 WebhookCreateParameters(_Model):
    """The parameters for creating a webhook.

    :ivar tags: The tags for the webhook.
    :vartype tags: dict[str, str]
    :ivar location: The location of the webhook. This cannot be changed after the resource is
     created. Required.
    :vartype location: str
    :ivar properties: The properties that the webhook will be created with.
    :vartype properties: ~azure.mgmt.containerregistry.models.WebhookPropertiesCreateParameters
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags for the webhook."""
    location: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The location of the webhook. This cannot be changed after the resource is created. Required."""
    properties: Optional["_models.WebhookPropertiesCreateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties that the webhook will be created with."""

    __flattened_items = ["service_uri", "custom_headers", "status", "scope", "actions"]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.WebhookPropertiesCreateParameters"] = 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 WebhookProperties(_Model):
    """The properties of a webhook.

    :ivar status: The status of the webhook at the time the operation was called. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.WebhookStatus
    :ivar scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
     'foo' is equivalent to 'foo:latest'. Empty means all events.
    :vartype scope: str
    :ivar actions: The list of actions that trigger the webhook to post notifications. Required.
    :vartype actions: list[str or ~azure.mgmt.containerregistry.models.WebhookAction]
    :ivar provisioning_state: The provisioning state of the webhook at the time the operation was
     called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and
     "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.containerregistry.models.ProvisioningState
    """

    status: Optional[Union[str, "_models.WebhookStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the webhook at the time the operation was called. Known values are: \"enabled\"
     and \"disabled\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope of repositories where the event can be triggered. For example, 'foo:*' means events
     for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is
     equivalent to 'foo:latest'. Empty means all events."""
    actions: list[Union[str, "_models.WebhookAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of actions that trigger the webhook to post notifications. Required."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the webhook at the time the operation was called. Known values are:
     \"Creating\", \"Updating\", \"Deleting\", \"Succeeded\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        actions: list[Union[str, "_models.WebhookAction"]],
        status: Optional[Union[str, "_models.WebhookStatus"]] = None,
        scope: 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 WebhookPropertiesCreateParameters(_Model):
    """The parameters for creating the properties of a webhook.

    :ivar service_uri: The service URI for the webhook to post notifications. Required.
    :vartype service_uri: str
    :ivar custom_headers: Custom headers that will be added to the webhook notifications.
    :vartype custom_headers: dict[str, str]
    :ivar status: The status of the webhook at the time the operation was called. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.WebhookStatus
    :ivar scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
     'foo' is equivalent to 'foo:latest'. Empty means all events.
    :vartype scope: str
    :ivar actions: The list of actions that trigger the webhook to post notifications. Required.
    :vartype actions: list[str or ~azure.mgmt.containerregistry.models.WebhookAction]
    """

    service_uri: str = rest_field(name="serviceUri", visibility=["read", "create", "update", "delete", "query"])
    """The service URI for the webhook to post notifications. Required."""
    custom_headers: Optional[dict[str, str]] = rest_field(
        name="customHeaders", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom headers that will be added to the webhook notifications."""
    status: Optional[Union[str, "_models.WebhookStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the webhook at the time the operation was called. Known values are: \"enabled\"
     and \"disabled\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope of repositories where the event can be triggered. For example, 'foo:*' means events
     for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is
     equivalent to 'foo:latest'. Empty means all events."""
    actions: list[Union[str, "_models.WebhookAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of actions that trigger the webhook to post notifications. Required."""

    @overload
    def __init__(
        self,
        *,
        service_uri: str,
        actions: list[Union[str, "_models.WebhookAction"]],
        custom_headers: Optional[dict[str, str]] = None,
        status: Optional[Union[str, "_models.WebhookStatus"]] = None,
        scope: 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 WebhookPropertiesUpdateParameters(_Model):
    """The parameters for updating the properties of a webhook.

    :ivar service_uri: The service URI for the webhook to post notifications.
    :vartype service_uri: str
    :ivar custom_headers: Custom headers that will be added to the webhook notifications.
    :vartype custom_headers: dict[str, str]
    :ivar status: The status of the webhook at the time the operation was called. Known values are:
     "enabled" and "disabled".
    :vartype status: str or ~azure.mgmt.containerregistry.models.WebhookStatus
    :ivar scope: The scope of repositories where the event can be triggered. For example, 'foo:*'
     means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only.
     'foo' is equivalent to 'foo:latest'. Empty means all events.
    :vartype scope: str
    :ivar actions: The list of actions that trigger the webhook to post notifications.
    :vartype actions: list[str or ~azure.mgmt.containerregistry.models.WebhookAction]
    """

    service_uri: Optional[str] = rest_field(
        name="serviceUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The service URI for the webhook to post notifications."""
    custom_headers: Optional[dict[str, str]] = rest_field(
        name="customHeaders", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom headers that will be added to the webhook notifications."""
    status: Optional[Union[str, "_models.WebhookStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the webhook at the time the operation was called. Known values are: \"enabled\"
     and \"disabled\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope of repositories where the event can be triggered. For example, 'foo:*' means events
     for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is
     equivalent to 'foo:latest'. Empty means all events."""
    actions: Optional[list[Union[str, "_models.WebhookAction"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of actions that trigger the webhook to post notifications."""

    @overload
    def __init__(
        self,
        *,
        service_uri: Optional[str] = None,
        custom_headers: Optional[dict[str, str]] = None,
        status: Optional[Union[str, "_models.WebhookStatus"]] = None,
        scope: Optional[str] = None,
        actions: Optional[list[Union[str, "_models.WebhookAction"]]] = 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 WebhookUpdateParameters(_Model):
    """The parameters for updating a webhook.

    :ivar tags: The tags for the webhook.
    :vartype tags: dict[str, str]
    :ivar properties: The properties that the webhook will be updated with.
    :vartype properties: ~azure.mgmt.containerregistry.models.WebhookPropertiesUpdateParameters
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags for the webhook."""
    properties: Optional["_models.WebhookPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties that the webhook will be updated with."""

    __flattened_items = ["service_uri", "custom_headers", "status", "scope", "actions"]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.WebhookPropertiesUpdateParameters"] = 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)
