# 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 Annotation(_Model):
    """Annotation associated with an application insights resource.

    :ivar annotation_name: Name of annotation.
    :vartype annotation_name: str
    :ivar category: Category of annotation, free form.
    :vartype category: str
    :ivar event_time: Time when event occurred.
    :vartype event_time: ~datetime.datetime
    :ivar id: Unique Id for annotation.
    :vartype id: str
    :ivar properties: Serialized JSON object for detailed properties.
    :vartype properties: str
    :ivar related_annotation: Related parent annotation if any.
    :vartype related_annotation: str
    """

    annotation_name: Optional[str] = rest_field(
        name="AnnotationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of annotation."""
    category: Optional[str] = rest_field(name="Category", visibility=["read", "create", "update", "delete", "query"])
    """Category of annotation, free form."""
    event_time: Optional[datetime.datetime] = rest_field(
        name="EventTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Time when event occurred."""
    id: Optional[str] = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
    """Unique Id for annotation."""
    properties: Optional[str] = rest_field(
        name="Properties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Serialized JSON object for detailed properties."""
    related_annotation: Optional[str] = rest_field(
        name="RelatedAnnotation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Related parent annotation if any."""

    @overload
    def __init__(
        self,
        *,
        annotation_name: Optional[str] = None,
        category: Optional[str] = None,
        event_time: Optional[datetime.datetime] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        properties: Optional[str] = None,
        related_annotation: 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 AnnotationError(_Model):
    """Error associated with trying to create annotation with Id that already exist.

    :ivar code: Error detail code and explanation.
    :vartype code: str
    :ivar message: Error message.
    :vartype message: str
    :ivar innererror: Inner error.
    :vartype innererror: ~azure.mgmt.applicationinsights.models.InnerError
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error detail code and explanation."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error message."""
    innererror: Optional["_models.InnerError"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Inner error."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        innererror: Optional["_models.InnerError"] = None,
    ) -> None: ...

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

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


class APIKeyRequest(_Model):
    """An Application Insights component API Key creation request definition.

    :ivar name: The name of the API Key.
    :vartype name: str
    :ivar linked_read_properties: The read access rights of this API Key.
    :vartype linked_read_properties: list[str]
    :ivar linked_write_properties: The write access rights of this API Key.
    :vartype linked_write_properties: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the API Key."""
    linked_read_properties: Optional[list[str]] = rest_field(
        name="linkedReadProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The read access rights of this API Key."""
    linked_write_properties: Optional[list[str]] = rest_field(
        name="linkedWriteProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The write access rights of this API Key."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        linked_read_properties: Optional[list[str]] = None,
        linked_write_properties: 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 ComponentsResource(_Model):
    """An azure resource object.

    :ivar id: Azure resource Id.
    :vartype id: str
    :ivar name: Azure resource name.
    :vartype name: str
    :ivar type: Azure resource type.
    :vartype type: str
    :ivar location: Resource location. Required.
    :vartype location: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Azure resource Id."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Azure resource name."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Azure resource type."""
    location: str = rest_field(visibility=["read", "create"])
    """Resource location. Required."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""

    @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 ApplicationInsightsComponent(ComponentsResource):
    """An Application Insights component definition.

    :ivar id: Azure resource Id.
    :vartype id: str
    :ivar name: Azure resource name.
    :vartype name: str
    :ivar type: Azure resource type.
    :vartype type: str
    :ivar location: Resource location. Required.
    :vartype location: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar kind: The kind of application that this component refers to, used to customize UI. This
     value is a freeform string, values should typically be one of the following: web, ios, other,
     store, java, phone. Required.
    :vartype kind: str
    :ivar etag: Resource etag.
    :vartype etag: str
    :ivar properties: Properties that define an Application Insights component resource.
    :vartype properties:
     ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProperties
    """

    kind: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The kind of application that this component refers to, used to customize UI. This value is a
     freeform string, values should typically be one of the following: web, ios, other, store, java,
     phone. Required."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource etag."""
    properties: Optional["_models.ApplicationInsightsComponentProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties that define an Application Insights component resource."""

    __flattened_items = [
        "application_id",
        "app_id",
        "name",
        "application_type",
        "flow_type",
        "request_source",
        "instrumentation_key",
        "creation_date",
        "tenant_id",
        "hockey_app_id",
        "hockey_app_token",
        "provisioning_state",
        "sampling_percentage",
        "connection_string",
        "retention_in_days",
        "disable_ip_masking",
        "immediate_purge_data_on30_days",
        "workspace_resource_id",
        "la_migration_date",
        "private_link_scoped_resources",
        "public_network_access_for_ingestion",
        "public_network_access_for_query",
        "ingestion_mode",
        "disable_local_auth",
        "force_customer_storage_for_profiler",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 ApplicationInsightsComponentAnalyticsItem(_Model):  # pylint: disable=name-too-long
    """Properties that define an Analytics item that is associated to an Application Insights
    component.

    :ivar id: Internally assigned unique id of the item definition.
    :vartype id: str
    :ivar name: The user-defined name of the item.
    :vartype name: str
    :ivar content: The content of this item.
    :vartype content: str
    :ivar version: This instance's version of the data model. This can change as new features are
     added.
    :vartype version: str
    :ivar scope: Enum indicating if this item definition is owned by a specific user or is shared
     between all users with access to the Application Insights component. Known values are: "shared"
     and "user".
    :vartype scope: str or ~azure.mgmt.applicationinsights.models.ItemScope
    :ivar type: Enum indicating the type of the Analytics item. Known values are: "none", "query",
     "recent", and "function".
    :vartype type: str or ~azure.mgmt.applicationinsights.models.ItemType
    :ivar time_created: Date and time in UTC when this item was created.
    :vartype time_created: str
    :ivar time_modified: Date and time in UTC of the last modification that was made to this item.
    :vartype time_modified: str
    :ivar properties: A set of properties that can be defined in the context of a specific item
     type. Each type may have its own properties.
    :vartype properties:
     ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItemProperties
    """

    id: Optional[str] = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
    """Internally assigned unique id of the item definition."""
    name: Optional[str] = rest_field(name="Name", visibility=["read", "create", "update", "delete", "query"])
    """The user-defined name of the item."""
    content: Optional[str] = rest_field(name="Content", visibility=["read", "create", "update", "delete", "query"])
    """The content of this item."""
    version: Optional[str] = rest_field(name="Version", visibility=["read"])
    """This instance's version of the data model. This can change as new features are added."""
    scope: Optional[Union[str, "_models.ItemScope"]] = rest_field(
        name="Scope", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enum indicating if this item definition is owned by a specific user or is shared between all
     users with access to the Application Insights component. Known values are: \"shared\" and
     \"user\"."""
    type: Optional[Union[str, "_models.ItemType"]] = rest_field(
        name="Type", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enum indicating the type of the Analytics item. Known values are: \"none\", \"query\",
     \"recent\", and \"function\"."""
    time_created: Optional[str] = rest_field(name="TimeCreated", visibility=["read"])
    """Date and time in UTC when this item was created."""
    time_modified: Optional[str] = rest_field(name="TimeModified", visibility=["read"])
    """Date and time in UTC of the last modification that was made to this item."""
    properties: Optional["_models.ApplicationInsightsComponentAnalyticsItemProperties"] = rest_field(
        name="Properties", visibility=["read", "create", "update", "delete", "query"]
    )
    """A set of properties that can be defined in the context of a specific item type. Each type may
     have its own properties."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        content: Optional[str] = None,
        scope: Optional[Union[str, "_models.ItemScope"]] = None,
        type: Optional[Union[str, "_models.ItemType"]] = None,
        properties: Optional["_models.ApplicationInsightsComponentAnalyticsItemProperties"] = None,
    ) -> None: ...

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

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


class ApplicationInsightsComponentAnalyticsItemProperties(_Model):  # pylint: disable=name-too-long
    """A set of properties that can be defined in the context of a specific item type. Each type may
    have its own properties.

    :ivar function_alias: A function alias, used when the type of the item is Function.
    :vartype function_alias: str
    """

    function_alias: Optional[str] = rest_field(
        name="functionAlias", visibility=["read", "create", "update", "delete", "query"]
    )
    """A function alias, used when the type of the item is Function."""

    @overload
    def __init__(
        self,
        *,
        function_alias: 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 ApplicationInsightsComponentAPIKey(_Model):
    """Properties that define an API key of an Application Insights Component.

    :ivar id: The unique ID of the API key inside an Application Insights component. It is auto
     generated when the API key is created.
    :vartype id: str
    :ivar api_key: The API key value. It will be only return once when the API Key was created.
    :vartype api_key: str
    :ivar created_date: The create date of this API key.
    :vartype created_date: str
    :ivar name: The name of the API key.
    :vartype name: str
    :ivar linked_read_properties: The read access rights of this API Key.
    :vartype linked_read_properties: list[str]
    :ivar linked_write_properties: The write access rights of this API Key.
    :vartype linked_write_properties: list[str]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """The unique ID of the API key inside an Application Insights component. It is auto generated
     when the API key is created."""
    api_key: Optional[str] = rest_field(name="apiKey", visibility=["read"])
    """The API key value. It will be only return once when the API Key was created."""
    created_date: Optional[str] = rest_field(
        name="createdDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """The create date of this API key."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the API key."""
    linked_read_properties: Optional[list[str]] = rest_field(
        name="linkedReadProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The read access rights of this API Key."""
    linked_write_properties: Optional[list[str]] = rest_field(
        name="linkedWriteProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The write access rights of this API Key."""

    @overload
    def __init__(
        self,
        *,
        created_date: Optional[str] = None,
        name: Optional[str] = None,
        linked_read_properties: Optional[list[str]] = None,
        linked_write_properties: 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 ApplicationInsightsComponentAvailableFeatures(_Model):  # pylint: disable=name-too-long
    """An Application Insights component available features.

    :ivar result: A list of Application Insights component feature.
    :vartype result:
     list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature]
    """

    result: Optional[list["_models.ApplicationInsightsComponentFeature"]] = rest_field(
        name="Result", visibility=["read"]
    )
    """A list of Application Insights component feature."""


class ApplicationInsightsComponentBillingFeatures(_Model):  # pylint: disable=name-too-long
    """An Application Insights component billing features.

    :ivar data_volume_cap: An Application Insights component daily data volume cap.
    :vartype data_volume_cap:
     ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap
    :ivar current_billing_features: Current enabled pricing plan. When the component is in the
     Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.
    :vartype current_billing_features: list[str]
    """

    data_volume_cap: Optional["_models.ApplicationInsightsComponentDataVolumeCap"] = rest_field(
        name="DataVolumeCap", visibility=["read", "create", "update", "delete", "query"]
    )
    """An Application Insights component daily data volume cap."""
    current_billing_features: Optional[list[str]] = rest_field(
        name="CurrentBillingFeatures", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current enabled pricing plan. When the component is in the Enterprise plan, this will list both
     'Basic' and 'Application Insights Enterprise'."""

    @overload
    def __init__(
        self,
        *,
        data_volume_cap: Optional["_models.ApplicationInsightsComponentDataVolumeCap"] = None,
        current_billing_features: 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 ApplicationInsightsComponentDataVolumeCap(_Model):  # pylint: disable=name-too-long
    """An Application Insights component daily data volume cap.

    :ivar cap: Daily data volume cap in GB.
    :vartype cap: float
    :ivar reset_time: Daily data volume cap UTC reset hour.
    :vartype reset_time: int
    :ivar warning_threshold: Reserved, not used for now.
    :vartype warning_threshold: int
    :ivar stop_send_notification_when_hit_threshold: Reserved, not used for now.
    :vartype stop_send_notification_when_hit_threshold: bool
    :ivar stop_send_notification_when_hit_cap: Do not send a notification email when the daily data
     volume cap is met.
    :vartype stop_send_notification_when_hit_cap: bool
    :ivar max_history_cap: Maximum daily data volume cap that the user can set for this component.
    :vartype max_history_cap: float
    """

    cap: Optional[float] = rest_field(name="Cap", visibility=["read", "create", "update", "delete", "query"])
    """Daily data volume cap in GB."""
    reset_time: Optional[int] = rest_field(name="ResetTime", visibility=["read"])
    """Daily data volume cap UTC reset hour."""
    warning_threshold: Optional[int] = rest_field(
        name="WarningThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reserved, not used for now."""
    stop_send_notification_when_hit_threshold: Optional[bool] = rest_field(
        name="StopSendNotificationWhenHitThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reserved, not used for now."""
    stop_send_notification_when_hit_cap: Optional[bool] = rest_field(
        name="StopSendNotificationWhenHitCap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Do not send a notification email when the daily data volume cap is met."""
    max_history_cap: Optional[float] = rest_field(name="MaxHistoryCap", visibility=["read"])
    """Maximum daily data volume cap that the user can set for this component."""

    @overload
    def __init__(
        self,
        *,
        cap: Optional[float] = None,
        warning_threshold: Optional[int] = None,
        stop_send_notification_when_hit_threshold: Optional[bool] = None,
        stop_send_notification_when_hit_cap: 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 ApplicationInsightsComponentExportConfiguration(_Model):  # pylint: disable=name-too-long
    """Properties that define a Continuous Export configuration.

    :ivar export_id: The unique ID of the export configuration inside an Application Insights
     component. It is auto generated when the Continuous Export configuration is created.
    :vartype export_id: str
    :ivar instrumentation_key: The instrumentation key of the Application Insights component.
    :vartype instrumentation_key: str
    :ivar record_types: This comma separated list of document types that will be exported. The
     possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews',
     'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.
    :vartype record_types: str
    :ivar application_name: The name of the Application Insights component.
    :vartype application_name: str
    :ivar subscription_id: The subscription of the Application Insights component.
    :vartype subscription_id: str
    :ivar resource_group: The resource group of the Application Insights component.
    :vartype resource_group: str
    :ivar destination_storage_subscription_id: The destination storage account subscription ID.
    :vartype destination_storage_subscription_id: str
    :ivar destination_storage_location_id: The destination account location ID.
    :vartype destination_storage_location_id: str
    :ivar destination_account_id: The name of destination account.
    :vartype destination_account_id: str
    :ivar destination_type: The destination type.
    :vartype destination_type: str
    :ivar is_user_enabled: This will be 'true' if the Continuous Export configuration is enabled,
     otherwise it will be 'false'.
    :vartype is_user_enabled: str
    :ivar last_user_update: Last time the Continuous Export configuration was updated.
    :vartype last_user_update: str
    :ivar notification_queue_enabled: Deprecated.
    :vartype notification_queue_enabled: str
    :ivar export_status: This indicates current Continuous Export configuration status. The
     possible values are 'Preparing', 'Success', 'Failure'.
    :vartype export_status: str
    :ivar last_success_time: The last time data was successfully delivered to the destination
     storage container for this Continuous Export configuration.
    :vartype last_success_time: str
    :ivar last_gap_time: The last time the Continuous Export configuration started failing.
    :vartype last_gap_time: str
    :ivar permanent_error_reason: This is the reason the Continuous Export configuration started
     failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'.
    :vartype permanent_error_reason: str
    :ivar storage_name: The name of the destination storage account.
    :vartype storage_name: str
    :ivar container_name: The name of the destination storage container.
    :vartype container_name: str
    """

    export_id: Optional[str] = rest_field(name="ExportId", visibility=["read"])
    """The unique ID of the export configuration inside an Application Insights component. It is auto
     generated when the Continuous Export configuration is created."""
    instrumentation_key: Optional[str] = rest_field(name="InstrumentationKey", visibility=["read"])
    """The instrumentation key of the Application Insights component."""
    record_types: Optional[str] = rest_field(
        name="RecordTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """This comma separated list of document types that will be exported. The possible values include
     'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd',
     'PerformanceCounters', 'Availability', 'Messages'."""
    application_name: Optional[str] = rest_field(name="ApplicationName", visibility=["read"])
    """The name of the Application Insights component."""
    subscription_id: Optional[str] = rest_field(name="SubscriptionId", visibility=["read"])
    """The subscription of the Application Insights component."""
    resource_group: Optional[str] = rest_field(name="ResourceGroup", visibility=["read"])
    """The resource group of the Application Insights component."""
    destination_storage_subscription_id: Optional[str] = rest_field(
        name="DestinationStorageSubscriptionId", visibility=["read"]
    )
    """The destination storage account subscription ID."""
    destination_storage_location_id: Optional[str] = rest_field(
        name="DestinationStorageLocationId", visibility=["read"]
    )
    """The destination account location ID."""
    destination_account_id: Optional[str] = rest_field(name="DestinationAccountId", visibility=["read"])
    """The name of destination account."""
    destination_type: Optional[str] = rest_field(name="DestinationType", visibility=["read"])
    """The destination type."""
    is_user_enabled: Optional[str] = rest_field(name="IsUserEnabled", visibility=["read"])
    """This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be
     'false'."""
    last_user_update: Optional[str] = rest_field(name="LastUserUpdate", visibility=["read"])
    """Last time the Continuous Export configuration was updated."""
    notification_queue_enabled: Optional[str] = rest_field(
        name="NotificationQueueEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Deprecated."""
    export_status: Optional[str] = rest_field(name="ExportStatus", visibility=["read"])
    """This indicates current Continuous Export configuration status. The possible values are
     'Preparing', 'Success', 'Failure'."""
    last_success_time: Optional[str] = rest_field(name="LastSuccessTime", visibility=["read"])
    """The last time data was successfully delivered to the destination storage container for this
     Continuous Export configuration."""
    last_gap_time: Optional[str] = rest_field(name="LastGapTime", visibility=["read"])
    """The last time the Continuous Export configuration started failing."""
    permanent_error_reason: Optional[str] = rest_field(name="PermanentErrorReason", visibility=["read"])
    """This is the reason the Continuous Export configuration started failing. It can be
     'AzureStorageNotFound' or 'AzureStorageAccessDenied'."""
    storage_name: Optional[str] = rest_field(name="StorageName", visibility=["read"])
    """The name of the destination storage account."""
    container_name: Optional[str] = rest_field(name="ContainerName", visibility=["read"])
    """The name of the destination storage container."""

    @overload
    def __init__(
        self,
        *,
        record_types: Optional[str] = None,
        notification_queue_enabled: 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 ApplicationInsightsComponentExportRequest(_Model):  # pylint: disable=name-too-long
    """An Application Insights component Continuous Export configuration request definition.

    :ivar record_types: The document types to be exported, as comma separated values. Allowed
     values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews',
     'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'.
    :vartype record_types: str
    :ivar destination_type: The Continuous Export destination type. This has to be 'Blob'.
    :vartype destination_type: str
    :ivar destination_address: The SAS URL for the destination storage container. It must grant
     write permission.
    :vartype destination_address: str
    :ivar is_enabled: Set to 'true' to create a Continuous Export configuration as enabled,
     otherwise set it to 'false'.
    :vartype is_enabled: str
    :ivar notification_queue_enabled: Deprecated.
    :vartype notification_queue_enabled: str
    :ivar notification_queue_uri: Deprecated.
    :vartype notification_queue_uri: str
    :ivar destination_storage_subscription_id: The subscription ID of the destination storage
     container.
    :vartype destination_storage_subscription_id: str
    :ivar destination_storage_location_id: The location ID of the destination storage container.
    :vartype destination_storage_location_id: str
    :ivar destination_account_id: The name of destination storage account.
    :vartype destination_account_id: str
    """

    record_types: Optional[str] = rest_field(
        name="RecordTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The document types to be exported, as comma separated values. Allowed values include
     'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd',
     'PerformanceCounters', 'Availability', 'Messages'."""
    destination_type: Optional[str] = rest_field(
        name="DestinationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Continuous Export destination type. This has to be 'Blob'."""
    destination_address: Optional[str] = rest_field(
        name="DestinationAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """The SAS URL for the destination storage container. It must grant write permission."""
    is_enabled: Optional[str] = rest_field(name="IsEnabled", visibility=["read", "create", "update", "delete", "query"])
    """Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to
     'false'."""
    notification_queue_enabled: Optional[str] = rest_field(
        name="NotificationQueueEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Deprecated."""
    notification_queue_uri: Optional[str] = rest_field(
        name="NotificationQueueUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """Deprecated."""
    destination_storage_subscription_id: Optional[str] = rest_field(
        name="DestinationStorageSubscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription ID of the destination storage container."""
    destination_storage_location_id: Optional[str] = rest_field(
        name="DestinationStorageLocationId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The location ID of the destination storage container."""
    destination_account_id: Optional[str] = rest_field(
        name="DestinationAccountId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of destination storage account."""

    @overload
    def __init__(
        self,
        *,
        record_types: Optional[str] = None,
        destination_type: Optional[str] = None,
        destination_address: Optional[str] = None,
        is_enabled: Optional[str] = None,
        notification_queue_enabled: Optional[str] = None,
        notification_queue_uri: Optional[str] = None,
        destination_storage_subscription_id: Optional[str] = None,
        destination_storage_location_id: Optional[str] = None,
        destination_account_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 ApplicationInsightsComponentFavorite(_Model):
    """Properties that define a favorite that is associated to an Application Insights component.

    :ivar name: The user-defined name of the favorite.
    :vartype name: str
    :ivar config: Configuration of this particular favorite, which are driven by the Azure portal
     UX. Configuration data is a string containing valid JSON.
    :vartype config: str
    :ivar version: This instance's version of the data model. This can change as new features are
     added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search.
    :vartype version: str
    :ivar favorite_id: Internally assigned unique id of the favorite definition.
    :vartype favorite_id: str
    :ivar favorite_type: Enum indicating if this favorite definition is owned by a specific user or
     is shared between all users with access to the Application Insights component. Known values
     are: "shared" and "user".
    :vartype favorite_type: str or ~azure.mgmt.applicationinsights.models.FavoriteType
    :ivar source_type: The source of the favorite definition.
    :vartype source_type: str
    :ivar time_modified: Date and time in UTC of the last modification that was made to this
     favorite definition.
    :vartype time_modified: str
    :ivar tags: A list of 0 or more tags that are associated with this favorite definition.
    :vartype tags: list[str]
    :ivar category: Favorite category, as defined by the user at creation time.
    :vartype category: str
    :ivar is_generated_from_template: Flag denoting wether or not this favorite was generated from
     a template.
    :vartype is_generated_from_template: bool
    :ivar user_id: Unique user id of the specific user that owns this favorite.
    :vartype user_id: str
    """

    name: Optional[str] = rest_field(name="Name", visibility=["read", "create", "update", "delete", "query"])
    """The user-defined name of the favorite."""
    config: Optional[str] = rest_field(name="Config", visibility=["read", "create", "update", "delete", "query"])
    """Configuration of this particular favorite, which are driven by the Azure portal UX.
     Configuration data is a string containing valid JSON."""
    version: Optional[str] = rest_field(name="Version", visibility=["read", "create", "update", "delete", "query"])
    """This instance's version of the data model. This can change as new features are added that can
     be marked favorite. Current examples include MetricsExplorer (ME) and Search."""
    favorite_id: Optional[str] = rest_field(name="FavoriteId", visibility=["read"])
    """Internally assigned unique id of the favorite definition."""
    favorite_type: Optional[Union[str, "_models.FavoriteType"]] = rest_field(
        name="FavoriteType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enum indicating if this favorite definition is owned by a specific user or is shared between
     all users with access to the Application Insights component. Known values are: \"shared\" and
     \"user\"."""
    source_type: Optional[str] = rest_field(
        name="SourceType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The source of the favorite definition."""
    time_modified: Optional[str] = rest_field(name="TimeModified", visibility=["read"])
    """Date and time in UTC of the last modification that was made to this favorite definition."""
    tags: Optional[list[str]] = rest_field(name="Tags", visibility=["read", "create", "update", "delete", "query"])
    """A list of 0 or more tags that are associated with this favorite definition."""
    category: Optional[str] = rest_field(name="Category", visibility=["read", "create", "update", "delete", "query"])
    """Favorite category, as defined by the user at creation time."""
    is_generated_from_template: Optional[bool] = rest_field(
        name="IsGeneratedFromTemplate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag denoting wether or not this favorite was generated from a template."""
    user_id: Optional[str] = rest_field(name="UserId", visibility=["read"])
    """Unique user id of the specific user that owns this favorite."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        config: Optional[str] = None,
        version: Optional[str] = None,
        favorite_type: Optional[Union[str, "_models.FavoriteType"]] = None,
        source_type: Optional[str] = None,
        tags: Optional[list[str]] = None,
        category: Optional[str] = None,
        is_generated_from_template: 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 ApplicationInsightsComponentFeature(_Model):
    """An Application Insights component daily data volume cap status.

    :ivar feature_name: The pricing feature name.
    :vartype feature_name: str
    :ivar meter_id: The meter id used for the feature.
    :vartype meter_id: str
    :ivar meter_rate_frequency: The meter rate for the feature's meter.
    :vartype meter_rate_frequency: str
    :ivar resouce_id: Reserved, not used now.
    :vartype resouce_id: str
    :ivar is_hidden: Reserved, not used now.
    :vartype is_hidden: bool
    :ivar capabilities: A list of Application Insights component feature capability.
    :vartype capabilities:
     list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability]
    :ivar title: Display name of the feature.
    :vartype title: str
    :ivar is_main_feature: Whether can apply addon feature on to it.
    :vartype is_main_feature: bool
    :ivar supported_addon_features: The add on features on main feature.
    :vartype supported_addon_features: str
    """

    feature_name: Optional[str] = rest_field(name="FeatureName", visibility=["read"])
    """The pricing feature name."""
    meter_id: Optional[str] = rest_field(name="MeterId", visibility=["read"])
    """The meter id used for the feature."""
    meter_rate_frequency: Optional[str] = rest_field(name="MeterRateFrequency", visibility=["read"])
    """The meter rate for the feature's meter."""
    resouce_id: Optional[str] = rest_field(name="ResouceId", visibility=["read"])
    """Reserved, not used now."""
    is_hidden: Optional[bool] = rest_field(name="IsHidden", visibility=["read"])
    """Reserved, not used now."""
    capabilities: Optional[list["_models.ApplicationInsightsComponentFeatureCapability"]] = rest_field(
        name="Capabilities", visibility=["read"]
    )
    """A list of Application Insights component feature capability."""
    title: Optional[str] = rest_field(name="Title", visibility=["read"])
    """Display name of the feature."""
    is_main_feature: Optional[bool] = rest_field(name="IsMainFeature", visibility=["read"])
    """Whether can apply addon feature on to it."""
    supported_addon_features: Optional[str] = rest_field(name="SupportedAddonFeatures", visibility=["read"])
    """The add on features on main feature."""


class ApplicationInsightsComponentFeatureCapabilities(_Model):  # pylint: disable=name-too-long
    """An Application Insights component feature capabilities.

    :ivar support_export_data: Whether allow to use continuous export feature.
    :vartype support_export_data: bool
    :ivar burst_throttle_policy: Reserved, not used now.
    :vartype burst_throttle_policy: str
    :ivar metadata_class: Reserved, not used now.
    :vartype metadata_class: str
    :ivar live_stream_metrics: Reserved, not used now.
    :vartype live_stream_metrics: bool
    :ivar application_map: Reserved, not used now.
    :vartype application_map: bool
    :ivar work_item_integration: Whether allow to use work item integration feature.
    :vartype work_item_integration: bool
    :ivar power_bi_integration: Reserved, not used now.
    :vartype power_bi_integration: bool
    :ivar open_schema: Reserved, not used now.
    :vartype open_schema: bool
    :ivar proactive_detection: Reserved, not used now.
    :vartype proactive_detection: bool
    :ivar analytics_integration: Reserved, not used now.
    :vartype analytics_integration: bool
    :ivar multiple_step_web_test: Whether allow to use multiple steps web test feature.
    :vartype multiple_step_web_test: bool
    :ivar api_access_level: Reserved, not used now.
    :vartype api_access_level: str
    :ivar tracking_type: The application insights component used tracking type.
    :vartype tracking_type: str
    :ivar daily_cap: Daily data volume cap in GB.
    :vartype daily_cap: float
    :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour.
    :vartype daily_cap_reset_time: float
    :ivar throttle_rate: Reserved, not used now.
    :vartype throttle_rate: float
    """

    support_export_data: Optional[bool] = rest_field(name="SupportExportData", visibility=["read"])
    """Whether allow to use continuous export feature."""
    burst_throttle_policy: Optional[str] = rest_field(name="BurstThrottlePolicy", visibility=["read"])
    """Reserved, not used now."""
    metadata_class: Optional[str] = rest_field(name="MetadataClass", visibility=["read"])
    """Reserved, not used now."""
    live_stream_metrics: Optional[bool] = rest_field(name="LiveStreamMetrics", visibility=["read"])
    """Reserved, not used now."""
    application_map: Optional[bool] = rest_field(name="ApplicationMap", visibility=["read"])
    """Reserved, not used now."""
    work_item_integration: Optional[bool] = rest_field(name="WorkItemIntegration", visibility=["read"])
    """Whether allow to use work item integration feature."""
    power_bi_integration: Optional[bool] = rest_field(name="PowerBIIntegration", visibility=["read"])
    """Reserved, not used now."""
    open_schema: Optional[bool] = rest_field(name="OpenSchema", visibility=["read"])
    """Reserved, not used now."""
    proactive_detection: Optional[bool] = rest_field(name="ProactiveDetection", visibility=["read"])
    """Reserved, not used now."""
    analytics_integration: Optional[bool] = rest_field(name="AnalyticsIntegration", visibility=["read"])
    """Reserved, not used now."""
    multiple_step_web_test: Optional[bool] = rest_field(name="MultipleStepWebTest", visibility=["read"])
    """Whether allow to use multiple steps web test feature."""
    api_access_level: Optional[str] = rest_field(name="ApiAccessLevel", visibility=["read"])
    """Reserved, not used now."""
    tracking_type: Optional[str] = rest_field(name="TrackingType", visibility=["read"])
    """The application insights component used tracking type."""
    daily_cap: Optional[float] = rest_field(name="DailyCap", visibility=["read"])
    """Daily data volume cap in GB."""
    daily_cap_reset_time: Optional[float] = rest_field(name="DailyCapResetTime", visibility=["read"])
    """Daily data volume cap UTC reset hour."""
    throttle_rate: Optional[float] = rest_field(name="ThrottleRate", visibility=["read"])
    """Reserved, not used now."""


class ApplicationInsightsComponentFeatureCapability(_Model):  # pylint: disable=name-too-long
    """An Application Insights component feature capability.

    :ivar name: The name of the capability.
    :vartype name: str
    :ivar description: The description of the capability.
    :vartype description: str
    :ivar value: The value of the capability.
    :vartype value: str
    :ivar unit: The unit of the capability.
    :vartype unit: str
    :ivar meter_id: The meter used for the capability.
    :vartype meter_id: str
    :ivar meter_rate_frequency: The meter rate of the meter.
    :vartype meter_rate_frequency: str
    """

    name: Optional[str] = rest_field(name="Name", visibility=["read"])
    """The name of the capability."""
    description: Optional[str] = rest_field(name="Description", visibility=["read"])
    """The description of the capability."""
    value: Optional[str] = rest_field(name="Value", visibility=["read"])
    """The value of the capability."""
    unit: Optional[str] = rest_field(name="Unit", visibility=["read"])
    """The unit of the capability."""
    meter_id: Optional[str] = rest_field(name="MeterId", visibility=["read"])
    """The meter used for the capability."""
    meter_rate_frequency: Optional[str] = rest_field(name="MeterRateFrequency", visibility=["read"])
    """The meter rate of the meter."""


class ApplicationInsightsComponentProactiveDetectionConfiguration(_Model):  # pylint: disable=name-too-long
    """Properties that define a ProactiveDetection configuration.

    :ivar name: The rule name.
    :vartype name: str
    :ivar enabled: A flag that indicates whether this rule is enabled by the user.
    :vartype enabled: bool
    :ivar send_emails_to_subscription_owners: A flag that indicated whether notifications on this
     rule should be sent to subscription owners.
    :vartype send_emails_to_subscription_owners: bool
    :ivar custom_emails: Custom email addresses for this rule notifications.
    :vartype custom_emails: list[str]
    :ivar last_updated_time: The last time this rule was updated.
    :vartype last_updated_time: str
    :ivar rule_definitions: Static definitions of the ProactiveDetection configuration rule (same
     values for all components).
    :vartype rule_definitions:
     ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The rule name."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A flag that indicates whether this rule is enabled by the user."""
    send_emails_to_subscription_owners: Optional[bool] = rest_field(
        name="sendEmailsToSubscriptionOwners", visibility=["read", "create", "update", "delete", "query"]
    )
    """A flag that indicated whether notifications on this rule should be sent to subscription owners."""
    custom_emails: Optional[list[str]] = rest_field(
        name="customEmails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom email addresses for this rule notifications."""
    last_updated_time: Optional[str] = rest_field(
        name="lastUpdatedTime", visibility=["read", "create", "update", "delete", "query"]
    )
    """The last time this rule was updated."""
    rule_definitions: Optional["_models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions"] = (
        rest_field(name="ruleDefinitions", visibility=["read", "create", "update", "delete", "query"])
    )
    """Static definitions of the ProactiveDetection configuration rule (same values for all
     components)."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        enabled: Optional[bool] = None,
        send_emails_to_subscription_owners: Optional[bool] = None,
        custom_emails: Optional[list[str]] = None,
        last_updated_time: Optional[str] = None,
        rule_definitions: Optional[
            "_models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions"
        ] = None,
    ) -> None: ...

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

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


class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(
    _Model
):  # pylint: disable=name-too-long
    """Static definitions of the ProactiveDetection configuration rule (same values for all
    components).

    :ivar name: The rule name.
    :vartype name: str
    :ivar display_name: The rule name as it is displayed in UI.
    :vartype display_name: str
    :ivar description: The rule description.
    :vartype description: str
    :ivar help_url: URL which displays additional info about the proactive detection rule.
    :vartype help_url: str
    :ivar is_hidden: A flag indicating whether the rule is hidden (from the UI).
    :vartype is_hidden: bool
    :ivar is_enabled_by_default: A flag indicating whether the rule is enabled by default.
    :vartype is_enabled_by_default: bool
    :ivar is_in_preview: A flag indicating whether the rule is in preview.
    :vartype is_in_preview: bool
    :ivar supports_email_notifications: A flag indicating whether email notifications are supported
     for detections for this rule.
    :vartype supports_email_notifications: bool
    """

    name: Optional[str] = rest_field(name="Name", visibility=["read", "create", "update", "delete", "query"])
    """The rule name."""
    display_name: Optional[str] = rest_field(
        name="DisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The rule name as it is displayed in UI."""
    description: Optional[str] = rest_field(
        name="Description", visibility=["read", "create", "update", "delete", "query"]
    )
    """The rule description."""
    help_url: Optional[str] = rest_field(name="HelpUrl", visibility=["read", "create", "update", "delete", "query"])
    """URL which displays additional info about the proactive detection rule."""
    is_hidden: Optional[bool] = rest_field(name="IsHidden", visibility=["read", "create", "update", "delete", "query"])
    """A flag indicating whether the rule is hidden (from the UI)."""
    is_enabled_by_default: Optional[bool] = rest_field(
        name="IsEnabledByDefault", visibility=["read", "create", "update", "delete", "query"]
    )
    """A flag indicating whether the rule is enabled by default."""
    is_in_preview: Optional[bool] = rest_field(
        name="IsInPreview", visibility=["read", "create", "update", "delete", "query"]
    )
    """A flag indicating whether the rule is in preview."""
    supports_email_notifications: Optional[bool] = rest_field(
        name="SupportsEmailNotifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """A flag indicating whether email notifications are supported for detections for this rule."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        description: Optional[str] = None,
        help_url: Optional[str] = None,
        is_hidden: Optional[bool] = None,
        is_enabled_by_default: Optional[bool] = None,
        is_in_preview: Optional[bool] = None,
        supports_email_notifications: 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 ApplicationInsightsComponentProperties(_Model):
    """Properties that define an Application Insights component resource.

    :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field
     and cannot be changed.
    :vartype application_id: str
    :ivar app_id: Application Insights Unique ID for your Application.
    :vartype app_id: str
    :ivar name: Application name.
    :vartype name: str
    :ivar application_type: Type of application being monitored. Required. Known values are: "web"
     and "other".
    :vartype application_type: str or ~azure.mgmt.applicationinsights.models.ApplicationType
    :ivar flow_type: Used by the Application Insights system to determine what kind of flow this
     component was created by. This is to be set to 'Bluefield' when creating/updating a component
     via the REST API. "Bluefield"
    :vartype flow_type: str or ~azure.mgmt.applicationinsights.models.FlowType
    :ivar request_source: Describes what tool created this Application Insights component.
     Customers using this API should set this to the default 'rest'. "rest"
    :vartype request_source: str or ~azure.mgmt.applicationinsights.models.RequestSource
    :ivar instrumentation_key: Application Insights Instrumentation key. A read-only value that
     applications can use to identify the destination for all telemetry sent to Azure Application
     Insights. This value will be supplied upon construction of each new Application Insights
     component.
    :vartype instrumentation_key: str
    :ivar creation_date: Creation Date for the Application Insights component, in ISO 8601 format.
    :vartype creation_date: ~datetime.datetime
    :ivar tenant_id: Azure Tenant Id.
    :vartype tenant_id: str
    :ivar hockey_app_id: The unique application ID created when a new application is added to
     HockeyApp, used for communications with HockeyApp.
    :vartype hockey_app_id: str
    :ivar hockey_app_token: Token used to authenticate communications with between Application
     Insights and HockeyApp.
    :vartype hockey_app_token: str
    :ivar provisioning_state: Current state of this component: 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
    :ivar sampling_percentage: Percentage of the data produced by the application being monitored
     that is being sampled for Application Insights telemetry.
    :vartype sampling_percentage: float
    :ivar connection_string: Application Insights component connection string.
    :vartype connection_string: str
    :ivar retention_in_days: Retention period in days.
    :vartype retention_in_days: int
    :ivar disable_ip_masking: Disable IP masking.
    :vartype disable_ip_masking: bool
    :ivar immediate_purge_data_on30_days: Purge data immediately after 30 days.
    :vartype immediate_purge_data_on30_days: bool
    :ivar workspace_resource_id: Resource Id of the log analytics workspace which the data will be
     ingested to. This property is required to create an application with this API version.
     Applications from older versions will not have this property.
    :vartype workspace_resource_id: str
    :ivar la_migration_date: The date which the component got migrated to LA, in ISO 8601 format.
    :vartype la_migration_date: ~datetime.datetime
    :ivar private_link_scoped_resources: List of linked private link scope resources.
    :vartype private_link_scoped_resources:
     list[~azure.mgmt.applicationinsights.models.PrivateLinkScopedResource]
    :ivar public_network_access_for_ingestion: The network access type for accessing Application
     Insights ingestion. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access_for_ingestion: str or
     ~azure.mgmt.applicationinsights.models.PublicNetworkAccessType
    :ivar public_network_access_for_query: The network access type for accessing Application
     Insights query. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access_for_query: str or
     ~azure.mgmt.applicationinsights.models.PublicNetworkAccessType
    :ivar ingestion_mode: Indicates the flow of the ingestion. Known values are:
     "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", and "LogAnalytics".
    :vartype ingestion_mode: str or ~azure.mgmt.applicationinsights.models.IngestionMode
    :ivar disable_local_auth: Disable Non-AAD based Auth.
    :vartype disable_local_auth: bool
    :ivar force_customer_storage_for_profiler: Force users to create their own storage account for
     profiler and debugger.
    :vartype force_customer_storage_for_profiler: bool
    """

    application_id: Optional[str] = rest_field(name="ApplicationId", visibility=["read"])
    """The unique ID of your application. This field mirrors the 'Name' field and cannot be changed."""
    app_id: Optional[str] = rest_field(name="AppId", visibility=["read"])
    """Application Insights Unique ID for your Application."""
    name: Optional[str] = rest_field(name="Name", visibility=["read"])
    """Application name."""
    application_type: Union[str, "_models.ApplicationType"] = rest_field(
        name="Application_Type", visibility=["read", "create"]
    )
    """Type of application being monitored. Required. Known values are: \"web\" and \"other\"."""
    flow_type: Optional[Union[str, "_models.FlowType"]] = rest_field(
        name="Flow_Type", visibility=["read", "create", "update", "delete", "query"]
    )
    """Used by the Application Insights system to determine what kind of flow this component was
     created by. This is to be set to 'Bluefield' when creating/updating a component via the REST
     API. \"Bluefield\""""
    request_source: Optional[Union[str, "_models.RequestSource"]] = rest_field(
        name="Request_Source", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes what tool created this Application Insights component. Customers using this API
     should set this to the default 'rest'. \"rest\""""
    instrumentation_key: Optional[str] = rest_field(name="InstrumentationKey", visibility=["read"])
    """Application Insights Instrumentation key. A read-only value that applications can use to
     identify the destination for all telemetry sent to Azure Application Insights. This value will
     be supplied upon construction of each new Application Insights component."""
    creation_date: Optional[datetime.datetime] = rest_field(name="CreationDate", visibility=["read"], format="rfc3339")
    """Creation Date for the Application Insights component, in ISO 8601 format."""
    tenant_id: Optional[str] = rest_field(name="TenantId", visibility=["read"])
    """Azure Tenant Id."""
    hockey_app_id: Optional[str] = rest_field(
        name="HockeyAppId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The unique application ID created when a new application is added to HockeyApp, used for
     communications with HockeyApp."""
    hockey_app_token: Optional[str] = rest_field(name="HockeyAppToken", visibility=["read"])
    """Token used to authenticate communications with between Application Insights and HockeyApp."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Current state of this component: 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."""
    sampling_percentage: Optional[float] = rest_field(
        name="SamplingPercentage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Percentage of the data produced by the application being monitored that is being sampled for
     Application Insights telemetry."""
    connection_string: Optional[str] = rest_field(name="ConnectionString", visibility=["read"])
    """Application Insights component connection string."""
    retention_in_days: Optional[int] = rest_field(
        name="RetentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Retention period in days."""
    disable_ip_masking: Optional[bool] = rest_field(
        name="DisableIpMasking", visibility=["read", "create", "update", "delete", "query"]
    )
    """Disable IP masking."""
    immediate_purge_data_on30_days: Optional[bool] = rest_field(
        name="ImmediatePurgeDataOn30Days", visibility=["read", "create", "update", "delete", "query"]
    )
    """Purge data immediately after 30 days."""
    workspace_resource_id: Optional[str] = rest_field(
        name="WorkspaceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource Id of the log analytics workspace which the data will be ingested to. This property is
     required to create an application with this API version. Applications from older versions will
     not have this property."""
    la_migration_date: Optional[datetime.datetime] = rest_field(
        name="LaMigrationDate", visibility=["read"], format="rfc3339"
    )
    """The date which the component got migrated to LA, in ISO 8601 format."""
    private_link_scoped_resources: Optional[list["_models.PrivateLinkScopedResource"]] = rest_field(
        name="PrivateLinkScopedResources", visibility=["read"]
    )
    """List of linked private link scope resources."""
    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 Application Insights ingestion. Known values are:
     \"Enabled\" and \"Disabled\"."""
    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 Application Insights query. Known values are: \"Enabled\"
     and \"Disabled\"."""
    ingestion_mode: Optional[Union[str, "_models.IngestionMode"]] = rest_field(
        name="IngestionMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates the flow of the ingestion. Known values are: \"ApplicationInsights\",
     \"ApplicationInsightsWithDiagnosticSettings\", and \"LogAnalytics\"."""
    disable_local_auth: Optional[bool] = rest_field(
        name="DisableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """Disable Non-AAD based Auth."""
    force_customer_storage_for_profiler: Optional[bool] = rest_field(
        name="ForceCustomerStorageForProfiler", visibility=["read", "create", "update", "delete", "query"]
    )
    """Force users to create their own storage account for profiler and debugger."""

    @overload
    def __init__(
        self,
        *,
        application_type: Union[str, "_models.ApplicationType"],
        flow_type: Optional[Union[str, "_models.FlowType"]] = None,
        request_source: Optional[Union[str, "_models.RequestSource"]] = None,
        hockey_app_id: Optional[str] = None,
        sampling_percentage: Optional[float] = None,
        retention_in_days: Optional[int] = None,
        disable_ip_masking: Optional[bool] = None,
        immediate_purge_data_on30_days: Optional[bool] = None,
        workspace_resource_id: Optional[str] = None,
        public_network_access_for_ingestion: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None,
        public_network_access_for_query: Optional[Union[str, "_models.PublicNetworkAccessType"]] = None,
        ingestion_mode: Optional[Union[str, "_models.IngestionMode"]] = None,
        disable_local_auth: Optional[bool] = None,
        force_customer_storage_for_profiler: 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 ApplicationInsightsComponentQuotaStatus(_Model):
    """An Application Insights component daily data volume cap status.

    :ivar app_id: The Application ID for the Application Insights component.
    :vartype app_id: str
    :ivar should_be_throttled: The daily data volume cap is met, and data ingestion will be
     stopped.
    :vartype should_be_throttled: bool
    :ivar expiration_time: Date and time when the daily data volume cap will be reset, and data
     ingestion will resume.
    :vartype expiration_time: str
    """

    app_id: Optional[str] = rest_field(name="AppId", visibility=["read"])
    """The Application ID for the Application Insights component."""
    should_be_throttled: Optional[bool] = rest_field(name="ShouldBeThrottled", visibility=["read"])
    """The daily data volume cap is met, and data ingestion will be stopped."""
    expiration_time: Optional[str] = rest_field(name="ExpirationTime", visibility=["read"])
    """Date and time when the daily data volume cap will be reset, and data ingestion will resume."""


class ApplicationInsightsComponentWebTestLocation(_Model):  # pylint: disable=name-too-long
    """Properties that define a web test location available to an Application Insights Component.

    :ivar display_name: The display name of the web test location.
    :vartype display_name: str
    :ivar tag: Internally defined geographic location tag.
    :vartype tag: str
    """

    display_name: Optional[str] = rest_field(name="DisplayName", visibility=["read"])
    """The display name of the web test location."""
    tag: Optional[str] = rest_field(name="Tag", visibility=["read"])
    """Internally defined geographic location tag."""


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

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


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

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


class ComponentLinkedStorageAccounts(ProxyResource):
    """An Application Insights component linked storage accounts.

    :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.applicationinsights.models.SystemData
    :ivar properties: The properties of the linked storage accounts.
    :vartype properties: ~azure.mgmt.applicationinsights.models.LinkedStorageAccountsProperties
    """

    properties: Optional["_models.LinkedStorageAccountsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the linked storage accounts."""

    __flattened_items = ["linked_storage_account"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ComponentLinkedStorageAccountsPatch(_Model):
    """An Application Insights component linked storage accounts patch.

    :ivar properties: The properties of the linked storage accounts.
    :vartype properties: ~azure.mgmt.applicationinsights.models.LinkedStorageAccountsProperties
    """

    properties: Optional["_models.LinkedStorageAccountsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the linked storage accounts."""

    __flattened_items = ["linked_storage_account"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ComponentPurgeBody(_Model):
    """Describes the body of a purge request for an App Insights component.

    :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.applicationinsights.models.ComponentPurgeBodyFilters]
    """

    table: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Table from which to purge data. Required."""
    filters: list["_models.ComponentPurgeBodyFilters"] = 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.ComponentPurgeBodyFilters"],
    ) -> None: ...

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

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


class ComponentPurgeBodyFilters(_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 ComponentPurgeResponse(_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 ComponentPurgeStatusResponse(_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.applicationinsights.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 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.applicationinsights.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 DeletedWorkbookResource(TrackedResource):
    """An azure resource object.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.applicationinsights.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 kind: The kind of workbook. Only valid value is shared. "shared"
    :vartype kind: str or ~azure.mgmt.applicationinsights.models.WorkbookSharedTypeKind
    :ivar etag: Resource etag.
    :vartype etag: str
    """

    kind: Optional[Union[str, "_models.WorkbookSharedTypeKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of workbook. Only valid value is shared. \"shared\""""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource etag."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        kind: Optional[Union[str, "_models.WorkbookSharedTypeKind"]] = 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:
        super().__init__(*args, **kwargs)


class DeletedWorkbook(DeletedWorkbookResource):
    """A workbook 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.applicationinsights.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 kind: The kind of workbook. Only valid value is shared. "shared"
    :vartype kind: str or ~azure.mgmt.applicationinsights.models.WorkbookSharedTypeKind
    :ivar etag: Resource etag.
    :vartype etag: str
    :ivar properties: Metadata describing a workbook for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.DeletedWorkbookProperties
    """

    properties: Optional["_models.DeletedWorkbookProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a workbook for an Azure resource."""

    __flattened_items = [
        "display_name",
        "serialized_data",
        "version",
        "time_modified",
        "category",
        "tags",
        "user_id",
        "source_id",
        "storage_uri",
        "description",
        "revision",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 DeletedWorkbookError(_Model):
    """Error response.

    :ivar error: The error details.
    :vartype error: ~azure.mgmt.applicationinsights.models.DeletedWorkbookErrorDefinition
    """

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

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

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

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


class DeletedWorkbookErrorDefinition(_Model):
    """Error definition.

    :ivar code: Service specific error code which serves as the substatus for the HTTP error code.
    :vartype code: str
    :ivar message: Description of the error.
    :vartype message: str
    :ivar innererror: Internal error details.
    :vartype innererror: ~azure.mgmt.applicationinsights.models.DeletedWorkbookInnerErrorTrace
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Service specific error code which serves as the substatus for the HTTP error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Description of the error."""
    innererror: Optional["_models.DeletedWorkbookInnerErrorTrace"] = rest_field(visibility=["read"])
    """Internal error details."""


class DeletedWorkbookInnerErrorTrace(_Model):
    """Error details.

    :ivar trace: detailed error trace.
    :vartype trace: list[str]
    """

    trace: Optional[list[str]] = rest_field(visibility=["read"])
    """detailed error trace."""


class DeletedWorkbookProperties(_Model):
    """Properties that contain a workbook.

    :ivar display_name: The user-defined name (display name) of the workbook. Required.
    :vartype display_name: str
    :ivar serialized_data: Configuration of this particular workbook. Configuration data is a
     string containing valid JSON. Required.
    :vartype serialized_data: str
    :ivar version: Workbook schema version format, like 'Notebook/1.0', which should match the
     workbook in serializedData.
    :vartype version: str
    :ivar time_modified: Date and time in UTC of the last modification that was made to this
     workbook definition.
    :vartype time_modified: ~datetime.datetime
    :ivar category: Workbook category, as defined by the user at creation time. Required.
    :vartype category: str
    :ivar tags: Being deprecated, please use the other tags field.
    :vartype tags: list[str]
    :ivar user_id: Unique user id of the specific user that owns this workbook.
    :vartype user_id: str
    :ivar source_id: ResourceId for a source resource.
    :vartype source_id: str
    :ivar storage_uri: The resourceId to the storage account when bring your own storage is used.
    :vartype storage_uri: str
    :ivar description: The description of the workbook.
    :vartype description: str
    :ivar revision: The unique revision id for this workbook definition.
    :vartype revision: str
    """

    display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"])
    """The user-defined name (display name) of the workbook. Required."""
    serialized_data: str = rest_field(name="serializedData", visibility=["read", "create", "update", "delete", "query"])
    """Configuration of this particular workbook. Configuration data is a string containing valid
     JSON. Required."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
     serializedData."""
    time_modified: Optional[datetime.datetime] = rest_field(name="timeModified", visibility=["read"], format="rfc3339")
    """Date and time in UTC of the last modification that was made to this workbook definition."""
    category: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workbook category, as defined by the user at creation time. Required."""
    tags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Being deprecated, please use the other tags field."""
    user_id: Optional[str] = rest_field(name="userId", visibility=["read"])
    """Unique user id of the specific user that owns this workbook."""
    source_id: Optional[str] = rest_field(name="sourceId", visibility=["read", "create", "update", "delete", "query"])
    """ResourceId for a source resource."""
    storage_uri: Optional[str] = rest_field(
        name="storageUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resourceId to the storage account when bring your own storage is used."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of the workbook."""
    revision: Optional[str] = rest_field(visibility=["read"])
    """The unique revision id for this workbook definition."""

    @overload
    def __init__(
        self,
        *,
        display_name: str,
        serialized_data: str,
        category: str,
        version: Optional[str] = None,
        tags: Optional[list[str]] = None,
        source_id: Optional[str] = None,
        storage_uri: 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 ErrorFieldContract(_Model):
    """Error Field contract.

    :ivar code: Property level error code.
    :vartype code: str
    :ivar message: Human-readable representation of property-level error.
    :vartype message: str
    :ivar target: Property name.
    :vartype target: str
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Property level error code."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Human-readable representation of property-level error."""
    target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Property name."""

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

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

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


class ErrorResponse(_Model):
    """Error response indicates Insights service is not able to process the incoming request. The
    reason is provided in the error message.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message indicating why the operation failed.
    :vartype message: str
    :ivar details: The list of invalid fields send in request, in case of validation error.
    :vartype details: list[~azure.mgmt.applicationinsights.models.ErrorFieldContract]
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error code."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error message indicating why the operation failed."""
    details: Optional[list["_models.ErrorFieldContract"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of invalid fields send in request, in case of validation error."""

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

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

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


class ErrorResponseComponents(_Model):
    """ErrorResponseComponents.

    :ivar error: Error response indicates Insights service is not able to process the incoming
     request. The reason is provided in the error message.
    :vartype error: ~azure.mgmt.applicationinsights.models.ErrorResponseComponentsError
    """

    error: Optional["_models.ErrorResponseComponentsError"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Error response indicates Insights service is not able to process the incoming request. The
     reason is provided in the error message."""

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

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

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


class ErrorResponseComponentsError(_Model):
    """Error response indicates Insights service is not able to process the incoming request. The
    reason is provided in the error message.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message indicating why the operation failed.
    :vartype message: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Error message indicating why the operation failed."""


class ErrorResponseLinkedStorage(_Model):
    """ErrorResponseLinkedStorage.

    :ivar error: Error response indicates Insights service is not able to process the incoming
     request. The reason is provided in the error message.
    :vartype error: ~azure.mgmt.applicationinsights.models.ErrorResponseLinkedStorageError
    """

    error: Optional["_models.ErrorResponseLinkedStorageError"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Error response indicates Insights service is not able to process the incoming request. The
     reason is provided in the error message."""

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

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

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


class ErrorResponseLinkedStorageError(_Model):
    """Error response indicates Insights service is not able to process the incoming request. The
    reason is provided in the error message.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message indicating why the operation failed.
    :vartype message: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Error message indicating why the operation failed."""


class HeaderField(_Model):
    """A header to add to the WebTest.

    :ivar header_field_name: The name of the header.
    :vartype header_field_name: str
    :ivar header_field_value: The value of the header.
    :vartype header_field_value: str
    """

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

    @overload
    def __init__(
        self,
        *,
        header_field_name: Optional[str] = None,
        header_field_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 InnerError(_Model):
    """Inner error.

    :ivar diagnosticcontext: Provides correlation for request.
    :vartype diagnosticcontext: str
    :ivar time: Request time.
    :vartype time: ~datetime.datetime
    """

    diagnosticcontext: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Provides correlation for request."""
    time: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Request time."""

    @overload
    def __init__(
        self,
        *,
        diagnosticcontext: Optional[str] = None,
        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 LinkedStorageAccountsProperties(_Model):
    """An Application Insights component linked storage account.

    :ivar linked_storage_account: Linked storage account resource ID.
    :vartype linked_storage_account: str
    """

    linked_storage_account: Optional[str] = rest_field(
        name="linkedStorageAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Linked storage account resource ID."""

    @overload
    def __init__(
        self,
        *,
        linked_storage_account: 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 LiveTokenResponse(_Model):
    """The response to a live token query.

    :ivar live_token: JWT token for accessing live metrics stream data.
    :vartype live_token: str
    """

    live_token: Optional[str] = rest_field(name="liveToken", visibility=["read"])
    """JWT token for accessing live metrics stream data."""


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.applicationinsights.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.applicationinsights.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 Operation(_Model):
    """Azure Workbooks REST API operation.

    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: The object that represents the operation.
    :vartype display: ~azure.mgmt.applicationinsights.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"]
    )
    """The object that represents 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):
    """The object that represents the operation.

    :ivar provider: Service provider: Microsoft.Insights.
    :vartype provider: str
    :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc.
    :vartype resource: str
    :ivar operation: Operation type: Read, write, delete, etc.
    :vartype operation: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Service provider: Microsoft.Insights."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource on which the operation is performed: Profile, endpoint, etc."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation type: Read, write, delete, etc."""

    @overload
    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        resource: Optional[str] = None,
        operation: 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 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 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.applicationinsights.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.applicationinsights.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 TagsResource(_Model):
    """A container holding only the Tags for a resource, allowing the user to update the tags on a
    WebTest 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 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 WebtestsResource(_Model):
    """An azure resource object.

    :ivar id: Azure resource Id.
    :vartype id: str
    :ivar name: Azure resource name.
    :vartype name: str
    :ivar type: Azure resource type.
    :vartype type: str
    :ivar location: Resource location. Required.
    :vartype location: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Azure resource Id."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Azure resource name."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Azure resource type."""
    location: str = rest_field(visibility=["read", "create"])
    """Resource location. Required."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""

    @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 WebTest(WebtestsResource):
    """An Application Insights WebTest definition.

    :ivar id: Azure resource Id.
    :vartype id: str
    :ivar name: Azure resource name.
    :vartype name: str
    :ivar type: Azure resource type.
    :vartype type: str
    :ivar location: Resource location. Required.
    :vartype location: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar kind: The kind of WebTest that this web test watches. Choices are ping, multistep and
     standard. Known values are: "ping", "multistep", and "standard".
    :vartype kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind
    :ivar properties: Metadata describing a web test for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.WebTestProperties
    """

    kind: Optional[Union[str, "_models.WebTestKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of WebTest that this web test watches. Choices are ping, multistep and standard. Known
     values are: \"ping\", \"multistep\", and \"standard\"."""
    properties: Optional["_models.WebTestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a web test for an Azure resource."""

    __flattened_items = [
        "synthetic_monitor_id",
        "web_test_name",
        "description",
        "enabled",
        "frequency",
        "timeout",
        "web_test_kind",
        "retry_enabled",
        "locations",
        "configuration",
        "provisioning_state",
        "request",
        "validation_rules",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 WebTestGeolocation(_Model):
    """Geo-physical location to run a WebTest from. You must specify one or more locations for the
    test to run from.

    :ivar location: Location ID for the WebTest to run from.
    :vartype location: str
    """

    location: Optional[str] = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
    """Location ID for the WebTest to run from."""

    @overload
    def __init__(
        self,
        *,
        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 WebTestProperties(_Model):
    """Metadata describing a web test for an Azure resource.

    :ivar synthetic_monitor_id: Unique ID of this WebTest. This is typically the same value as the
     Name field. Required.
    :vartype synthetic_monitor_id: str
    :ivar web_test_name: User defined name if this WebTest. Required.
    :vartype web_test_name: str
    :ivar description: User defined description for this WebTest.
    :vartype description: str
    :ivar enabled: Is the test actively being monitored.
    :vartype enabled: bool
    :ivar frequency: Interval in seconds between test runs for this WebTest. Default value is 300.
    :vartype frequency: int
    :ivar timeout: Seconds until this WebTest will timeout and fail. Default value is 30.
    :vartype timeout: int
    :ivar web_test_kind: The kind of web test this is, valid choices are ping, multistep and
     standard. Required. Known values are: "ping", "multistep", and "standard".
    :vartype web_test_kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind
    :ivar retry_enabled: Allow for retries should this WebTest fail.
    :vartype retry_enabled: bool
    :ivar locations: A list of where to physically run the tests from to give global coverage for
     accessibility of your application. Required.
    :vartype locations: list[~azure.mgmt.applicationinsights.models.WebTestGeolocation]
    :ivar configuration: An XML configuration specification for a WebTest.
    :vartype configuration: ~azure.mgmt.applicationinsights.models.WebTestPropertiesConfiguration
    :ivar provisioning_state: Current state of this component, 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
    :ivar request: The collection of request properties.
    :vartype request: ~azure.mgmt.applicationinsights.models.WebTestPropertiesRequest
    :ivar validation_rules: The collection of validation rule properties.
    :vartype validation_rules:
     ~azure.mgmt.applicationinsights.models.WebTestPropertiesValidationRules
    """

    synthetic_monitor_id: str = rest_field(
        name="SyntheticMonitorId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Unique ID of this WebTest. This is typically the same value as the Name field. Required."""
    web_test_name: str = rest_field(name="Name", visibility=["read", "create", "update", "delete", "query"])
    """User defined name if this WebTest. Required."""
    description: Optional[str] = rest_field(
        name="Description", visibility=["read", "create", "update", "delete", "query"]
    )
    """User defined description for this WebTest."""
    enabled: Optional[bool] = rest_field(name="Enabled", visibility=["read", "create", "update", "delete", "query"])
    """Is the test actively being monitored."""
    frequency: Optional[int] = rest_field(name="Frequency", visibility=["read", "create", "update", "delete", "query"])
    """Interval in seconds between test runs for this WebTest. Default value is 300."""
    timeout: Optional[int] = rest_field(name="Timeout", visibility=["read", "create", "update", "delete", "query"])
    """Seconds until this WebTest will timeout and fail. Default value is 30."""
    web_test_kind: Union[str, "_models.WebTestKind"] = rest_field(
        name="Kind", visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of web test this is, valid choices are ping, multistep and standard. Required. Known
     values are: \"ping\", \"multistep\", and \"standard\"."""
    retry_enabled: Optional[bool] = rest_field(
        name="RetryEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allow for retries should this WebTest fail."""
    locations: list["_models.WebTestGeolocation"] = rest_field(
        name="Locations", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of where to physically run the tests from to give global coverage for accessibility of
     your application. Required."""
    configuration: Optional["_models.WebTestPropertiesConfiguration"] = rest_field(
        name="Configuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """An XML configuration specification for a WebTest."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Current state of this component, 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."""
    request: Optional["_models.WebTestPropertiesRequest"] = rest_field(
        name="Request", visibility=["read", "create", "update", "delete", "query"]
    )
    """The collection of request properties."""
    validation_rules: Optional["_models.WebTestPropertiesValidationRules"] = rest_field(
        name="ValidationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """The collection of validation rule properties."""

    @overload
    def __init__(
        self,
        *,
        synthetic_monitor_id: str,
        web_test_name: str,
        web_test_kind: Union[str, "_models.WebTestKind"],
        locations: list["_models.WebTestGeolocation"],
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        frequency: Optional[int] = None,
        timeout: Optional[int] = None,
        retry_enabled: Optional[bool] = None,
        configuration: Optional["_models.WebTestPropertiesConfiguration"] = None,
        request: Optional["_models.WebTestPropertiesRequest"] = None,
        validation_rules: Optional["_models.WebTestPropertiesValidationRules"] = None,
    ) -> None: ...

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

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


class WebTestPropertiesConfiguration(_Model):
    """An XML configuration specification for a WebTest.

    :ivar web_test: The XML specification of a WebTest to run against an application.
    :vartype web_test: str
    """

    web_test: Optional[str] = rest_field(name="WebTest", visibility=["read", "create", "update", "delete", "query"])
    """The XML specification of a WebTest to run against an application."""

    @overload
    def __init__(
        self,
        *,
        web_test: 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 WebTestPropertiesRequest(_Model):
    """The collection of request properties.

    :ivar request_url: Url location to test.
    :vartype request_url: str
    :ivar headers: List of headers and their values to add to the WebTest call.
    :vartype headers: list[~azure.mgmt.applicationinsights.models.HeaderField]
    :ivar http_verb: Http verb to use for this web test.
    :vartype http_verb: str
    :ivar request_body: Base64 encoded string body to send with this web test.
    :vartype request_body: str
    :ivar parse_dependent_requests: Parse Dependent request for this WebTest.
    :vartype parse_dependent_requests: bool
    :ivar follow_redirects: Follow redirects for this web test.
    :vartype follow_redirects: bool
    """

    request_url: Optional[str] = rest_field(
        name="RequestUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """Url location to test."""
    headers: Optional[list["_models.HeaderField"]] = rest_field(
        name="Headers", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of headers and their values to add to the WebTest call."""
    http_verb: Optional[str] = rest_field(name="HttpVerb", visibility=["read", "create", "update", "delete", "query"])
    """Http verb to use for this web test."""
    request_body: Optional[str] = rest_field(
        name="RequestBody", visibility=["read", "create", "update", "delete", "query"]
    )
    """Base64 encoded string body to send with this web test."""
    parse_dependent_requests: Optional[bool] = rest_field(
        name="ParseDependentRequests", visibility=["read", "create", "update", "delete", "query"]
    )
    """Parse Dependent request for this WebTest."""
    follow_redirects: Optional[bool] = rest_field(
        name="FollowRedirects", visibility=["read", "create", "update", "delete", "query"]
    )
    """Follow redirects for this web test."""

    @overload
    def __init__(
        self,
        *,
        request_url: Optional[str] = None,
        headers: Optional[list["_models.HeaderField"]] = None,
        http_verb: Optional[str] = None,
        request_body: Optional[str] = None,
        parse_dependent_requests: Optional[bool] = None,
        follow_redirects: 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 WebTestPropertiesValidationRules(_Model):
    """The collection of validation rule properties.

    :ivar content_validation: The collection of content validation properties.
    :vartype content_validation:
     ~azure.mgmt.applicationinsights.models.WebTestPropertiesValidationRulesContentValidation
    :ivar ssl_check: Checks to see if the SSL cert is still valid.
    :vartype ssl_check: bool
    :ivar ssl_cert_remaining_lifetime_check: A number of days to check still remain before the the
     existing SSL cert expires.  Value must be positive and the SSLCheck must be set to true.
    :vartype ssl_cert_remaining_lifetime_check: int
    :ivar expected_http_status_code: Validate that the WebTest returns the http status code
     provided.
    :vartype expected_http_status_code: int
    :ivar ignore_http_status_code: When set, validation will ignore the status code.
    :vartype ignore_http_status_code: bool
    """

    content_validation: Optional["_models.WebTestPropertiesValidationRulesContentValidation"] = rest_field(
        name="ContentValidation", visibility=["read", "create", "update", "delete", "query"]
    )
    """The collection of content validation properties."""
    ssl_check: Optional[bool] = rest_field(name="SSLCheck", visibility=["read", "create", "update", "delete", "query"])
    """Checks to see if the SSL cert is still valid."""
    ssl_cert_remaining_lifetime_check: Optional[int] = rest_field(
        name="SSLCertRemainingLifetimeCheck", visibility=["read", "create", "update", "delete", "query"]
    )
    """A number of days to check still remain before the the existing SSL cert expires.  Value must be
     positive and the SSLCheck must be set to true."""
    expected_http_status_code: Optional[int] = rest_field(
        name="ExpectedHttpStatusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validate that the WebTest returns the http status code provided."""
    ignore_http_status_code: Optional[bool] = rest_field(
        name="IgnoreHttpStatusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """When set, validation will ignore the status code."""

    @overload
    def __init__(
        self,
        *,
        content_validation: Optional["_models.WebTestPropertiesValidationRulesContentValidation"] = None,
        ssl_check: Optional[bool] = None,
        ssl_cert_remaining_lifetime_check: Optional[int] = None,
        expected_http_status_code: Optional[int] = None,
        ignore_http_status_code: 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 WebTestPropertiesValidationRulesContentValidation(_Model):  # pylint: disable=name-too-long
    """The collection of content validation properties.

    :ivar content_match: Content to look for in the return of the WebTest.  Must not be null or
     empty.
    :vartype content_match: str
    :ivar ignore_case: When set, this value makes the ContentMatch validation case insensitive.
    :vartype ignore_case: bool
    :ivar pass_if_text_found: When true, validation will pass if there is a match for the
     ContentMatch string.  If false, validation will fail if there is a match.
    :vartype pass_if_text_found: bool
    """

    content_match: Optional[str] = rest_field(
        name="ContentMatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Content to look for in the return of the WebTest.  Must not be null or empty."""
    ignore_case: Optional[bool] = rest_field(
        name="IgnoreCase", visibility=["read", "create", "update", "delete", "query"]
    )
    """When set, this value makes the ContentMatch validation case insensitive."""
    pass_if_text_found: Optional[bool] = rest_field(
        name="PassIfTextFound", visibility=["read", "create", "update", "delete", "query"]
    )
    """When true, validation will pass if there is a match for the ContentMatch string.  If false,
     validation will fail if there is a match."""

    @overload
    def __init__(
        self,
        *,
        content_match: Optional[str] = None,
        ignore_case: Optional[bool] = None,
        pass_if_text_found: 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 Workbook(TrackedResource):
    """A workbook 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.applicationinsights.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: Metadata describing a workbook for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.WorkbookProperties
    :ivar identity: Identity used for BYOS.
    :vartype identity: ~azure.mgmt.applicationinsights.models.WorkbookResourceIdentity
    :ivar kind: The kind of workbook. Only valid value is shared. "shared"
    :vartype kind: str or ~azure.mgmt.applicationinsights.models.WorkbookSharedTypeKind
    :ivar etag: Resource etag.
    :vartype etag: str
    """

    properties: Optional["_models.WorkbookProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a workbook for an Azure resource."""
    identity: Optional["_models.WorkbookResourceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identity used for BYOS."""
    kind: Optional[Union[str, "_models.WorkbookSharedTypeKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of workbook. Only valid value is shared. \"shared\""""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource etag."""

    __flattened_items = [
        "display_name",
        "serialized_data",
        "version",
        "time_modified",
        "category",
        "tags",
        "user_id",
        "source_id",
        "storage_uri",
        "description",
        "revision",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.WorkbookProperties"] = None,
        identity: Optional["_models.WorkbookResourceIdentity"] = None,
        kind: Optional[Union[str, "_models.WorkbookSharedTypeKind"]] = 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 WorkbookError(_Model):
    """Error response.

    :ivar error: The error details.
    :vartype error: ~azure.mgmt.applicationinsights.models.WorkbookErrorDefinition
    """

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

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

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

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


class WorkbookErrorDefinition(_Model):
    """Error definition.

    :ivar code: Service specific error code which serves as the substatus for the HTTP error code.
    :vartype code: str
    :ivar message: Description of the error.
    :vartype message: str
    :ivar innererror: Internal error details.
    :vartype innererror: ~azure.mgmt.applicationinsights.models.WorkbookInnerErrorTrace
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Service specific error code which serves as the substatus for the HTTP error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Description of the error."""
    innererror: Optional["_models.WorkbookInnerErrorTrace"] = rest_field(visibility=["read"])
    """Internal error details."""


class WorkbookInnerErrorTrace(_Model):
    """Error details.

    :ivar trace: detailed error trace.
    :vartype trace: list[str]
    """

    trace: Optional[list[str]] = rest_field(visibility=["read"])
    """detailed error trace."""


class WorkbookProperties(_Model):
    """Properties that contain a workbook.

    :ivar display_name: The user-defined name (display name) of the workbook. Required.
    :vartype display_name: str
    :ivar serialized_data: Configuration of this particular workbook. Configuration data is a
     string containing valid JSON. Required.
    :vartype serialized_data: str
    :ivar version: Workbook schema version format, like 'Notebook/1.0', which should match the
     workbook in serializedData.
    :vartype version: str
    :ivar time_modified: Date and time in UTC of the last modification that was made to this
     workbook definition.
    :vartype time_modified: ~datetime.datetime
    :ivar category: Workbook category, as defined by the user at creation time. Required.
    :vartype category: str
    :ivar tags: Being deprecated, please use the other tags field.
    :vartype tags: list[str]
    :ivar user_id: Unique user id of the specific user that owns this workbook.
    :vartype user_id: str
    :ivar source_id: ResourceId for a source resource.
    :vartype source_id: str
    :ivar storage_uri: The resourceId to the storage account when bring your own storage is used.
    :vartype storage_uri: str
    :ivar description: The description of the workbook.
    :vartype description: str
    :ivar revision: The unique revision id for this workbook definition.
    :vartype revision: str
    """

    display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"])
    """The user-defined name (display name) of the workbook. Required."""
    serialized_data: str = rest_field(name="serializedData", visibility=["read", "create", "update", "delete", "query"])
    """Configuration of this particular workbook. Configuration data is a string containing valid
     JSON. Required."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workbook schema version format, like 'Notebook/1.0', which should match the workbook in
     serializedData."""
    time_modified: Optional[datetime.datetime] = rest_field(name="timeModified", visibility=["read"], format="rfc3339")
    """Date and time in UTC of the last modification that was made to this workbook definition."""
    category: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workbook category, as defined by the user at creation time. Required."""
    tags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Being deprecated, please use the other tags field."""
    user_id: Optional[str] = rest_field(name="userId", visibility=["read"])
    """Unique user id of the specific user that owns this workbook."""
    source_id: Optional[str] = rest_field(name="sourceId", visibility=["read", "create", "update", "delete", "query"])
    """ResourceId for a source resource."""
    storage_uri: Optional[str] = rest_field(
        name="storageUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resourceId to the storage account when bring your own storage is used."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of the workbook."""
    revision: Optional[str] = rest_field(visibility=["read"])
    """The unique revision id for this workbook definition."""

    @overload
    def __init__(
        self,
        *,
        display_name: str,
        serialized_data: str,
        category: str,
        version: Optional[str] = None,
        tags: Optional[list[str]] = None,
        source_id: Optional[str] = None,
        storage_uri: 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 WorkbookPropertiesUpdateParameters(_Model):
    """Properties that contain a workbook for PATCH operation.

    :ivar display_name: The user-defined name (display name) of the workbook.
    :vartype display_name: str
    :ivar serialized_data: Configuration of this particular workbook. Configuration data is a
     string containing valid JSON.
    :vartype serialized_data: str
    :ivar category: Workbook category, as defined by the user at creation time.
    :vartype category: str
    :ivar tags: A list of 0 or more tags that are associated with this workbook definition.
    :vartype tags: list[str]
    :ivar description: The description of the workbook.
    :vartype description: str
    :ivar revision: The unique revision id for this workbook definition.
    :vartype revision: str
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user-defined name (display name) of the workbook."""
    serialized_data: Optional[str] = rest_field(
        name="serializedData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Configuration of this particular workbook. Configuration data is a string containing valid
     JSON."""
    category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workbook category, as defined by the user at creation time."""
    tags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of 0 or more tags that are associated with this workbook definition."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of the workbook."""
    revision: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unique revision id for this workbook definition."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        serialized_data: Optional[str] = None,
        category: Optional[str] = None,
        tags: Optional[list[str]] = None,
        description: Optional[str] = None,
        revision: Optional[str] = None,
    ) -> None: ...

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

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


class WorkbookResourceIdentity(ManagedServiceIdentity):
    """Identity used for BYOS.

    :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.applicationinsights.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.applicationinsights.models.UserAssignedIdentity]
    """

    @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 WorkbookTemplate(TrackedResource):
    """An Application Insights workbook template 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.applicationinsights.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: Metadata describing a workbook template for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.WorkbookTemplateProperties
    """

    properties: Optional["_models.WorkbookTemplateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a workbook template for an Azure resource."""

    __flattened_items = ["priority", "author", "template_data", "galleries", "localized"]

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

    @overload
    def __init__(self, mapping: Mapping[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 WorkbookTemplateError(_Model):
    """Error message that will indicate why the operation failed.

    :ivar error: Error message object that will indicate why the operation failed.
    :vartype error: ~azure.mgmt.applicationinsights.models.WorkbookTemplateErrorBody
    """

    error: Optional["_models.WorkbookTemplateErrorBody"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message object that will indicate why the operation failed."""

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

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

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


class WorkbookTemplateErrorBody(_Model):
    """Error message body that will indicate why the operation failed.

    :ivar code: Service-defined error code. This code serves as a sub-status for the HTTP error
     code specified in the response.
    :vartype code: str
    :ivar message: Human-readable representation of the error.
    :vartype message: str
    :ivar details: The list of invalid fields send in request, in case of validation error.
    :vartype details:
     list[~azure.mgmt.applicationinsights.models.WorkbookTemplateErrorFieldContract]
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Service-defined error code. This code serves as a sub-status for the HTTP error code specified
     in the response."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Human-readable representation of the error."""
    details: Optional[list["_models.WorkbookTemplateErrorFieldContract"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of invalid fields send in request, in case of validation error."""

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

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

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


class WorkbookTemplateErrorFieldContract(_Model):
    """Error Field contract.

    :ivar code: Property level error code.
    :vartype code: str
    :ivar message: Human-readable representation of property-level error.
    :vartype message: str
    :ivar target: Property name.
    :vartype target: str
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Property level error code."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Human-readable representation of property-level error."""
    target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Property name."""

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

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

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


class WorkbookTemplateGallery(_Model):
    """Gallery information for a workbook template.

    :ivar name: Name of the workbook template in the gallery.
    :vartype name: str
    :ivar category: Category for the gallery.
    :vartype category: str
    :ivar type: Type of workbook supported by the workbook template.
    :vartype type: str
    :ivar order: Order of the template within the gallery.
    :vartype order: int
    :ivar resource_type: Azure resource type supported by the gallery.
    :vartype resource_type: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the workbook template in the gallery."""
    category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Category for the gallery."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Type of workbook supported by the workbook template."""
    order: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Order of the template within the gallery."""
    resource_type: Optional[str] = rest_field(
        name="resourceType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure resource type supported by the gallery."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        category: Optional[str] = None,
        type: Optional[str] = None,
        order: Optional[int] = None,
        resource_type: 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 WorkbookTemplateLocalizedGallery(_Model):
    """Localized template data and gallery information.

    :ivar template_data: Valid JSON object containing workbook template payload.
    :vartype template_data: any
    :ivar galleries: Workbook galleries supported by the template.
    :vartype galleries: list[~azure.mgmt.applicationinsights.models.WorkbookTemplateGallery]
    """

    template_data: Optional[Any] = rest_field(
        name="templateData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Valid JSON object containing workbook template payload."""
    galleries: Optional[list["_models.WorkbookTemplateGallery"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Workbook galleries supported by the template."""

    @overload
    def __init__(
        self,
        *,
        template_data: Optional[Any] = None,
        galleries: Optional[list["_models.WorkbookTemplateGallery"]] = None,
    ) -> None: ...

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

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


class WorkbookTemplateProperties(_Model):
    """Properties that contain a workbook template.

    :ivar priority: Priority of the template. Determines which template to open when a workbook
     gallery is opened in viewer mode.
    :vartype priority: int
    :ivar author: Information about the author of the workbook template.
    :vartype author: str
    :ivar template_data: Valid JSON object containing workbook template payload. Required.
    :vartype template_data: any
    :ivar galleries: Workbook galleries supported by the template. Required.
    :vartype galleries: list[~azure.mgmt.applicationinsights.models.WorkbookTemplateGallery]
    :ivar localized: Key value pair of localized gallery. Each key is the locale code of languages
     supported by the Azure portal.
    :vartype localized: dict[str,
     list[~azure.mgmt.applicationinsights.models.WorkbookTemplateLocalizedGallery]]
    """

    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Priority of the template. Determines which template to open when a workbook gallery is opened
     in viewer mode."""
    author: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Information about the author of the workbook template."""
    template_data: Any = rest_field(name="templateData", visibility=["read", "create", "update", "delete", "query"])
    """Valid JSON object containing workbook template payload. Required."""
    galleries: list["_models.WorkbookTemplateGallery"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Workbook galleries supported by the template. Required."""
    localized: Optional[dict[str, list["_models.WorkbookTemplateLocalizedGallery"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Key value pair of localized gallery. Each key is the locale code of languages supported by the
     Azure portal."""

    @overload
    def __init__(
        self,
        *,
        template_data: Any,
        galleries: list["_models.WorkbookTemplateGallery"],
        priority: Optional[int] = None,
        author: Optional[str] = None,
        localized: Optional[dict[str, list["_models.WorkbookTemplateLocalizedGallery"]]] = None,
    ) -> None: ...

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

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


class WorkbookTemplateUpdateParameters(_Model):
    """The parameters that can be provided when updating workbook template.

    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar properties: Metadata describing a workbook for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.WorkbookTemplateProperties
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    properties: Optional["_models.WorkbookTemplateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a workbook for an Azure resource."""

    __flattened_items = ["priority", "author", "template_data", "galleries", "localized"]

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

    @overload
    def __init__(self, mapping: Mapping[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 WorkbookUpdateParameters(_Model):
    """The parameters that can be provided when updating workbook properties properties.

    :ivar kind: The kind of workbook. Only valid value is shared. "shared"
    :vartype kind: str or ~azure.mgmt.applicationinsights.models.WorkbookUpdateSharedTypeKind
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar properties: Metadata describing a workbook for an Azure resource.
    :vartype properties: ~azure.mgmt.applicationinsights.models.WorkbookPropertiesUpdateParameters
    """

    kind: Optional[Union[str, "_models.WorkbookUpdateSharedTypeKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of workbook. Only valid value is shared. \"shared\""""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"])
    """Resource tags."""
    properties: Optional["_models.WorkbookPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata describing a workbook for an Azure resource."""

    __flattened_items = ["display_name", "serialized_data", "category", "tags", "description", "revision"]

    @overload
    def __init__(
        self,
        *,
        kind: Optional[Union[str, "_models.WorkbookUpdateSharedTypeKind"]] = None,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.WorkbookPropertiesUpdateParameters"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 WorkItemConfiguration(_Model):
    """Work item configuration associated with an application insights resource.

    :ivar connector_id: Connector identifier where work item is created.
    :vartype connector_id: str
    :ivar config_display_name: Configuration friendly name.
    :vartype config_display_name: str
    :ivar is_default: Boolean value indicating whether configuration is default.
    :vartype is_default: bool
    :ivar id: Unique Id for work item.
    :vartype id: str
    :ivar config_properties: Serialized JSON object for detailed properties.
    :vartype config_properties: str
    """

    connector_id: Optional[str] = rest_field(
        name="ConnectorId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connector identifier where work item is created."""
    config_display_name: Optional[str] = rest_field(
        name="ConfigDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Configuration friendly name."""
    is_default: Optional[bool] = rest_field(
        name="IsDefault", visibility=["read", "create", "update", "delete", "query"]
    )
    """Boolean value indicating whether configuration is default."""
    id: Optional[str] = rest_field(name="Id", visibility=["read", "create", "update", "delete", "query"])
    """Unique Id for work item."""
    config_properties: Optional[str] = rest_field(
        name="ConfigProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Serialized JSON object for detailed properties."""

    @overload
    def __init__(
        self,
        *,
        connector_id: Optional[str] = None,
        config_display_name: Optional[str] = None,
        is_default: Optional[bool] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        config_properties: 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 WorkItemConfigurationError(_Model):
    """Error associated with trying to get work item configuration or configurations.

    :ivar code: Error detail code and explanation.
    :vartype code: str
    :ivar message: Error message.
    :vartype message: str
    :ivar innererror: Inner error.
    :vartype innererror: ~azure.mgmt.applicationinsights.models.InnerError
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error detail code and explanation."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error message."""
    innererror: Optional["_models.InnerError"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Inner error."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        innererror: Optional["_models.InnerError"] = None,
    ) -> None: ...

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

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


class WorkItemCreateConfiguration(_Model):
    """Work item configuration creation payload.

    :ivar connector_id: Unique connector id.
    :vartype connector_id: str
    :ivar connector_data_configuration: Serialized JSON object for detailed properties.
    :vartype connector_data_configuration: str
    :ivar validate_only: Boolean indicating validate only.
    :vartype validate_only: bool
    :ivar work_item_properties: Custom work item properties.
    :vartype work_item_properties: dict[str, str]
    """

    connector_id: Optional[str] = rest_field(
        name="ConnectorId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Unique connector id."""
    connector_data_configuration: Optional[str] = rest_field(
        name="ConnectorDataConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Serialized JSON object for detailed properties."""
    validate_only: Optional[bool] = rest_field(
        name="ValidateOnly", visibility=["read", "create", "update", "delete", "query"]
    )
    """Boolean indicating validate only."""
    work_item_properties: Optional[dict[str, str]] = rest_field(
        name="WorkItemProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom work item properties."""

    @overload
    def __init__(
        self,
        *,
        connector_id: Optional[str] = None,
        connector_data_configuration: Optional[str] = None,
        validate_only: Optional[bool] = None,
        work_item_properties: 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)
