# coding: utf-8

"""
    Amber API Server

    Boon Logic Amber API server

    OpenAPI spec version: 2.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class FeatureConfig(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    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.
    """
    swagger_types = {
        'name': 'str',
        'min_val': 'float',
        'max_val': 'float',
        'weight': 'int',
        'fusion_rule': 'str',
        'fusion_ttl': 'int'
    }

    attribute_map = {
        'name': 'name',
        'min_val': 'minVal',
        'max_val': 'maxVal',
        'weight': 'weight',
        'fusion_rule': 'fusionRule',
        'fusion_ttl': 'fusionTTL'
    }

    def __init__(self, name=None, min_val=None, max_val=None, weight=None, fusion_rule='submit', fusion_ttl=None):
        """FeatureConfig - a model defined in Swagger"""
        self._name = None
        self._min_val = None
        self._max_val = None
        self._weight = None
        self._fusion_rule = None
        self._fusion_ttl = None
        self.discriminator = None
        if name is not None:
            self.name = name
        if min_val is not None:
            self.min_val = min_val
        if max_val is not None:
            self.max_val = max_val
        if weight is not None:
            self.weight = weight
        if fusion_rule is not None:
            self.fusion_rule = fusion_rule
        if fusion_ttl is not None:
            self.fusion_ttl = fusion_ttl

    @property
    def name(self):
        """Gets the name of this FeatureConfig.

        Name for this feature. Must be unique with respect to other features in the configuration. Regex: `^[A-Za-z0-9.:_-]{1,1024}$`.

        :return: The name of this FeatureConfig.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this FeatureConfig.

        Name for this feature. Must be unique with respect to other features in the configuration. Regex: `^[A-Za-z0-9.:_-]{1,1024}$`.

        :param name: The name of this FeatureConfig.
        :type: str
        """

        self._name = name

    @property
    def min_val(self):
        """Gets the min_val of this FeatureConfig.

        Minimum expected value for this feature. `minVal` can be left unset if it is not known at configuration time. In that case, data collected during the `Buffering` stage will be used to infer an optimal `minVal` during the `Autotuning` stage and it will be set to the autotuned value at the start of `Learning`.

        :return: The min_val of this FeatureConfig.
        :rtype: float
        """
        return self._min_val

    @min_val.setter
    def min_val(self, min_val):
        """Sets the min_val of this FeatureConfig.

        Minimum expected value for this feature. `minVal` can be left unset if it is not known at configuration time. In that case, data collected during the `Buffering` stage will be used to infer an optimal `minVal` during the `Autotuning` stage and it will be set to the autotuned value at the start of `Learning`.

        :param min_val: The min_val of this FeatureConfig.
        :type: float
        """

        self._min_val = min_val

    @property
    def max_val(self):
        """Gets the max_val of this FeatureConfig.

        Maximum expected value for this feature. `maxVal` can be left unset if it is not known at configuration time. In that case, data collected during the `Buffering` stage will be used to infer an optimal value during the `Autotuning` stage and it will be set to the autotuned value at the start of `Learning`.

        :return: The max_val of this FeatureConfig.
        :rtype: float
        """
        return self._max_val

    @max_val.setter
    def max_val(self, max_val):
        """Sets the max_val of this FeatureConfig.

        Maximum expected value for this feature. `maxVal` can be left unset if it is not known at configuration time. In that case, data collected during the `Buffering` stage will be used to infer an optimal value during the `Autotuning` stage and it will be set to the autotuned value at the start of `Learning`.

        :param max_val: The max_val of this FeatureConfig.
        :type: float
        """

        self._max_val = max_val

    @property
    def weight(self):
        """Gets the weight of this FeatureConfig.

        Weight of this feature relative to others, as an integer between 1 and 1000.

        :return: The weight of this FeatureConfig.
        :rtype: int
        """
        return self._weight

    @weight.setter
    def weight(self, weight):
        """Sets the weight of this FeatureConfig.

        Weight of this feature relative to others, as an integer between 1 and 1000.

        :param weight: The weight of this FeatureConfig.
        :type: int
        """

        self._weight = weight

    @property
    def fusion_rule(self):
        """Gets the fusion_rule of this FeatureConfig.

        Inference policy for the fusion vector when using `PUT /data`. If `submit`, any `PUT /data` request that updates this feature will cause the fusion vector to be submitted for inference. If `nosubmit`, updates to this feature will not trigger a fusion vector inference.

        :return: The fusion_rule of this FeatureConfig.
        :rtype: str
        """
        return self._fusion_rule

    @fusion_rule.setter
    def fusion_rule(self, fusion_rule):
        """Sets the fusion_rule of this FeatureConfig.

        Inference policy for the fusion vector when using `PUT /data`. If `submit`, any `PUT /data` request that updates this feature will cause the fusion vector to be submitted for inference. If `nosubmit`, updates to this feature will not trigger a fusion vector inference.

        :param fusion_rule: The fusion_rule of this FeatureConfig.
        :type: str
        """
        allowed_values = ["submit", "nosubmit"]
        if fusion_rule not in allowed_values:
            raise ValueError(
                "Invalid value for `fusion_rule` ({0}), must be one of {1}"
                .format(fusion_rule, allowed_values)
            )

        self._fusion_rule = fusion_rule

    @property
    def fusion_ttl(self):
        """Gets the fusion_ttl of this FeatureConfig.

        Number of seconds without an update before this feature's value is considered invalid.

        :return: The fusion_ttl of this FeatureConfig.
        :rtype: int
        """
        return self._fusion_ttl

    @fusion_ttl.setter
    def fusion_ttl(self, fusion_ttl):
        """Sets the fusion_ttl of this FeatureConfig.

        Number of seconds without an update before this feature's value is considered invalid.

        :param fusion_ttl: The fusion_ttl of this FeatureConfig.
        :type: int
        """

        self._fusion_ttl = fusion_ttl

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(FeatureConfig, dict):
            for key, value in self.items():
                result[key] = value

        return result

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

    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, FeatureConfig):
            return False

        return self.__dict__ == other.__dict__

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