# coding: utf-8

"""
    Veeroute.LSS Stock

    Veeroute.LSS Stock API  # noqa: E501

    The version of the OpenAPI document: 3.8.168700
    Contact: support@veeroute.com
    Generated by: https://openapi-generator.tech
"""


import inspect
import pprint
import re  # noqa: F401
import six

from vrt_lss_stock.configuration import Configuration


class Storage(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'key': 'str',
        'balance': 'Balance',
        'forecast': 'list[BalanceDelta]',
        'tariff': 'StorageTariff',
        'restricted_time_indexes': 'list[int]'
    }

    attribute_map = {
        'key': 'key',
        'balance': 'balance',
        'forecast': 'forecast',
        'tariff': 'tariff',
        'restricted_time_indexes': 'restricted_time_indexes'
    }

    def __init__(self, key=None, balance=None, forecast=None, tariff=None, restricted_time_indexes=None, local_vars_configuration=None):  # noqa: E501
        """Storage - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._key = None
        self._balance = None
        self._forecast = None
        self._tariff = None
        self._restricted_time_indexes = None
        self.discriminator = None

        self.key = key
        self.balance = balance
        self.forecast = forecast
        self.tariff = tariff
        if restricted_time_indexes is not None:
            self.restricted_time_indexes = restricted_time_indexes

    @property
    def key(self):
        """Gets the key of this Storage.  # noqa: E501

        Storage key.  # noqa: E501

        :return: The key of this Storage.  # noqa: E501
        :rtype: str
        """
        return self._key

    @key.setter
    def key(self, key):
        """Sets the key of this Storage.

        Storage key.  # noqa: E501

        :param key: The key of this Storage.  # noqa: E501
        :type key: str
        """
        if self.local_vars_configuration.client_side_validation and key is None:  # noqa: E501
            raise ValueError("Invalid value for `key`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                key is not None and len(key) > 1024):
            raise ValueError("Invalid value for `key`, length must be less than or equal to `1024`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                key is not None and len(key) < 1):
            raise ValueError("Invalid value for `key`, length must be greater than or equal to `1`")  # noqa: E501

        self._key = key

    @property
    def balance(self):
        """Gets the balance of this Storage.  # noqa: E501


        :return: The balance of this Storage.  # noqa: E501
        :rtype: Balance
        """
        return self._balance

    @balance.setter
    def balance(self, balance):
        """Sets the balance of this Storage.


        :param balance: The balance of this Storage.  # noqa: E501
        :type balance: Balance
        """

        self._balance = balance

    @property
    def forecast(self):
        """Gets the forecast of this Storage.  # noqa: E501

        List of balance delta.  # noqa: E501

        :return: The forecast of this Storage.  # noqa: E501
        :rtype: list[BalanceDelta]
        """
        return self._forecast

    @forecast.setter
    def forecast(self, forecast):
        """Sets the forecast of this Storage.

        List of balance delta.  # noqa: E501

        :param forecast: The forecast of this Storage.  # noqa: E501
        :type forecast: list[BalanceDelta]
        """
        if self.local_vars_configuration.client_side_validation and forecast is None:  # noqa: E501
            raise ValueError("Invalid value for `forecast`, must not be `None`")  # noqa: E501

        self._forecast = forecast

    @property
    def tariff(self):
        """Gets the tariff of this Storage.  # noqa: E501


        :return: The tariff of this Storage.  # noqa: E501
        :rtype: StorageTariff
        """
        return self._tariff

    @tariff.setter
    def tariff(self, tariff):
        """Sets the tariff of this Storage.


        :param tariff: The tariff of this Storage.  # noqa: E501
        :type tariff: StorageTariff
        """

        self._tariff = tariff

    @property
    def restricted_time_indexes(self):
        """Gets the restricted_time_indexes of this Storage.  # noqa: E501

        List of rectricted time indexes for transfer.  # noqa: E501

        :return: The restricted_time_indexes of this Storage.  # noqa: E501
        :rtype: list[int]
        """
        return self._restricted_time_indexes

    @restricted_time_indexes.setter
    def restricted_time_indexes(self, restricted_time_indexes):
        """Sets the restricted_time_indexes of this Storage.

        List of rectricted time indexes for transfer.  # noqa: E501

        :param restricted_time_indexes: The restricted_time_indexes of this Storage.  # noqa: E501
        :type restricted_time_indexes: list[int]
        """

        self._restricted_time_indexes = restricted_time_indexes

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = inspect.getargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, Storage):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
