# 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 ApiEntityReference(_Model):
    """The API entity reference.

    :ivar id: The ARM resource id in the form of
     /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ARM resource id in the form of
     /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/..."""

    @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 ApplicationGateway(_Model):
    """Application Gateway the CG profile will use to interact with CGs in a backend pool.

    :ivar resource: The Application Gateway ARM resource Id.
    :vartype resource: str
    :ivar backend_address_pools: List of Application Gateway Backend Address Pools.
    :vartype backend_address_pools:
     list[~azure.mgmt.containerinstance.models.ApplicationGatewayBackendAddressPool]
    """

    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Application Gateway ARM resource Id."""
    backend_address_pools: Optional[list["_models.ApplicationGatewayBackendAddressPool"]] = rest_field(
        name="backendAddressPools", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Application Gateway Backend Address Pools."""

    @overload
    def __init__(
        self,
        *,
        resource: Optional[str] = None,
        backend_address_pools: Optional[list["_models.ApplicationGatewayBackendAddressPool"]] = 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 ApplicationGatewayBackendAddressPool(_Model):
    """NGroups application gateway backend address pool.

    :ivar resource: The application gateway backend address pool ARM resource Id.
    :vartype resource: str
    """

    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The application gateway backend address pool ARM resource Id."""

    @overload
    def __init__(
        self,
        *,
        resource: 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 ArmResource(_Model):
    """Resource.

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

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


class AzureFileVolume(_Model):
    """The properties of the Azure File volume. Azure File shares are mounted as volumes.

    :ivar share_name: The name of the Azure File share to be mounted as a volume. Required.
    :vartype share_name: str
    :ivar read_only: The flag indicating whether the Azure File shared mounted as a volume is
     read-only.
    :vartype read_only: bool
    :ivar storage_account_name: The name of the storage account that contains the Azure File share.
     Required.
    :vartype storage_account_name: str
    :ivar storage_account_key: The storage account access key used to access the Azure File share.
    :vartype storage_account_key: str
    :ivar storage_account_key_reference: The reference to the storage account access key used to
     access the Azure File share.
    :vartype storage_account_key_reference: str
    """

    share_name: str = rest_field(name="shareName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the Azure File share to be mounted as a volume. Required."""
    read_only: Optional[bool] = rest_field(name="readOnly", visibility=["read", "create", "update", "delete", "query"])
    """The flag indicating whether the Azure File shared mounted as a volume is read-only."""
    storage_account_name: str = rest_field(
        name="storageAccountName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the storage account that contains the Azure File share. Required."""
    storage_account_key: Optional[str] = rest_field(
        name="storageAccountKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The storage account access key used to access the Azure File share."""
    storage_account_key_reference: Optional[str] = rest_field(
        name="storageAccountKeyReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference to the storage account access key used to access the Azure File share."""

    @overload
    def __init__(
        self,
        *,
        share_name: str,
        storage_account_name: str,
        read_only: Optional[bool] = None,
        storage_account_key: Optional[str] = None,
        storage_account_key_reference: 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 CachedImages(_Model):
    """The cached image and OS type.

    :ivar os_type: The OS type of the cached image. Required.
    :vartype os_type: str
    :ivar image: The cached image name. Required.
    :vartype image: str
    """

    os_type: str = rest_field(name="osType", visibility=["read", "create", "update", "delete", "query"])
    """The OS type of the cached image. Required."""
    image: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The cached image name. Required."""

    @overload
    def __init__(
        self,
        *,
        os_type: str,
        image: str,
    ) -> 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 Capabilities(_Model):
    """The regional capabilities.

    :ivar resource_type: The resource type that this capability describes.
    :vartype resource_type: str
    :ivar os_type: The OS type that this capability describes.
    :vartype os_type: str
    :ivar location: The resource location.
    :vartype location: str
    :ivar ip_address_type: The ip address type that this capability describes.
    :vartype ip_address_type: str
    :ivar gpu: The GPU sku that this capability describes.
    :vartype gpu: str
    :ivar capabilities: The supported capabilities.
    :vartype capabilities: ~azure.mgmt.containerinstance.models.CapabilitiesCapabilities
    """

    resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"])
    """The resource type that this capability describes."""
    os_type: Optional[str] = rest_field(name="osType", visibility=["read"])
    """The OS type that this capability describes."""
    location: Optional[str] = rest_field(visibility=["read"])
    """The resource location."""
    ip_address_type: Optional[str] = rest_field(name="ipAddressType", visibility=["read"])
    """The ip address type that this capability describes."""
    gpu: Optional[str] = rest_field(visibility=["read"])
    """The GPU sku that this capability describes."""
    capabilities: Optional["_models.CapabilitiesCapabilities"] = rest_field(visibility=["read"])
    """The supported capabilities."""


class CapabilitiesCapabilities(_Model):
    """The supported capabilities.

    :ivar max_memory_in_gb: The maximum allowed memory request in GB.
    :vartype max_memory_in_gb: float
    :ivar max_cpu: The maximum allowed CPU request in cores.
    :vartype max_cpu: float
    :ivar max_gpu_count: The maximum allowed GPU count.
    :vartype max_gpu_count: float
    """

    max_memory_in_gb: Optional[float] = rest_field(name="maxMemoryInGB", visibility=["read"])
    """The maximum allowed memory request in GB."""
    max_cpu: Optional[float] = rest_field(name="maxCpu", visibility=["read"])
    """The maximum allowed CPU request in cores."""
    max_gpu_count: Optional[float] = rest_field(name="maxGpuCount", visibility=["read"])
    """The maximum allowed GPU count."""


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

    :ivar error: An error response from the Container Instance service.
    :vartype error: ~azure.mgmt.containerinstance.models.CloudErrorBody
    """

    error: Optional["_models.CloudErrorBody"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """An error response from the Container Instance service."""

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

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

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


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

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

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

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

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

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


class ConfidentialComputeProperties(_Model):
    """The properties for confidential container group.

    :ivar cce_policy: The base64 encoded confidential compute enforcement policy.
    :vartype cce_policy: str
    """

    cce_policy: Optional[str] = rest_field(name="ccePolicy", visibility=["read", "create", "update", "delete", "query"])
    """The base64 encoded confidential compute enforcement policy."""

    @overload
    def __init__(
        self,
        *,
        cce_policy: 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 ConfigMap(_Model):
    """The container config map.

    :ivar key_value_pairs: The key value pairs dictionary in the config map.
    :vartype key_value_pairs: dict[str, str]
    """

    key_value_pairs: Optional[dict[str, str]] = rest_field(
        name="keyValuePairs", visibility=["read", "create", "update", "delete", "query"]
    )
    """The key value pairs dictionary in the config map."""

    @overload
    def __init__(
        self,
        *,
        key_value_pairs: 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 Container(_Model):
    """A container instance.

    :ivar name: The user-provided name of the container instance. Required.
    :vartype name: str
    :ivar properties: The properties of the container instance. Required.
    :vartype properties: ~azure.mgmt.containerinstance.models.ContainerProperties
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The user-provided name of the container instance. Required."""
    properties: "_models.ContainerProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The properties of the container instance. Required."""

    __flattened_items = [
        "image",
        "command",
        "ports",
        "environment_variables",
        "instance_view",
        "resources",
        "volume_mounts",
        "liveness_probe",
        "readiness_probe",
        "security_context",
        "config_map",
    ]

    @overload
    def __init__(
        self,
        *,
        name: str,
        properties: "_models.ContainerProperties",
    ) -> 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 ContainerAttachResponse(_Model):
    """The information for the output stream from container attach.

    :ivar web_socket_uri: The uri for the output stream from the attach.
    :vartype web_socket_uri: str
    :ivar password: The password to the output stream from the attach. Send as an Authorization
     header value when connecting to the websocketUri.
    :vartype password: str
    """

    web_socket_uri: Optional[str] = rest_field(
        name="webSocketUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The uri for the output stream from the attach."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The password to the output stream from the attach. Send as an Authorization header value when
     connecting to the websocketUri."""

    @overload
    def __init__(
        self,
        *,
        web_socket_uri: Optional[str] = None,
        password: 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 ContainerExec(_Model):
    """The container execution command, for liveness or readiness probe.

    :ivar command: The commands to execute within the container.
    :vartype command: list[str]
    """

    command: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The commands to execute within the container."""

    @overload
    def __init__(
        self,
        *,
        command: 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 ContainerExecRequest(_Model):
    """The container exec request.

    :ivar command: The command to be executed.
    :vartype command: str
    :ivar terminal_size: The size of the terminal.
    :vartype terminal_size: ~azure.mgmt.containerinstance.models.ContainerExecRequestTerminalSize
    """

    command: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The command to be executed."""
    terminal_size: Optional["_models.ContainerExecRequestTerminalSize"] = rest_field(
        name="terminalSize", visibility=["read", "create", "update", "delete", "query"]
    )
    """The size of the terminal."""

    @overload
    def __init__(
        self,
        *,
        command: Optional[str] = None,
        terminal_size: Optional["_models.ContainerExecRequestTerminalSize"] = 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 ContainerExecRequestTerminalSize(_Model):
    """The size of the terminal.

    :ivar rows: The row size of the terminal.
    :vartype rows: int
    :ivar cols: The column size of the terminal.
    :vartype cols: int
    """

    rows: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The row size of the terminal."""
    cols: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The column size of the terminal."""

    @overload
    def __init__(
        self,
        *,
        rows: Optional[int] = None,
        cols: Optional[int] = None,
    ) -> None: ...

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

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


class ContainerExecResponse(_Model):
    """The information for the container exec command.

    :ivar web_socket_uri: The uri for the exec websocket.
    :vartype web_socket_uri: str
    :ivar password: The password to start the exec command.
    :vartype password: str
    """

    web_socket_uri: Optional[str] = rest_field(
        name="webSocketUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The uri for the exec websocket."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The password to start the exec command."""

    @overload
    def __init__(
        self,
        *,
        web_socket_uri: Optional[str] = None,
        password: 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 ProxyResource(ArmResource):
    """Proxy Resource.

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


class ContainerGroup(ProxyResource):
    """A container group.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
    :ivar location: The resource location of the container group.
    :vartype location: str
    :ivar tags: The resource tags.
    :vartype tags: dict[str, str]
    :ivar zones: The availability zones.
    :vartype zones: list[str]
    :ivar identity: The identity of the container group, if configured.
    :vartype identity: ~azure.mgmt.containerinstance.models.ContainerGroupIdentity
    :ivar properties: The container group properties. Required.
    :vartype properties: ~azure.mgmt.containerinstance.models.ContainerGroupProperties
    """

    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource location of the container group."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource tags."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The availability zones."""
    identity: Optional["_models.ContainerGroupIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the container group, if configured."""
    properties: "_models.ContainerGroupProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The container group properties. Required."""

    __flattened_items = [
        "provisioning_state",
        "secret_references",
        "containers",
        "image_registry_credentials",
        "restart_policy",
        "ip_address",
        "os_type",
        "volumes",
        "instance_view",
        "diagnostics",
        "subnet_ids",
        "dns_config",
        "sku",
        "encryption_properties",
        "init_containers",
        "extensions",
        "confidential_compute_properties",
        "priority",
        "identity_acls",
        "container_group_profile",
        "standby_pool_profile",
        "is_created_from_standby_pool",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: "_models.ContainerGroupProperties",
        location: Optional[str] = None,
        tags: Optional[dict[str, str]] = None,
        zones: Optional[list[str]] = None,
        identity: Optional["_models.ContainerGroupIdentity"] = 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 ContainerGroupDiagnostics(_Model):
    """Container group diagnostic information.

    :ivar log_analytics: Container group log analytics information.
    :vartype log_analytics: ~azure.mgmt.containerinstance.models.LogAnalytics
    """

    log_analytics: Optional["_models.LogAnalytics"] = rest_field(
        name="logAnalytics", visibility=["read", "create", "update", "delete", "query"]
    )
    """Container group log analytics information."""

    @overload
    def __init__(
        self,
        *,
        log_analytics: Optional["_models.LogAnalytics"] = 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 ContainerGroupIdentity(_Model):
    """Identity for the container group.

    :ivar principal_id: The principal id of the container group identity. This property will only
     be provided for a system assigned identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant id associated with the container group. This property will only be
     provided for a system assigned identity.
    :vartype tenant_id: str
    :ivar type: The type of identity used for the container group. The type 'SystemAssigned,
     UserAssigned' includes both an implicitly created identity and a set of user assigned
     identities. The type 'None' will remove any identities from the container group. Known values
     are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None".
    :vartype type: str or ~azure.mgmt.containerinstance.models.ResourceIdentityType
    :ivar user_assigned_identities: The list of user identities associated with the container
     group.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.containerinstance.models.UserAssignedIdentities]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal id of the container group identity. This property will only be provided for a
     system assigned identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant id associated with the container group. This property will only be provided for a
     system assigned identity."""
    type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity used for the container group. The type 'SystemAssigned, UserAssigned'
     includes both an implicitly created identity and a set of user assigned identities. The type
     'None' will remove any identities from the container group. Known values are:
     \"SystemAssigned\", \"UserAssigned\", \"SystemAssigned, UserAssigned\", and \"None\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentities"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of user identities associated with the container group."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentities"]] = 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 ContainerGroupProfile(ProxyResource):
    """A container group profile object.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
    :ivar properties: The container group profile properties.
    :vartype properties: ~azure.mgmt.containerinstance.models.ContainerGroupProfileProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives.
    :vartype location: str
    :ivar zones: The availability zones.
    :vartype zones: list[str]
    """

    properties: Optional["_models.ContainerGroupProfileProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The container group profile properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The geo-location where the resource lives."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The availability zones."""

    __flattened_items = [
        "sku",
        "encryption_properties",
        "containers",
        "init_containers",
        "extensions",
        "image_registry_credentials",
        "restart_policy",
        "shutdown_grace_period",
        "ip_address",
        "time_to_live",
        "os_type",
        "volumes",
        "diagnostics",
        "priority",
        "confidential_compute_properties",
        "security_context",
        "revision",
        "registered_revisions",
        "use_krypton",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ContainerGroupProfileProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        location: Optional[str] = None,
        zones: 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:
        _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 ContainerGroupProfilePatch(_Model):
    """Properties of container group profile that need to be patched.

    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

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

    @overload
    def __init__(
        self,
        *,
        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 ContainerGroupProfileProperties(_Model):
    """The container group profile properties.

    :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
     "Dedicated", and "Confidential".
    :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
    :ivar encryption_properties: The encryption properties for a container group.
    :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
    :ivar containers: The containers within the container group. Required.
    :vartype containers: list[~azure.mgmt.containerinstance.models.Container]
    :ivar init_containers: The init containers for a container group.
    :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
    :ivar extensions: extensions used by virtual kubelet.
    :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
    :ivar image_registry_credentials: The image registry credentials by which the container group
     is created from.
    :vartype image_registry_credentials:
     list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
    :ivar restart_policy: Restart policy for all containers within the container group.

     * `Always` Always restart
     * `OnFailure` Restart on failure
     * `Never` Never restart. Known values are: "Always", "OnFailure", and "Never".
    :vartype restart_policy: str or
     ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
    :ivar shutdown_grace_period: Shutdown grace period for containers in a container group.
    :vartype shutdown_grace_period: ~datetime.datetime
    :ivar ip_address: The IP address type of the container group.
    :vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
    :ivar time_to_live: Post completion time to live for containers of a CG.
    :vartype time_to_live: ~datetime.datetime
    :ivar os_type: The operating system type required by the containers in the container group.
     Required. Known values are: "Windows" and "Linux".
    :vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
    :ivar volumes: The list of volumes that can be mounted by containers in this container group.
    :vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
    :ivar diagnostics: The diagnostic information for a container group.
    :vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
    :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
    :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
    :ivar confidential_compute_properties: The properties for confidential container group.
    :vartype confidential_compute_properties:
     ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
    :ivar security_context: The container security properties.
    :vartype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
    :ivar revision: Container group profile current revision number.
    :vartype revision: int
    :ivar registered_revisions: Registered revisions are calculated at request time based off the
     records in the table logs.
    :vartype registered_revisions: list[int]
    :ivar use_krypton: Gets or sets Krypton use property.
    :vartype use_krypton: bool
    """

    sku: Optional[Union[str, "_models.ContainerGroupSku"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The SKU for a container group. Known values are: \"NotSpecified\", \"Standard\", \"Dedicated\",
     and \"Confidential\"."""
    encryption_properties: Optional["_models.EncryptionProperties"] = rest_field(
        name="encryptionProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The encryption properties for a container group."""
    containers: list["_models.Container"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The containers within the container group. Required."""
    init_containers: Optional[list["_models.InitContainerDefinition"]] = rest_field(
        name="initContainers", visibility=["read", "create", "update", "delete", "query"]
    )
    """The init containers for a container group."""
    extensions: Optional[list["_models.DeploymentExtensionSpec"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """extensions used by virtual kubelet."""
    image_registry_credentials: Optional[list["_models.ImageRegistryCredential"]] = rest_field(
        name="imageRegistryCredentials", visibility=["read", "create", "update", "delete", "query"]
    )
    """The image registry credentials by which the container group is created from."""
    restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = rest_field(
        name="restartPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Restart policy for all containers within the container group.
 
      * `Always` Always restart
      * `OnFailure` Restart on failure
      * `Never` Never restart. Known values are: \"Always\", \"OnFailure\", and \"Never\"."""
    shutdown_grace_period: Optional[datetime.datetime] = rest_field(
        name="shutdownGracePeriod", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Shutdown grace period for containers in a container group."""
    ip_address: Optional["_models.IpAddress"] = rest_field(
        name="ipAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IP address type of the container group."""
    time_to_live: Optional[datetime.datetime] = rest_field(
        name="timeToLive", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Post completion time to live for containers of a CG."""
    os_type: Union[str, "_models.OperatingSystemTypes"] = rest_field(
        name="osType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The operating system type required by the containers in the container group. Required. Known
     values are: \"Windows\" and \"Linux\"."""
    volumes: Optional[list["_models.Volume"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of volumes that can be mounted by containers in this container group."""
    diagnostics: Optional["_models.ContainerGroupDiagnostics"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The diagnostic information for a container group."""
    priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The priority of the container group. Known values are: \"Regular\" and \"Spot\"."""
    confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = rest_field(
        name="confidentialComputeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties for confidential container group."""
    security_context: Optional["_models.SecurityContextDefinition"] = rest_field(
        name="securityContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """The container security properties."""
    revision: Optional[int] = rest_field(visibility=["read"])
    """Container group profile current revision number."""
    registered_revisions: Optional[list[int]] = rest_field(name="registeredRevisions", visibility=["read"])
    """Registered revisions are calculated at request time based off the records in the table logs."""
    use_krypton: Optional[bool] = rest_field(
        name="useKrypton", visibility=["read", "create", "update", "delete", "query"]
    )
    """Gets or sets Krypton use property."""

    @overload
    def __init__(
        self,
        *,
        containers: list["_models.Container"],
        os_type: Union[str, "_models.OperatingSystemTypes"],
        sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
        encryption_properties: Optional["_models.EncryptionProperties"] = None,
        init_containers: Optional[list["_models.InitContainerDefinition"]] = None,
        extensions: Optional[list["_models.DeploymentExtensionSpec"]] = None,
        image_registry_credentials: Optional[list["_models.ImageRegistryCredential"]] = None,
        restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
        shutdown_grace_period: Optional[datetime.datetime] = None,
        ip_address: Optional["_models.IpAddress"] = None,
        time_to_live: Optional[datetime.datetime] = None,
        volumes: Optional[list["_models.Volume"]] = None,
        diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
        priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
        confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
        security_context: Optional["_models.SecurityContextDefinition"] = None,
        use_krypton: 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 ContainerGroupProfileReferenceDefinition(_Model):
    """The container group profile reference.

    :ivar id: The container group profile reference id.This will be an ARM resource id in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}'.
    :vartype id: str
    :ivar revision: The container group profile reference revision.
    :vartype revision: int
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The container group profile reference id.This will be an ARM resource id in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroupProfiles/{containerGroupProfileName}'."""
    revision: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The container group profile reference revision."""

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

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

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


class ContainerGroupProfileStub(_Model):
    """The object that contains a reference to a Container Group Profile and it's other related
    properties.

    :ivar resource: A reference to the container group profile ARM resource hosted in ACI RP.
    :vartype resource: ~azure.mgmt.containerinstance.models.ApiEntityReference
    :ivar revision: The revision of the CG profile is an optional property. If customer does not to
     provide a revision then NGroups will pickup the latest revision of CGProfile.
    :vartype revision: int
    :ivar network_profile: A network profile for network settings of a ContainerGroupProfile.
    :vartype network_profile: ~azure.mgmt.containerinstance.models.NetworkProfile
    :ivar storage_profile: Storage profile for storage related settings of a container group
     profile.
    :vartype storage_profile: ~azure.mgmt.containerinstance.models.StorageProfile
    :ivar container_group_properties: Container Group properties which can be set while creating or
     updating the NGroups.
    :vartype container_group_properties:
     ~azure.mgmt.containerinstance.models.NGroupContainerGroupProperties
    """

    resource: Optional["_models.ApiEntityReference"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A reference to the container group profile ARM resource hosted in ACI RP."""
    revision: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The revision of the CG profile is an optional property. If customer does not to provide a
     revision then NGroups will pickup the latest revision of CGProfile."""
    network_profile: Optional["_models.NetworkProfile"] = rest_field(
        name="networkProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """A network profile for network settings of a ContainerGroupProfile."""
    storage_profile: Optional["_models.StorageProfile"] = rest_field(
        name="storageProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage profile for storage related settings of a container group profile."""
    container_group_properties: Optional["_models.NGroupContainerGroupProperties"] = rest_field(
        name="containerGroupProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Container Group properties which can be set while creating or updating the NGroups."""

    @overload
    def __init__(
        self,
        *,
        resource: Optional["_models.ApiEntityReference"] = None,
        revision: Optional[int] = None,
        network_profile: Optional["_models.NetworkProfile"] = None,
        storage_profile: Optional["_models.StorageProfile"] = None,
        container_group_properties: Optional["_models.NGroupContainerGroupProperties"] = 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 ContainerGroupProperties(_Model):
    """The container group properties.

    :ivar provisioning_state: The provisioning state of the container group. This only appears in
     the response.
    :vartype provisioning_state: str
    :ivar secret_references: The secret references that will be referenced within the container
     group.
    :vartype secret_references: list[~azure.mgmt.containerinstance.models.SecretReference]
    :ivar containers: The containers within the container group. Required.
    :vartype containers: list[~azure.mgmt.containerinstance.models.Container]
    :ivar image_registry_credentials: The image registry credentials by which the container group
     is created from.
    :vartype image_registry_credentials:
     list[~azure.mgmt.containerinstance.models.ImageRegistryCredential]
    :ivar restart_policy: Restart policy for all containers within the container group.

     * `Always` Always restart
     * `OnFailure` Restart on failure
     * `Never` Never restart. Known values are: "Always", "OnFailure", and "Never".
    :vartype restart_policy: str or
     ~azure.mgmt.containerinstance.models.ContainerGroupRestartPolicy
    :ivar ip_address: The IP address type of the container group.
    :vartype ip_address: ~azure.mgmt.containerinstance.models.IpAddress
    :ivar os_type: The operating system type required by the containers in the container group.
     Known values are: "Windows" and "Linux".
    :vartype os_type: str or ~azure.mgmt.containerinstance.models.OperatingSystemTypes
    :ivar volumes: The list of volumes that can be mounted by containers in this container group.
    :vartype volumes: list[~azure.mgmt.containerinstance.models.Volume]
    :ivar instance_view: The instance view of the container group. Only valid in response.
    :vartype instance_view:
     ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView
    :ivar diagnostics: The diagnostic information for a container group.
    :vartype diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
    :ivar subnet_ids: The subnet resource IDs for a container group.
    :vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
    :ivar dns_config: The DNS config information for a container group.
    :vartype dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration
    :ivar sku: The SKU for a container group. Known values are: "NotSpecified", "Standard",
     "Dedicated", and "Confidential".
    :vartype sku: str or ~azure.mgmt.containerinstance.models.ContainerGroupSku
    :ivar encryption_properties: The encryption properties for a container group.
    :vartype encryption_properties: ~azure.mgmt.containerinstance.models.EncryptionProperties
    :ivar init_containers: The init containers for a container group.
    :vartype init_containers: list[~azure.mgmt.containerinstance.models.InitContainerDefinition]
    :ivar extensions: extensions used by virtual kubelet.
    :vartype extensions: list[~azure.mgmt.containerinstance.models.DeploymentExtensionSpec]
    :ivar confidential_compute_properties: The properties for confidential container group.
    :vartype confidential_compute_properties:
     ~azure.mgmt.containerinstance.models.ConfidentialComputeProperties
    :ivar priority: The priority of the container group. Known values are: "Regular" and "Spot".
    :vartype priority: str or ~azure.mgmt.containerinstance.models.ContainerGroupPriority
    :ivar identity_acls: The access control levels of the identities.
    :vartype identity_acls: ~azure.mgmt.containerinstance.models.IdentityAcls
    :ivar container_group_profile: The reference container group profile properties.
    :vartype container_group_profile:
     ~azure.mgmt.containerinstance.models.ContainerGroupProfileReferenceDefinition
    :ivar standby_pool_profile: The reference standby pool profile properties.
    :vartype standby_pool_profile:
     ~azure.mgmt.containerinstance.models.StandbyPoolProfileDefinition
    :ivar is_created_from_standby_pool: The flag to determine whether the container group is
     created from standby pool.
    :vartype is_created_from_standby_pool: bool
    """

    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """The provisioning state of the container group. This only appears in the response."""
    secret_references: Optional[list["_models.SecretReference"]] = rest_field(
        name="secretReferences", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secret references that will be referenced within the container group."""
    containers: list["_models.Container"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The containers within the container group. Required."""
    image_registry_credentials: Optional[list["_models.ImageRegistryCredential"]] = rest_field(
        name="imageRegistryCredentials", visibility=["read", "create", "update", "delete", "query"]
    )
    """The image registry credentials by which the container group is created from."""
    restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = rest_field(
        name="restartPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Restart policy for all containers within the container group.
 
      * `Always` Always restart
      * `OnFailure` Restart on failure
      * `Never` Never restart. Known values are: \"Always\", \"OnFailure\", and \"Never\"."""
    ip_address: Optional["_models.IpAddress"] = rest_field(
        name="ipAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IP address type of the container group."""
    os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = rest_field(
        name="osType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The operating system type required by the containers in the container group. Known values are:
     \"Windows\" and \"Linux\"."""
    volumes: Optional[list["_models.Volume"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of volumes that can be mounted by containers in this container group."""
    instance_view: Optional["_models.ContainerGroupPropertiesInstanceView"] = rest_field(
        name="instanceView", visibility=["read"]
    )
    """The instance view of the container group. Only valid in response."""
    diagnostics: Optional["_models.ContainerGroupDiagnostics"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The diagnostic information for a container group."""
    subnet_ids: Optional[list["_models.ContainerGroupSubnetId"]] = rest_field(
        name="subnetIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subnet resource IDs for a container group."""
    dns_config: Optional["_models.DnsConfiguration"] = rest_field(
        name="dnsConfig", visibility=["read", "create", "update", "delete", "query"]
    )
    """The DNS config information for a container group."""
    sku: Optional[Union[str, "_models.ContainerGroupSku"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The SKU for a container group. Known values are: \"NotSpecified\", \"Standard\", \"Dedicated\",
     and \"Confidential\"."""
    encryption_properties: Optional["_models.EncryptionProperties"] = rest_field(
        name="encryptionProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The encryption properties for a container group."""
    init_containers: Optional[list["_models.InitContainerDefinition"]] = rest_field(
        name="initContainers", visibility=["read", "create", "update", "delete", "query"]
    )
    """The init containers for a container group."""
    extensions: Optional[list["_models.DeploymentExtensionSpec"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """extensions used by virtual kubelet."""
    confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = rest_field(
        name="confidentialComputeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties for confidential container group."""
    priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The priority of the container group. Known values are: \"Regular\" and \"Spot\"."""
    identity_acls: Optional["_models.IdentityAcls"] = rest_field(
        name="identityAcls", visibility=["read", "create", "update", "delete", "query"]
    )
    """The access control levels of the identities."""
    container_group_profile: Optional["_models.ContainerGroupProfileReferenceDefinition"] = rest_field(
        name="containerGroupProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference container group profile properties."""
    standby_pool_profile: Optional["_models.StandbyPoolProfileDefinition"] = rest_field(
        name="standbyPoolProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference standby pool profile properties."""
    is_created_from_standby_pool: Optional[bool] = rest_field(name="isCreatedFromStandbyPool", visibility=["read"])
    """The flag to determine whether the container group is created from standby pool."""

    @overload
    def __init__(
        self,
        *,
        containers: list["_models.Container"],
        secret_references: Optional[list["_models.SecretReference"]] = None,
        image_registry_credentials: Optional[list["_models.ImageRegistryCredential"]] = None,
        restart_policy: Optional[Union[str, "_models.ContainerGroupRestartPolicy"]] = None,
        ip_address: Optional["_models.IpAddress"] = None,
        os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None,
        volumes: Optional[list["_models.Volume"]] = None,
        diagnostics: Optional["_models.ContainerGroupDiagnostics"] = None,
        subnet_ids: Optional[list["_models.ContainerGroupSubnetId"]] = None,
        dns_config: Optional["_models.DnsConfiguration"] = None,
        sku: Optional[Union[str, "_models.ContainerGroupSku"]] = None,
        encryption_properties: Optional["_models.EncryptionProperties"] = None,
        init_containers: Optional[list["_models.InitContainerDefinition"]] = None,
        extensions: Optional[list["_models.DeploymentExtensionSpec"]] = None,
        confidential_compute_properties: Optional["_models.ConfidentialComputeProperties"] = None,
        priority: Optional[Union[str, "_models.ContainerGroupPriority"]] = None,
        identity_acls: Optional["_models.IdentityAcls"] = None,
        container_group_profile: Optional["_models.ContainerGroupProfileReferenceDefinition"] = None,
        standby_pool_profile: Optional["_models.StandbyPoolProfileDefinition"] = 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 ContainerGroupPropertiesInstanceView(_Model):
    """The instance view of the container group. Only valid in response.

    :ivar events: The events of this container group.
    :vartype events: list[~azure.mgmt.containerinstance.models.Event]
    :ivar state: The state of the container group. Only valid in response.
    :vartype state: str
    """

    events: Optional[list["_models.Event"]] = rest_field(visibility=["read"])
    """The events of this container group."""
    state: Optional[str] = rest_field(visibility=["read"])
    """The state of the container group. Only valid in response."""


class ContainerGroupSubnetId(_Model):
    """Container group subnet information.

    :ivar id: Resource ID of virtual network and subnet. Required.
    :vartype id: str
    :ivar name: Friendly name for the subnet.
    :vartype name: str
    """

    id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource ID of virtual network and subnet. Required."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Friendly name for the subnet."""

    @overload
    def __init__(
        self,
        *,
        id: str,  # pylint: disable=redefined-builtin
        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 ContainerHttpGet(_Model):
    """The container Http Get settings, for liveness or readiness probe.

    :ivar path: The path to probe.
    :vartype path: str
    :ivar port: The port number to probe. Required.
    :vartype port: int
    :ivar scheme: The scheme. Known values are: "http" and "https".
    :vartype scheme: str or ~azure.mgmt.containerinstance.models.Scheme
    :ivar http_headers: The HTTP headers.
    :vartype http_headers: list[~azure.mgmt.containerinstance.models.HttpHeader]
    """

    path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The path to probe."""
    port: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The port number to probe. Required."""
    scheme: Optional[Union[str, "_models.Scheme"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The scheme. Known values are: \"http\" and \"https\"."""
    http_headers: Optional[list["_models.HttpHeader"]] = rest_field(
        name="httpHeaders", visibility=["read", "create", "update", "delete", "query"]
    )
    """The HTTP headers."""

    @overload
    def __init__(
        self,
        *,
        port: int,
        path: Optional[str] = None,
        scheme: Optional[Union[str, "_models.Scheme"]] = None,
        http_headers: Optional[list["_models.HttpHeader"]] = 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 ContainerPort(_Model):
    """The port exposed on the container instance.

    :ivar protocol: The protocol associated with the port. Known values are: "TCP" and "UDP".
    :vartype protocol: str or ~azure.mgmt.containerinstance.models.ContainerNetworkProtocol
    :ivar port: The port number exposed within the container group. Required.
    :vartype port: int
    """

    protocol: Optional[Union[str, "_models.ContainerNetworkProtocol"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The protocol associated with the port. Known values are: \"TCP\" and \"UDP\"."""
    port: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The port number exposed within the container group. Required."""

    @overload
    def __init__(
        self,
        *,
        port: int,
        protocol: Optional[Union[str, "_models.ContainerNetworkProtocol"]] = 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 ContainerProbe(_Model):
    """The container probe, for liveness or readiness.

    :ivar exec_property: The execution command to probe.
    :vartype exec_property: ~azure.mgmt.containerinstance.models.ContainerExec
    :ivar http_get: The Http Get settings to probe.
    :vartype http_get: ~azure.mgmt.containerinstance.models.ContainerHttpGet
    :ivar initial_delay_seconds: The initial delay seconds.
    :vartype initial_delay_seconds: int
    :ivar period_seconds: The period seconds.
    :vartype period_seconds: int
    :ivar failure_threshold: The failure threshold.
    :vartype failure_threshold: int
    :ivar success_threshold: The success threshold.
    :vartype success_threshold: int
    :ivar timeout_seconds: The timeout seconds.
    :vartype timeout_seconds: int
    """

    exec_property: Optional["_models.ContainerExec"] = rest_field(
        name="exec", visibility=["read", "create", "update", "delete", "query"]
    )
    """The execution command to probe."""
    http_get: Optional["_models.ContainerHttpGet"] = rest_field(
        name="httpGet", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Http Get settings to probe."""
    initial_delay_seconds: Optional[int] = rest_field(
        name="initialDelaySeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The initial delay seconds."""
    period_seconds: Optional[int] = rest_field(
        name="periodSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The period seconds."""
    failure_threshold: Optional[int] = rest_field(
        name="failureThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """The failure threshold."""
    success_threshold: Optional[int] = rest_field(
        name="successThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """The success threshold."""
    timeout_seconds: Optional[int] = rest_field(
        name="timeoutSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The timeout seconds."""

    @overload
    def __init__(
        self,
        *,
        exec_property: Optional["_models.ContainerExec"] = None,
        http_get: Optional["_models.ContainerHttpGet"] = None,
        initial_delay_seconds: Optional[int] = None,
        period_seconds: Optional[int] = None,
        failure_threshold: Optional[int] = None,
        success_threshold: Optional[int] = None,
        timeout_seconds: Optional[int] = None,
    ) -> None: ...

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

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


class ContainerProperties(_Model):
    """The container instance properties.

    :ivar image: The name of the image used to create the container instance.
    :vartype image: str
    :ivar command: The commands to execute within the container instance in exec form.
    :vartype command: list[str]
    :ivar ports: The exposed ports on the container instance.
    :vartype ports: list[~azure.mgmt.containerinstance.models.ContainerPort]
    :ivar environment_variables: The environment variables to set in the container instance.
    :vartype environment_variables: list[~azure.mgmt.containerinstance.models.EnvironmentVariable]
    :ivar instance_view: The instance view of the container instance. Only valid in response.
    :vartype instance_view: ~azure.mgmt.containerinstance.models.ContainerPropertiesInstanceView
    :ivar resources: The resource requirements of the container instance.
    :vartype resources: ~azure.mgmt.containerinstance.models.ResourceRequirements
    :ivar volume_mounts: The volume mounts available to the container instance.
    :vartype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
    :ivar liveness_probe: The liveness probe.
    :vartype liveness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
    :ivar readiness_probe: The readiness probe.
    :vartype readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
    :ivar security_context: The container security properties.
    :vartype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
    :ivar config_map: The config map.
    :vartype config_map: ~azure.mgmt.containerinstance.models.ConfigMap
    """

    image: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the image used to create the container instance."""
    command: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The commands to execute within the container instance in exec form."""
    ports: Optional[list["_models.ContainerPort"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The exposed ports on the container instance."""
    environment_variables: Optional[list["_models.EnvironmentVariable"]] = rest_field(
        name="environmentVariables", visibility=["read", "create", "update", "delete", "query"]
    )
    """The environment variables to set in the container instance."""
    instance_view: Optional["_models.ContainerPropertiesInstanceView"] = rest_field(
        name="instanceView", visibility=["read"]
    )
    """The instance view of the container instance. Only valid in response."""
    resources: Optional["_models.ResourceRequirements"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource requirements of the container instance."""
    volume_mounts: Optional[list["_models.VolumeMount"]] = rest_field(
        name="volumeMounts", visibility=["read", "create", "update", "delete", "query"]
    )
    """The volume mounts available to the container instance."""
    liveness_probe: Optional["_models.ContainerProbe"] = rest_field(
        name="livenessProbe", visibility=["read", "create", "update", "delete", "query"]
    )
    """The liveness probe."""
    readiness_probe: Optional["_models.ContainerProbe"] = rest_field(
        name="readinessProbe", visibility=["read", "create", "update", "delete", "query"]
    )
    """The readiness probe."""
    security_context: Optional["_models.SecurityContextDefinition"] = rest_field(
        name="securityContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """The container security properties."""
    config_map: Optional["_models.ConfigMap"] = rest_field(
        name="configMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """The config map."""

    @overload
    def __init__(
        self,
        *,
        image: Optional[str] = None,
        command: Optional[list[str]] = None,
        ports: Optional[list["_models.ContainerPort"]] = None,
        environment_variables: Optional[list["_models.EnvironmentVariable"]] = None,
        resources: Optional["_models.ResourceRequirements"] = None,
        volume_mounts: Optional[list["_models.VolumeMount"]] = None,
        liveness_probe: Optional["_models.ContainerProbe"] = None,
        readiness_probe: Optional["_models.ContainerProbe"] = None,
        security_context: Optional["_models.SecurityContextDefinition"] = None,
        config_map: Optional["_models.ConfigMap"] = 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 ContainerPropertiesInstanceView(_Model):
    """The instance view of the container instance. Only valid in response.

    :ivar restart_count: The number of times that the container instance has been restarted.
    :vartype restart_count: int
    :ivar current_state: Current container instance state.
    :vartype current_state: ~azure.mgmt.containerinstance.models.ContainerState
    :ivar previous_state: Previous container instance state.
    :vartype previous_state: ~azure.mgmt.containerinstance.models.ContainerState
    :ivar events: The events of the container instance.
    :vartype events: list[~azure.mgmt.containerinstance.models.Event]
    """

    restart_count: Optional[int] = rest_field(name="restartCount", visibility=["read"])
    """The number of times that the container instance has been restarted."""
    current_state: Optional["_models.ContainerState"] = rest_field(name="currentState", visibility=["read"])
    """Current container instance state."""
    previous_state: Optional["_models.ContainerState"] = rest_field(name="previousState", visibility=["read"])
    """Previous container instance state."""
    events: Optional[list["_models.Event"]] = rest_field(visibility=["read"])
    """The events of the container instance."""


class ContainerState(_Model):
    """The container instance state.

    :ivar state: The state of the container instance.
    :vartype state: str
    :ivar start_time: The date-time when the container instance state started.
    :vartype start_time: ~datetime.datetime
    :ivar exit_code: The container instance exit codes correspond to those from the ``docker run``
     command.
    :vartype exit_code: int
    :ivar finish_time: The date-time when the container instance state finished.
    :vartype finish_time: ~datetime.datetime
    :ivar detail_status: The human-readable status of the container instance state.
    :vartype detail_status: str
    """

    state: Optional[str] = rest_field(visibility=["read"])
    """The state of the container instance."""
    start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339")
    """The date-time when the container instance state started."""
    exit_code: Optional[int] = rest_field(name="exitCode", visibility=["read"])
    """The container instance exit codes correspond to those from the ``docker run`` command."""
    finish_time: Optional[datetime.datetime] = rest_field(name="finishTime", visibility=["read"], format="rfc3339")
    """The date-time when the container instance state finished."""
    detail_status: Optional[str] = rest_field(name="detailStatus", visibility=["read"])
    """The human-readable status of the container instance state."""


class DeploymentExtensionSpec(_Model):
    """Extension sidecars to be added to the deployment.

    :ivar name: Name of the extension. Required.
    :vartype name: str
    :ivar properties: Extension specific properties.
    :vartype properties: ~azure.mgmt.containerinstance.models.DeploymentExtensionSpecProperties
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the extension. Required."""
    properties: Optional["_models.DeploymentExtensionSpecProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Extension specific properties."""

    __flattened_items = ["extension_type", "version", "settings", "protected_settings"]

    @overload
    def __init__(
        self,
        *,
        name: str,
        properties: Optional["_models.DeploymentExtensionSpecProperties"] = 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 DeploymentExtensionSpecProperties(_Model):
    """Extension specific properties.

    :ivar extension_type: Type of extension to be added. Required.
    :vartype extension_type: str
    :ivar version: Version of the extension being used. Required.
    :vartype version: str
    :ivar settings: Settings for the extension.
    :vartype settings: any
    :ivar protected_settings: Protected settings for the extension.
    :vartype protected_settings: any
    """

    extension_type: str = rest_field(name="extensionType", visibility=["read", "create", "update", "delete", "query"])
    """Type of extension to be added. Required."""
    version: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Version of the extension being used. Required."""
    settings: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Settings for the extension."""
    protected_settings: Optional[Any] = rest_field(
        name="protectedSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protected settings for the extension."""

    @overload
    def __init__(
        self,
        *,
        extension_type: str,
        version: str,
        settings: Optional[Any] = None,
        protected_settings: Optional[Any] = 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 DnsConfiguration(_Model):
    """DNS configuration for the container group.

    :ivar name_servers: The DNS servers for the container group. Required.
    :vartype name_servers: list[str]
    :ivar search_domains: The DNS search domains for hostname lookup in the container group.
    :vartype search_domains: str
    :ivar options: The DNS options for the container group.
    :vartype options: str
    """

    name_servers: list[str] = rest_field(name="nameServers", visibility=["read", "create", "update", "delete", "query"])
    """The DNS servers for the container group. Required."""
    search_domains: Optional[str] = rest_field(
        name="searchDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """The DNS search domains for hostname lookup in the container group."""
    options: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The DNS options for the container group."""

    @overload
    def __init__(
        self,
        *,
        name_servers: list[str],
        search_domains: Optional[str] = None,
        options: 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 ElasticProfile(_Model):
    """Describes the elastic profile of the NGroup.

    :ivar desired_count:
    :vartype desired_count: int
    :ivar maintain_desired_count: Flag that indicates whether desiredCount should be maintained
     when customer deletes SPECIFIC container groups (CGs) from the NGroups. In this case, new CGs
     will be created by NGroup to compensate for the specific deleted ones.
    :vartype maintain_desired_count: bool
    :ivar container_group_naming_policy: Container Groups are named on a generic guid based naming
     scheme/policy. Customer can modify naming policy to add prefix to CG names during scale out
     operation.
    :vartype container_group_naming_policy:
     ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicy
    """

    desired_count: Optional[int] = rest_field(
        name="desiredCount", visibility=["read", "create", "update", "delete", "query"]
    )
    maintain_desired_count: Optional[bool] = rest_field(
        name="maintainDesiredCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag that indicates whether desiredCount should be maintained when customer deletes SPECIFIC
     container groups (CGs) from the NGroups. In this case, new CGs will be created by NGroup to
     compensate for the specific deleted ones."""
    container_group_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicy"] = rest_field(
        name="containerGroupNamingPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Container Groups are named on a generic guid based naming scheme/policy. Customer can modify
     naming policy to add prefix to CG names during scale out operation."""

    @overload
    def __init__(
        self,
        *,
        desired_count: Optional[int] = None,
        maintain_desired_count: Optional[bool] = None,
        container_group_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicy"] = 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 ElasticProfileContainerGroupNamingPolicy(_Model):
    """Container Groups are named on a generic guid based naming scheme/policy. Customer can modify
    naming policy to add prefix to CG names during scale out operation.

    :ivar guid_naming_policy:
    :vartype guid_naming_policy:
     ~azure.mgmt.containerinstance.models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy
    """

    guid_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy"] = rest_field(
        name="guidNamingPolicy", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        guid_naming_policy: Optional["_models.ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy"] = 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 ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy(_Model):  # pylint: disable=name-too-long
    """ElasticProfileContainerGroupNamingPolicyGuidNamingPolicy.

    :ivar prefix: The prefix can be used when there are tooling limitations (e.g. on the Azure
     portal where CGs from multiple NGroups exist in the same RG). The prefix with the suffixed
     resource name must still follow Azure resource naming guidelines.
    :vartype prefix: str
    """

    prefix: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The prefix can be used when there are tooling limitations (e.g. on the Azure portal where CGs
     from multiple NGroups exist in the same RG). The prefix with the suffixed resource name must
     still follow Azure resource naming guidelines."""

    @overload
    def __init__(
        self,
        *,
        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 EncryptionProperties(_Model):
    """The container group encryption properties.

    :ivar vault_base_url: The keyvault base url. Required.
    :vartype vault_base_url: str
    :ivar key_name: The encryption key name. Required.
    :vartype key_name: str
    :ivar key_version: The encryption key version. Required.
    :vartype key_version: str
    :ivar identity: The keyvault managed identity.
    :vartype identity: str
    """

    vault_base_url: str = rest_field(name="vaultBaseUrl", visibility=["read", "create", "update", "delete", "query"])
    """The keyvault base url. Required."""
    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """The encryption key name. Required."""
    key_version: str = rest_field(name="keyVersion", visibility=["read", "create", "update", "delete", "query"])
    """The encryption key version. Required."""
    identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The keyvault managed identity."""

    @overload
    def __init__(
        self,
        *,
        vault_base_url: str,
        key_name: str,
        key_version: str,
        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 EnvironmentVariable(_Model):
    """The environment variable to set within the container instance.

    :ivar name: The name of the environment variable. Required.
    :vartype name: str
    :ivar value: The value of the environment variable.
    :vartype value: str
    :ivar secure_value: The value of the secure environment variable.
    :vartype secure_value: str
    :ivar secure_value_reference: The reference of the secure environment variable.
    :vartype secure_value_reference: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the environment variable. Required."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The value of the environment variable."""
    secure_value: Optional[str] = rest_field(
        name="secureValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value of the secure environment variable."""
    secure_value_reference: Optional[str] = rest_field(
        name="secureValueReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference of the secure environment variable."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        value: Optional[str] = None,
        secure_value: Optional[str] = None,
        secure_value_reference: 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 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.containerinstance.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.containerinstance.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.containerinstance.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 Event(_Model):
    """A container group or container instance event.

    :ivar count: The count of the event.
    :vartype count: int
    :ivar first_timestamp: The date-time of the earliest logged event.
    :vartype first_timestamp: ~datetime.datetime
    :ivar last_timestamp: The date-time of the latest logged event.
    :vartype last_timestamp: ~datetime.datetime
    :ivar name: The event name.
    :vartype name: str
    :ivar message: The event message.
    :vartype message: str
    :ivar type: The event type.
    :vartype type: str
    """

    count: Optional[int] = rest_field(visibility=["read"])
    """The count of the event."""
    first_timestamp: Optional[datetime.datetime] = rest_field(
        name="firstTimestamp", visibility=["read"], format="rfc3339"
    )
    """The date-time of the earliest logged event."""
    last_timestamp: Optional[datetime.datetime] = rest_field(
        name="lastTimestamp", visibility=["read"], format="rfc3339"
    )
    """The date-time of the latest logged event."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The event name."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The event message."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The event type."""


class FileShare(_Model):
    """File shares that can be mounted on container groups.

    :ivar name:
    :vartype name: str
    :ivar resource_group_name:
    :vartype resource_group_name: str
    :ivar storage_account_name:
    :vartype storage_account_name: str
    :ivar properties:
    :vartype properties: ~azure.mgmt.containerinstance.models.FileShareProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    resource_group_name: Optional[str] = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    storage_account_name: Optional[str] = rest_field(
        name="storageAccountName", visibility=["read", "create", "update", "delete", "query"]
    )
    properties: Optional["_models.FileShareProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

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

    :ivar share_access_type: Specifies how Container Groups can access the Azure file share i.e.
     all CG will share same Azure file share or going to have exclusive file share. Known values
     are: "Shared" and "Exclusive".
    :vartype share_access_type: str or
     ~azure.mgmt.containerinstance.models.AzureFileShareAccessType
    :ivar share_access_tier: Access tier for specific share. GpV2 account can choose between
     TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Learn
     more at:
     `https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier
     <https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier>`_.
     Known values are: "Cool", "Hot", "Premium", and "TransactionOptimized".
    :vartype share_access_tier: str or
     ~azure.mgmt.containerinstance.models.AzureFileShareAccessTier
    """

    share_access_type: Optional[Union[str, "_models.AzureFileShareAccessType"]] = rest_field(
        name="shareAccessType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies how Container Groups can access the Azure file share i.e. all CG will share same
     Azure file share or going to have exclusive file share. Known values are: \"Shared\" and
     \"Exclusive\"."""
    share_access_tier: Optional[Union[str, "_models.AzureFileShareAccessTier"]] = rest_field(
        name="shareAccessTier", visibility=["read", "create", "update", "delete", "query"]
    )
    """Access tier for specific share. GpV2 account can choose between TransactionOptimized (default),
     Hot, and Cool. FileStorage account can choose Premium. Learn more at:
     `https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier
     <https://learn.microsoft.com/en-us/rest/api/storagerp/file-shares/create?tabs=HTTP#shareaccesstier>`_.
     Known values are: \"Cool\", \"Hot\", \"Premium\", and \"TransactionOptimized\"."""

    @overload
    def __init__(
        self,
        *,
        share_access_type: Optional[Union[str, "_models.AzureFileShareAccessType"]] = None,
        share_access_tier: Optional[Union[str, "_models.AzureFileShareAccessTier"]] = 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 GitRepoVolume(_Model):
    """Represents a volume that is populated with the contents of a git repository.

    :ivar directory: Target directory name. Must not contain or start with '..'.  If '.' is
     supplied, the volume directory will be the git repository.  Otherwise, if specified, the volume
     will contain the git repository in the subdirectory with the given name.
    :vartype directory: str
    :ivar repository: Repository URL. Required.
    :vartype repository: str
    :ivar revision: Commit hash for the specified revision.
    :vartype revision: str
    """

    directory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Target directory name. Must not contain or start with '..'.  If '.' is supplied, the volume
     directory will be the git repository.  Otherwise, if specified, the volume will contain the git
     repository in the subdirectory with the given name."""
    repository: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Repository URL. Required."""
    revision: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Commit hash for the specified revision."""

    @overload
    def __init__(
        self,
        *,
        repository: str,
        directory: Optional[str] = None,
        revision: 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 GpuResource(_Model):
    """The GPU resource.

    :ivar count: The count of the GPU resource. Required.
    :vartype count: int
    :ivar sku: The SKU of the GPU resource. Required. Known values are: "K80", "P100", and "V100".
    :vartype sku: str or ~azure.mgmt.containerinstance.models.GpuSku
    """

    count: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The count of the GPU resource. Required."""
    sku: Union[str, "_models.GpuSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the GPU resource. Required. Known values are: \"K80\", \"P100\", and \"V100\"."""

    @overload
    def __init__(
        self,
        *,
        count: int,
        sku: Union[str, "_models.GpuSku"],
    ) -> 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 HttpHeader(_Model):
    """The HTTP header.

    :ivar name: The header name.
    :vartype name: str
    :ivar value: The header value.
    :vartype value: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The header name."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The header value."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = 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 IdentityAccessControl(_Model):
    """The access control for an identity.

    :ivar access: The access level of the identity. Known values are: "All", "System", and "User".
    :vartype access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
    :ivar identity: An identity.
    :vartype identity: str
    """

    access: Optional[Union[str, "_models.IdentityAccessLevel"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The access level of the identity. Known values are: \"All\", \"System\", and \"User\"."""
    identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """An identity."""

    @overload
    def __init__(
        self,
        *,
        access: Optional[Union[str, "_models.IdentityAccessLevel"]] = 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 IdentityAcls(_Model):
    """The access control levels of the identities.

    :ivar default_access: The default access level. Known values are: "All", "System", and "User".
    :vartype default_access: str or ~azure.mgmt.containerinstance.models.IdentityAccessLevel
    :ivar acls: The access control levels for each identity.
    :vartype acls: list[~azure.mgmt.containerinstance.models.IdentityAccessControl]
    """

    default_access: Optional[Union[str, "_models.IdentityAccessLevel"]] = rest_field(
        name="defaultAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """The default access level. Known values are: \"All\", \"System\", and \"User\"."""
    acls: Optional[list["_models.IdentityAccessControl"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The access control levels for each identity."""

    @overload
    def __init__(
        self,
        *,
        default_access: Optional[Union[str, "_models.IdentityAccessLevel"]] = None,
        acls: Optional[list["_models.IdentityAccessControl"]] = 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 ImageRegistryCredential(_Model):
    """Image registry credential.

    :ivar server: The Docker image registry server without a protocol such as "http" and "https".
     Required.
    :vartype server: str
    :ivar username: The username for the private registry.
    :vartype username: str
    :ivar password: The password for the private registry.
    :vartype password: str
    :ivar password_reference: The reference for the private registry password.
    :vartype password_reference: str
    :ivar identity: The identity for the private registry.
    :vartype identity: str
    :ivar identity_url: The identity URL for the private registry.
    :vartype identity_url: str
    """

    server: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Docker image registry server without a protocol such as \"http\" and \"https\". Required."""
    username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The username for the private registry."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The password for the private registry."""
    password_reference: Optional[str] = rest_field(
        name="passwordReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference for the private registry password."""
    identity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The identity for the private registry."""
    identity_url: Optional[str] = rest_field(
        name="identityUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity URL for the private registry."""

    @overload
    def __init__(
        self,
        *,
        server: str,
        username: Optional[str] = None,
        password: Optional[str] = None,
        password_reference: Optional[str] = None,
        identity: Optional[str] = None,
        identity_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 InitContainerDefinition(_Model):
    """The init container definition.

    :ivar name: The name for the init container. Required.
    :vartype name: str
    :ivar properties: The properties for the init container. Required.
    :vartype properties: ~azure.mgmt.containerinstance.models.InitContainerPropertiesDefinition
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name for the init container. Required."""
    properties: "_models.InitContainerPropertiesDefinition" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties for the init container. Required."""

    __flattened_items = [
        "image",
        "command",
        "environment_variables",
        "instance_view",
        "volume_mounts",
        "security_context",
    ]

    @overload
    def __init__(
        self,
        *,
        name: str,
        properties: "_models.InitContainerPropertiesDefinition",
    ) -> 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 InitContainerPropertiesDefinition(_Model):
    """The init container definition properties.

    :ivar image: The image of the init container.
    :vartype image: str
    :ivar command: The command to execute within the init container in exec form.
    :vartype command: list[str]
    :ivar environment_variables: The environment variables to set in the init container.
    :vartype environment_variables: list[~azure.mgmt.containerinstance.models.EnvironmentVariable]
    :ivar instance_view: The instance view of the init container. Only valid in response.
    :vartype instance_view:
     ~azure.mgmt.containerinstance.models.InitContainerPropertiesDefinitionInstanceView
    :ivar volume_mounts: The volume mounts available to the init container.
    :vartype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
    :ivar security_context: The container security properties.
    :vartype security_context: ~azure.mgmt.containerinstance.models.SecurityContextDefinition
    """

    image: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The image of the init container."""
    command: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The command to execute within the init container in exec form."""
    environment_variables: Optional[list["_models.EnvironmentVariable"]] = rest_field(
        name="environmentVariables", visibility=["read", "create", "update", "delete", "query"]
    )
    """The environment variables to set in the init container."""
    instance_view: Optional["_models.InitContainerPropertiesDefinitionInstanceView"] = rest_field(
        name="instanceView", visibility=["read"]
    )
    """The instance view of the init container. Only valid in response."""
    volume_mounts: Optional[list["_models.VolumeMount"]] = rest_field(
        name="volumeMounts", visibility=["read", "create", "update", "delete", "query"]
    )
    """The volume mounts available to the init container."""
    security_context: Optional["_models.SecurityContextDefinition"] = rest_field(
        name="securityContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """The container security properties."""

    @overload
    def __init__(
        self,
        *,
        image: Optional[str] = None,
        command: Optional[list[str]] = None,
        environment_variables: Optional[list["_models.EnvironmentVariable"]] = None,
        volume_mounts: Optional[list["_models.VolumeMount"]] = None,
        security_context: Optional["_models.SecurityContextDefinition"] = 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 InitContainerPropertiesDefinitionInstanceView(_Model):  # pylint: disable=name-too-long
    """The instance view of the init container. Only valid in response.

    :ivar restart_count: The number of times that the init container has been restarted.
    :vartype restart_count: int
    :ivar current_state: The current state of the init container.
    :vartype current_state: ~azure.mgmt.containerinstance.models.ContainerState
    :ivar previous_state: The previous state of the init container.
    :vartype previous_state: ~azure.mgmt.containerinstance.models.ContainerState
    :ivar events: The events of the init container.
    :vartype events: list[~azure.mgmt.containerinstance.models.Event]
    """

    restart_count: Optional[int] = rest_field(name="restartCount", visibility=["read"])
    """The number of times that the init container has been restarted."""
    current_state: Optional["_models.ContainerState"] = rest_field(name="currentState", visibility=["read"])
    """The current state of the init container."""
    previous_state: Optional["_models.ContainerState"] = rest_field(name="previousState", visibility=["read"])
    """The previous state of the init container."""
    events: Optional[list["_models.Event"]] = rest_field(visibility=["read"])
    """The events of the init container."""


class IpAddress(_Model):
    """IP address for the container group.

    :ivar ports: The list of ports exposed on the container group. Required.
    :vartype ports: list[~azure.mgmt.containerinstance.models.Port]
    :ivar type: Specifies if the IP is exposed to the public internet or private VNET. Required.
     Known values are: "Public" and "Private".
    :vartype type: str or ~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
    :ivar ip: The IP exposed to the public internet.
    :vartype ip: str
    :ivar dns_name_label: The Dns name label for the IP.
    :vartype dns_name_label: str
    :ivar auto_generated_domain_name_label_scope: The value representing the security enum. The
     'Unsecure' value is the default value if not selected and means the object's domain name label
     is not secured against subdomain takeover. The 'TenantReuse' value is the default value if
     selected and means the object's domain name label can be reused within the same tenant. The
     'SubscriptionReuse' value means the object's domain name label can be reused within the same
     subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused
     within the same resource group. The 'NoReuse' value means the object's domain name label cannot
     be reused within the same resource group, subscription, or tenant. Known values are:
     "Unsecure", "TenantReuse", "SubscriptionReuse", "ResourceGroupReuse", and "Noreuse".
    :vartype auto_generated_domain_name_label_scope: str or
     ~azure.mgmt.containerinstance.models.DnsNameLabelReusePolicy
    :ivar fqdn: The FQDN for the IP.
    :vartype fqdn: str
    """

    ports: list["_models.Port"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of ports exposed on the container group. Required."""
    type: Union[str, "_models.ContainerGroupIpAddressType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies if the IP is exposed to the public internet or private VNET. Required. Known values
     are: \"Public\" and \"Private\"."""
    ip: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The IP exposed to the public internet."""
    dns_name_label: Optional[str] = rest_field(
        name="dnsNameLabel", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Dns name label for the IP."""
    auto_generated_domain_name_label_scope: Optional[Union[str, "_models.DnsNameLabelReusePolicy"]] = rest_field(
        name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value representing the security enum. The 'Unsecure' value is the default value if not
     selected and means the object's domain name label is not secured against subdomain takeover.
     The 'TenantReuse' value is the default value if selected and means the object's domain name
     label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's
     domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value
     means the object's domain name label can be reused within the same resource group. The
     'NoReuse' value means the object's domain name label cannot be reused within the same resource
     group, subscription, or tenant. Known values are: \"Unsecure\", \"TenantReuse\",
     \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"Noreuse\"."""
    fqdn: Optional[str] = rest_field(visibility=["read"])
    """The FQDN for the IP."""

    @overload
    def __init__(
        self,
        *,
        ports: list["_models.Port"],
        type: Union[str, "_models.ContainerGroupIpAddressType"],
        ip: Optional[str] = None,
        dns_name_label: Optional[str] = None,
        auto_generated_domain_name_label_scope: Optional[Union[str, "_models.DnsNameLabelReusePolicy"]] = 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 LoadBalancer(_Model):
    """LoadBalancer the CG profile will use to interact with CGs in a backend pool.

    :ivar backend_address_pools: List of Load Balancer Backend Address Pools.
    :vartype backend_address_pools:
     list[~azure.mgmt.containerinstance.models.LoadBalancerBackendAddressPool]
    """

    backend_address_pools: Optional[list["_models.LoadBalancerBackendAddressPool"]] = rest_field(
        name="backendAddressPools", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Load Balancer Backend Address Pools."""

    @overload
    def __init__(
        self,
        *,
        backend_address_pools: Optional[list["_models.LoadBalancerBackendAddressPool"]] = 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 LoadBalancerBackendAddressPool(_Model):
    """NGroups load balancer backend address pool.

    :ivar resource: The Load Balancer backend address pool ARM resource Id.
    :vartype resource: str
    """

    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Load Balancer backend address pool ARM resource Id."""

    @overload
    def __init__(
        self,
        *,
        resource: 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 LogAnalytics(_Model):
    """Container group log analytics information.

    :ivar workspace_id: The workspace id for log analytics. Required.
    :vartype workspace_id: str
    :ivar workspace_key: The workspace key for log analytics. Required.
    :vartype workspace_key: str
    :ivar log_type: The log type to be used. Known values are: "ContainerInsights" and
     "ContainerInstanceLogs".
    :vartype log_type: str or ~azure.mgmt.containerinstance.models.LogAnalyticsLogType
    :ivar metadata: Metadata for log analytics.
    :vartype metadata: dict[str, str]
    :ivar workspace_resource_id: The workspace resource id for log analytics.
    :vartype workspace_resource_id: str
    """

    workspace_id: str = rest_field(name="workspaceId", visibility=["read", "create", "update", "delete", "query"])
    """The workspace id for log analytics. Required."""
    workspace_key: str = rest_field(name="workspaceKey", visibility=["read", "create", "update", "delete", "query"])
    """The workspace key for log analytics. Required."""
    log_type: Optional[Union[str, "_models.LogAnalyticsLogType"]] = rest_field(
        name="logType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The log type to be used. Known values are: \"ContainerInsights\" and \"ContainerInstanceLogs\"."""
    metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Metadata for log analytics."""
    workspace_resource_id: Optional[str] = rest_field(
        name="workspaceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The workspace resource id for log analytics."""

    @overload
    def __init__(
        self,
        *,
        workspace_id: str,
        workspace_key: str,
        log_type: Optional[Union[str, "_models.LogAnalyticsLogType"]] = None,
        metadata: Optional[dict[str, str]] = None,
        workspace_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 Logs(_Model):
    """The logs.

    :ivar content: The content of the log.
    :vartype content: str
    """

    content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The content of the log."""

    @overload
    def __init__(
        self,
        *,
        content: 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 ManagedServiceIdentity(_Model):
    """Managed service identity (system assigned and/or user assigned identities).

    :ivar principal_id: The service principal ID of the system assigned identity. This property
     will only be provided for a system assigned identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be
     provided for a system assigned identity.
    :vartype tenant_id: str
    :ivar type: The type of managed identity assigned to this resource. Required. Known values are:
     "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned".
    :vartype type: str or ~azure.mgmt.containerinstance.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.containerinstance.models.UserAssignedIdentity]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The service principal ID of the system assigned identity. This property will only be provided
     for a system assigned identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant ID of the system assigned identity. This property will only be provided for a system
     assigned identity."""
    type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity assigned to this resource. Required. Known values are: \"None\",
     \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identities assigned to this resource by the user."""

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.ManagedServiceIdentityType"],
        user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = 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 NetworkProfile(_Model):
    """A network profile for network settings of a ContainerGroupProfile. Used to manage load balancer
    and application gateway backend pools, specifically updating the IP addresses of CGs within the
    backend pool.

    :ivar load_balancer: LoadBalancer the CG profile will use to interact with CGs in a backend
     pool.
    :vartype load_balancer: ~azure.mgmt.containerinstance.models.LoadBalancer
    :ivar application_gateway: Application Gateway the CG profile will use to interact with CGs in
     a backend pool.
    :vartype application_gateway: ~azure.mgmt.containerinstance.models.ApplicationGateway
    """

    load_balancer: Optional["_models.LoadBalancer"] = rest_field(
        name="loadBalancer", visibility=["read", "create", "update", "delete", "query"]
    )
    """LoadBalancer the CG profile will use to interact with CGs in a backend pool."""
    application_gateway: Optional["_models.ApplicationGateway"] = rest_field(
        name="applicationGateway", visibility=["read", "create", "update", "delete", "query"]
    )
    """Application Gateway the CG profile will use to interact with CGs in a backend pool."""

    @overload
    def __init__(
        self,
        *,
        load_balancer: Optional["_models.LoadBalancer"] = None,
        application_gateway: Optional["_models.ApplicationGateway"] = 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 NGroup(ProxyResource):
    """Describes the NGroups resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
    :ivar properties: Describes the properties of the NGroups resource.
    :vartype properties: ~azure.mgmt.containerinstance.models.NGroupProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives.
    :vartype location: str
    :ivar zones: The availability zones.
    :vartype zones: list[str]
    :ivar identity: The identity of the NGroup, if configured.
    :vartype identity: ~azure.mgmt.containerinstance.models.NGroupIdentity
    """

    properties: Optional["_models.NGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the properties of the NGroups resource."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The geo-location where the resource lives."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The availability zones."""
    identity: Optional["_models.NGroupIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the NGroup, if configured."""

    __flattened_items = [
        "elastic_profile",
        "placement_profile",
        "container_group_profiles",
        "provisioning_state",
        "update_profile",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NGroupProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        location: Optional[str] = None,
        zones: Optional[list[str]] = None,
        identity: Optional["_models.NGroupIdentity"] = 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 NGroupCGPropertyContainer(_Model):
    """Container properties that can be provided with NGroups object.

    :ivar name: container name.
    :vartype name: str
    :ivar properties: container properties.
    :vartype properties: ~azure.mgmt.containerinstance.models.NGroupCGPropertyContainerProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """container name."""
    properties: Optional["_models.NGroupCGPropertyContainerProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """container properties."""

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

    :ivar volume_mounts:
    :vartype volume_mounts: list[~azure.mgmt.containerinstance.models.VolumeMount]
    """

    volume_mounts: Optional[list["_models.VolumeMount"]] = rest_field(
        name="volumeMounts", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        volume_mounts: Optional[list["_models.VolumeMount"]] = 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 NGroupCGPropertyVolume(_Model):
    """Contains information about the volumes that can be mounted by Containers in the Container
    Groups.

    :ivar name: The name of the volume. Required.
    :vartype name: str
    :ivar azure_file: The Azure File volume.
    :vartype azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the volume. Required."""
    azure_file: Optional["_models.AzureFileVolume"] = rest_field(
        name="azureFile", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure File volume."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        azure_file: Optional["_models.AzureFileVolume"] = 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 NGroupContainerGroupProperties(_Model):
    """Container Group properties which can be set while creating or updating the NGroups.

    :ivar subnet_ids: Contains information about Virtual Network Subnet ARM Resource.
    :vartype subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId]
    :ivar volumes: Contains information about the volumes that can be mounted by Containers in the
     Container Groups.
    :vartype volumes: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyVolume]
    :ivar containers: Contains information about Container which can be set while creating or
     updating the NGroups.
    :vartype containers: list[~azure.mgmt.containerinstance.models.NGroupCGPropertyContainer]
    """

    subnet_ids: Optional[list["_models.ContainerGroupSubnetId"]] = rest_field(
        name="subnetIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Contains information about Virtual Network Subnet ARM Resource."""
    volumes: Optional[list["_models.NGroupCGPropertyVolume"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Contains information about the volumes that can be mounted by Containers in the Container
     Groups."""
    containers: Optional[list["_models.NGroupCGPropertyContainer"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Contains information about Container which can be set while creating or updating the NGroups."""

    @overload
    def __init__(
        self,
        *,
        subnet_ids: Optional[list["_models.ContainerGroupSubnetId"]] = None,
        volumes: Optional[list["_models.NGroupCGPropertyVolume"]] = None,
        containers: Optional[list["_models.NGroupCGPropertyContainer"]] = 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 NGroupIdentity(_Model):
    """Identity for the NGroup.

    :ivar principal_id: The principal id of the NGroup identity. This property will only be
     provided for a system assigned identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant id associated with the NGroup. This property will only be provided
     for a system assigned identity.
    :vartype tenant_id: str
    :ivar type: The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned'
     includes both an implicitly created identity and a set of user assigned identities. The type
     'None' will remove any identities from the NGroup. Known values are: "SystemAssigned",
     "UserAssigned", "SystemAssigned, UserAssigned", and "None".
    :vartype type: str or ~azure.mgmt.containerinstance.models.ResourceIdentityType
    :ivar user_assigned_identities: The list of user identities associated with the NGroup.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.containerinstance.models.UserAssignedIdentities]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal id of the NGroup identity. This property will only be provided for a system
     assigned identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant id associated with the NGroup. This property will only be provided for a system
     assigned identity."""
    type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity used for the NGroup. The type 'SystemAssigned, UserAssigned' includes both
     an implicitly created identity and a set of user assigned identities. The type 'None' will
     remove any identities from the NGroup. Known values are: \"SystemAssigned\", \"UserAssigned\",
     \"SystemAssigned, UserAssigned\", and \"None\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentities"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of user identities associated with the NGroup."""

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

    :ivar system_data: Metadata pertaining to creation and last modification of the resource.
    :vartype system_data: ~azure.mgmt.containerinstance.models.SystemData
    :ivar properties: Describes the properties of the NGroups resource.
    :vartype properties: ~azure.mgmt.containerinstance.models.NGroupProperties
    :ivar identity: The identity of the NGroup, if configured.
    :vartype identity: ~azure.mgmt.containerinstance.models.NGroupIdentity
    :ivar tags: The resource tags.
    :vartype tags: dict[str, str]
    :ivar zones: The zones for the NGroup.
    :vartype zones: list[str]
    """

    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Metadata pertaining to creation and last modification of the resource."""
    properties: Optional["_models.NGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the properties of the NGroups resource."""
    identity: Optional["_models.NGroupIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the NGroup, if configured."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource tags."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The zones for the NGroup."""

    __flattened_items = [
        "elastic_profile",
        "placement_profile",
        "container_group_profiles",
        "provisioning_state",
        "update_profile",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NGroupProperties"] = None,
        identity: Optional["_models.NGroupIdentity"] = None,
        tags: Optional[dict[str, str]] = None,
        zones: 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:
        _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 NGroupProperties(_Model):
    """Describes the properties of the NGroups resource.

    :ivar elastic_profile: The elastic profile.
    :vartype elastic_profile: ~azure.mgmt.containerinstance.models.ElasticProfile
    :ivar placement_profile: Provides options w.r.t allocation and management w.r.t certain
     placement policies. These utilize capabilities provided by the underlying Azure infrastructure.
     They are typically used for high availability scenarios. E.g., distributing CGs across fault
     domains.
    :vartype placement_profile: ~azure.mgmt.containerinstance.models.PlacementProfile
    :ivar container_group_profiles: The Container Group Profiles that could be used in the NGroups
     resource.
    :vartype container_group_profiles:
     list[~azure.mgmt.containerinstance.models.ContainerGroupProfileStub]
    :ivar provisioning_state: The provisioning state, which only appears in the response. Known
     values are: "Creating", "Updating", "Failed", "Succeeded", "Canceled", "Deleting", and
     "Migrating".
    :vartype provisioning_state: str or
     ~azure.mgmt.containerinstance.models.NGroupProvisioningState
    :ivar update_profile: Used by the customer to specify the way to update the Container Groups in
     NGroup.
    :vartype update_profile: ~azure.mgmt.containerinstance.models.UpdateProfile
    """

    elastic_profile: Optional["_models.ElasticProfile"] = rest_field(
        name="elasticProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """The elastic profile."""
    placement_profile: Optional["_models.PlacementProfile"] = rest_field(
        name="placementProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provides options w.r.t allocation and management w.r.t certain placement policies. These
     utilize capabilities provided by the underlying Azure infrastructure. They are typically used
     for high availability scenarios. E.g., distributing CGs across fault domains."""
    container_group_profiles: Optional[list["_models.ContainerGroupProfileStub"]] = rest_field(
        name="containerGroupProfiles", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Container Group Profiles that could be used in the NGroups resource."""
    provisioning_state: Optional[Union[str, "_models.NGroupProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state, which only appears in the response. Known values are: \"Creating\",
     \"Updating\", \"Failed\", \"Succeeded\", \"Canceled\", \"Deleting\", and \"Migrating\"."""
    update_profile: Optional["_models.UpdateProfile"] = rest_field(
        name="updateProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """Used by the customer to specify the way to update the Container Groups in NGroup."""

    @overload
    def __init__(
        self,
        *,
        elastic_profile: Optional["_models.ElasticProfile"] = None,
        placement_profile: Optional["_models.PlacementProfile"] = None,
        container_group_profiles: Optional[list["_models.ContainerGroupProfileStub"]] = None,
        update_profile: Optional["_models.UpdateProfile"] = 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 Operation(_Model):
    """An operation for Azure Container Instance service.

    :ivar name: The name of the operation. Required.
    :vartype name: str
    :ivar display: The display information of the operation. Required.
    :vartype display: ~azure.mgmt.containerinstance.models.OperationDisplay
    :ivar properties: The additional properties.
    :vartype properties: any
    :ivar origin: The intended executor of the operation. Known values are: "User" and "System".
    :vartype origin: str or ~azure.mgmt.containerinstance.models.ContainerInstanceOperationsOrigin
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the operation. Required."""
    display: "_models.OperationDisplay" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The display information of the operation. Required."""
    properties: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The additional properties."""
    origin: Optional[Union[str, "_models.ContainerInstanceOperationsOrigin"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The intended executor of the operation. Known values are: \"User\" and \"System\"."""

    __flattened_items = [""]

    @overload
    def __init__(
        self,
        *,
        name: str,
        display: "_models.OperationDisplay",
        properties: Optional[Any] = None,
        origin: Optional[Union[str, "_models.ContainerInstanceOperationsOrigin"]] = 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 OperationDisplay(_Model):
    """The display information of the operation.

    :ivar provider: The name of the provider of the operation.
    :vartype provider: str
    :ivar resource: The name of the resource type of the operation.
    :vartype resource: str
    :ivar operation: The friendly name of the operation.
    :vartype operation: str
    :ivar description: The description of the operation.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the provider of the operation."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the resource type of the operation."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The friendly name of the operation."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of 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 PlacementProfile(_Model):
    """Provides options w.r.t allocation and management w.r.t certain placement policies. These
    utilize capabilities provided by the underlying Azure infrastructure. They are typically used
    for high availability scenarios. E.g., distributing CGs across fault domains.

    :ivar fault_domain_count: The number of fault domains to be used to spread CGs in the NGroups
     resource. This can only be specified during NGroup creation and is immutable after that.
    :vartype fault_domain_count: int
    """

    fault_domain_count: Optional[int] = rest_field(
        name="faultDomainCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of fault domains to be used to spread CGs in the NGroups resource. This can only be
     specified during NGroup creation and is immutable after that."""

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

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

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


class Port(_Model):
    """The port exposed on the container group.

    :ivar protocol: The protocol associated with the port. Known values are: "TCP" and "UDP".
    :vartype protocol: str or ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProtocol
    :ivar port: The port number. Required.
    :vartype port: int
    """

    protocol: Optional[Union[str, "_models.ContainerGroupNetworkProtocol"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The protocol associated with the port. Known values are: \"TCP\" and \"UDP\"."""
    port: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The port number. Required."""

    @overload
    def __init__(
        self,
        *,
        port: int,
        protocol: Optional[Union[str, "_models.ContainerGroupNetworkProtocol"]] = 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):
    """The Resource model definition.

    :ivar id: The resource id.
    :vartype id: str
    :ivar name: The resource name.
    :vartype name: str
    :ivar type: The resource type.
    :vartype type: str
    :ivar location: The resource location.
    :vartype location: str
    :ivar tags: The resource tags.
    :vartype tags: dict[str, str]
    :ivar zones: The zones for the container group.
    :vartype zones: list[str]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """The resource id."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The resource name."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The resource type."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource location."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource tags."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The zones for the container group."""

    @overload
    def __init__(
        self,
        *,
        location: Optional[str] = None,
        tags: Optional[dict[str, str]] = None,
        zones: 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 ResourceLimits(_Model):
    """The resource limits.

    :ivar memory_in_gb: The memory limit in GB of this container instance.
    :vartype memory_in_gb: float
    :ivar cpu: The CPU limit of this container instance.
    :vartype cpu: float
    :ivar gpu: The GPU limit of this container instance.
    :vartype gpu: ~azure.mgmt.containerinstance.models.GpuResource
    """

    memory_in_gb: Optional[float] = rest_field(
        name="memoryInGB", visibility=["read", "create", "update", "delete", "query"]
    )
    """The memory limit in GB of this container instance."""
    cpu: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The CPU limit of this container instance."""
    gpu: Optional["_models.GpuResource"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The GPU limit of this container instance."""

    @overload
    def __init__(
        self,
        *,
        memory_in_gb: Optional[float] = None,
        cpu: Optional[float] = None,
        gpu: Optional["_models.GpuResource"] = 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 ResourceRequests(_Model):
    """The resource requests.

    :ivar memory_in_gb: The memory request in GB of this container instance. Required.
    :vartype memory_in_gb: float
    :ivar cpu: The CPU request of this container instance. Required.
    :vartype cpu: float
    :ivar gpu: The GPU request of this container instance.
    :vartype gpu: ~azure.mgmt.containerinstance.models.GpuResource
    """

    memory_in_gb: float = rest_field(name="memoryInGB", visibility=["read", "create", "update", "delete", "query"])
    """The memory request in GB of this container instance. Required."""
    cpu: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The CPU request of this container instance. Required."""
    gpu: Optional["_models.GpuResource"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The GPU request of this container instance."""

    @overload
    def __init__(
        self,
        *,
        memory_in_gb: float,
        cpu: float,
        gpu: Optional["_models.GpuResource"] = 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 ResourceRequirements(_Model):
    """The resource requirements.

    :ivar requests: The resource requests of this container instance. Required.
    :vartype requests: ~azure.mgmt.containerinstance.models.ResourceRequests
    :ivar limits: The resource limits of this container instance.
    :vartype limits: ~azure.mgmt.containerinstance.models.ResourceLimits
    """

    requests: "_models.ResourceRequests" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource requests of this container instance. Required."""
    limits: Optional["_models.ResourceLimits"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource limits of this container instance."""

    @overload
    def __init__(
        self,
        *,
        requests: "_models.ResourceRequests",
        limits: Optional["_models.ResourceLimits"] = 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 TrackedResource(ArmResource):
    """Tracked Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.containerinstance.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 SandboxGroup(TrackedResource):
    """A SandboxGroup tracked resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.containerinstance.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 resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.containerinstance.models.SandboxGroupProperties
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.containerinstance.models.ManagedServiceIdentity
    """

    properties: Optional["_models.SandboxGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.SandboxGroupProperties"] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = 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 SandboxGroupAccessToken(_Model):
    """The result of getting an access token for a SandboxGroup.

    :ivar endpoint: The endpoint URL to use with the access token. Required.
    :vartype endpoint: str
    :ivar access_token: The access token used to authenticate against the endpoint. Required.
    :vartype access_token: str
    :ivar not_after: The UTC date and time at which the access token expires. Required.
    :vartype not_after: ~datetime.datetime
    """

    endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The endpoint URL to use with the access token. Required."""
    access_token: str = rest_field(name="accessToken", visibility=["read", "create", "update", "delete", "query"])
    """The access token used to authenticate against the endpoint. Required."""
    not_after: datetime.datetime = rest_field(
        name="notAfter", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The UTC date and time at which the access token expires. Required."""

    @overload
    def __init__(
        self,
        *,
        endpoint: str,
        access_token: str,
        not_after: datetime.datetime,
    ) -> 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 SandboxGroupNetworkProfile(_Model):
    """The network profile for a SandboxGroup.

    :ivar subnets: The list of subnets associated with the SandboxGroup.
    :vartype subnets: list[~azure.mgmt.containerinstance.models.SubnetReference]
    """

    subnets: Optional[list["_models.SubnetReference"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of subnets associated with the SandboxGroup."""

    @overload
    def __init__(
        self,
        *,
        subnets: Optional[list["_models.SubnetReference"]] = 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 SandboxGroupProperties(_Model):
    """Properties of a SandboxGroup.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Updating", "Deleting", and "Accepted".
    :vartype provisioning_state: str or
     ~azure.mgmt.containerinstance.models.SandboxGroupProvisioningState
    :ivar network_profile: The network profile of the SandboxGroup.
    :vartype network_profile: ~azure.mgmt.containerinstance.models.SandboxGroupNetworkProfile
    :ivar management_resource_group_id: The ARM resource ID of the management resource group
     associated with this SandboxGroup.
    :vartype management_resource_group_id: str
    """

    provisioning_state: Optional[Union[str, "_models.SandboxGroupProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Updating\", \"Deleting\", and \"Accepted\"."""
    network_profile: Optional["_models.SandboxGroupNetworkProfile"] = rest_field(
        name="networkProfile", visibility=["read", "create"]
    )
    """The network profile of the SandboxGroup."""
    management_resource_group_id: Optional[str] = rest_field(name="managementResourceGroupId", visibility=["read"])
    """The ARM resource ID of the management resource group associated with this SandboxGroup."""

    @overload
    def __init__(
        self,
        *,
        network_profile: Optional["_models.SandboxGroupNetworkProfile"] = 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 SandboxGroupTagsUpdate(_Model):
    """The type used for updating a SandboxGroup resource.

    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.containerinstance.models.ManagedServiceIdentity
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = 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 SecretReference(_Model):
    """A secret reference.

    :ivar name: The identifier of the secret reference. Required.
    :vartype name: str
    :ivar identity: The ARM resource id of the managed identity that has access to the secret in
     the key vault. Required.
    :vartype identity: str
    :ivar secret_reference_uri: The URI to the secret in key vault. Required.
    :vartype secret_reference_uri: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The identifier of the secret reference. Required."""
    identity: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ARM resource id of the managed identity that has access to the secret in the key vault.
     Required."""
    secret_reference_uri: str = rest_field(
        name="secretReferenceUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URI to the secret in key vault. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        identity: str,
        secret_reference_uri: str,
    ) -> 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 SecurityContextCapabilitiesDefinition(_Model):
    """The capabilities to add or drop from a container.

    :ivar add: The capabilities to add to the container.
    :vartype add: list[str]
    :ivar drop: The capabilities to drop from the container.
    :vartype drop: list[str]
    """

    add: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The capabilities to add to the container."""
    drop: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The capabilities to drop from the container."""

    @overload
    def __init__(
        self,
        *,
        add: Optional[list[str]] = None,
        drop: 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 SecurityContextDefinition(_Model):
    """The security context for the container.

    :ivar privileged: The flag to determine if the container permissions is elevated to Privileged.
    :vartype privileged: bool
    :ivar allow_privilege_escalation: A boolean value indicating whether the init process can
     elevate its privileges.
    :vartype allow_privilege_escalation: bool
    :ivar capabilities: The capabilities to add or drop from a container.
    :vartype capabilities:
     ~azure.mgmt.containerinstance.models.SecurityContextCapabilitiesDefinition
    :ivar run_as_group: Sets the User GID for the container.
    :vartype run_as_group: int
    :ivar run_as_user: Sets the User UID for the container.
    :vartype run_as_user: int
    :ivar seccomp_profile: a base64 encoded string containing the contents of the JSON in the
     seccomp profile.
    :vartype seccomp_profile: str
    """

    privileged: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The flag to determine if the container permissions is elevated to Privileged."""
    allow_privilege_escalation: Optional[bool] = rest_field(
        name="allowPrivilegeEscalation", visibility=["read", "create", "update", "delete", "query"]
    )
    """A boolean value indicating whether the init process can elevate its privileges."""
    capabilities: Optional["_models.SecurityContextCapabilitiesDefinition"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The capabilities to add or drop from a container."""
    run_as_group: Optional[int] = rest_field(
        name="runAsGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """Sets the User GID for the container."""
    run_as_user: Optional[int] = rest_field(
        name="runAsUser", visibility=["read", "create", "update", "delete", "query"]
    )
    """Sets the User UID for the container."""
    seccomp_profile: Optional[str] = rest_field(
        name="seccompProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """a base64 encoded string containing the contents of the JSON in the seccomp profile."""

    @overload
    def __init__(
        self,
        *,
        privileged: Optional[bool] = None,
        allow_privilege_escalation: Optional[bool] = None,
        capabilities: Optional["_models.SecurityContextCapabilitiesDefinition"] = None,
        run_as_group: Optional[int] = None,
        run_as_user: Optional[int] = None,
        seccomp_profile: 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 StandbyPoolProfileDefinition(_Model):
    """The standby pool profile reference.

    :ivar id: The standby pool profile reference id.This will be an ARM resource id in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyPoolName}'.
    :vartype id: str
    :ivar fail_container_group_create_on_reuse_failure: The flag to determine whether ACI should
     fail the create request if the container group can not be obtained from standby pool.
    :vartype fail_container_group_create_on_reuse_failure: bool
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The standby pool profile reference id.This will be an ARM resource id in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyPoolName}'."""
    fail_container_group_create_on_reuse_failure: Optional[bool] = rest_field(
        name="failContainerGroupCreateOnReuseFailure", visibility=["read", "create", "update", "delete", "query"]
    )
    """The flag to determine whether ACI should fail the create request if the container group can not
     be obtained from standby pool."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        fail_container_group_create_on_reuse_failure: 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 StorageProfile(_Model):
    """Storage profile for storage related settings of a container group profile.

    :ivar file_shares:
    :vartype file_shares: list[~azure.mgmt.containerinstance.models.FileShare]
    """

    file_shares: Optional[list["_models.FileShare"]] = rest_field(
        name="fileShares", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        file_shares: Optional[list["_models.FileShare"]] = 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 SubnetReference(_Model):
    """A reference to a subnet resource.

    :ivar id: The ARM resource ID of the subnet. The caller must have
     ``Microsoft.Network/virtualNetworks/subnets/join/action`` permission on this subnet (enforced
     via a linked access check at create/update time). Required.
    :vartype id: str
    """

    id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ARM resource ID of the subnet. The caller must have
     ``Microsoft.Network/virtualNetworks/subnets/join/action`` permission on this subnet (enforced
     via a linked access check at create/update time). Required."""

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

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

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


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

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.containerinstance.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.containerinstance.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 UpdateProfile(_Model):
    """Used by the customer to specify the way to update the Container Groups in NGroup.

    :ivar update_mode: Known values are: "Manual" and "Rolling".
    :vartype update_mode: str or ~azure.mgmt.containerinstance.models.NGroupUpdateMode
    :ivar rolling_update_profile: This profile allows the customers to customize the rolling
     update.
    :vartype rolling_update_profile:
     ~azure.mgmt.containerinstance.models.UpdateProfileRollingUpdateProfile
    """

    update_mode: Optional[Union[str, "_models.NGroupUpdateMode"]] = rest_field(
        name="updateMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"Manual\" and \"Rolling\"."""
    rolling_update_profile: Optional["_models.UpdateProfileRollingUpdateProfile"] = rest_field(
        name="rollingUpdateProfile", visibility=["read", "create", "update", "delete", "query"]
    )
    """This profile allows the customers to customize the rolling update."""

    @overload
    def __init__(
        self,
        *,
        update_mode: Optional[Union[str, "_models.NGroupUpdateMode"]] = None,
        rolling_update_profile: Optional["_models.UpdateProfileRollingUpdateProfile"] = 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 UpdateProfileRollingUpdateProfile(_Model):
    """This profile allows the customers to customize the rolling update.

    :ivar max_batch_percent: Maximum percentage of total Container Groups which can be updated
     simultaneously by rolling update in one batch.
    :vartype max_batch_percent: int
    :ivar max_unhealthy_percent: Maximum percentage of the updated Container Groups which can be in
     unhealthy state after each batch is updated.
    :vartype max_unhealthy_percent: int
    :ivar pause_time_between_batches: The wait time between batches after completing the one batch
     of the rolling update and starting the next batch. The time duration should be specified in ISO
     8601 format for duration.
    :vartype pause_time_between_batches: str
    :ivar in_place_update: Default is false. If set to true, the CGs will be updated in-place
     instead of creating new CG and deleting old ones.
    :vartype in_place_update: bool
    """

    max_batch_percent: Optional[int] = rest_field(
        name="maxBatchPercent", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum percentage of total Container Groups which can be updated simultaneously by rolling
     update in one batch."""
    max_unhealthy_percent: Optional[int] = rest_field(
        name="maxUnhealthyPercent", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum percentage of the updated Container Groups which can be in unhealthy state after each
     batch is updated."""
    pause_time_between_batches: Optional[str] = rest_field(
        name="pauseTimeBetweenBatches", visibility=["read", "create", "update", "delete", "query"]
    )
    """The wait time between batches after completing the one batch of the rolling update and starting
     the next batch. The time duration should be specified in ISO 8601 format for duration."""
    in_place_update: Optional[bool] = rest_field(
        name="inPlaceUpdate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Default is false. If set to true, the CGs will be updated in-place instead of creating new CG
     and deleting old ones."""

    @overload
    def __init__(
        self,
        *,
        max_batch_percent: Optional[int] = None,
        max_unhealthy_percent: Optional[int] = None,
        pause_time_between_batches: Optional[str] = None,
        in_place_update: 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 Usage(_Model):
    """A single usage result.

    :ivar id: Id of the usage result.
    :vartype id: str
    :ivar unit: Unit of the usage result.
    :vartype unit: str
    :ivar current_value: The current usage of the resource.
    :vartype current_value: int
    :ivar limit: The maximum permitted usage of the resource.
    :vartype limit: int
    :ivar name: The name object of the resource.
    :vartype name: ~azure.mgmt.containerinstance.models.UsageName
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Id of the usage result."""
    unit: Optional[str] = rest_field(visibility=["read"])
    """Unit of the usage result."""
    current_value: Optional[int] = rest_field(name="currentValue", visibility=["read"])
    """The current usage of the resource."""
    limit: Optional[int] = rest_field(visibility=["read"])
    """The maximum permitted usage of the resource."""
    name: Optional["_models.UsageName"] = rest_field(visibility=["read"])
    """The name object of the resource."""


class UsageName(_Model):
    """The name object of the resource.

    :ivar value: The name of the resource.
    :vartype value: str
    :ivar localized_value: The localized name of the resource.
    :vartype localized_value: str
    """

    value: Optional[str] = rest_field(visibility=["read"])
    """The name of the resource."""
    localized_value: Optional[str] = rest_field(name="localizedValue", visibility=["read"])
    """The localized name of the resource."""


class UserAssignedIdentities(_Model):
    """The list of user identities associated with the container group. The user identity dictionary
    key references will be ARM resource ids in the form:
    '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

    :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 UserAssignedIdentity(_Model):
    """User assigned identity properties.

    :ivar principal_id: The principal ID of the assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client ID of the assigned identity.
    :vartype client_id: str
    """

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


class Volume(_Model):
    """The properties of the volume.

    :ivar name: The name of the volume. Required.
    :vartype name: str
    :ivar azure_file: The Azure File volume.
    :vartype azure_file: ~azure.mgmt.containerinstance.models.AzureFileVolume
    :ivar empty_dir: The empty directory volume.
    :vartype empty_dir: any
    :ivar secret: The secret volume.
    :vartype secret: dict[str, str]
    :ivar secret_reference: The secret reference volume.
    :vartype secret_reference: dict[str, str]
    :ivar git_repo: The git repo volume.
    :vartype git_repo: ~azure.mgmt.containerinstance.models.GitRepoVolume
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the volume. Required."""
    azure_file: Optional["_models.AzureFileVolume"] = rest_field(
        name="azureFile", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure File volume."""
    empty_dir: Optional[Any] = rest_field(name="emptyDir", visibility=["read", "create", "update", "delete", "query"])
    """The empty directory volume."""
    secret: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The secret volume."""
    secret_reference: Optional[dict[str, str]] = rest_field(
        name="secretReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secret reference volume."""
    git_repo: Optional["_models.GitRepoVolume"] = rest_field(
        name="gitRepo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The git repo volume."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        azure_file: Optional["_models.AzureFileVolume"] = None,
        empty_dir: Optional[Any] = None,
        secret: Optional[dict[str, str]] = None,
        secret_reference: Optional[dict[str, str]] = None,
        git_repo: Optional["_models.GitRepoVolume"] = 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 VolumeMount(_Model):
    """The properties of the volume mount.

    :ivar name: The name of the volume mount. Required.
    :vartype name: str
    :ivar mount_path: The path within the container where the volume should be mounted. Must not
     contain colon (:). Required.
    :vartype mount_path: str
    :ivar read_only: The flag indicating whether the volume mount is read-only.
    :vartype read_only: bool
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the volume mount. Required."""
    mount_path: str = rest_field(name="mountPath", visibility=["read", "create", "update", "delete", "query"])
    """The path within the container where the volume should be mounted. Must not contain colon (:).
     Required."""
    read_only: Optional[bool] = rest_field(name="readOnly", visibility=["read", "create", "update", "delete", "query"])
    """The flag indicating whether the volume mount is read-only."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        mount_path: str,
        read_only: 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)
