# 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) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from enum import Enum, EnumMeta
from six import with_metaclass

class _CaseInsensitiveEnumMeta(EnumMeta):
    def __getitem__(self, name):
        return super().__getitem__(name.upper())

    def __getattr__(cls, name):
        """Return the enum member matching `name`
        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        """
        try:
            return cls._member_map_[name.upper()]
        except KeyError:
            raise AttributeError(name)


class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """The type of identity that created the resource.
    """

    USER = "User"
    APPLICATION = "Application"
    MANAGED_IDENTITY = "ManagedIdentity"
    KEY = "Key"

class ImpactType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """The impact type
    """

    NONE = "None"  #: Pending updates has no impact on resource.
    FREEZE = "Freeze"  #: Pending updates can freeze network or disk io operation on resource.
    RESTART = "Restart"  #: Pending updates can cause resource to restart.
    REDEPLOY = "Redeploy"  #: Pending updates can redeploy resource.

class MaintenanceScope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """Gets or sets maintenanceScope of the configuration
    """

    HOST = "Host"  #: This maintenance scope controls installation of azure platform updates i.e. services on physical nodes hosting customer VMs.
    OS_IMAGE = "OSImage"  #: This maintenance scope controls os image installation on VM/VMSS.
    EXTENSION = "Extension"  #: This maintenance scope controls extension installation on VM/VMSS.
    IN_GUEST_PATCH = "InGuestPatch"  #: This maintenance scope controls installation of windows and linux packages on VM/VMSS.
    SQLDB = "SQLDB"  #: This maintenance scope controls installation of SQL server platform updates.
    SQL_MANAGED_INSTANCE = "SQLManagedInstance"  #: This maintenance scope controls installation of SQL managed instance platform update.

class RebootOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """Possible reboot preference as defined by the user based on which it would be decided to reboot
    the machine or not after the patch operation is completed.
    """

    IF_REQUIRED = "IfRequired"
    NEVER = "Never"
    ALWAYS = "Always"

class TaskScope(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """Global Task execute once when schedule trigger. Resource task execute for each VM.
    """

    GLOBAL_ENUM = "Global"
    RESOURCE = "Resource"

class UpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """The status
    """

    PENDING = "Pending"  #: There are pending updates to be installed.
    IN_PROGRESS = "InProgress"  #: Updates installation are in progress.
    COMPLETED = "Completed"  #: All updates are successfully applied.
    RETRY_NOW = "RetryNow"  #: Updates installation failed but are ready to retry again.
    RETRY_LATER = "RetryLater"  #: Updates installation failed and should be retried later.

class Visibility(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
    """Gets or sets the visibility of the configuration. The default value is 'Custom'
    """

    CUSTOM = "Custom"  #: Only visible to users with permissions.
    PUBLIC = "Public"  #: Visible to all users.
