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


class AdvisorScoreEntity(ProxyResource):
    """The details of Advisor score for a single category.

    :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.advisor.models.SystemData
    :ivar properties: The Advisor score data.
    :vartype properties: ~azure.mgmt.advisor.models.AdvisorScoreEntityProperties
    """

    properties: Optional["_models.AdvisorScoreEntityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Advisor score data."""

    __flattened_items = ["last_refreshed_score", "time_series"]

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

    @overload
    def __init__(self, mapping: Mapping[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 AdvisorScoreEntityProperties(_Model):
    """The Advisor score data.

    :ivar last_refreshed_score: The details of latest available score.
    :vartype last_refreshed_score: ~azure.mgmt.advisor.models.ScoreEntity
    :ivar time_series: The historic Advisor score data.
    :vartype time_series: list[~azure.mgmt.advisor.models.TimeSeriesEntity]
    """

    last_refreshed_score: Optional["_models.ScoreEntity"] = rest_field(
        name="lastRefreshedScore", visibility=["read", "create", "update", "delete", "query"]
    )
    """The details of latest available score."""
    time_series: Optional[list["_models.TimeSeriesEntity"]] = rest_field(
        name="timeSeries", visibility=["read", "create", "update", "delete", "query"]
    )
    """The historic Advisor score data."""

    @overload
    def __init__(
        self,
        *,
        last_refreshed_score: Optional["_models.ScoreEntity"] = None,
        time_series: Optional[list["_models.TimeSeriesEntity"]] = None,
    ) -> None: ...

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

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


class ArmErrorResponse(_Model):
    """ArmErrorResponse.

    :ivar error: ARM error response body.
    :vartype error: ~azure.mgmt.advisor.models.ARMErrorResponseBody
    """

    error: Optional["_models.ARMErrorResponseBody"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """ARM error response body."""

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

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

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


class ARMErrorResponseBody(_Model):
    """ARM error response body.

    :ivar message: Gets or sets the string that describes the error in detail and provides
     debugging information.
    :vartype message: str
    :ivar code: Gets or sets the string that can be used to programmatically identify the error.
    :vartype code: str
    """

    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Gets or sets the string that describes the error in detail and provides debugging information."""
    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Gets or sets the string that can be used to programmatically identify the error."""

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

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

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


class AssessmentResult(ProxyResource):
    """The Advisor assessment result data structure.

    :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.advisor.models.SystemData
    :ivar properties: The Advisor assessment result properties structure.
    :vartype properties: ~azure.mgmt.advisor.models.AssessmentResultProperties
    """

    properties: Optional["_models.AssessmentResultProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Advisor assessment result properties structure."""

    __flattened_items = [
        "workload_id",
        "workload_name",
        "assessment_id",
        "description",
        "type_id",
        "type",
        "score",
        "state",
        "type_version",
        "locale",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AssessmentResultProperties(_Model):
    """Assessment result properties.

    :ivar workload_id: Workload Id.
    :vartype workload_id: str
    :ivar workload_name: Workload Name.
    :vartype workload_name: str
    :ivar assessment_id: Assessment Id.
    :vartype assessment_id: str
    :ivar description: Assessment Type Description.
    :vartype description: str
    :ivar type_id: Assessment Type Id.
    :vartype type_id: str
    :ivar type: Assessment Type.
    :vartype type: str
    :ivar score: Assessment Score.
    :vartype score: int
    :ivar state: Assessment State.
    :vartype state: str
    :ivar type_version: Assessment Type Version.
    :vartype type_version: str
    :ivar locale: Assessment Type Locale.
    :vartype locale: str
    """

    workload_id: Optional[str] = rest_field(
        name="workloadId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Workload Id."""
    workload_name: Optional[str] = rest_field(name="workloadName", visibility=["read"])
    """Workload Name."""
    assessment_id: Optional[str] = rest_field(name="assessmentId", visibility=["read"])
    """Assessment Id."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Assessment Type Description."""
    type_id: Optional[str] = rest_field(name="typeId", visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Id."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Assessment Type."""
    score: Optional[int] = rest_field(visibility=["read"])
    """Assessment Score."""
    state: Optional[str] = rest_field(visibility=["read"])
    """Assessment State."""
    type_version: Optional[str] = rest_field(name="typeVersion", visibility=["read"])
    """Assessment Type Version."""
    locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Locale."""

    @overload
    def __init__(
        self,
        *,
        workload_id: Optional[str] = None,
        type_id: Optional[str] = None,
        locale: 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 AssessmentTypeResult(_Model):
    """The Advisor assessment type result data structure.

    :ivar id: Assessment Type Id.
    :vartype id: str
    :ivar title: Assessment Type Title.
    :vartype title: str
    :ivar description: Assessment Type Description.
    :vartype description: str
    :ivar locale: Assessment Type Locale.
    :vartype locale: str
    :ivar version: Assessment Type Version.
    :vartype version: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Id."""
    title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Title."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Description."""
    locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Locale."""
    version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Assessment Type Version."""

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

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

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


class ConfigData(Resource):
    """The Advisor configuration data structure.

    :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.advisor.models.SystemData
    :ivar properties: The Advisor configuration data structure.
    :vartype properties: ~azure.mgmt.advisor.models.ConfigDataProperties
    """

    properties: Optional["_models.ConfigDataProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Advisor configuration data structure."""

    __flattened_items = ["exclude", "low_cpu_threshold", "duration", "digests"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ConfigDataProperties(_Model):
    """Configuration data properties.

    :ivar exclude: Exclude the resource from Advisor evaluations. Valid values: False (default) or
     True.
    :vartype exclude: bool
    :ivar low_cpu_threshold: Minimum percentage threshold for Advisor low CPU utilization
     evaluation. Valid only for subscriptions. Valid values: 5 (default), 10, 15 or 20. Known values
     are: "5", "10", "15", and "20".
    :vartype low_cpu_threshold: str or ~azure.mgmt.advisor.models.CpuThreshold
    :ivar duration: Minimum duration for Advisor low CPU utilization evaluation. Valid only for
     subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90. Known values are: "7", "14",
     "21", "30", "60", and "90".
    :vartype duration: str or ~azure.mgmt.advisor.models.Duration
    :ivar digests: Advisor digest configuration. Valid only for subscriptions.
    :vartype digests: list[~azure.mgmt.advisor.models.DigestConfig]
    """

    exclude: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Exclude the resource from Advisor evaluations. Valid values: False (default) or True."""
    low_cpu_threshold: Optional[Union[str, "_models.CpuThreshold"]] = rest_field(
        name="lowCpuThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for
     subscriptions. Valid values: 5 (default), 10, 15 or 20. Known values are: \"5\", \"10\",
     \"15\", and \"20\"."""
    duration: Optional[Union[str, "_models.Duration"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum duration for Advisor low CPU utilization evaluation. Valid only for subscriptions.
     Valid values: 7 (default), 14, 21, 30, 60 or 90. Known values are: \"7\", \"14\", \"21\",
     \"30\", \"60\", and \"90\"."""
    digests: Optional[list["_models.DigestConfig"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Advisor digest configuration. Valid only for subscriptions."""

    @overload
    def __init__(
        self,
        *,
        exclude: Optional[bool] = None,
        low_cpu_threshold: Optional[Union[str, "_models.CpuThreshold"]] = None,
        duration: Optional[Union[str, "_models.Duration"]] = None,
        digests: Optional[list["_models.DigestConfig"]] = None,
    ) -> None: ...

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

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


class DigestConfig(_Model):
    """Advisor Digest configuration entity.

    :ivar name: Name of digest configuration. Value is case-insensitive and must be unique within a
     subscription.
    :vartype name: str
    :ivar action_group_resource_id: Action group resource id used by digest.
    :vartype action_group_resource_id: str
    :ivar frequency: Frequency that digest will be triggered, in days. Value must be between 7 and
     30 days inclusive.
    :vartype frequency: int
    :ivar categories: Categories to send digest for. If categories are not provided, then digest
     will be sent for all categories.
    :vartype categories: list[str or ~azure.mgmt.advisor.models.Category]
    :ivar language: Language for digest content body. Value must be ISO 639-1 code for one of Azure
     portal supported languages. Otherwise, it will be converted into one. Default value is English
     (en).
    :vartype language: str
    :ivar state: State of digest configuration. Known values are: "Active" and "Disabled".
    :vartype state: str or ~azure.mgmt.advisor.models.DigestConfigState
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of digest configuration. Value is case-insensitive and must be unique within a
     subscription."""
    action_group_resource_id: Optional[str] = rest_field(
        name="actionGroupResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Action group resource id used by digest."""
    frequency: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Frequency that digest will be triggered, in days. Value must be between 7 and 30 days
     inclusive."""
    categories: Optional[list[Union[str, "_models.Category"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Categories to send digest for. If categories are not provided, then digest will be sent for all
     categories."""
    language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Language for digest content body. Value must be ISO 639-1 code for one of Azure portal
     supported languages. Otherwise, it will be converted into one. Default value is English (en)."""
    state: Optional[Union[str, "_models.DigestConfigState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """State of digest configuration. Known values are: \"Active\" and \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        action_group_resource_id: Optional[str] = None,
        frequency: Optional[int] = None,
        categories: Optional[list[Union[str, "_models.Category"]]] = None,
        language: Optional[str] = None,
        state: Optional[Union[str, "_models.DigestConfigState"]] = None,
    ) -> None: ...

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

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


class ErrorAdditionalInfo(_Model):
    """The resource management error additional info.

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

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


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

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

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


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

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

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

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

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

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


class ExtensionResource(Resource):
    """The base extension 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.advisor.models.SystemData
    """


class MetadataEntity(ProxyResource):
    """The metadata entity contract.

    :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.advisor.models.SystemData
    :ivar properties: The metadata entity properties.
    :vartype properties: ~azure.mgmt.advisor.models.MetadataEntityProperties
    """

    properties: Optional["_models.MetadataEntityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The metadata entity properties."""

    __flattened_items = ["display_name", "depends_on", "applicable_scenarios", "supported_values"]

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

    @overload
    def __init__(self, mapping: Mapping[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 MetadataEntityProperties(_Model):
    """The metadata entity properties.

    :ivar display_name: The display name.
    :vartype display_name: str
    :ivar depends_on: The list of keys on which this entity depends on.
    :vartype depends_on: list[str]
    :ivar applicable_scenarios: The list of scenarios applicable to this metadata entity.
    :vartype applicable_scenarios: list[str or ~azure.mgmt.advisor.models.Scenario]
    :ivar supported_values: The list of supported values.
    :vartype supported_values: list[~azure.mgmt.advisor.models.MetadataSupportedValueDetail]
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name."""
    depends_on: Optional[list[str]] = rest_field(
        name="dependsOn", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of keys on which this entity depends on."""
    applicable_scenarios: Optional[list[Union[str, "_models.Scenario"]]] = rest_field(
        name="applicableScenarios", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of scenarios applicable to this metadata entity."""
    supported_values: Optional[list["_models.MetadataSupportedValueDetail"]] = rest_field(
        name="supportedValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of supported values."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        depends_on: Optional[list[str]] = None,
        applicable_scenarios: Optional[list[Union[str, "_models.Scenario"]]] = None,
        supported_values: Optional[list["_models.MetadataSupportedValueDetail"]] = None,
    ) -> None: ...

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

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


class MetadataSupportedValueDetail(_Model):
    """The metadata supported value detail.

    :ivar id: The id.
    :vartype id: str
    :ivar display_name: The display name.
    :vartype display_name: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The id."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name."""

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

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

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


class OperationDisplayInfo(_Model):
    """The operation supported by Advisor.

    :ivar description: The description of the operation.
    :vartype description: str
    :ivar operation: The action that users can perform, based on their permission level.
    :vartype operation: str
    :ivar provider: Service provider: Microsoft Advisor.
    :vartype provider: str
    :ivar resource: Resource on which the operation is performed.
    :vartype resource: str
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description of the operation."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The action that users can perform, based on their permission level."""
    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Service provider: Microsoft Advisor."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource on which the operation is performed."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        operation: Optional[str] = None,
        provider: Optional[str] = None,
        resource: Optional[str] = None,
    ) -> None: ...

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

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


class OperationEntity(_Model):
    """The operation supported by Advisor.

    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: The operation supported by Advisor.
    :vartype display: ~azure.mgmt.advisor.models.OperationDisplayInfo
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation name: {provider}/{resource}/{operation}."""
    display: Optional["_models.OperationDisplayInfo"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The operation supported by Advisor."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display: Optional["_models.OperationDisplayInfo"] = None,
    ) -> None: ...

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

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


class PredictionRequest(_Model):
    """Parameters for predict recommendation.

    :ivar properties: Request properties for prediction recommendation.
    :vartype properties: ~azure.mgmt.advisor.models.PredictionRequestProperties
    """

    properties: Optional["_models.PredictionRequestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Request properties for prediction recommendation."""

    __flattened_items = ["prediction_type", "extended_properties"]

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

    @overload
    def __init__(self, mapping: Mapping[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 PredictionRequestProperties(_Model):
    """Properties given for the predictor.

    :ivar prediction_type: Type of the prediction. "PredictiveRightsizing"
    :vartype prediction_type: str or ~azure.mgmt.advisor.models.PredictionType
    :ivar extended_properties: Extended properties are arguments specific for each prediction type.
    :vartype extended_properties: any
    """

    prediction_type: Optional[Union[str, "_models.PredictionType"]] = rest_field(
        name="predictionType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the prediction. \"PredictiveRightsizing\""""
    extended_properties: Optional[Any] = rest_field(
        name="extendedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended properties are arguments specific for each prediction type."""

    @overload
    def __init__(
        self,
        *,
        prediction_type: Optional[Union[str, "_models.PredictionType"]] = None,
        extended_properties: Optional[Any] = None,
    ) -> None: ...

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

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


class PredictionResponse(_Model):
    """Response used by predictions.

    :ivar properties: The properties of the prediction.
    :vartype properties: ~azure.mgmt.advisor.models.PredictionResponseProperties
    """

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

    __flattened_items = [
        "extended_properties",
        "prediction_type",
        "category",
        "impact",
        "impacted_field",
        "last_updated",
        "short_description",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 PredictionResponseProperties(_Model):
    """Properties of the prediction.

    :ivar extended_properties: Extended properties.
    :vartype extended_properties: any
    :ivar prediction_type: Type of the prediction. "PredictiveRightsizing"
    :vartype prediction_type: str or ~azure.mgmt.advisor.models.PredictionType
    :ivar category: The category of the recommendation. Known values are: "HighAvailability",
     "Security", "Performance", "Cost", and "OperationalExcellence".
    :vartype category: str or ~azure.mgmt.advisor.models.Category
    :ivar impact: The business impact of the recommendation. Known values are: "High", "Medium",
     and "Low".
    :vartype impact: str or ~azure.mgmt.advisor.models.Impact
    :ivar impacted_field: The resource type identified by Advisor.
    :vartype impacted_field: str
    :ivar last_updated: The most recent time that Advisor checked the validity of the
     recommendation.
    :vartype last_updated: ~datetime.datetime
    :ivar short_description: A summary of the recommendation.
    :vartype short_description: ~azure.mgmt.advisor.models.ShortDescription
    """

    extended_properties: Optional[Any] = rest_field(
        name="extendedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended properties."""
    prediction_type: Optional[Union[str, "_models.PredictionType"]] = rest_field(
        name="predictionType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the prediction. \"PredictiveRightsizing\""""
    category: Optional[Union[str, "_models.Category"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The category of the recommendation. Known values are: \"HighAvailability\", \"Security\",
     \"Performance\", \"Cost\", and \"OperationalExcellence\"."""
    impact: Optional[Union[str, "_models.Impact"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The business impact of the recommendation. Known values are: \"High\", \"Medium\", and \"Low\"."""
    impacted_field: Optional[str] = rest_field(
        name="impactedField", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource type identified by Advisor."""
    last_updated: Optional[datetime.datetime] = rest_field(
        name="lastUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The most recent time that Advisor checked the validity of the recommendation."""
    short_description: Optional["_models.ShortDescription"] = rest_field(
        name="shortDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """A summary of the recommendation."""

    @overload
    def __init__(
        self,
        *,
        extended_properties: Optional[Any] = None,
        prediction_type: Optional[Union[str, "_models.PredictionType"]] = None,
        category: Optional[Union[str, "_models.Category"]] = None,
        impact: Optional[Union[str, "_models.Impact"]] = None,
        impacted_field: Optional[str] = None,
        last_updated: Optional[datetime.datetime] = None,
        short_description: Optional["_models.ShortDescription"] = None,
    ) -> None: ...

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

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


class RecommendationPatchPayload(_Model):
    """The recommendation patch payload.

    :ivar properties: The properties for recommendation patch payload.
    :vartype properties: ~azure.mgmt.advisor.models.RecommendationStatePropertiesPayload
    """

    properties: Optional["_models.RecommendationStatePropertiesPayload"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties for recommendation patch payload."""

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

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

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


class RecommendationProperties(_Model):
    """The properties of the recommendation.

    :ivar category: The category of the recommendation. Known values are: "HighAvailability",
     "Security", "Performance", "Cost", and "OperationalExcellence".
    :vartype category: str or ~azure.mgmt.advisor.models.Category
    :ivar control: The sub-category of the recommendation. Known values are: "HighAvailability",
     "BusinessContinuity", "DisasterRecovery", "Scalability", "MonitoringAndAlerting",
     "ServiceUpgradeAndRetirement", "Other", "PrioritizedRecommendations", and "Personalized".
    :vartype control: str or ~azure.mgmt.advisor.models.Control
    :ivar impact: The business impact of the recommendation. Known values are: "High", "Medium",
     and "Low".
    :vartype impact: str or ~azure.mgmt.advisor.models.Impact
    :ivar impacted_field: The resource type identified by Advisor.
    :vartype impacted_field: str
    :ivar impacted_value: The resource identified by Advisor.
    :vartype impacted_value: str
    :ivar recommendation_status: The state of the Recommendation. Known values are: "New",
     "Postponed", "Dismissed", and "Completed".
    :vartype recommendation_status: str or ~azure.mgmt.advisor.models.RecommendationStatus
    :ivar completion_type: The type of recommendation completion, which is either MarkedByUser or
     SystemVerified.
    :vartype completion_type: str
    :ivar recommendation_dismiss_reason: The reason the Recommendation was dismissed. Known values
     are: "ExcessiveCostInvestmentRequired", "TooComplexOrImpracticalToImplement",
     "AnAlternativeSolutionIsAlreadyInPlace", "IncompatibleWithTheCurrentConfiguration",
     "ImplementationStepsAreUnclear", "RiskIsAcceptable", and "Other".
    :vartype recommendation_dismiss_reason: str or
     ~azure.mgmt.advisor.models.RecommendationDismissReason
    :ivar postponed_until_date_time: The time the Recommendation was postponed until.
    :vartype postponed_until_date_time: ~datetime.datetime
    :ivar last_refreshed: The most recent time Advisor evaluated the recommendation for validity
     (re-ingested).
    :vartype last_refreshed: ~datetime.datetime
    :ivar last_updated: The most recent time the recommendation state changed (manual or
     automated).
    :vartype last_updated: ~datetime.datetime
    :ivar created_time: The created time of the recommendation.
    :vartype created_time: ~datetime.datetime
    :ivar metadata: The recommendation metadata.
    :vartype metadata: dict[str, any]
    :ivar recommendation_type_id: The recommendation-type GUID.
    :vartype recommendation_type_id: str
    :ivar risk: The potential risk of not implementing the recommendation. Known values are:
     "Error", "Warning", and "None".
    :vartype risk: str or ~azure.mgmt.advisor.models.Risk
    :ivar short_description: A summary of the recommendation.
    :vartype short_description: ~azure.mgmt.advisor.models.ShortDescription
    :ivar suppression_id: The single snoozed or dismissed rule for the recommendation.
    :vartype suppression_id: str
    :ivar extended_properties: Extended properties.
    :vartype extended_properties: dict[str, str]
    :ivar resource_metadata: Metadata of resource that was assessed.
    :vartype resource_metadata: ~azure.mgmt.advisor.models.ResourceMetadata
    :ivar description: The detailed description of recommendation.
    :vartype description: str
    :ivar label: The label of recommendation.
    :vartype label: str
    :ivar learn_more_link: The link to learn more about recommendation and generation logic.
    :vartype learn_more_link: str
    :ivar potential_benefits: The potential benefit of implementing recommendation.
    :vartype potential_benefits: str
    :ivar actions: The list of recommended actions to implement recommendation.
    :vartype actions: list[dict[str, any]]
    :ivar remediation: The automated way to apply recommendation.
    :vartype remediation: dict[str, any]
    :ivar exposed_metadata_properties: The recommendation metadata properties exposed to customer
     to provide additional information.
    :vartype exposed_metadata_properties: dict[str, any]
    :ivar tracked_properties: The properties of a tracked recommendation.
    :vartype tracked_properties: ~azure.mgmt.advisor.models.TrackedRecommendationProperties
    :ivar review: The Review that this Recommendation belongs to.
    :vartype review: ~azure.mgmt.advisor.models.RecommendationPropertiesReview
    :ivar resource_workload: The Workload that this Resource belongs to.
    :vartype resource_workload: ~azure.mgmt.advisor.models.RecommendationPropertiesResourceWorkload
    :ivar source_system: The Source System that this Recommendation originated from.
    :vartype source_system: str
    :ivar notes: Additional notes for the Recommendation.
    :vartype notes: str
    """

    category: Optional[Union[str, "_models.Category"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The category of the recommendation. Known values are: \"HighAvailability\", \"Security\",
     \"Performance\", \"Cost\", and \"OperationalExcellence\"."""
    control: Optional[Union[str, "_models.Control"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The sub-category of the recommendation. Known values are: \"HighAvailability\",
     \"BusinessContinuity\", \"DisasterRecovery\", \"Scalability\", \"MonitoringAndAlerting\",
     \"ServiceUpgradeAndRetirement\", \"Other\", \"PrioritizedRecommendations\", and
     \"Personalized\"."""
    impact: Optional[Union[str, "_models.Impact"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The business impact of the recommendation. Known values are: \"High\", \"Medium\", and \"Low\"."""
    impacted_field: Optional[str] = rest_field(
        name="impactedField", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource type identified by Advisor."""
    impacted_value: Optional[str] = rest_field(
        name="impactedValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource identified by Advisor."""
    recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field(
        name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """The state of the Recommendation. Known values are: \"New\", \"Postponed\", \"Dismissed\", and
     \"Completed\"."""
    completion_type: Optional[str] = rest_field(
        name="completionType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of recommendation completion, which is either MarkedByUser or SystemVerified."""
    recommendation_dismiss_reason: Optional[Union[str, "_models.RecommendationDismissReason"]] = rest_field(
        name="recommendationDismissReason", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reason the Recommendation was dismissed. Known values are:
     \"ExcessiveCostInvestmentRequired\", \"TooComplexOrImpracticalToImplement\",
     \"AnAlternativeSolutionIsAlreadyInPlace\", \"IncompatibleWithTheCurrentConfiguration\",
     \"ImplementationStepsAreUnclear\", \"RiskIsAcceptable\", and \"Other\"."""
    postponed_until_date_time: Optional[datetime.datetime] = rest_field(
        name="postponedUntilDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time the Recommendation was postponed until."""
    last_refreshed: Optional[datetime.datetime] = rest_field(
        name="lastRefreshed", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The most recent time Advisor evaluated the recommendation for validity (re-ingested)."""
    last_updated: Optional[datetime.datetime] = rest_field(
        name="lastUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The most recent time the recommendation state changed (manual or automated)."""
    created_time: Optional[datetime.datetime] = rest_field(
        name="createdTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The created time of the recommendation."""
    metadata: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The recommendation metadata."""
    recommendation_type_id: Optional[str] = rest_field(
        name="recommendationTypeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The recommendation-type GUID."""
    risk: Optional[Union[str, "_models.Risk"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The potential risk of not implementing the recommendation. Known values are: \"Error\",
     \"Warning\", and \"None\"."""
    short_description: Optional["_models.ShortDescription"] = rest_field(
        name="shortDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """A summary of the recommendation."""
    suppression_id: Optional[str] = rest_field(
        name="suppressionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The single snoozed or dismissed rule for the recommendation."""
    extended_properties: Optional[dict[str, str]] = rest_field(
        name="extendedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended properties."""
    resource_metadata: Optional["_models.ResourceMetadata"] = rest_field(
        name="resourceMetadata", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata of resource that was assessed."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The detailed description of recommendation."""
    label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The label of recommendation."""
    learn_more_link: Optional[str] = rest_field(
        name="learnMoreLink", visibility=["read", "create", "update", "delete", "query"]
    )
    """The link to learn more about recommendation and generation logic."""
    potential_benefits: Optional[str] = rest_field(
        name="potentialBenefits", visibility=["read", "create", "update", "delete", "query"]
    )
    """The potential benefit of implementing recommendation."""
    actions: Optional[list[dict[str, Any]]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The list of recommended actions to implement recommendation."""
    remediation: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The automated way to apply recommendation."""
    exposed_metadata_properties: Optional[dict[str, Any]] = rest_field(
        name="exposedMetadataProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The recommendation metadata properties exposed to customer to provide additional information."""
    tracked_properties: Optional["_models.TrackedRecommendationProperties"] = rest_field(
        name="trackedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a tracked recommendation."""
    review: Optional["_models.RecommendationPropertiesReview"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Review that this Recommendation belongs to."""
    resource_workload: Optional["_models.RecommendationPropertiesResourceWorkload"] = rest_field(
        name="resourceWorkload", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Workload that this Resource belongs to."""
    source_system: Optional[str] = rest_field(
        name="sourceSystem", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Source System that this Recommendation originated from."""
    notes: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Additional notes for the Recommendation."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        category: Optional[Union[str, "_models.Category"]] = None,
        control: Optional[Union[str, "_models.Control"]] = None,
        impact: Optional[Union[str, "_models.Impact"]] = None,
        impacted_field: Optional[str] = None,
        impacted_value: Optional[str] = None,
        recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None,
        completion_type: Optional[str] = None,
        recommendation_dismiss_reason: Optional[Union[str, "_models.RecommendationDismissReason"]] = None,
        postponed_until_date_time: Optional[datetime.datetime] = None,
        last_refreshed: Optional[datetime.datetime] = None,
        last_updated: Optional[datetime.datetime] = None,
        created_time: Optional[datetime.datetime] = None,
        metadata: Optional[dict[str, Any]] = None,
        recommendation_type_id: Optional[str] = None,
        risk: Optional[Union[str, "_models.Risk"]] = None,
        short_description: Optional["_models.ShortDescription"] = None,
        suppression_id: Optional[str] = None,
        extended_properties: Optional[dict[str, str]] = None,
        resource_metadata: Optional["_models.ResourceMetadata"] = None,
        description: Optional[str] = None,
        label: Optional[str] = None,
        learn_more_link: Optional[str] = None,
        potential_benefits: Optional[str] = None,
        actions: Optional[list[dict[str, Any]]] = None,
        remediation: Optional[dict[str, Any]] = None,
        exposed_metadata_properties: Optional[dict[str, Any]] = None,
        tracked_properties: Optional["_models.TrackedRecommendationProperties"] = None,
        review: Optional["_models.RecommendationPropertiesReview"] = None,
        resource_workload: Optional["_models.RecommendationPropertiesResourceWorkload"] = None,
        source_system: Optional[str] = None,
        notes: 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 RecommendationPropertiesResourceWorkload(_Model):
    """The Workload that this Resource belongs to.

    :ivar id: The Id of the Workload.
    :vartype id: str
    :ivar name: The Name of the Workload.
    :vartype name: str
    """

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

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

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

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


class RecommendationPropertiesReview(_Model):
    """The Review that this Recommendation belongs to.

    :ivar id: The ARM Resource Id of the Review.
    :vartype id: str
    :ivar name: The Name of the Review.
    :vartype name: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ARM Resource Id of the Review."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Name of the Review."""

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

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

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


class RecommendationStatePropertiesPayload(_Model):
    """Properties for recommendation state patch payload.

    :ivar recommendation_status: The state of the recommendation. Known values are: "New",
     "Postponed", "Dismissed", and "Completed".
    :vartype recommendation_status: str or ~azure.mgmt.advisor.models.RecommendationStatus
    :ivar recommendation_dismiss_reason: The reason the state of the Recommendation was changed.
     Known values are: "ExcessiveCostInvestmentRequired", "TooComplexOrImpracticalToImplement",
     "AnAlternativeSolutionIsAlreadyInPlace", "IncompatibleWithTheCurrentConfiguration",
     "ImplementationStepsAreUnclear", "RiskIsAcceptable", and "Other".
    :vartype recommendation_dismiss_reason: str or
     ~azure.mgmt.advisor.models.RecommendationDismissReason
    :ivar postponed_until_date_time: The time the Recommendation was postponed until.
    :vartype postponed_until_date_time: ~datetime.datetime
    """

    recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field(
        name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """The state of the recommendation. Known values are: \"New\", \"Postponed\", \"Dismissed\", and
     \"Completed\"."""
    recommendation_dismiss_reason: Optional[Union[str, "_models.RecommendationDismissReason"]] = rest_field(
        name="recommendationDismissReason", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reason the state of the Recommendation was changed. Known values are:
     \"ExcessiveCostInvestmentRequired\", \"TooComplexOrImpracticalToImplement\",
     \"AnAlternativeSolutionIsAlreadyInPlace\", \"IncompatibleWithTheCurrentConfiguration\",
     \"ImplementationStepsAreUnclear\", \"RiskIsAcceptable\", and \"Other\"."""
    postponed_until_date_time: Optional[datetime.datetime] = rest_field(
        name="postponedUntilDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The time the Recommendation was postponed until."""

    @overload
    def __init__(
        self,
        *,
        recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None,
        recommendation_dismiss_reason: Optional[Union[str, "_models.RecommendationDismissReason"]] = None,
        postponed_until_date_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 ResiliencyReview(ProxyResource):
    """The Advisor resiliency review data structure.

    :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.advisor.models.SystemData
    :ivar properties: Advisor resiliency review properties.
    :vartype properties: ~azure.mgmt.advisor.models.ResiliencyReviewProperties
    """

    properties: Optional["_models.ResiliencyReviewProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Advisor resiliency review properties."""

    __flattened_items = [
        "review_name",
        "workload_name",
        "review_status",
        "recommendations_count",
        "published_at",
        "updated_at",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 ResiliencyReviewProperties(_Model):
    """Resiliency review properties.

    :ivar review_name: Review name.
    :vartype review_name: str
    :ivar workload_name: Workload Name.
    :vartype workload_name: str
    :ivar review_status: Review status. Known values are: "New", "InProgress", and "Completed".
    :vartype review_status: str or ~azure.mgmt.advisor.models.ReviewStatus
    :ivar recommendations_count: Review recommendations count.
    :vartype recommendations_count: int
    :ivar published_at: Review last updated timestamp.
    :vartype published_at: str
    :ivar updated_at: Review last updated timestamp.
    :vartype updated_at: str
    """

    review_name: Optional[str] = rest_field(name="reviewName", visibility=["read"])
    """Review name."""
    workload_name: Optional[str] = rest_field(name="workloadName", visibility=["read"])
    """Workload Name."""
    review_status: Optional[Union[str, "_models.ReviewStatus"]] = rest_field(name="reviewStatus", visibility=["read"])
    """Review status. Known values are: \"New\", \"InProgress\", and \"Completed\"."""
    recommendations_count: Optional[int] = rest_field(name="recommendationsCount", visibility=["read"])
    """Review recommendations count."""
    published_at: Optional[str] = rest_field(name="publishedAt", visibility=["read"])
    """Review last updated timestamp."""
    updated_at: Optional[str] = rest_field(name="updatedAt", visibility=["read"])
    """Review last updated timestamp."""


class ResourceMetadata(_Model):
    """Recommendation resource metadata.

    :ivar resource_id: Azure resource Id of the assessed resource.
    :vartype resource_id: str
    :ivar source: Source from which recommendation is generated.
    :vartype source: str
    :ivar action: The action to view resource.
    :vartype action: dict[str, any]
    :ivar singular: The singular user friendly name of resource type. eg: virtual machine.
    :vartype singular: str
    :ivar plural: The plural user friendly name of resource type. eg: virtual machines.
    :vartype plural: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure resource Id of the assessed resource."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Source from which recommendation is generated."""
    action: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The action to view resource."""
    singular: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The singular user friendly name of resource type. eg: virtual machine."""
    plural: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The plural user friendly name of resource type. eg: virtual machines."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        source: Optional[str] = None,
        action: Optional[dict[str, Any]] = None,
        singular: Optional[str] = None,
        plural: 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 ResourceRecommendationBase(ExtensionResource):
    """Advisor Recommendation.

    :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.advisor.models.SystemData
    :ivar properties: The properties of the recommendation.
    :vartype properties: ~azure.mgmt.advisor.models.RecommendationProperties
    """

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

    __flattened_items = [
        "category",
        "control",
        "impact",
        "impacted_field",
        "impacted_value",
        "recommendation_status",
        "completion_type",
        "recommendation_dismiss_reason",
        "postponed_until_date_time",
        "last_refreshed",
        "last_updated",
        "created_time",
        "metadata",
        "recommendation_type_id",
        "risk",
        "short_description",
        "suppression_id",
        "extended_properties",
        "resource_metadata",
        "description",
        "label",
        "learn_more_link",
        "potential_benefits",
        "actions",
        "remediation",
        "exposed_metadata_properties",
        "tracked_properties",
        "review",
        "resource_workload",
        "source_system",
        "notes",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 ScoreEntity(_Model):
    """The details of Advisor Score.

    :ivar date: The date score was calculated.
    :vartype date: str
    :ivar score: The percentage score.
    :vartype score: float
    :ivar consumption_units: The consumption units for the score.
    :vartype consumption_units: float
    :ivar impacted_resource_count: The number of impacted resources.
    :vartype impacted_resource_count: float
    :ivar potential_score_increase: The potential percentage increase in overall score at
     subscription level once all recommendations in this scope are implemented.
    :vartype potential_score_increase: float
    :ivar category_count: The count of impacted categories.
    :vartype category_count: float
    """

    date: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The date score was calculated."""
    score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The percentage score."""
    consumption_units: Optional[float] = rest_field(
        name="consumptionUnits", visibility=["read", "create", "update", "delete", "query"]
    )
    """The consumption units for the score."""
    impacted_resource_count: Optional[float] = rest_field(
        name="impactedResourceCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of impacted resources."""
    potential_score_increase: Optional[float] = rest_field(
        name="potentialScoreIncrease", visibility=["read", "create", "update", "delete", "query"]
    )
    """The potential percentage increase in overall score at subscription level once all
     recommendations in this scope are implemented."""
    category_count: Optional[float] = rest_field(name="categoryCount", visibility=["read"])
    """The count of impacted categories."""

    @overload
    def __init__(
        self,
        *,
        date: Optional[str] = None,
        score: Optional[float] = None,
        consumption_units: Optional[float] = None,
        impacted_resource_count: Optional[float] = None,
        potential_score_increase: Optional[float] = None,
    ) -> None: ...

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

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


class ShortDescription(_Model):
    """A summary of the recommendation.

    :ivar problem: The issue or opportunity identified by the recommendation and proposed solution.
    :vartype problem: str
    :ivar solution: The issue or opportunity identified by the recommendation and proposed
     solution.
    :vartype solution: str
    """

    problem: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The issue or opportunity identified by the recommendation and proposed solution."""
    solution: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The issue or opportunity identified by the recommendation and proposed solution."""

    @overload
    def __init__(
        self,
        *,
        problem: Optional[str] = None,
        solution: 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 SuppressionContract(ExtensionResource):
    """The details of the snoozed or dismissed rule; for example, the duration, name, and GUID
    associated with the rule.

    :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.advisor.models.SystemData
    :ivar properties: The properties of the suppression.
    :vartype properties: ~azure.mgmt.advisor.models.SuppressionProperties
    """

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

    __flattened_items = ["suppression_id", "ttl", "expiration_time_stamp"]

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

    @overload
    def __init__(self, mapping: Mapping[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 SuppressionProperties(_Model):
    """The properties of the suppression.

    :ivar suppression_id: The GUID of the suppression.
    :vartype suppression_id: str
    :ivar ttl: The duration for which the suppression is valid.
    :vartype ttl: str
    :ivar expiration_time_stamp: Gets or sets the expiration time stamp.
    :vartype expiration_time_stamp: ~datetime.datetime
    """

    suppression_id: Optional[str] = rest_field(
        name="suppressionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The GUID of the suppression."""
    ttl: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The duration for which the suppression is valid."""
    expiration_time_stamp: Optional[datetime.datetime] = rest_field(
        name="expirationTimeStamp", visibility=["read"], format="rfc3339"
    )
    """Gets or sets the expiration time stamp."""

    @overload
    def __init__(
        self,
        *,
        suppression_id: Optional[str] = None,
        ttl: 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.advisor.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.advisor.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 TimeSeriesEntity(_Model):
    """The historic data at different aggregation levels.

    :ivar aggregation_level: The aggregation level of the score. Known values are: "week", "day",
     and "month".
    :vartype aggregation_level: str or ~azure.mgmt.advisor.models.Aggregated
    :ivar score_history: The past score data.
    :vartype score_history: list[~azure.mgmt.advisor.models.ScoreEntity]
    """

    aggregation_level: Optional[Union[str, "_models.Aggregated"]] = rest_field(
        name="aggregationLevel", visibility=["read", "create", "update", "delete", "query"]
    )
    """The aggregation level of the score. Known values are: \"week\", \"day\", and \"month\"."""
    score_history: Optional[list["_models.ScoreEntity"]] = rest_field(
        name="scoreHistory", visibility=["read", "create", "update", "delete", "query"]
    )
    """The past score data."""

    @overload
    def __init__(
        self,
        *,
        aggregation_level: Optional[Union[str, "_models.Aggregated"]] = None,
        score_history: Optional[list["_models.ScoreEntity"]] = None,
    ) -> None: ...

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

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


class TrackedRecommendationProperties(_Model):
    """The tracked properties of a Recommendation.

    :ivar priority: The Priority of the Recommendation. Known values are: "Critical", "High",
     "Medium", "Low", and "Informational".
    :vartype priority: str or ~azure.mgmt.advisor.models.Priority
    """

    priority: Optional[Union[str, "_models.Priority"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Priority of the Recommendation. Known values are: \"Critical\", \"High\", \"Medium\",
     \"Low\", and \"Informational\"."""

    @overload
    def __init__(
        self,
        *,
        priority: Optional[Union[str, "_models.Priority"]] = None,
    ) -> None: ...

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

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


class WorkloadResult(_Model):
    """The Workload result data structure.

    :ivar id: Workload Id.
    :vartype id: str
    :ivar name: Workload Name.
    :vartype name: str
    :ivar subscription_id: Subscription Id.
    :vartype subscription_id: str
    :ivar subscription_name: Subscription Name.
    :vartype subscription_name: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workload Id."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Workload Name."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription Id."""
    subscription_name: Optional[str] = rest_field(
        name="subscriptionName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription Name."""

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

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

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