# 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 AccessRule(_Model):
    """Access rule in a network security perimeter configuration profile.

    :ivar name: Name of the access rule.
    :vartype name: str
    :ivar properties:
    :vartype properties: ~azure.mgmt.loganalytics.models.AccessRuleProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the access rule."""
    properties: Optional["_models.AccessRuleProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

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

    :ivar direction: Known values are: "Inbound" and "Outbound".
    :vartype direction: str or ~azure.mgmt.loganalytics.models.AccessRuleDirection
    :ivar address_prefixes: Address prefixes in the CIDR format for inbound rules.
    :vartype address_prefixes: list[str]
    :ivar subscriptions: Subscriptions for inbound rules.
    :vartype subscriptions:
     list[~azure.mgmt.loganalytics.models.AccessRulePropertiesSubscriptionsItem]
    :ivar network_security_perimeters: Network security perimeters for inbound rules.
    :vartype network_security_perimeters:
     list[~azure.mgmt.loganalytics.models.NetworkSecurityPerimeter]
    :ivar fully_qualified_domain_names: Fully qualified domain names (FQDN) for outbound rules.
    :vartype fully_qualified_domain_names: list[str]
    :ivar email_addresses: Email addresses for outbound rules.
    :vartype email_addresses: list[str]
    :ivar phone_numbers: Phone numbers for outbound rules.
    :vartype phone_numbers: list[str]
    """

    direction: Optional[Union[str, "_models.AccessRuleDirection"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"Inbound\" and \"Outbound\"."""
    address_prefixes: Optional[list[str]] = rest_field(
        name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Address prefixes in the CIDR format for inbound rules."""
    subscriptions: Optional[list["_models.AccessRulePropertiesSubscriptionsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscriptions for inbound rules."""
    network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = rest_field(
        name="networkSecurityPerimeters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Network security perimeters for inbound rules."""
    fully_qualified_domain_names: Optional[list[str]] = rest_field(
        name="fullyQualifiedDomainNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully qualified domain names (FQDN) for outbound rules."""
    email_addresses: Optional[list[str]] = rest_field(
        name="emailAddresses", visibility=["read", "create", "update", "delete", "query"]
    )
    """Email addresses for outbound rules."""
    phone_numbers: Optional[list[str]] = rest_field(
        name="phoneNumbers", visibility=["read", "create", "update", "delete", "query"]
    )
    """Phone numbers for outbound rules."""

    @overload
    def __init__(
        self,
        *,
        direction: Optional[Union[str, "_models.AccessRuleDirection"]] = None,
        address_prefixes: Optional[list[str]] = None,
        subscriptions: Optional[list["_models.AccessRulePropertiesSubscriptionsItem"]] = None,
        network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = None,
        fully_qualified_domain_names: Optional[list[str]] = None,
        email_addresses: Optional[list[str]] = None,
        phone_numbers: 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 AccessRulePropertiesSubscriptionsItem(_Model):
    """we add this model  in order to replace subscriptions model in CommonTypes with this model via
    alternateType decorator.

    :ivar id: The fully qualified Azure resource ID of the subscription e.g.
     ('/subscriptions/00000000-0000-0000-0000-000000000000').
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The fully qualified Azure resource ID of the subscription e.g.
     ('/subscriptions/00000000-0000-0000-0000-000000000000')."""

    @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 AssociatedWorkspace(_Model):
    """The list of Log Analytics workspaces associated with the cluster.

    :ivar workspace_id: Associated workspace immutable id.
    :vartype workspace_id: str
    :ivar workspace_name: Associated workspace resource name.
    :vartype workspace_name: str
    :ivar resource_id: Associated workspace arm resource id, in the form of:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}.
    :vartype resource_id: str
    :ivar associate_date: The time of workspace association.
    :vartype associate_date: ~datetime.datetime
    """

    workspace_id: Optional[str] = rest_field(name="workspaceId", visibility=["read"])
    """Associated workspace immutable id."""
    workspace_name: Optional[str] = rest_field(name="workspaceName", visibility=["read"])
    """Associated workspace resource name."""
    resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"])
    """Associated workspace arm resource id, in the form of:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}."""
    associate_date: Optional[datetime.datetime] = rest_field(
        name="associateDate", visibility=["read"], format="rfc3339"
    )
    """The time of workspace association."""


class AvailableServiceTier(_Model):
    """Service Tier details.

    :ivar service_tier: The name of the Service Tier. Known values are: "Free", "Standard",
     "Premium", "PerNode", "PerGB2018", "Standalone", and "CapacityReservation".
    :vartype service_tier: str or ~azure.mgmt.loganalytics.models.SkuNameEnum
    :ivar enabled: True if the Service Tier is enabled for the workspace.
    :vartype enabled: bool
    :ivar minimum_retention: The minimum retention for the Service Tier, in days.
    :vartype minimum_retention: int
    :ivar maximum_retention: The maximum retention for the Service Tier, in days.
    :vartype maximum_retention: int
    :ivar default_retention: The default retention for the Service Tier, in days.
    :vartype default_retention: int
    :ivar capacity_reservation_level: The capacity reservation level in GB per day. Returned for
     the Capacity Reservation Service Tier.
    :vartype capacity_reservation_level: int
    :ivar last_sku_update: Time when the sku was last updated for the workspace. Returned for the
     Capacity Reservation Service Tier.
    :vartype last_sku_update: str
    """

    service_tier: Optional[Union[str, "_models.SkuNameEnum"]] = rest_field(name="serviceTier", visibility=["read"])
    """The name of the Service Tier. Known values are: \"Free\", \"Standard\", \"Premium\",
     \"PerNode\", \"PerGB2018\", \"Standalone\", and \"CapacityReservation\"."""
    enabled: Optional[bool] = rest_field(visibility=["read"])
    """True if the Service Tier is enabled for the workspace."""
    minimum_retention: Optional[int] = rest_field(name="minimumRetention", visibility=["read"])
    """The minimum retention for the Service Tier, in days."""
    maximum_retention: Optional[int] = rest_field(name="maximumRetention", visibility=["read"])
    """The maximum retention for the Service Tier, in days."""
    default_retention: Optional[int] = rest_field(name="defaultRetention", visibility=["read"])
    """The default retention for the Service Tier, in days."""
    capacity_reservation_level: Optional[int] = rest_field(name="capacityReservationLevel", visibility=["read"])
    """The capacity reservation level in GB per day. Returned for the Capacity Reservation Service
     Tier."""
    last_sku_update: Optional[str] = rest_field(name="lastSkuUpdate", visibility=["read"])
    """Time when the sku was last updated for the workspace. Returned for the Capacity Reservation
     Service Tier."""


class Resource(_Model):
    """Resource.

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

    etag: Optional[str] = rest_field(visibility=["read"])
    """Resource Etag."""


class CapacityReservationProperties(_Model):
    """The Capacity Reservation properties.

    :ivar last_sku_update: The last time Sku was updated.
    :vartype last_sku_update: ~datetime.datetime
    :ivar min_capacity: Minimum CapacityReservation value in Gigabytes.
    :vartype min_capacity: int
    """

    last_sku_update: Optional[datetime.datetime] = rest_field(
        name="lastSkuUpdate", visibility=["read"], format="rfc3339"
    )
    """The last time Sku was updated."""
    min_capacity: Optional[int] = rest_field(name="minCapacity", visibility=["read"])
    """Minimum CapacityReservation value in Gigabytes."""


class TrackedResource(Resource):
    """Tracked Resource.

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

    :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.loganalytics.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: Log Analytics cluster properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.ClusterProperties
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.loganalytics.models.ManagedServiceIdentity
    :ivar sku: The sku properties.
    :vartype sku: ~azure.mgmt.loganalytics.models.ClusterSku
    """

    properties: Optional["_models.ClusterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Log Analytics cluster properties."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""
    sku: Optional["_models.ClusterSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The sku properties."""

    __flattened_items = [
        "cluster_id",
        "provisioning_state",
        "is_double_encryption_enabled",
        "is_availability_zones_enabled",
        "billing_type",
        "key_vault_properties",
        "last_modified_date",
        "created_date",
        "associated_workspaces",
        "capacity_reservation_properties",
        "replication",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.ClusterProperties"] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
        sku: Optional["_models.ClusterSku"] = 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 ClusterPatch(_Model):
    """The top level Log Analytics cluster resource container.

    :ivar properties: Log Analytics cluster properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.ClusterPatchProperties
    :ivar identity: Resource's identity.
    :vartype identity: ~azure.mgmt.loganalytics.models.ManagedServiceIdentity
    :ivar sku: The sku properties.
    :vartype sku: ~azure.mgmt.loganalytics.models.ClusterSku
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.ClusterPatchProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Log Analytics cluster properties."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource's identity."""
    sku: Optional["_models.ClusterSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The sku properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""

    __flattened_items = ["key_vault_properties", "billing_type"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ClusterPatchProperties"] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
        sku: Optional["_models.ClusterSku"] = None,
        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:
        _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 ClusterPatchProperties(_Model):
    """Log Analytics cluster patch properties.

    :ivar key_vault_properties: The associated key properties.
    :vartype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties
    :ivar billing_type: The cluster's billing type. Known values are: "Cluster" and "Workspaces".
    :vartype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType
    """

    key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field(
        name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The associated key properties."""
    billing_type: Optional[Union[str, "_models.BillingType"]] = rest_field(
        name="billingType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cluster's billing type. Known values are: \"Cluster\" and \"Workspaces\"."""

    @overload
    def __init__(
        self,
        *,
        key_vault_properties: Optional["_models.KeyVaultProperties"] = None,
        billing_type: Optional[Union[str, "_models.BillingType"]] = 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 ClusterProperties(_Model):
    """Cluster properties.

    :ivar cluster_id: The ID associated with the cluster.
    :vartype cluster_id: str
    :ivar provisioning_state: The provisioning state of the cluster. Known values are: "Creating",
     "Succeeded", "Failed", "Canceled", "Deleting", "ProvisioningAccount", and "Updating".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.ClusterEntityStatus
    :ivar is_double_encryption_enabled: Configures whether cluster will use double encryption. This
     Property can not be modified after cluster creation. Default value is 'true'.
    :vartype is_double_encryption_enabled: bool
    :ivar is_availability_zones_enabled: Sets whether the cluster will support availability zones.
     This can be set as true only in regions where Azure Data Explorer support Availability Zones.
     This Property can not be modified after cluster creation. Default value is 'true' if region
     supports Availability Zones.
    :vartype is_availability_zones_enabled: bool
    :ivar billing_type: The cluster's billing type. Known values are: "Cluster" and "Workspaces".
    :vartype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType
    :ivar key_vault_properties: The associated key properties.
    :vartype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties
    :ivar last_modified_date: The last time the cluster was updated.
    :vartype last_modified_date: ~datetime.datetime
    :ivar created_date: The cluster creation time.
    :vartype created_date: ~datetime.datetime
    :ivar associated_workspaces: The list of Log Analytics workspaces associated with the cluster.
    :vartype associated_workspaces: list[~azure.mgmt.loganalytics.models.AssociatedWorkspace]
    :ivar capacity_reservation_properties: Additional properties for capacity reservation.
    :vartype capacity_reservation_properties:
     ~azure.mgmt.loganalytics.models.CapacityReservationProperties
    :ivar replication: Cluster's replication properties.
    :vartype replication: ~azure.mgmt.loganalytics.models.ClusterReplicationProperties
    """

    cluster_id: Optional[str] = rest_field(name="clusterId", visibility=["read"])
    """The ID associated with the cluster."""
    provisioning_state: Optional[Union[str, "_models.ClusterEntityStatus"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the cluster. Known values are: \"Creating\", \"Succeeded\",
     \"Failed\", \"Canceled\", \"Deleting\", \"ProvisioningAccount\", and \"Updating\"."""
    is_double_encryption_enabled: Optional[bool] = rest_field(
        name="isDoubleEncryptionEnabled", visibility=["read", "create"]
    )
    """Configures whether cluster will use double encryption. This Property can not be modified after
     cluster creation. Default value is 'true'."""
    is_availability_zones_enabled: Optional[bool] = rest_field(
        name="isAvailabilityZonesEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Sets whether the cluster will support availability zones. This can be set as true only in
     regions where Azure Data Explorer support Availability Zones. This Property can not be modified
     after cluster creation. Default value is 'true' if region supports Availability Zones."""
    billing_type: Optional[Union[str, "_models.BillingType"]] = rest_field(
        name="billingType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cluster's billing type. Known values are: \"Cluster\" and \"Workspaces\"."""
    key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field(
        name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The associated key properties."""
    last_modified_date: Optional[datetime.datetime] = rest_field(
        name="lastModifiedDate", visibility=["read"], format="rfc3339"
    )
    """The last time the cluster was updated."""
    created_date: Optional[datetime.datetime] = rest_field(name="createdDate", visibility=["read"], format="rfc3339")
    """The cluster creation time."""
    associated_workspaces: Optional[list["_models.AssociatedWorkspace"]] = rest_field(
        name="associatedWorkspaces", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of Log Analytics workspaces associated with the cluster."""
    capacity_reservation_properties: Optional["_models.CapacityReservationProperties"] = rest_field(
        name="capacityReservationProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional properties for capacity reservation."""
    replication: Optional["_models.ClusterReplicationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Cluster's replication properties."""

    @overload
    def __init__(
        self,
        *,
        is_double_encryption_enabled: Optional[bool] = None,
        is_availability_zones_enabled: Optional[bool] = None,
        billing_type: Optional[Union[str, "_models.BillingType"]] = None,
        key_vault_properties: Optional["_models.KeyVaultProperties"] = None,
        associated_workspaces: Optional[list["_models.AssociatedWorkspace"]] = None,
        capacity_reservation_properties: Optional["_models.CapacityReservationProperties"] = None,
        replication: Optional["_models.ClusterReplicationProperties"] = 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 ClusterReplicationProperties(_Model):
    """Cluster replication properties.

    :ivar location: The secondary location of the replication. If replication is being enabled,
     enabled must be provided.
    :vartype location: str
    :ivar enabled: Specifies whether the replication is enabled or not. When true the cluster is
     replicate to the specified location.
    :vartype enabled: bool
    :ivar is_availability_zones_enabled: Should enable AvailabilityZones for the given replicated
     cluster.
    :vartype is_availability_zones_enabled: bool
    :ivar provisioning_state: The provisioning state of the cluster replication. Known values are:
     "Succeeded", "EnableRequested", "Enabling", "DisableRequested", "Disabling",
     "RollbackRequested", "RollingBack", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.ClusterReplicationState
    :ivar created_date: The cluster's replication creation time.
    :vartype created_date: ~datetime.datetime
    :ivar last_modified_date: The last time the cluster's replication was updated.
    :vartype last_modified_date: ~datetime.datetime
    """

    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The secondary location of the replication. If replication is being enabled, enabled must be
     provided."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Specifies whether the replication is enabled or not. When true the cluster is replicate to the
     specified location."""
    is_availability_zones_enabled: Optional[bool] = rest_field(
        name="isAvailabilityZonesEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Should enable AvailabilityZones for the given replicated cluster."""
    provisioning_state: Optional[Union[str, "_models.ClusterReplicationState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the cluster replication. Known values are: \"Succeeded\",
     \"EnableRequested\", \"Enabling\", \"DisableRequested\", \"Disabling\", \"RollbackRequested\",
     \"RollingBack\", \"Failed\", and \"Canceled\"."""
    created_date: Optional[datetime.datetime] = rest_field(name="createdDate", visibility=["read"], format="rfc3339")
    """The cluster's replication creation time."""
    last_modified_date: Optional[datetime.datetime] = rest_field(
        name="lastModifiedDate", visibility=["read"], format="rfc3339"
    )
    """The last time the cluster's replication was updated."""

    @overload
    def __init__(
        self,
        *,
        location: Optional[str] = None,
        enabled: Optional[bool] = None,
        is_availability_zones_enabled: Optional[bool] = None,
    ) -> None: ...

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

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


class ClusterSku(_Model):
    """The cluster sku definition.

    :ivar capacity: The capacity reservation level in Gigabytes for this cluster.
    :vartype capacity: int
    :ivar name: The SKU (tier) of a cluster. "CapacityReservation"
    :vartype name: str or ~azure.mgmt.loganalytics.models.ClusterSkuNameEnum
    """

    capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The capacity reservation level in Gigabytes for this cluster."""
    name: Optional[Union[str, "_models.ClusterSkuNameEnum"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The SKU (tier) of a cluster. \"CapacityReservation\""""

    @overload
    def __init__(
        self,
        *,
        capacity: Optional[int] = None,
        name: Optional[Union[str, "_models.ClusterSkuNameEnum"]] = 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 Column(_Model):
    """Table column.

    :ivar name: Column name.
    :vartype name: str
    :ivar type: Column data type. Known values are: "string", "int", "long", "real", "boolean",
     "dateTime", "guid", and "dynamic".
    :vartype type: str or ~azure.mgmt.loganalytics.models.ColumnTypeEnum
    :ivar data_type_hint: Column data type logical hint. Known values are: "uri", "guid",
     "armPath", and "ip".
    :vartype data_type_hint: str or ~azure.mgmt.loganalytics.models.ColumnDataTypeHintEnum
    :ivar display_name: Column display name.
    :vartype display_name: str
    :ivar description: Column description.
    :vartype description: str
    :ivar is_default_display: Is displayed by default.
    :vartype is_default_display: bool
    :ivar is_hidden: Is column hidden.
    :vartype is_hidden: bool
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Column name."""
    type: Optional[Union[str, "_models.ColumnTypeEnum"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Column data type. Known values are: \"string\", \"int\", \"long\", \"real\", \"boolean\",
     \"dateTime\", \"guid\", and \"dynamic\"."""
    data_type_hint: Optional[Union[str, "_models.ColumnDataTypeHintEnum"]] = rest_field(
        name="dataTypeHint", visibility=["read", "create", "update", "delete", "query"]
    )
    """Column data type logical hint. Known values are: \"uri\", \"guid\", \"armPath\", and \"ip\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Column display name."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Column description."""
    is_default_display: Optional[bool] = rest_field(name="isDefaultDisplay", visibility=["read"])
    """Is displayed by default."""
    is_hidden: Optional[bool] = rest_field(name="isHidden", visibility=["read"])
    """Is column hidden."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        type: Optional[Union[str, "_models.ColumnTypeEnum"]] = None,
        data_type_hint: Optional[Union[str, "_models.ColumnDataTypeHintEnum"]] = None,
        display_name: 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 CoreSummary(_Model):
    """The core summary of a search.

    :ivar status: The status of a core summary.
    :vartype status: str
    :ivar number_of_documents: The number of documents of a core summary. Required.
    :vartype number_of_documents: int
    """

    status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The status of a core summary."""
    number_of_documents: int = rest_field(
        name="numberOfDocuments", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of documents of a core summary. Required."""

    @overload
    def __init__(
        self,
        *,
        number_of_documents: int,
        status: 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(Resource):
    """Proxy Resource.

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


class DataExport(ProxyResource):
    """The top level data export resource container.

    :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.loganalytics.models.SystemData
    :ivar properties: data export properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.DataExportProperties
    """

    properties: Optional["_models.DataExportProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """data export properties."""

    __flattened_items = ["data_export_id", "table_names", "destination", "enable", "created_date", "last_modified_date"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.DataExportProperties"] = 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 DataExportProperties(_Model):
    """Data Export properties.

    :ivar data_export_id: The data export rule ID.
    :vartype data_export_id: str
    :ivar table_names: An array of tables to export, for example: [“Heartbeat, SecurityEvent”].
     Required.
    :vartype table_names: list[str]
    :ivar destination: destination properties.
    :vartype destination: ~azure.mgmt.loganalytics.models.Destination
    :ivar enable: Active when enabled.
    :vartype enable: bool
    :ivar created_date: The latest data export rule modification time.
    :vartype created_date: str
    :ivar last_modified_date: Date and time when the export was last modified.
    :vartype last_modified_date: str
    """

    data_export_id: Optional[str] = rest_field(
        name="dataExportId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The data export rule ID."""
    table_names: list[str] = rest_field(name="tableNames", visibility=["read", "create", "update", "delete", "query"])
    """An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. Required."""
    destination: Optional["_models.Destination"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """destination properties."""
    enable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Active when enabled."""
    created_date: Optional[str] = rest_field(
        name="createdDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """The latest data export rule modification time."""
    last_modified_date: Optional[str] = rest_field(
        name="lastModifiedDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date and time when the export was last modified."""

    @overload
    def __init__(
        self,
        *,
        table_names: list[str],
        data_export_id: Optional[str] = None,
        destination: Optional["_models.Destination"] = None,
        enable: Optional[bool] = None,
        created_date: Optional[str] = None,
        last_modified_date: 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 DataSource(ProxyResource):
    """Datasources under OMS Workspace.

    :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.loganalytics.models.SystemData
    :ivar properties: The data source properties in raw json format, each kind of data source have
     it's own schema. Required.
    :vartype properties: any
    :ivar etag: The ETag of the data source.
    :vartype etag: str
    :ivar kind: The kind of the DataSource. Required. Known values are: "WindowsEvent",
     "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection",
     "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection",
     "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath",
     "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration",
     "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath",
     "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365",
     "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration",
     "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration",
     "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", and
     "SqlDataClassification".
    :vartype kind: str or ~azure.mgmt.loganalytics.models.DataSourceKind
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    properties: Any = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The data source properties in raw json format, each kind of data source have it's own schema.
     Required."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the data source."""
    kind: Union[str, "_models.DataSourceKind"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The kind of the DataSource. Required. Known values are: \"WindowsEvent\",
     \"WindowsPerformanceCounter\", \"IISLogs\", \"LinuxSyslog\", \"LinuxSyslogCollection\",
     \"LinuxPerformanceObject\", \"LinuxPerformanceCollection\", \"CustomLog\",
     \"CustomLogCollection\", \"AzureAuditLog\", \"AzureActivityLog\", \"GenericDataSource\",
     \"ChangeTrackingCustomPath\", \"ChangeTrackingPath\", \"ChangeTrackingServices\",
     \"ChangeTrackingDataTypeConfiguration\", \"ChangeTrackingDefaultRegistry\",
     \"ChangeTrackingRegistry\", \"ChangeTrackingLinuxPath\", \"LinuxChangeTrackingPath\",
     \"ChangeTrackingContentLocation\", \"WindowsTelemetry\", \"Office365\",
     \"SecurityWindowsBaselineConfiguration\",
     \"SecurityCenterSecurityWindowsBaselineConfiguration\",
     \"SecurityEventCollectionConfiguration\",
     \"SecurityInsightsSecurityEventCollectionConfiguration\", \"ImportComputerGroup\",
     \"NetworkMonitoring\", \"Itsm\", \"DnsAnalytics\", \"ApplicationInsights\", and
     \"SqlDataClassification\"."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""

    @overload
    def __init__(
        self,
        *,
        properties: Any,
        kind: Union[str, "_models.DataSourceKind"],
        etag: Optional[str] = None,
        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 Destination(_Model):
    """Destination properties.

    :ivar resource_id: The destination resource ID. This can be copied from the Properties entry of
     the destination resource in Azure. Required.
    :vartype resource_id: str
    :ivar type: The type of the destination resource. Known values are: "StorageAccount" and
     "EventHub".
    :vartype type: str or ~azure.mgmt.loganalytics.models.Type
    :ivar meta_data: destination meta data.
    :vartype meta_data: ~azure.mgmt.loganalytics.models.DestinationMetaData
    """

    resource_id: str = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"])
    """The destination resource ID. This can be copied from the Properties entry of the destination
     resource in Azure. Required."""
    type: Optional[Union[str, "_models.Type"]] = rest_field(visibility=["read"])
    """The type of the destination resource. Known values are: \"StorageAccount\" and \"EventHub\"."""
    meta_data: Optional["_models.DestinationMetaData"] = rest_field(
        name="metaData", visibility=["read", "create", "update", "delete", "query"]
    )
    """destination meta data."""

    __flattened_items = ["event_hub_name"]

    @overload
    def __init__(
        self,
        *,
        resource_id: str,
        meta_data: Optional["_models.DestinationMetaData"] = 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.meta_data is None:
                return None
            return getattr(self.meta_data, 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.meta_data is None:
                self.meta_data = self._attr_to_rest_field["meta_data"]._class_type()
            setattr(self.meta_data, key, value)
        else:
            super().__setattr__(key, value)


class DestinationMetaData(_Model):
    """Destination meta data.

    :ivar event_hub_name: Optional. Allows to define an Event Hub name. Not applicable when
     destination is Storage Account.
    :vartype event_hub_name: str
    """

    event_hub_name: Optional[str] = rest_field(
        name="eventHubName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional. Allows to define an Event Hub name. Not applicable when destination is Storage
     Account."""

    @overload
    def __init__(
        self,
        *,
        event_hub_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 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.loganalytics.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.loganalytics.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.loganalytics.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 Identity(_Model):
    """Identity for the resource.

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

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

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.IdentityType"],
        user_assigned_identities: Optional[dict[str, "_models.UserIdentityProperties"]] = None,
    ) -> None: ...

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

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


class IntelligencePack(_Model):
    """Intelligence Pack containing a string name and boolean indicating if it's enabled.

    :ivar name: The name of the intelligence pack.
    :vartype name: str
    :ivar enabled: The enabled boolean for the intelligence pack.
    :vartype enabled: bool
    :ivar display_name: The display name of the intelligence pack.
    :vartype display_name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the intelligence pack."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The enabled boolean for the intelligence pack."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name of the intelligence pack."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        enabled: Optional[bool] = None,
        display_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 KeyVaultProperties(_Model):
    """The key vault properties.

    :ivar key_vault_uri: The Key Vault uri which holds they key associated with the Log Analytics
     cluster.
    :vartype key_vault_uri: str
    :ivar key_name: The name of the key associated with the Log Analytics cluster.
    :vartype key_name: str
    :ivar key_version: The version of the key associated with the Log Analytics cluster.
    :vartype key_version: str
    :ivar key_rsa_size: Selected key minimum required size.
    :vartype key_rsa_size: int
    """

    key_vault_uri: Optional[str] = rest_field(
        name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Key Vault uri which holds they key associated with the Log Analytics cluster."""
    key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the key associated with the Log Analytics cluster."""
    key_version: Optional[str] = rest_field(
        name="keyVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The version of the key associated with the Log Analytics cluster."""
    key_rsa_size: Optional[int] = rest_field(
        name="keyRsaSize", visibility=["read", "create", "update", "delete", "query"]
    )
    """Selected key minimum required size."""

    @overload
    def __init__(
        self,
        *,
        key_vault_uri: Optional[str] = None,
        key_name: Optional[str] = None,
        key_version: Optional[str] = None,
        key_rsa_size: 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 LinkedService(ProxyResource):
    """The top level Linked service resource container.

    :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.loganalytics.models.SystemData
    :ivar properties: The properties of the linked service. Required.
    :vartype properties: ~azure.mgmt.loganalytics.models.LinkedServiceProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    properties: "_models.LinkedServiceProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the linked service. Required."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""

    __flattened_items = ["resource_id", "write_access_resource_id", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: "_models.LinkedServiceProperties",
        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:
        _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 LinkedServiceProperties(_Model):
    """Linked service properties.

    :ivar resource_id: The resource id of the resource that will be linked to the workspace. This
     should be used for linking resources which require read access.
    :vartype resource_id: str
    :ivar write_access_resource_id: The resource id of the resource that will be linked to the
     workspace. This should be used for linking resources which require write access.
    :vartype write_access_resource_id: str
    :ivar provisioning_state: The provisioning state of the linked service. Known values are:
     "Succeeded", "Deleting", "ProvisioningAccount", and "Updating".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.LinkedServiceEntityStatus
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource id of the resource that will be linked to the workspace. This should be used for
     linking resources which require read access."""
    write_access_resource_id: Optional[str] = rest_field(
        name="writeAccessResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource id of the resource that will be linked to the workspace. This should be used for
     linking resources which require write access."""
    provisioning_state: Optional[Union[str, "_models.LinkedServiceEntityStatus"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """The provisioning state of the linked service. Known values are: \"Succeeded\", \"Deleting\",
     \"ProvisioningAccount\", and \"Updating\"."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        write_access_resource_id: Optional[str] = None,
        provisioning_state: Optional[Union[str, "_models.LinkedServiceEntityStatus"]] = 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 LinkedStorageAccountsProperties(_Model):
    """Linked storage accounts properties.

    :ivar data_source_type: Linked storage accounts type. Known values are: "CustomLogs",
     "AzureWatson", "Query", "Ingestion", and "Alerts".
    :vartype data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType
    :ivar storage_account_ids: Linked storage accounts resources ids.
    :vartype storage_account_ids: list[str]
    """

    data_source_type: Optional[Union[str, "_models.DataSourceType"]] = rest_field(
        name="dataSourceType", visibility=["read"]
    )
    """Linked storage accounts type. Known values are: \"CustomLogs\", \"AzureWatson\", \"Query\",
     \"Ingestion\", and \"Alerts\"."""
    storage_account_ids: Optional[list[str]] = rest_field(
        name="storageAccountIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Linked storage accounts resources ids."""

    @overload
    def __init__(
        self,
        *,
        storage_account_ids: 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 LinkedStorageAccountsResource(ProxyResource):
    """Linked storage accounts top level resource container.

    :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.loganalytics.models.SystemData
    :ivar properties: Linked storage accounts properties. Required.
    :vartype properties: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsProperties
    """

    properties: "_models.LinkedStorageAccountsProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Linked storage accounts properties. Required."""

    __flattened_items = ["data_source_type", "storage_account_ids"]

    @overload
    def __init__(
        self,
        *,
        properties: "_models.LinkedStorageAccountsProperties",
    ) -> 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 LogAnalyticsQueryPack(TrackedResource):
    """An Log Analytics QueryPack definition.

    :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.loganalytics.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: Properties that define a Log Analytics QueryPack resource. Required.
    :vartype properties: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackProperties
    """

    properties: "_models.LogAnalyticsQueryPackProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties that define a Log Analytics QueryPack resource. Required."""

    __flattened_items = ["query_pack_id", "time_created", "time_modified", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        location: str,
        properties: "_models.LogAnalyticsQueryPackProperties",
        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:
        _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 LogAnalyticsQueryPackProperties(_Model):
    """Properties that define a Log Analytics QueryPack resource.

    :ivar query_pack_id: The unique ID of your application. This field cannot be changed.
    :vartype query_pack_id: str
    :ivar time_created: Creation Date for the Log Analytics QueryPack, in ISO 8601 format.
    :vartype time_created: ~datetime.datetime
    :ivar time_modified: Last modified date of the Log Analytics QueryPack, in ISO 8601 format.
    :vartype time_modified: ~datetime.datetime
    :ivar provisioning_state: Current state of this QueryPack: whether or not is has been
     provisioned within the resource group it is defined. Users cannot change this value but are
     able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
    :vartype provisioning_state: str
    """

    query_pack_id: Optional[str] = rest_field(name="queryPackId", visibility=["read"])
    """The unique ID of your application. This field cannot be changed."""
    time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339")
    """Creation Date for the Log Analytics QueryPack, in ISO 8601 format."""
    time_modified: Optional[datetime.datetime] = rest_field(name="timeModified", visibility=["read"], format="rfc3339")
    """Last modified date of the Log Analytics QueryPack, in ISO 8601 format."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Current state of this QueryPack: whether or not is has been provisioned within the resource
     group it is defined. Users cannot change this value but are able to read from it. Values will
     include Succeeded, Deploying, Canceled, and Failed."""


class LogAnalyticsQueryPackQuery(ProxyResource):
    """A Log Analytics QueryPack-Query definition.

    :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.loganalytics.models.SystemData
    :ivar properties: Properties that define an Log Analytics QueryPack-Query resource.
    :vartype properties: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQueryProperties
    """

    properties: Optional["_models.LogAnalyticsQueryPackQueryProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties that define an Log Analytics QueryPack-Query resource."""

    __flattened_items = [
        "id",
        "display_name",
        "time_created",
        "time_modified",
        "author",
        "description",
        "body",
        "related",
        "tags",
        "properties",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.LogAnalyticsQueryPackQueryProperties"] = 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 LogAnalyticsQueryPackQueryProperties(_Model):
    """Properties that define an Log Analytics QueryPack-Query resource.

    :ivar id: The unique ID of your application. This field cannot be changed.
    :vartype id: str
    :ivar display_name: Unique display name for your query within the Query Pack. Required.
    :vartype display_name: str
    :ivar time_created: Creation Date for the Log Analytics Query, in ISO 8601 format.
    :vartype time_created: ~datetime.datetime
    :ivar time_modified: Last modified date of the Log Analytics Query, in ISO 8601 format.
    :vartype time_modified: ~datetime.datetime
    :ivar author: Object Id of user creating the query.
    :vartype author: str
    :ivar description: Description of the query.
    :vartype description: str
    :ivar body: Body of the query. Required.
    :vartype body: str
    :ivar related: The related metadata items for the function.
    :vartype related: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated
    :ivar tags: Tags associated with the query.
    :vartype tags: dict[str, list[str]]
    :ivar properties: Additional properties that can be set for the query.
    :vartype properties: any
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """The unique ID of your application. This field cannot be changed."""
    display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"])
    """Unique display name for your query within the Query Pack. Required."""
    time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339")
    """Creation Date for the Log Analytics Query, in ISO 8601 format."""
    time_modified: Optional[datetime.datetime] = rest_field(name="timeModified", visibility=["read"], format="rfc3339")
    """Last modified date of the Log Analytics Query, in ISO 8601 format."""
    author: Optional[str] = rest_field(visibility=["read"])
    """Object Id of user creating the query."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the query."""
    body: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Body of the query. Required."""
    related: Optional["_models.LogAnalyticsQueryPackQueryPropertiesRelated"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The related metadata items for the function."""
    tags: Optional[dict[str, list[str]]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags associated with the query."""
    properties: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Additional properties that can be set for the query."""

    @overload
    def __init__(
        self,
        *,
        display_name: str,
        body: str,
        description: Optional[str] = None,
        related: Optional["_models.LogAnalyticsQueryPackQueryPropertiesRelated"] = None,
        tags: Optional[dict[str, list[str]]] = None,
        properties: 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 LogAnalyticsQueryPackQueryPropertiesRelated(_Model):  # pylint: disable=name-too-long
    """The related metadata items for the function.

    :ivar categories: The related categories for the function.
    :vartype categories: list[str]
    :ivar resource_types: The related resource types for the function.
    :vartype resource_types: list[str]
    :ivar solutions: The related Log Analytics solutions for the function.
    :vartype solutions: list[str]
    """

    categories: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The related categories for the function."""
    resource_types: Optional[list[str]] = rest_field(
        name="resourceTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The related resource types for the function."""
    solutions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The related Log Analytics solutions for the function."""

    @overload
    def __init__(
        self,
        *,
        categories: Optional[list[str]] = None,
        resource_types: Optional[list[str]] = None,
        solutions: 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 LogAnalyticsQueryPackQuerySearchProperties(_Model):  # pylint: disable=name-too-long
    """Properties that define an Log Analytics QueryPack-Query search properties.

    :ivar related: The related metadata items for the function.
    :vartype related:
     ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated
    :ivar tags: Tags associated with the query.
    :vartype tags: dict[str, list[str]]
    """

    related: Optional["_models.LogAnalyticsQueryPackQuerySearchPropertiesRelated"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The related metadata items for the function."""
    tags: Optional[dict[str, list[str]]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags associated with the query."""

    @overload
    def __init__(
        self,
        *,
        related: Optional["_models.LogAnalyticsQueryPackQuerySearchPropertiesRelated"] = None,
        tags: Optional[dict[str, 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 LogAnalyticsQueryPackQuerySearchPropertiesRelated(_Model):  # pylint: disable=name-too-long
    """The related metadata items for the function.

    :ivar categories: The related categories for the function.
    :vartype categories: list[str]
    :ivar resource_types: The related resource types for the function.
    :vartype resource_types: list[str]
    :ivar solutions: The related Log Analytics solutions for the function.
    :vartype solutions: list[str]
    """

    categories: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The related categories for the function."""
    resource_types: Optional[list[str]] = rest_field(
        name="resourceTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The related resource types for the function."""
    solutions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The related Log Analytics solutions for the function."""

    @overload
    def __init__(
        self,
        *,
        categories: Optional[list[str]] = None,
        resource_types: Optional[list[str]] = None,
        solutions: 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 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.loganalytics.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.loganalytics.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 ManagementGroup(_Model):
    """A management group that is connected to a workspace.

    :ivar properties: The properties of the management group.
    :vartype properties: ~azure.mgmt.loganalytics.models.ManagementGroupProperties
    """

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

    __flattened_items = ["server_count", "is_gateway", "name", "id", "created", "data_received", "version", "sku"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ManagementGroupProperties"] = 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 ManagementGroupProperties(_Model):
    """Management group properties.

    :ivar server_count: The number of servers connected to the management group.
    :vartype server_count: int
    :ivar is_gateway: Gets or sets a value indicating whether the management group is a gateway.
    :vartype is_gateway: bool
    :ivar name: The name of the management group.
    :vartype name: str
    :ivar id: The unique ID of the management group.
    :vartype id: str
    :ivar created: The datetime that the management group was created.
    :vartype created: ~datetime.datetime
    :ivar data_received: The last datetime that the management group received data.
    :vartype data_received: ~datetime.datetime
    :ivar version: The version of System Center that is managing the management group.
    :vartype version: str
    :ivar sku: The SKU of System Center that is managing the management group.
    :vartype sku: str
    """

    server_count: Optional[int] = rest_field(
        name="serverCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of servers connected to the management group."""
    is_gateway: Optional[bool] = rest_field(
        name="isGateway", visibility=["read", "create", "update", "delete", "query"]
    )
    """Gets or sets a value indicating whether the management group is a gateway."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the management group."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unique ID of the management group."""
    created: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The datetime that the management group was created."""
    data_received: Optional[datetime.datetime] = rest_field(
        name="dataReceived", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The last datetime that the management group received data."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The version of System Center that is managing the management group."""
    sku: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of System Center that is managing the management group."""

    @overload
    def __init__(
        self,
        *,
        server_count: Optional[int] = None,
        is_gateway: Optional[bool] = None,
        name: Optional[str] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        created: Optional[datetime.datetime] = None,
        data_received: Optional[datetime.datetime] = None,
        version: Optional[str] = None,
        sku: 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 MetricName(_Model):
    """The name of a metric.

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

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The system name of the metric."""
    localized_value: Optional[str] = rest_field(
        name="localizedValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The localized name of the metric."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[str] = None,
        localized_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 NetworkSecurityPerimeter(_Model):
    """Information about a network security perimeter (NSP).

    :ivar id: Fully qualified Azure resource ID of the NSP resource.
    :vartype id: str
    :ivar perimeter_guid: Universal unique ID (UUID) of the network security perimeter.
    :vartype perimeter_guid: str
    :ivar location: Location of the network security perimeter.
    :vartype location: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Fully qualified Azure resource ID of the NSP resource."""
    perimeter_guid: Optional[str] = rest_field(
        name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"]
    )
    """Universal unique ID (UUID) of the network security perimeter."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    """Location of the network security perimeter."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        perimeter_guid: Optional[str] = None,
        location: 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 NetworkSecurityPerimeterConfiguration(ProxyResource):
    """Network security perimeter (NSP) configuration 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.loganalytics.models.SystemData
    :ivar properties:
    :vartype properties:
     ~azure.mgmt.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties
    """

    properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

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

    :ivar provisioning_state: Known values are: "Succeeded", "Creating", "Updating", "Deleting",
     "Accepted", "Failed", and "Canceled".
    :vartype provisioning_state: str or
     ~azure.mgmt.loganalytics.models.NetworkSecurityPerimeterConfigurationProvisioningState
    :ivar provisioning_issues: List of provisioning issues, if any.
    :vartype provisioning_issues: list[~azure.mgmt.loganalytics.models.ProvisioningIssue]
    :ivar network_security_perimeter:
    :vartype network_security_perimeter: ~azure.mgmt.loganalytics.models.NetworkSecurityPerimeter
    :ivar resource_association:
    :vartype resource_association: ~azure.mgmt.loganalytics.models.ResourceAssociation
    :ivar profile:
    :vartype profile: ~azure.mgmt.loganalytics.models.NetworkSecurityProfile
    """

    provisioning_state: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigurationProvisioningState"]] = (
        rest_field(name="provisioningState", visibility=["read"])
    )
    """Known values are: \"Succeeded\", \"Creating\", \"Updating\", \"Deleting\", \"Accepted\",
     \"Failed\", and \"Canceled\"."""
    provisioning_issues: Optional[list["_models.ProvisioningIssue"]] = rest_field(
        name="provisioningIssues", visibility=["read"]
    )
    """List of provisioning issues, if any."""
    network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = rest_field(
        name="networkSecurityPerimeter", visibility=["read", "create", "update", "delete", "query"]
    )
    resource_association: Optional["_models.ResourceAssociation"] = rest_field(
        name="resourceAssociation", visibility=["read", "create", "update", "delete", "query"]
    )
    profile: Optional["_models.NetworkSecurityProfile"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = None,
        resource_association: Optional["_models.ResourceAssociation"] = None,
        profile: Optional["_models.NetworkSecurityProfile"] = 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 NetworkSecurityProfile(_Model):
    """Network security perimeter configuration profile.

    :ivar name: Name of the profile.
    :vartype name: str
    :ivar access_rules_version: Current access rules version.
    :vartype access_rules_version: int
    :ivar access_rules: List of Access Rules.
    :vartype access_rules: list[~azure.mgmt.loganalytics.models.AccessRule]
    :ivar diagnostic_settings_version: Current diagnostic settings version.
    :vartype diagnostic_settings_version: int
    :ivar enabled_log_categories: List of log categories that are enabled.
    :vartype enabled_log_categories: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the profile."""
    access_rules_version: Optional[int] = rest_field(
        name="accessRulesVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current access rules version."""
    access_rules: Optional[list["_models.AccessRule"]] = rest_field(
        name="accessRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Access Rules."""
    diagnostic_settings_version: Optional[int] = rest_field(
        name="diagnosticSettingsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current diagnostic settings version."""
    enabled_log_categories: Optional[list[str]] = rest_field(
        name="enabledLogCategories", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of log categories that are enabled."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        access_rules_version: Optional[int] = None,
        access_rules: Optional[list["_models.AccessRule"]] = None,
        diagnostic_settings_version: Optional[int] = None,
        enabled_log_categories: 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 Operation(_Model):
    """Supported operation of OperationalInsights resource provider.

    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: Display metadata associated with the operation.
    :vartype display: ~azure.mgmt.loganalytics.models.OperationDisplay
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation name: {provider}/{resource}/{operation}."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Display metadata associated with the operation."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display: Optional["_models.OperationDisplay"] = 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 OperationDisplay(_Model):
    """Display metadata associated with the operation.

    :ivar provider: Service provider: Microsoft OperationsManagement.
    :vartype provider: str
    :ivar resource: Resource on which the operation is performed etc.
    :vartype resource: str
    :ivar operation: Type of operation: get, read, delete, etc.
    :vartype operation: str
    :ivar description: Description of operation.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Service provider: Microsoft OperationsManagement."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource on which the operation is performed etc."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Type of operation: get, read, delete, etc."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of 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 OperationStatus(_Model):
    """The status of operation.

    :ivar id: The operation Id.
    :vartype id: str
    :ivar name: The operation name.
    :vartype name: str
    :ivar start_time: The start time of the operation.
    :vartype start_time: str
    :ivar end_time: The end time of the operation.
    :vartype end_time: str
    :ivar status: The status of the operation.
    :vartype status: str
    :ivar error: The error detail of the operation if any.
    :vartype error: ~azure.mgmt.loganalytics.models.ErrorResponse
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The operation Id."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The operation name."""
    start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"])
    """The start time of the operation."""
    end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"])
    """The end time of the operation."""
    status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The status of the operation."""
    error: Optional["_models.ErrorResponse"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error detail of the operation if any."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        start_time: Optional[str] = None,
        end_time: Optional[str] = None,
        status: Optional[str] = None,
        error: Optional["_models.ErrorResponse"] = 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 PrivateLinkScopedResource(_Model):
    """The private link scope resource reference.

    :ivar resource_id: The full resource Id of the private link scope resource.
    :vartype resource_id: str
    :ivar scope_id: The private link scope unique Identifier.
    :vartype scope_id: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The full resource Id of the private link scope resource."""
    scope_id: Optional[str] = rest_field(name="scopeId", visibility=["read", "create", "update", "delete", "query"])
    """The private link scope unique Identifier."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        scope_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 ProvisioningIssue(_Model):
    """Describes a provisioning issue for a network security perimeter configuration.

    :ivar name: Name of the issue.
    :vartype name: str
    :ivar properties:
    :vartype properties: ~azure.mgmt.loganalytics.models.ProvisioningIssueProperties
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Name of the issue."""
    properties: Optional["_models.ProvisioningIssueProperties"] = rest_field(visibility=["read"])


class ProvisioningIssueProperties(_Model):
    """Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource
    providers should generate separate provisioning issue elements for each separate issue
    detected, and include a meaningful and distinctive description, as well as any appropriate
    suggestedResourceIds and suggestedAccessRules.

    :ivar issue_type: Type of issue. Known values are: "Unknown",
     "ConfigurationPropagationFailure", "MissingPerimeterConfiguration", and
     "MissingIdentityConfiguration".
    :vartype issue_type: str or ~azure.mgmt.loganalytics.models.IssueType
    :ivar severity: Severity of the issue. Known values are: "Warning" and "Error".
    :vartype severity: str or ~azure.mgmt.loganalytics.models.Severity
    :ivar description: Description of the issue.
    :vartype description: str
    :ivar suggested_resource_ids: Fully qualified resource IDs of suggested resources that can be
     associated to the network security perimeter (NSP) to remediate the issue.
    :vartype suggested_resource_ids: list[str]
    :ivar suggested_access_rules: Access rules that can be added to the network security profile
     (NSP) to remediate the issue.
    :vartype suggested_access_rules: list[~azure.mgmt.loganalytics.models.AccessRule]
    """

    issue_type: Optional[Union[str, "_models.IssueType"]] = rest_field(name="issueType", visibility=["read"])
    """Type of issue. Known values are: \"Unknown\", \"ConfigurationPropagationFailure\",
     \"MissingPerimeterConfiguration\", and \"MissingIdentityConfiguration\"."""
    severity: Optional[Union[str, "_models.Severity"]] = rest_field(visibility=["read"])
    """Severity of the issue. Known values are: \"Warning\" and \"Error\"."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Description of the issue."""
    suggested_resource_ids: Optional[list[str]] = rest_field(name="suggestedResourceIds", visibility=["read"])
    """Fully qualified resource IDs of suggested resources that can be associated to the network
     security perimeter (NSP) to remediate the issue."""
    suggested_access_rules: Optional[list["_models.AccessRule"]] = rest_field(
        name="suggestedAccessRules", visibility=["read"]
    )
    """Access rules that can be added to the network security profile (NSP) to remediate the issue."""


class ResourceAssociation(_Model):
    """Information about resource association.

    :ivar name: Name of the resource association.
    :vartype name: str
    :ivar access_mode: Known values are: "Enforced", "Learning", and "Audit".
    :vartype access_mode: str or ~azure.mgmt.loganalytics.models.ResourceAssociationAccessMode
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the resource association."""
    access_mode: Optional[Union[str, "_models.ResourceAssociationAccessMode"]] = rest_field(
        name="accessMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"Enforced\", \"Learning\", and \"Audit\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        access_mode: Optional[Union[str, "_models.ResourceAssociationAccessMode"]] = 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 RestoredLogs(_Model):
    """Restore parameters.

    :ivar start_restore_time: The timestamp to start the restore from (UTC).
    :vartype start_restore_time: ~datetime.datetime
    :ivar end_restore_time: The timestamp to end the restore by (UTC).
    :vartype end_restore_time: ~datetime.datetime
    :ivar source_table: The table to restore data from.
    :vartype source_table: str
    :ivar azure_async_operation_id: Search results table async operation id.
    :vartype azure_async_operation_id: str
    """

    start_restore_time: Optional[datetime.datetime] = rest_field(
        name="startRestoreTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp to start the restore from (UTC)."""
    end_restore_time: Optional[datetime.datetime] = rest_field(
        name="endRestoreTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp to end the restore by (UTC)."""
    source_table: Optional[str] = rest_field(
        name="sourceTable", visibility=["read", "create", "update", "delete", "query"]
    )
    """The table to restore data from."""
    azure_async_operation_id: Optional[str] = rest_field(name="azureAsyncOperationId", visibility=["read"])
    """Search results table async operation id."""

    @overload
    def __init__(
        self,
        *,
        start_restore_time: Optional[datetime.datetime] = None,
        end_restore_time: Optional[datetime.datetime] = None,
        source_table: 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 ResultStatistics(_Model):
    """Search job execution statistics.

    :ivar progress: Search job completion percentage.
    :vartype progress: float
    :ivar ingested_records: The number of rows that were returned by the search job.
    :vartype ingested_records: int
    :ivar scanned_gb: Search job: Amount of scanned data.
    :vartype scanned_gb: float
    """

    progress: Optional[float] = rest_field(visibility=["read"])
    """Search job completion percentage."""
    ingested_records: Optional[int] = rest_field(name="ingestedRecords", visibility=["read"])
    """The number of rows that were returned by the search job."""
    scanned_gb: Optional[float] = rest_field(name="scannedGb", visibility=["read"])
    """Search job: Amount of scanned data."""


class RuleDefinition(_Model):
    """Rule definition parameters.

    :ivar query: Summary rule query.
    :vartype query: str
    :ivar bin_size: Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720,
     1440.
    :vartype bin_size: int
    :ivar bin_delay: The minimum delay in seconds before bin processing.
    :vartype bin_delay: int
    :ivar bin_start_time: The start time (UTC) when Summary rule execution starts.
    :vartype bin_start_time: ~datetime.datetime
    :ivar time_selector: The time cursor used in Summary rules bins processing, e.g. TimeGenerated.
     "TimeGenerated"
    :vartype time_selector: str or ~azure.mgmt.loganalytics.models.TimeSelectorEnum
    :ivar destination_table: The destination table used for the Summary rule results.
    :vartype destination_table: str
    """

    query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Summary rule query."""
    bin_size: Optional[int] = rest_field(name="binSize", visibility=["read", "create", "update", "delete", "query"])
    """Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440."""
    bin_delay: Optional[int] = rest_field(name="binDelay", visibility=["read", "create", "update", "delete", "query"])
    """The minimum delay in seconds before bin processing."""
    bin_start_time: Optional[datetime.datetime] = rest_field(
        name="binStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start time (UTC) when Summary rule execution starts."""
    time_selector: Optional[Union[str, "_models.TimeSelectorEnum"]] = rest_field(
        name="timeSelector", visibility=["read", "create", "update", "delete", "query"]
    )
    """The time cursor used in Summary rules bins processing, e.g. TimeGenerated. \"TimeGenerated\""""
    destination_table: Optional[str] = rest_field(
        name="destinationTable", visibility=["read", "create", "update", "delete", "query"]
    )
    """The destination table used for the Summary rule results."""

    @overload
    def __init__(
        self,
        *,
        query: Optional[str] = None,
        bin_size: Optional[int] = None,
        bin_delay: Optional[int] = None,
        bin_start_time: Optional[datetime.datetime] = None,
        time_selector: Optional[Union[str, "_models.TimeSelectorEnum"]] = None,
        destination_table: 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 SavedSearch(ProxyResource):
    """Value object for saved search results.

    :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.loganalytics.models.SystemData
    :ivar properties: The properties of the saved search. Required.
    :vartype properties: ~azure.mgmt.loganalytics.models.SavedSearchProperties
    :ivar etag: The ETag of the saved search. To override an existing saved search, use "*" or
     specify the current Etag.
    :vartype etag: str
    """

    properties: "_models.SavedSearchProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The properties of the saved search. Required."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the saved search. To override an existing saved search, use \"*\" or specify the
     current Etag."""

    __flattened_items = [
        "category",
        "display_name",
        "query",
        "function_alias",
        "function_parameters",
        "version",
        "tags",
    ]

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

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

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

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

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


class SavedSearchesListResult(_Model):
    """The saved search list operation response.

    :ivar value: The array of result values.
    :vartype value: list[~azure.mgmt.loganalytics.models.SavedSearch]
    """

    value: Optional[list["_models.SavedSearch"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of result values."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.SavedSearch"]] = 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 SavedSearchProperties(_Model):
    """Value object for saved search results.

    :ivar category: The category of the saved search. This helps the user to find a saved search
     faster. Required.
    :vartype category: str
    :ivar display_name: Saved search display name. Required.
    :vartype display_name: str
    :ivar query: The query expression for the saved search. Required.
    :vartype query: str
    :ivar function_alias: The function alias if query serves as a function.
    :vartype function_alias: str
    :ivar function_parameters: The optional function parameters if query serves as a function.
     Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2
     = default_value2'. For more examples and proper syntax please refer to
     `https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions
     <https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions>`_.
    :vartype function_parameters: str
    :ivar version: The version number of the query language. The current version is 2 and is the
     default.
    :vartype version: int
    :ivar tags: The tags attached to the saved search.
    :vartype tags: list[~azure.mgmt.loganalytics.models.Tag]
    """

    category: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The category of the saved search. This helps the user to find a saved search faster. Required."""
    display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"])
    """Saved search display name. Required."""
    query: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The query expression for the saved search. Required."""
    function_alias: Optional[str] = rest_field(
        name="functionAlias", visibility=["read", "create", "update", "delete", "query"]
    )
    """The function alias if query serves as a function."""
    function_parameters: Optional[str] = rest_field(
        name="functionParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """The optional function parameters if query serves as a function. Value should be in the
     following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For
     more examples and proper syntax please refer to
     `https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions
     <https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions>`_."""
    version: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The version number of the query language. The current version is 2 and is the default."""
    tags: Optional[list["_models.Tag"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags attached to the saved search."""

    @overload
    def __init__(
        self,
        *,
        category: str,
        display_name: str,
        query: str,
        function_alias: Optional[str] = None,
        function_parameters: Optional[str] = None,
        version: Optional[int] = None,
        tags: Optional[list["_models.Tag"]] = 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 Schema(_Model):
    """Table's schema.

    :ivar name: Table name.
    :vartype name: str
    :ivar display_name: Table display name.
    :vartype display_name: str
    :ivar description: Table description.
    :vartype description: str
    :ivar columns: A list of table custom columns.
    :vartype columns: list[~azure.mgmt.loganalytics.models.Column]
    :ivar standard_columns: A list of table standard columns.
    :vartype standard_columns: list[~azure.mgmt.loganalytics.models.Column]
    :ivar categories: Table category.
    :vartype categories: list[str]
    :ivar labels: Table labels.
    :vartype labels: list[str]
    :ivar source: Table's creator. Known values are: "microsoft" and "customer".
    :vartype source: str or ~azure.mgmt.loganalytics.models.SourceEnum
    :ivar table_type: Table's creator. Known values are: "Microsoft", "CustomLog", "RestoredLogs",
     and "SearchResults".
    :vartype table_type: str or ~azure.mgmt.loganalytics.models.TableTypeEnum
    :ivar table_sub_type: The subtype describes what APIs can be used to interact with the table,
     and what features are available against it. Known values are: "Any", "Classic", and
     "DataCollectionRuleBased".
    :vartype table_sub_type: str or ~azure.mgmt.loganalytics.models.TableSubTypeEnum
    :ivar solutions: List of solutions the table is affiliated with.
    :vartype solutions: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Table name."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Table display name."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Table description."""
    columns: Optional[list["_models.Column"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of table custom columns."""
    standard_columns: Optional[list["_models.Column"]] = rest_field(name="standardColumns", visibility=["read"])
    """A list of table standard columns."""
    categories: Optional[list[str]] = rest_field(visibility=["read"])
    """Table category."""
    labels: Optional[list[str]] = rest_field(visibility=["read"])
    """Table labels."""
    source: Optional[Union[str, "_models.SourceEnum"]] = rest_field(visibility=["read"])
    """Table's creator. Known values are: \"microsoft\" and \"customer\"."""
    table_type: Optional[Union[str, "_models.TableTypeEnum"]] = rest_field(name="tableType", visibility=["read"])
    """Table's creator. Known values are: \"Microsoft\", \"CustomLog\", \"RestoredLogs\", and
     \"SearchResults\"."""
    table_sub_type: Optional[Union[str, "_models.TableSubTypeEnum"]] = rest_field(
        name="tableSubType", visibility=["read"]
    )
    """The subtype describes what APIs can be used to interact with the table, and what features are
     available against it. Known values are: \"Any\", \"Classic\", and \"DataCollectionRuleBased\"."""
    solutions: Optional[list[str]] = rest_field(visibility=["read"])
    """List of solutions the table is affiliated with."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        description: Optional[str] = None,
        columns: Optional[list["_models.Column"]] = 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 SearchGetSchemaResponse(_Model):
    """The get schema operation response.

    :ivar metadata: The metadata from search results.
    :vartype metadata: ~azure.mgmt.loganalytics.models.SearchMetadata
    :ivar value: The array of result values.
    :vartype value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue]
    """

    metadata: Optional["_models.SearchMetadata"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The metadata from search results."""
    value: Optional[list["_models.SearchSchemaValue"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of result values."""

    @overload
    def __init__(
        self,
        *,
        metadata: Optional["_models.SearchMetadata"] = None,
        value: Optional[list["_models.SearchSchemaValue"]] = 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 SearchMetadata(_Model):
    """Metadata for search results.

    :ivar search_id: The request id of the search.
    :vartype search_id: str
    :ivar result_type: The search result type.
    :vartype result_type: str
    :ivar total: The total number of search results.
    :vartype total: int
    :ivar top: The number of top search results.
    :vartype top: int
    :ivar id: The id of the search results request.
    :vartype id: str
    :ivar core_summaries: The core summaries.
    :vartype core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary]
    :ivar status: The status of the search results.
    :vartype status: str
    :ivar start_time: The start time for the search.
    :vartype start_time: ~datetime.datetime
    :ivar last_updated: The time of last update.
    :vartype last_updated: ~datetime.datetime
    :ivar e_tag: The ETag of the search results.
    :vartype e_tag: str
    :ivar sort: How the results are sorted.
    :vartype sort: list[~azure.mgmt.loganalytics.models.SearchSort]
    :ivar request_time: The request time.
    :vartype request_time: int
    :ivar aggregated_value_field: The aggregated value field.
    :vartype aggregated_value_field: str
    :ivar aggregated_grouping_fields: The aggregated grouping fields.
    :vartype aggregated_grouping_fields: str
    :ivar sum: The sum of all aggregates returned in the result set.
    :vartype sum: int
    :ivar max: The max of all aggregates returned in the result set.
    :vartype max: int
    :ivar schema: The schema.
    :vartype schema: ~azure.mgmt.loganalytics.models.SearchMetadataSchema
    """

    search_id: Optional[str] = rest_field(name="requestId", visibility=["read", "create", "update", "delete", "query"])
    """The request id of the search."""
    result_type: Optional[str] = rest_field(
        name="resultType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The search result type."""
    total: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The total number of search results."""
    top: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of top search results."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The id of the search results request."""
    core_summaries: Optional[list["_models.CoreSummary"]] = rest_field(
        name="coreSummaries", visibility=["read", "create", "update", "delete", "query"]
    )
    """The core summaries."""
    status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The status of the search results."""
    start_time: Optional[datetime.datetime] = rest_field(
        name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start time for the search."""
    last_updated: Optional[datetime.datetime] = rest_field(
        name="lastUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time of last update."""
    e_tag: Optional[str] = rest_field(name="eTag", visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the search results."""
    sort: Optional[list["_models.SearchSort"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """How the results are sorted."""
    request_time: Optional[int] = rest_field(
        name="requestTime", visibility=["read", "create", "update", "delete", "query"]
    )
    """The request time."""
    aggregated_value_field: Optional[str] = rest_field(
        name="aggregatedValueField", visibility=["read", "create", "update", "delete", "query"]
    )
    """The aggregated value field."""
    aggregated_grouping_fields: Optional[str] = rest_field(
        name="aggregatedGroupingFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """The aggregated grouping fields."""
    sum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The sum of all aggregates returned in the result set."""
    max: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The max of all aggregates returned in the result set."""
    schema: Optional["_models.SearchMetadataSchema"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The schema."""

    @overload
    def __init__(
        self,
        *,
        search_id: Optional[str] = None,
        result_type: Optional[str] = None,
        total: Optional[int] = None,
        top: Optional[int] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        core_summaries: Optional[list["_models.CoreSummary"]] = None,
        status: Optional[str] = None,
        start_time: Optional[datetime.datetime] = None,
        last_updated: Optional[datetime.datetime] = None,
        e_tag: Optional[str] = None,
        sort: Optional[list["_models.SearchSort"]] = None,
        request_time: Optional[int] = None,
        aggregated_value_field: Optional[str] = None,
        aggregated_grouping_fields: Optional[str] = None,
        sum: Optional[int] = None,
        max: Optional[int] = None,  # pylint: disable=redefined-builtin
        schema: Optional["_models.SearchMetadataSchema"] = 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 SearchMetadataSchema(_Model):
    """Schema metadata for search.

    :ivar name: The name of the metadata schema.
    :vartype name: str
    :ivar version: The version of the metadata schema.
    :vartype version: int
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the metadata schema."""
    version: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The version of the metadata schema."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        version: 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 SearchResults(_Model):
    """Parameters of the search job that initiated this table.

    :ivar query: Search job query.
    :vartype query: str
    :ivar description: Search job Description.
    :vartype description: str
    :ivar limit: Limit the search job to return up to specified number of rows.
    :vartype limit: int
    :ivar start_search_time: The timestamp to start the search from (UTC).
    :vartype start_search_time: ~datetime.datetime
    :ivar end_search_time: The timestamp to end the search by (UTC).
    :vartype end_search_time: ~datetime.datetime
    :ivar source_table: The table used in the search job.
    :vartype source_table: str
    :ivar azure_async_operation_id: Search results table async operation id.
    :vartype azure_async_operation_id: str
    """

    query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Search job query."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Search job Description."""
    limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Limit the search job to return up to specified number of rows."""
    start_search_time: Optional[datetime.datetime] = rest_field(
        name="startSearchTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp to start the search from (UTC)."""
    end_search_time: Optional[datetime.datetime] = rest_field(
        name="endSearchTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp to end the search by (UTC)."""
    source_table: Optional[str] = rest_field(name="sourceTable", visibility=["read"])
    """The table used in the search job."""
    azure_async_operation_id: Optional[str] = rest_field(name="azureAsyncOperationId", visibility=["read"])
    """Search results table async operation id."""

    @overload
    def __init__(
        self,
        *,
        query: Optional[str] = None,
        description: Optional[str] = None,
        limit: Optional[int] = None,
        start_search_time: Optional[datetime.datetime] = None,
        end_search_time: Optional[datetime.datetime] = None,
    ) -> None: ...

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

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


class SearchSchemaValue(_Model):
    """Value object for schema results.

    :ivar name: The name of the schema.
    :vartype name: str
    :ivar display_name: The display name of the schema.
    :vartype display_name: str
    :ivar type: The type.
    :vartype type: str
    :ivar indexed: The boolean that indicates the field is searchable as free text. Required.
    :vartype indexed: bool
    :ivar stored: The boolean that indicates whether or not the field is stored. Required.
    :vartype stored: bool
    :ivar facet: The boolean that indicates whether or not the field is a facet. Required.
    :vartype facet: bool
    :ivar owner_type: The array of workflows containing the field.
    :vartype owner_type: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the schema."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name of the schema."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type."""
    indexed: bool = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The boolean that indicates the field is searchable as free text. Required."""
    stored: bool = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The boolean that indicates whether or not the field is stored. Required."""
    facet: bool = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The boolean that indicates whether or not the field is a facet. Required."""
    owner_type: Optional[list[str]] = rest_field(
        name="ownerType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of workflows containing the field."""

    @overload
    def __init__(
        self,
        *,
        indexed: bool,
        stored: bool,
        facet: bool,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        type: Optional[str] = None,
        owner_type: 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 SearchSort(_Model):
    """The sort parameters for search.

    :ivar name: The name of the field the search query is sorted on.
    :vartype name: str
    :ivar order: The sort order of the search. Known values are: "asc" and "desc".
    :vartype order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the field the search query is sorted on."""
    order: Optional[Union[str, "_models.SearchSortEnum"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The sort order of the search. Known values are: \"asc\" and \"desc\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        order: Optional[Union[str, "_models.SearchSortEnum"]] = 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 SharedKeys(_Model):
    """The shared keys for a workspace.

    :ivar primary_shared_key: The primary shared key of a workspace.
    :vartype primary_shared_key: str
    :ivar secondary_shared_key: The secondary shared key of a workspace.
    :vartype secondary_shared_key: str
    """

    primary_shared_key: Optional[str] = rest_field(
        name="primarySharedKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The primary shared key of a workspace."""
    secondary_shared_key: Optional[str] = rest_field(
        name="secondarySharedKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secondary shared key of a workspace."""

    @overload
    def __init__(
        self,
        *,
        primary_shared_key: Optional[str] = None,
        secondary_shared_key: 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 StorageAccount(_Model):
    """Describes a storage account connection.

    :ivar id: The Azure Resource Manager ID of the storage account resource. Required.
    :vartype id: str
    :ivar key: The storage account key. Required.
    :vartype key: str
    """

    id: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Azure Resource Manager ID of the storage account resource. Required."""
    key: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The storage account key. Required."""

    @overload
    def __init__(
        self,
        *,
        id: str,  # pylint: disable=redefined-builtin
        key: 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 StorageInsight(ProxyResource):
    """The top level storage insight resource container.

    :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.loganalytics.models.SystemData
    :ivar properties: Storage insight properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.StorageInsightProperties
    :ivar e_tag: The ETag of the storage insight.
    :vartype e_tag: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.StorageInsightProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage insight properties."""
    e_tag: Optional[str] = rest_field(name="eTag", visibility=["read", "create", "update", "delete", "query"])
    """The ETag of the storage insight."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""

    __flattened_items = ["containers", "tables", "storage_account", "status"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.StorageInsightProperties"] = None,
        e_tag: Optional[str] = None,
        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:
        _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 StorageInsightProperties(_Model):
    """Storage insight properties.

    :ivar containers: The names of the blob containers that the workspace should read.
    :vartype containers: list[str]
    :ivar tables: The names of the Azure tables that the workspace should read.
    :vartype tables: list[str]
    :ivar storage_account: The storage account connection details. Required.
    :vartype storage_account: ~azure.mgmt.loganalytics.models.StorageAccount
    :ivar status: The status of the storage insight.
    :vartype status: ~azure.mgmt.loganalytics.models.StorageInsightStatus
    """

    containers: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The names of the blob containers that the workspace should read."""
    tables: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The names of the Azure tables that the workspace should read."""
    storage_account: "_models.StorageAccount" = rest_field(
        name="storageAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The storage account connection details. Required."""
    status: Optional["_models.StorageInsightStatus"] = rest_field(visibility=["read"])
    """The status of the storage insight."""

    @overload
    def __init__(
        self,
        *,
        storage_account: "_models.StorageAccount",
        containers: Optional[list[str]] = None,
        tables: 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 StorageInsightStatus(_Model):
    """The status of the storage insight.

    :ivar state: The state of the storage insight connection to the workspace. Required. Known
     values are: "OK" and "ERROR".
    :vartype state: str or ~azure.mgmt.loganalytics.models.StorageInsightState
    :ivar description: Description of the state of the storage insight.
    :vartype description: str
    """

    state: Union[str, "_models.StorageInsightState"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The state of the storage insight connection to the workspace. Required. Known values are:
     \"OK\" and \"ERROR\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the state of the storage insight."""

    @overload
    def __init__(
        self,
        *,
        state: Union[str, "_models.StorageInsightState"],
        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 SummaryLogs(ProxyResource):
    """Workspace data summary rules definition.

    :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.loganalytics.models.SystemData
    :ivar properties: Summary rule properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.SummaryLogsProperties
    """

    properties: Optional["_models.SummaryLogsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Summary rule properties."""

    __flattened_items = [
        "rule_type",
        "display_name",
        "description",
        "is_active",
        "status_code",
        "provisioning_state",
        "rule_definition",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SummaryLogsProperties"] = 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 SummaryLogsProperties(_Model):
    """Summary rule properties.

    :ivar rule_type: SummaryRules rule type: User. "User"
    :vartype rule_type: str or ~azure.mgmt.loganalytics.models.RuleTypeEnum
    :ivar display_name: The display name of the Summary rule.
    :vartype display_name: str
    :ivar description: The description of the Summary rule.
    :vartype description: str
    :ivar is_active: Indicates if Summary rule is active. If not, Summary rule execution stops.
    :vartype is_active: bool
    :ivar status_code: Indicates the reason for rule deactivation. Known values are: "UserAction"
     and "DataPlaneError".
    :vartype status_code: str or ~azure.mgmt.loganalytics.models.StatusCodeEnum
    :ivar provisioning_state: Summary rule is in provisioning state. If set to 'updating' or
     'deleting', indicates a resource lock due to an ongoing operation, preventing any update to the
     Summary rule until the operation is complete. Known values are: "Updating", "Succeeded",
     "Deleting", "Failed", and "Canceled".
    :vartype provisioning_state: str or
     ~azure.mgmt.loganalytics.models.SummaryLogsProvisioningState
    :ivar rule_definition: Rule definition parameters.
    :vartype rule_definition: ~azure.mgmt.loganalytics.models.RuleDefinition
    """

    rule_type: Optional[Union[str, "_models.RuleTypeEnum"]] = rest_field(
        name="ruleType", visibility=["read", "create", "update", "delete", "query"]
    )
    """SummaryRules rule type: User. \"User\""""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name of the Summary rule."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of the Summary rule."""
    is_active: Optional[bool] = rest_field(name="isActive", visibility=["read"])
    """Indicates if Summary rule is active. If not, Summary rule execution stops."""
    status_code: Optional[Union[str, "_models.StatusCodeEnum"]] = rest_field(name="statusCode", visibility=["read"])
    """Indicates the reason for rule deactivation. Known values are: \"UserAction\" and
     \"DataPlaneError\"."""
    provisioning_state: Optional[Union[str, "_models.SummaryLogsProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Summary rule is in provisioning state. If set to 'updating' or 'deleting', indicates a resource
     lock due to an ongoing operation, preventing any update to the Summary rule until the operation
     is complete. Known values are: \"Updating\", \"Succeeded\", \"Deleting\", \"Failed\", and
     \"Canceled\"."""
    rule_definition: Optional["_models.RuleDefinition"] = rest_field(
        name="ruleDefinition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Rule definition parameters."""

    @overload
    def __init__(
        self,
        *,
        rule_type: Optional[Union[str, "_models.RuleTypeEnum"]] = None,
        display_name: Optional[str] = None,
        description: Optional[str] = None,
        rule_definition: Optional["_models.RuleDefinition"] = 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 SummaryLogsRetryBin(_Model):
    """Request to retry a summary logs bin.

    :ivar properties: Retry bin properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.SummaryLogsRetryBinProperties
    """

    properties: Optional["_models.SummaryLogsRetryBinProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Retry bin properties."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SummaryLogsRetryBinProperties"] = 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 SummaryLogsRetryBinProperties(_Model):
    """Properties for retrying a Summary rule bin.

    :ivar retry_bin_start_time: The time (UTC) of the bin to retry. Required.
    :vartype retry_bin_start_time: ~datetime.datetime
    """

    retry_bin_start_time: datetime.datetime = rest_field(
        name="retryBinStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time (UTC) of the bin to retry. Required."""

    @overload
    def __init__(
        self,
        *,
        retry_bin_start_time: 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 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.loganalytics.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.loganalytics.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 Table(ProxyResource):
    """Workspace data table definition.

    :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.loganalytics.models.SystemData
    :ivar properties: Table's properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.TableProperties
    """

    properties: Optional["_models.TableProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Table's properties."""

    __flattened_items = [
        "retention_in_days",
        "total_retention_in_days",
        "archive_retention_in_days",
        "search_results",
        "restored_logs",
        "result_statistics",
        "plan",
        "last_plan_modified_date",
        "schema",
        "provisioning_state",
        "retention_in_days_as_default",
        "total_retention_in_days_as_default",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TableProperties"] = 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 TableProperties(_Model):
    """Table properties.

    :ivar retention_in_days: In Analytics table: the tables analytics retention in days, between 4
     and 730. Setting this property to -1 will default to the workspace retention. In Basic and
     Auxiliary table: read only property.
    :vartype retention_in_days: int
    :ivar total_retention_in_days: The table total retention in days, between 4 and 4383. Setting
     this property to -1 will default to retentionInDays.
    :vartype total_retention_in_days: int
    :ivar archive_retention_in_days: The tables long-term retention in days. Calculated as
     (totalRetentionInDays-retentionInDays).
    :vartype archive_retention_in_days: int
    :ivar search_results: Parameters of the search job that initiated this table.
    :vartype search_results: ~azure.mgmt.loganalytics.models.SearchResults
    :ivar restored_logs: Parameters of the restore operation that initiated this table.
    :vartype restored_logs: ~azure.mgmt.loganalytics.models.RestoredLogs
    :ivar result_statistics: Search job execution statistics.
    :vartype result_statistics: ~azure.mgmt.loganalytics.models.ResultStatistics
    :ivar plan: Instruct the system how to handle and charge the logs ingested to this table. Known
     values are: "Basic", "Analytics", and "Auxiliary".
    :vartype plan: str or ~azure.mgmt.loganalytics.models.TablePlanEnum
    :ivar last_plan_modified_date: The timestamp that table plan was last modified (UTC).
    :vartype last_plan_modified_date: str
    :ivar schema: Table schema.
    :vartype schema: ~azure.mgmt.loganalytics.models.Schema
    :ivar provisioning_state: Table's current provisioning state. If set to 'updating', indicates a
     resource lock due to ongoing operation, forbidding any update to the table until the ongoing
     operation is concluded. Known values are: "Updating", "InProgress", "Succeeded", and
     "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.ProvisioningStateEnum
    :ivar retention_in_days_as_default: True - Value originates from workspace retention in days,
     False - Customer specific.
    :vartype retention_in_days_as_default: bool
    :ivar total_retention_in_days_as_default: True - Value originates from retention in days, False
     - Customer specific.
    :vartype total_retention_in_days_as_default: bool
    """

    retention_in_days: Optional[int] = rest_field(
        name="retentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """In Analytics table: the tables analytics retention in days, between 4 and 730. Setting this
     property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only
     property."""
    total_retention_in_days: Optional[int] = rest_field(
        name="totalRetentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """The table total retention in days, between 4 and 4383. Setting this property to -1 will default
     to retentionInDays."""
    archive_retention_in_days: Optional[int] = rest_field(name="archiveRetentionInDays", visibility=["read"])
    """The tables long-term retention in days. Calculated as (totalRetentionInDays-retentionInDays)."""
    search_results: Optional["_models.SearchResults"] = rest_field(
        name="searchResults", visibility=["read", "create", "update", "delete", "query"]
    )
    """Parameters of the search job that initiated this table."""
    restored_logs: Optional["_models.RestoredLogs"] = rest_field(
        name="restoredLogs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Parameters of the restore operation that initiated this table."""
    result_statistics: Optional["_models.ResultStatistics"] = rest_field(name="resultStatistics", visibility=["read"])
    """Search job execution statistics."""
    plan: Optional[Union[str, "_models.TablePlanEnum"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Instruct the system how to handle and charge the logs ingested to this table. Known values are:
     \"Basic\", \"Analytics\", and \"Auxiliary\"."""
    last_plan_modified_date: Optional[str] = rest_field(name="lastPlanModifiedDate", visibility=["read"])
    """The timestamp that table plan was last modified (UTC)."""
    schema: Optional["_models.Schema"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Table schema."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningStateEnum"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Table's current provisioning state. If set to 'updating', indicates a resource lock due to
     ongoing operation, forbidding any update to the table until the ongoing operation is concluded.
     Known values are: \"Updating\", \"InProgress\", \"Succeeded\", and \"Deleting\"."""
    retention_in_days_as_default: Optional[bool] = rest_field(name="retentionInDaysAsDefault", visibility=["read"])
    """True - Value originates from workspace retention in days, False - Customer specific."""
    total_retention_in_days_as_default: Optional[bool] = rest_field(
        name="totalRetentionInDaysAsDefault", visibility=["read"]
    )
    """True - Value originates from retention in days, False - Customer specific."""

    @overload
    def __init__(
        self,
        *,
        retention_in_days: Optional[int] = None,
        total_retention_in_days: Optional[int] = None,
        search_results: Optional["_models.SearchResults"] = None,
        restored_logs: Optional["_models.RestoredLogs"] = None,
        plan: Optional[Union[str, "_models.TablePlanEnum"]] = None,
        schema: Optional["_models.Schema"] = 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 Tag(_Model):
    """A tag of a saved search.

    :ivar name: The tag name. Required.
    :vartype name: str
    :ivar value: The tag value. Required.
    :vartype value: str
    """

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

    @overload
    def __init__(
        self,
        *,
        name: str,
        value: 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 TagsResource(_Model):
    """A container holding only the Tags for a resource, allowing the user to update the tags on a
    QueryPack instance.

    :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 UsageMetric(_Model):
    """A metric describing the usage of a resource.

    :ivar name: The name of the metric.
    :vartype name: ~azure.mgmt.loganalytics.models.MetricName
    :ivar unit: The units used for the metric.
    :vartype unit: str
    :ivar current_value: The current value of the metric.
    :vartype current_value: float
    :ivar limit: The quota limit for the metric.
    :vartype limit: float
    :ivar next_reset_time: The time that the metric's value will reset.
    :vartype next_reset_time: ~datetime.datetime
    :ivar quota_period: The quota period that determines the length of time between value resets.
    :vartype quota_period: str
    """

    name: Optional["_models.MetricName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the metric."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The units used for the metric."""
    current_value: Optional[float] = rest_field(
        name="currentValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The current value of the metric."""
    limit: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quota limit for the metric."""
    next_reset_time: Optional[datetime.datetime] = rest_field(
        name="nextResetTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time that the metric's value will reset."""
    quota_period: Optional[str] = rest_field(
        name="quotaPeriod", visibility=["read", "create", "update", "delete", "query"]
    )
    """The quota period that determines the length of time between value resets."""

    @overload
    def __init__(
        self,
        *,
        name: Optional["_models.MetricName"] = None,
        unit: Optional[str] = None,
        current_value: Optional[float] = None,
        limit: Optional[float] = None,
        next_reset_time: Optional[datetime.datetime] = None,
        quota_period: 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 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 UserIdentityProperties(_Model):
    """User assigned identity properties.

    :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 Workspace(TrackedResource):
    """The top level Workspace resource container.

    :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.loganalytics.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: Workspace properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.WorkspaceProperties
    :ivar identity: The identity of the resource.
    :vartype identity: ~azure.mgmt.loganalytics.models.Identity
    :ivar etag: The etag of the workspace.
    :vartype etag: str
    """

    properties: Optional["_models.WorkspaceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Workspace properties."""
    identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The identity of the resource."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The etag of the workspace."""

    __flattened_items = [
        "provisioning_state",
        "customer_id",
        "sku",
        "retention_in_days",
        "workspace_capping",
        "created_date",
        "modified_date",
        "public_network_access_for_ingestion",
        "public_network_access_for_query",
        "force_cmk_for_query",
        "private_link_scoped_resources",
        "features",
        "default_data_collection_rule_resource_id",
        "replication",
        "failover",
    ]

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

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

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

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

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


class WorkspaceCapping(_Model):
    """The daily volume cap for ingestion.

    :ivar daily_quota_gb: The workspace daily quota for ingestion.
    :vartype daily_quota_gb: float
    :ivar quota_next_reset_time: The time when the quota will be rest.
    :vartype quota_next_reset_time: str
    :ivar data_ingestion_status: The status of data ingestion for this workspace. Known values are:
     "RespectQuota", "ForceOn", "ForceOff", "OverQuota", "SubscriptionSuspended", and
     "ApproachingQuota".
    :vartype data_ingestion_status: str or ~azure.mgmt.loganalytics.models.DataIngestionStatus
    """

    daily_quota_gb: Optional[float] = rest_field(
        name="dailyQuotaGb", visibility=["read", "create", "update", "delete", "query"]
    )
    """The workspace daily quota for ingestion."""
    quota_next_reset_time: Optional[str] = rest_field(name="quotaNextResetTime", visibility=["read"])
    """The time when the quota will be rest."""
    data_ingestion_status: Optional[Union[str, "_models.DataIngestionStatus"]] = rest_field(
        name="dataIngestionStatus", visibility=["read"]
    )
    """The status of data ingestion for this workspace. Known values are: \"RespectQuota\",
     \"ForceOn\", \"ForceOff\", \"OverQuota\", \"SubscriptionSuspended\", and \"ApproachingQuota\"."""

    @overload
    def __init__(
        self,
        *,
        daily_quota_gb: Optional[float] = 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 WorkspaceFailoverProperties(_Model):
    """The failover state of the replication.

    :ivar state: The failover state of the replication. Known values are: "Inactive", "Activating",
     "Active", "Deactivating", and "Failed".
    :vartype state: str or ~azure.mgmt.loganalytics.models.WorkspaceFailoverState
    :ivar last_modified_date: The last time when the failover state was updated.
    :vartype last_modified_date: ~datetime.datetime
    """

    state: Optional[Union[str, "_models.WorkspaceFailoverState"]] = rest_field(visibility=["read"])
    """The failover state of the replication. Known values are: \"Inactive\", \"Activating\",
     \"Active\", \"Deactivating\", and \"Failed\"."""
    last_modified_date: Optional[datetime.datetime] = rest_field(
        name="lastModifiedDate", visibility=["read"], format="rfc3339"
    )
    """The last time when the failover state was updated."""


class WorkspaceFeatures(_Model):
    """Workspace features.

    :ivar enable_data_export: Flag that indicate if data should be exported.
    :vartype enable_data_export: bool
    :ivar immediate_purge_data_on30_days: Flag that describes if we want to remove the data after
     30 days.
    :vartype immediate_purge_data_on30_days: bool
    :ivar enable_log_access_using_only_resource_permissions: Flag that indicate which permission to
     use - resource or workspace or both.
    :vartype enable_log_access_using_only_resource_permissions: bool
    :ivar cluster_resource_id: Dedicated LA cluster resourceId that is linked to the workspaces.
    :vartype cluster_resource_id: str
    :ivar disable_local_auth: Disable Non-AAD based Auth.
    :vartype disable_local_auth: bool
    :ivar unified_sentinel_billing_only: An indication if the specify workspace is limited to
     sentinel's unified billing model only.
    :vartype unified_sentinel_billing_only: bool
    :ivar associations: List of associations for the workspace. Indicates if the workspace is
     associated with any of the following experiences: MDC, Sentinel, SentinelGraph, etc.
    :vartype associations: list[str]
    """

    enable_data_export: Optional[bool] = rest_field(
        name="enableDataExport", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag that indicate if data should be exported."""
    immediate_purge_data_on30_days: Optional[bool] = rest_field(
        name="immediatePurgeDataOn30Days", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag that describes if we want to remove the data after 30 days."""
    enable_log_access_using_only_resource_permissions: Optional[bool] = rest_field(
        name="enableLogAccessUsingOnlyResourcePermissions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag that indicate which permission to use - resource or workspace or both."""
    cluster_resource_id: Optional[str] = rest_field(
        name="clusterResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Dedicated LA cluster resourceId that is linked to the workspaces."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """Disable Non-AAD based Auth."""
    unified_sentinel_billing_only: Optional[bool] = rest_field(name="unifiedSentinelBillingOnly", visibility=["read"])
    """An indication if the specify workspace is limited to sentinel's unified billing model only."""
    associations: Optional[list[str]] = rest_field(visibility=["read"])
    """List of associations for the workspace. Indicates if the workspace is associated with any of
     the following experiences: MDC, Sentinel, SentinelGraph, etc."""

    @overload
    def __init__(
        self,
        *,
        enable_data_export: Optional[bool] = None,
        immediate_purge_data_on30_days: Optional[bool] = None,
        enable_log_access_using_only_resource_permissions: Optional[bool] = None,
        cluster_resource_id: Optional[str] = None,
        disable_local_auth: 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 WorkspacePatch(AzureEntityResource):
    """The top level Workspace resource container.

    :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.loganalytics.models.SystemData
    :ivar etag: Resource Etag.
    :vartype etag: str
    :ivar properties: Workspace properties.
    :vartype properties: ~azure.mgmt.loganalytics.models.WorkspaceProperties
    :ivar identity: The identity of the resource.
    :vartype identity: ~azure.mgmt.loganalytics.models.Identity
    :ivar tags: Resource tags. Optional.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.WorkspaceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Workspace properties."""
    identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The identity of the resource."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags. Optional."""

    __flattened_items = [
        "provisioning_state",
        "customer_id",
        "sku",
        "retention_in_days",
        "workspace_capping",
        "created_date",
        "modified_date",
        "public_network_access_for_ingestion",
        "public_network_access_for_query",
        "force_cmk_for_query",
        "private_link_scoped_resources",
        "features",
        "default_data_collection_rule_resource_id",
        "replication",
        "failover",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.WorkspaceProperties"] = None,
        identity: Optional["_models.Identity"] = None,
        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:
        _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 WorkspaceProperties(_Model):
    """Workspace properties.

    :ivar provisioning_state: The provisioning state of the workspace. Known values are:
     "Creating", "Succeeded", "Failed", "Canceled", "Deleting", "ProvisioningAccount", and
     "Updating".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.WorkspaceEntityStatus
    :ivar customer_id: This is a read-only property. Represents the ID associated with the
     workspace.
    :vartype customer_id: str
    :ivar sku: The SKU of the workspace.
    :vartype sku: ~azure.mgmt.loganalytics.models.WorkspaceSku
    :ivar retention_in_days: The workspace data retention in days. Allowed values are per pricing
     plan. See pricing tiers documentation for details.
    :vartype retention_in_days: int
    :ivar workspace_capping: The daily volume cap for ingestion.
    :vartype workspace_capping: ~azure.mgmt.loganalytics.models.WorkspaceCapping
    :ivar created_date: Workspace creation date.
    :vartype created_date: ~datetime.datetime
    :ivar modified_date: Workspace modification date.
    :vartype modified_date: ~datetime.datetime
    :ivar public_network_access_for_ingestion: The network access type for accessing Log Analytics
     ingestion. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access_for_ingestion: str or
     ~azure.mgmt.loganalytics.models.PublicNetworkAccessType
    :ivar public_network_access_for_query: The network access type for accessing Log Analytics
     query. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access_for_query: str or
     ~azure.mgmt.loganalytics.models.PublicNetworkAccessType
    :ivar force_cmk_for_query: Indicates whether customer managed storage is mandatory for query
     management.
    :vartype force_cmk_for_query: bool
    :ivar private_link_scoped_resources: List of linked private link scope resources.
    :vartype private_link_scoped_resources:
     list[~azure.mgmt.loganalytics.models.PrivateLinkScopedResource]
    :ivar features: Workspace features.
    :vartype features: ~azure.mgmt.loganalytics.models.WorkspaceFeatures
    :ivar default_data_collection_rule_resource_id: The resource ID of the default Data Collection
     Rule to use for this workspace. Expected format is -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}.
    :vartype default_data_collection_rule_resource_id: str
    :ivar replication: workspace replication properties.
    :vartype replication: ~azure.mgmt.loganalytics.models.WorkspaceReplicationProperties
    :ivar failover: workspace failover properties.
    :vartype failover: ~azure.mgmt.loganalytics.models.WorkspaceFailoverProperties
    """

    provisioning_state: Optional[Union[str, "_models.WorkspaceEntityStatus"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the workspace. Known values are: \"Creating\", \"Succeeded\",
     \"Failed\", \"Canceled\", \"Deleting\", \"ProvisioningAccount\", and \"Updating\"."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """This is a read-only property. Represents the ID associated with the workspace."""
    sku: Optional["_models.WorkspaceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the workspace."""
    retention_in_days: Optional[int] = rest_field(
        name="retentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers
     documentation for details."""
    workspace_capping: Optional["_models.WorkspaceCapping"] = rest_field(
        name="workspaceCapping", visibility=["read", "create", "update", "delete", "query"]
    )
    """The daily volume cap for ingestion."""
    created_date: Optional[datetime.datetime] = rest_field(name="createdDate", visibility=["read"], format="rfc3339")
    """Workspace creation date."""
    modified_date: Optional[datetime.datetime] = rest_field(name="modifiedDate", visibility=["read"], format="rfc3339")
    """Workspace modification date."""
    public_network_access_for_ingestion: Optional[Union[str, "_models.PublicNetworkAccessType"]] = rest_field(
        name="publicNetworkAccessForIngestion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The network access type for accessing Log Analytics ingestion. Known values are: \"Enabled\",
     \"Disabled\", and \"SecuredByPerimeter\"."""
    public_network_access_for_query: Optional[Union[str, "_models.PublicNetworkAccessType"]] = rest_field(
        name="publicNetworkAccessForQuery", visibility=["read", "create", "update", "delete", "query"]
    )
    """The network access type for accessing Log Analytics query. Known values are: \"Enabled\",
     \"Disabled\", and \"SecuredByPerimeter\"."""
    force_cmk_for_query: Optional[bool] = rest_field(
        name="forceCmkForQuery", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether customer managed storage is mandatory for query management."""
    private_link_scoped_resources: Optional[list["_models.PrivateLinkScopedResource"]] = rest_field(
        name="privateLinkScopedResources", visibility=["read"]
    )
    """List of linked private link scope resources."""
    features: Optional["_models.WorkspaceFeatures"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Workspace features."""
    default_data_collection_rule_resource_id: Optional[str] = rest_field(
        name="defaultDataCollectionRuleResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource ID of the default Data Collection Rule to use for this workspace. Expected format
     is -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}."""
    replication: Optional["_models.WorkspaceReplicationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """workspace replication properties."""
    failover: Optional["_models.WorkspaceFailoverProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """workspace failover properties."""

    @overload
    def __init__(
        self,
        *,
        sku: Optional["_models.WorkspaceSku"] = None,
        retention_in_days: Optional[int] = None,
        workspace_capping: Optional["_models.WorkspaceCapping"] = None,
        public_network_access_for_ingestion: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None,
        public_network_access_for_query: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None,
        force_cmk_for_query: Optional[bool] = None,
        features: Optional["_models.WorkspaceFeatures"] = None,
        default_data_collection_rule_resource_id: Optional[str] = None,
        replication: Optional["_models.WorkspaceReplicationProperties"] = None,
        failover: Optional["_models.WorkspaceFailoverProperties"] = 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 WorkspacePurgeBody(_Model):
    """Describes the body of a purge request for an App Insights Workspace.

    :ivar table: Table from which to purge data. Required.
    :vartype table: str
    :ivar filters: The set of columns and filters (queries) to run over them to purge the resulting
     data. Required.
    :vartype filters: list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters]
    """

    table: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Table from which to purge data. Required."""
    filters: list["_models.WorkspacePurgeBodyFilters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The set of columns and filters (queries) to run over them to purge the resulting data.
     Required."""

    @overload
    def __init__(
        self,
        *,
        table: str,
        filters: list["_models.WorkspacePurgeBodyFilters"],
    ) -> 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 WorkspacePurgeBodyFilters(_Model):
    """User-defined filters to return data which will be purged from the table.

    :ivar column: The column of the table over which the given query should run.
    :vartype column: str
    :ivar operator: A query operator to evaluate over the provided column and value(s). Supported
     operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would
     in a KQL query.
    :vartype operator: str
    :ivar value: the value for the operator to function over. This can be a number (e.g., > 100), a
     string (timestamp >= '2017-09-01') or array of values.
    :vartype value: any
    :ivar key: When filtering over custom dimensions, this key will be used as the name of the
     custom dimension.
    :vartype key: str
    """

    column: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The column of the table over which the given query should run."""
    operator: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A query operator to evaluate over the provided column and value(s). Supported operators are ==,
     =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query."""
    value: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """the value for the operator to function over. This can be a number (e.g., > 100), a string
     (timestamp >= '2017-09-01') or array of values."""
    key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """When filtering over custom dimensions, this key will be used as the name of the custom
     dimension."""

    @overload
    def __init__(
        self,
        *,
        column: Optional[str] = None,
        operator: Optional[str] = None,
        value: Optional[Any] = None,
        key: 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 WorkspacePurgeResponse(_Model):
    """Response containing operationId for a specific purge action.

    :ivar operation_id: Id to use when querying for status for a particular purge operation.
     Required.
    :vartype operation_id: str
    """

    operation_id: str = rest_field(name="operationId", visibility=["read", "create", "update", "delete", "query"])
    """Id to use when querying for status for a particular purge operation. Required."""

    @overload
    def __init__(
        self,
        *,
        operation_id: 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 WorkspacePurgeStatusResponse(_Model):
    """Response containing status for a specific purge operation.

    :ivar status: Status of the operation represented by the requested Id. Required. Known values
     are: "pending" and "completed".
    :vartype status: str or ~azure.mgmt.loganalytics.models.PurgeState
    """

    status: Union[str, "_models.PurgeState"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Status of the operation represented by the requested Id. Required. Known values are:
     \"pending\" and \"completed\"."""

    @overload
    def __init__(
        self,
        *,
        status: Union[str, "_models.PurgeState"],
    ) -> 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 WorkspaceReplicationProperties(_Model):
    """Workspace replication properties.

    :ivar location: The location of the replication.
    :vartype location: str
    :ivar enabled: Specifies whether the replication is enabled or not. When true, workspace
     configuration and data is replicated to the specified location. If replication is been enabled,
     location must be provided.
    :vartype enabled: bool
    :ivar provisioning_state: The provisioning state of the replication. Known values are:
     "Succeeded", "EnableRequested", "Enabling", "DisableRequested", "Disabling",
     "RollbackRequested", "RollingBack", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.WorkspaceReplicationState
    :ivar created_date: The last time when the replication was enabled.
    :vartype created_date: ~datetime.datetime
    :ivar last_modified_date: The last time when the replication was updated.
    :vartype last_modified_date: ~datetime.datetime
    """

    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The location of the replication."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Specifies whether the replication is enabled or not. When true, workspace configuration and
     data is replicated to the specified location. If replication is been enabled, location must be
     provided."""
    provisioning_state: Optional[Union[str, "_models.WorkspaceReplicationState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the replication. Known values are: \"Succeeded\",
     \"EnableRequested\", \"Enabling\", \"DisableRequested\", \"Disabling\", \"RollbackRequested\",
     \"RollingBack\", \"Failed\", and \"Canceled\"."""
    created_date: Optional[datetime.datetime] = rest_field(name="createdDate", visibility=["read"], format="rfc3339")
    """The last time when the replication was enabled."""
    last_modified_date: Optional[datetime.datetime] = rest_field(
        name="lastModifiedDate", visibility=["read"], format="rfc3339"
    )
    """The last time when the replication was updated."""

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

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

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


class WorkspaceSku(_Model):
    """The SKU (tier) of a workspace.

    :ivar name: The name of the SKU. Required. Known values are: "Free", "Standard", "Premium",
     "PerNode", "PerGB2018", "Standalone", "CapacityReservation", and "LACluster".
    :vartype name: str or ~azure.mgmt.loganalytics.models.WorkspaceSkuNameEnum
    :ivar capacity_reservation_level: The capacity reservation level in GB for this workspace, when
     CapacityReservation sku is selected.
    :vartype capacity_reservation_level: int
    :ivar last_sku_update: The last time when the sku was updated.
    :vartype last_sku_update: ~datetime.datetime
    """

    name: Union[str, "_models.WorkspaceSkuNameEnum"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the SKU. Required. Known values are: \"Free\", \"Standard\", \"Premium\",
     \"PerNode\", \"PerGB2018\", \"Standalone\", \"CapacityReservation\", and \"LACluster\"."""
    capacity_reservation_level: Optional[int] = rest_field(
        name="capacityReservationLevel", visibility=["read", "create", "update", "delete", "query"]
    )
    """The capacity reservation level in GB for this workspace, when CapacityReservation sku is
     selected."""
    last_sku_update: Optional[datetime.datetime] = rest_field(
        name="lastSkuUpdate", visibility=["read"], format="rfc3339"
    )
    """The last time when the sku was updated."""

    @overload
    def __init__(
        self,
        *,
        name: Union[str, "_models.WorkspaceSkuNameEnum"],
        capacity_reservation_level: 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)
