# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from swagger_server.models.base_model_ import Model
from swagger_server import util


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

    Do not edit the class manually.
    """
    def __init__(self, id: int=None, name: str=None, serving: float=None, unit: str=None, stored_at: str=None, outdated_at: str=None, updated_at: str=None):  # noqa: E501
        """Item - a model defined in Swagger

        :param id: The id of this Item.  # noqa: E501
        :type id: int
        :param name: The name of this Item.  # noqa: E501
        :type name: str
        :param serving: The serving of this Item.  # noqa: E501
        :type serving: float
        :param unit: The unit of this Item.  # noqa: E501
        :type unit: str
        :param stored_at: The stored_at of this Item.  # noqa: E501
        :type stored_at: str
        :param outdated_at: The outdated_at of this Item.  # noqa: E501
        :type outdated_at: str
        :param updated_at: The updated_at of this Item.  # noqa: E501
        :type updated_at: str
        """
        self.swagger_types = {
            'id': int,
            'name': str,
            'serving': float,
            'unit': str,
            'stored_at': str,
            'outdated_at': str,
            'updated_at': str
        }

        self.attribute_map = {
            'id': 'id',
            'name': 'name',
            'serving': 'serving',
            'unit': 'unit',
            'stored_at': 'stored_at',
            'outdated_at': 'outdated_at',
            'updated_at': 'updated_at'
        }
        self._id = id
        self._name = name
        self._serving = serving
        self._unit = unit
        self._stored_at = stored_at
        self._outdated_at = outdated_at
        self._updated_at = updated_at

    @classmethod
    def from_dict(cls, dikt) -> 'Item':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The Item of this Item.  # noqa: E501
        :rtype: Item
        """
        return util.deserialize_model(dikt, cls)

    @property
    def id(self) -> int:
        """Gets the id of this Item.


        :return: The id of this Item.
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id: int):
        """Sets the id of this Item.


        :param id: The id of this Item.
        :type id: int
        """

        self._id = id

    @property
    def name(self) -> str:
        """Gets the name of this Item.


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

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


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

        self._name = name

    @property
    def serving(self) -> float:
        """Gets the serving of this Item.


        :return: The serving of this Item.
        :rtype: float
        """
        return self._serving

    @serving.setter
    def serving(self, serving: float):
        """Sets the serving of this Item.


        :param serving: The serving of this Item.
        :type serving: float
        """

        self._serving = serving

    @property
    def unit(self) -> str:
        """Gets the unit of this Item.


        :return: The unit of this Item.
        :rtype: str
        """
        return self._unit

    @unit.setter
    def unit(self, unit: str):
        """Sets the unit of this Item.


        :param unit: The unit of this Item.
        :type unit: str
        """
        allowed_values = ["g", "kg", "package", "l"]  # noqa: E501
        if unit not in allowed_values:
            raise ValueError(
                "Invalid value for `unit` ({0}), must be one of {1}"
                .format(unit, allowed_values)
            )

        self._unit = unit

    @property
    def stored_at(self) -> str:
        """Gets the stored_at of this Item.


        :return: The stored_at of this Item.
        :rtype: str
        """
        return self._stored_at

    @stored_at.setter
    def stored_at(self, stored_at: str):
        """Sets the stored_at of this Item.


        :param stored_at: The stored_at of this Item.
        :type stored_at: str
        """

        self._stored_at = stored_at

    @property
    def outdated_at(self) -> str:
        """Gets the outdated_at of this Item.


        :return: The outdated_at of this Item.
        :rtype: str
        """
        return self._outdated_at

    @outdated_at.setter
    def outdated_at(self, outdated_at: str):
        """Sets the outdated_at of this Item.


        :param outdated_at: The outdated_at of this Item.
        :type outdated_at: str
        """

        self._outdated_at = outdated_at

    @property
    def updated_at(self) -> str:
        """Gets the updated_at of this Item.


        :return: The updated_at of this Item.
        :rtype: str
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at: str):
        """Sets the updated_at of this Item.


        :param updated_at: The updated_at of this Item.
        :type updated_at: str
        """

        self._updated_at = updated_at
