# coding: utf-8


"""
IGNORE:
    Nutanix Licensing APIs

    Manage licenses for your clusters and Prism Central, get information on applied licenses, license compliance details and feature entitlements.  # noqa: E501

    OpenAPI spec version: 4.3.2
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
IGNORE
"""
import pprint
import json
import ast
import re  # noqa: F401

import six
from pathlib import Path
from ntnx_licensing_py_client.models.licensing.v4.config.BaseClusterInfo import BaseClusterInfo  # noqa: F401,E501
from ntnx_licensing_py_client.models.licensing.v4.config.EnforcementPolicy import EnforcementPolicy  # noqa: F401,E501
from ntnx_licensing_py_client.models.licensing.v4.config.LicenseClass import LicenseClass  # noqa: F401,E501
from ntnx_licensing_py_client.models.licensing.v4.config.LogicalVersion import LogicalVersion  # noqa: F401,E501
from ntnx_licensing_py_client.models.licensing.v4.config.PostPaidConfig import PostPaidConfig  # noqa: F401,E501

class Setting(BaseClusterInfo):

    """Response object containing setting details.

    :param logical_version: (:attr:`logical_version`) 
    :type logical_version: 
    
    
    :param is_standby: (:attr:`is_standby`) True value indicates that cluster summary file is downloaded but license summary file is not uplaoded.
    :type is_standby: 
    
    
    :param has_non_compliant_features: (:attr:`has_non_compliant_features`) True value indicates that user is allowed to use non compliant features. (**Default** False)
    :type has_non_compliant_features: 
    
    
    :param is_license_check_disabled: (:attr:`is_license_check_disabled`) Used to enable and disable NCC license checks. (**Default** False)
    :type is_license_check_disabled: 
    
    
    :param license_class: (:attr:`license_class`) 
    :type license_class: 
    
    
    :param enforcement_policy: (:attr:`enforcement_policy`) 
    :type enforcement_policy: 
    
    
    :param license_key: (:attr:`license_key`) License key applied to dark site clusters.
    :type license_key: 
     max=100 chars
    
    :param has_ultimate_trial_ended: (:attr:`has_ultimate_trial_ended`) Indicates whether ultimate trial is active or not.
    :type has_ultimate_trial_ended: 
    
    
    :param post_paid_config: (:attr:`post_paid_config`) 
    :type post_paid_config: 
    
    

    """
    """
    IGNORE:
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    IGNORE
    """  # noqa: E501
    swagger_types = {
        'logical_version': 'licensing.v4.config.LogicalVersion',
        'is_standby': 'bool',
        'has_non_compliant_features': 'bool',
        'is_license_check_disabled': 'bool',
        'license_class': 'licensing.v4.config.LicenseClass',
        'enforcement_policy': 'licensing.v4.config.EnforcementPolicy',
        'license_key': 'str',
        'has_ultimate_trial_ended': 'bool',
        'post_paid_config': 'licensing.v4.config.PostPaidConfig',
        'is_multicluster': 'bool',
        'ext_id': 'str',
        'links': 'list[common.v1.response.ApiLink]',
        'tenant_id': 'str',
        '_reserved': 'dict(str, object)',
        '_object_type': 'str',
        '_unknown_fields': 'dict(str, object)',
    }

    attribute_map = {
        'logical_version': 'logicalVersion',
        'is_standby': 'isStandby',
        'has_non_compliant_features': 'hasNonCompliantFeatures',
        'is_license_check_disabled': 'isLicenseCheckDisabled',
        'license_class': 'licenseClass',
        'enforcement_policy': 'enforcementPolicy',
        'license_key': 'licenseKey',
        'has_ultimate_trial_ended': 'hasUltimateTrialEnded',
        'post_paid_config': 'postPaidConfig',
        'is_multicluster': 'isMulticluster',
        'ext_id': 'extId',
        'links': 'links',
        'tenant_id': 'tenantId',
        '_reserved': '$reserved',
        '_object_type': '$objectType',
        '_unknown_fields': '$unknownFields',
    }



    def __init__(self, logical_version=None, is_standby=None, has_non_compliant_features=False, is_license_check_disabled=False, license_class=None, enforcement_policy=None, license_key=None, has_ultimate_trial_ended=None, post_paid_config=None, is_multicluster=None, ext_id=None, links=None, tenant_id=None, *args, **kwargs):  # noqa: E501
        BaseClusterInfo.__init__(self, is_multicluster, ext_id, links, tenant_id, *args, **kwargs)
        self.__logical_version = None
        self.__is_standby = None
        self.__has_non_compliant_features = None
        self.__is_license_check_disabled = None
        self.__license_class = None
        self.__enforcement_policy = None
        self.__license_key = None
        self.__has_ultimate_trial_ended = None
        self.__post_paid_config = None
        self.discriminator = None
        if logical_version is not None:
            self.__logical_version = logical_version
        if is_standby is not None:
            self.__is_standby = is_standby
        if has_non_compliant_features is not None:
            self.__has_non_compliant_features = has_non_compliant_features
        if is_license_check_disabled is not None:
            self.__is_license_check_disabled = is_license_check_disabled
        if license_class is not None:
            self.__license_class = license_class
        if enforcement_policy is not None:
            self.__enforcement_policy = enforcement_policy
        if license_key is not None:
            self.__license_key = license_key
        if has_ultimate_trial_ended is not None:
            self.__has_ultimate_trial_ended = has_ultimate_trial_ended
        if post_paid_config is not None:
            self.__post_paid_config = post_paid_config

    def _initialize_object_type(self):
        return 'licensing.v4.config.Setting'

    def _initialize_object_version(self):
        return 'v4.r3'


    @property
    def logical_version(self):
        """
        

        :type:
            :class:`~ntnx_licensing_py_client.models.licensing.v4.config.LogicalVersion`
        """  # noqa: E501
        return self.__logical_version

    @logical_version.setter
    def logical_version(self, logical_version):

        self.__logical_version = logical_version

    @property
    def is_standby(self):
        """
        True value indicates that cluster summary file is downloaded but license summary file is not uplaoded.

        :type:
                :class:`~bool`
        """  # noqa: E501
        return self.__is_standby

    @is_standby.setter
    def is_standby(self, is_standby):

        self.__is_standby = is_standby

    @property
    def has_non_compliant_features(self):
        """
        True value indicates that user is allowed to use non compliant features.

        :type:
                :class:`~bool`
        """  # noqa: E501
        return self.__has_non_compliant_features

    @has_non_compliant_features.setter
    def has_non_compliant_features(self, has_non_compliant_features):

        self.__has_non_compliant_features = has_non_compliant_features

    @property
    def is_license_check_disabled(self):
        """
        Used to enable and disable NCC license checks.

        :type:
                :class:`~bool`
        """  # noqa: E501
        return self.__is_license_check_disabled

    @is_license_check_disabled.setter
    def is_license_check_disabled(self, is_license_check_disabled):

        self.__is_license_check_disabled = is_license_check_disabled

    @property
    def license_class(self):
        """
        

        :type:
            :class:`~ntnx_licensing_py_client.models.licensing.v4.config.LicenseClass`
        """  # noqa: E501
        return self.__license_class

    @license_class.setter
    def license_class(self, license_class):

        self.__license_class = license_class

    @property
    def enforcement_policy(self):
        """
        

        :type:
            :class:`~ntnx_licensing_py_client.models.licensing.v4.config.EnforcementPolicy`
        """  # noqa: E501
        return self.__enforcement_policy

    @enforcement_policy.setter
    def enforcement_policy(self, enforcement_policy):

        self.__enforcement_policy = enforcement_policy

    @property
    def license_key(self):
        """
        License key applied to dark site clusters.

        :type:
                :class:`~str`
        """  # noqa: E501
        return self.__license_key

    @license_key.setter
    def license_key(self, license_key):
        if license_key is not None and len(license_key) > 100:
            raise ValueError("Invalid value for `license_key`, length must be less than or equal to `100`")  # noqa: E501

        self.__license_key = license_key

    @property
    def has_ultimate_trial_ended(self):
        """
        Indicates whether ultimate trial is active or not.

        :type:
                :class:`~bool`
        """  # noqa: E501
        return self.__has_ultimate_trial_ended

    @has_ultimate_trial_ended.setter
    def has_ultimate_trial_ended(self, has_ultimate_trial_ended):

        self.__has_ultimate_trial_ended = has_ultimate_trial_ended

    @property
    def post_paid_config(self):
        """
        

        :type:
            :class:`~ntnx_licensing_py_client.models.licensing.v4.config.PostPaidConfig`
        """  # noqa: E501
        return self.__post_paid_config

    @post_paid_config.setter
    def post_paid_config(self, post_paid_config):

        self.__post_paid_config = post_paid_config

    def _to_dict(self, sanitize):
        """Returns the model properties as a dict. Omits None properties based on the provided "sanitize" parameter.

        :param sanitize: A flag to omit None properties if set to True
        :type sanitize: bool
        """

        result = {}
        for attr, attr_type in six.iteritems(self.swagger_types):

            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x._to_dict(sanitize) if hasattr(x, "_to_dict") else x,
                    value
                ))
            elif hasattr(value, "_to_dict"):
                result[attr] = value._to_dict(sanitize)
            elif isinstance(value, Path):
                result[attr] = str(value)
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1]._to_dict(sanitize)) if hasattr(item[1], "_to_dict")
                    else (
                        (item[0], str(item[1])) if item[0] == 'path' and '$objectType' in value and value['$objectType'] == 'pathlib.Path'
                        else item
                    ),
                    six.iteritems(value)
                ))
            else:
                if sanitize:
                    if value is not None:
                        result[attr] = value
                else:
                    result[attr] = value
        if issubclass(Setting, dict):
            for key, value in six.iteritems(self):
                result[key] = value

        # handle unknown fields
        result['_unknown_fields'] = {}
        unknown = self.get_unknown_fields()
        if sanitize:
            unknown = self._sanitize_for_serialization(unknown)

        return {**result, **unknown}


    def to_dict(self):
        """Returns the model properties as a dictionary"""
        return self._to_dict(False)

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self._to_dict(True))

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Setting):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other

