# coding: utf-8

"""
    Creditas OpenAPI

    This is specification of the Creditas OpenAPI. It contains definitions of Creditas banking services exposed via API accessible on the internet.  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: is@creditas.cz
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from creditas.configuration import Configuration


class AccountStatement(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 = {
        'period': 'str',
        'year': 'int',
        'number': 'int',
        'date_from': 'date',
        'date_to': 'date'
    }

    attribute_map = {
        'period': 'period',
        'year': 'year',
        'number': 'number',
        'date_from': 'dateFrom',
        'date_to': 'dateTo'
    }

    def __init__(self, period=None, year=None, number=None, date_from=None, date_to=None, _configuration=None):  # noqa: E501
        """AccountStatement - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._period = None
        self._year = None
        self._number = None
        self._date_from = None
        self._date_to = None
        self.discriminator = None

        self.period = period
        self.year = year
        self.number = number
        self.date_from = date_from
        self.date_to = date_to

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

        The period of statement  # noqa: E501

        :return: The period of this AccountStatement.  # noqa: E501
        :rtype: str
        """
        return self._period

    @period.setter
    def period(self, period):
        """Sets the period of this AccountStatement.

        The period of statement  # noqa: E501

        :param period: The period of this AccountStatement.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and period is None:
            raise ValueError("Invalid value for `period`, must not be `None`")  # noqa: E501
        allowed_values = ["DAY", "WEEK", "MONTH", "QUARTER", "HALF", "YEAR"]  # noqa: E501
        if (self._configuration.client_side_validation and
                period not in allowed_values):
            raise ValueError(
                "Invalid value for `period` ({0}), must be one of {1}"  # noqa: E501
                .format(period, allowed_values)
            )

        self._period = period

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

        The statement's year  # noqa: E501

        :return: The year of this AccountStatement.  # noqa: E501
        :rtype: int
        """
        return self._year

    @year.setter
    def year(self, year):
        """Sets the year of this AccountStatement.

        The statement's year  # noqa: E501

        :param year: The year of this AccountStatement.  # noqa: E501
        :type: int
        """
        if self._configuration.client_side_validation and year is None:
            raise ValueError("Invalid value for `year`, must not be `None`")  # noqa: E501

        self._year = year

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

        The statement's sequence number  # noqa: E501

        :return: The number of this AccountStatement.  # noqa: E501
        :rtype: int
        """
        return self._number

    @number.setter
    def number(self, number):
        """Sets the number of this AccountStatement.

        The statement's sequence number  # noqa: E501

        :param number: The number of this AccountStatement.  # noqa: E501
        :type: int
        """
        if self._configuration.client_side_validation and number is None:
            raise ValueError("Invalid value for `number`, must not be `None`")  # noqa: E501

        self._number = number

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

        The start-date of the statement period  # noqa: E501

        :return: The date_from of this AccountStatement.  # noqa: E501
        :rtype: date
        """
        return self._date_from

    @date_from.setter
    def date_from(self, date_from):
        """Sets the date_from of this AccountStatement.

        The start-date of the statement period  # noqa: E501

        :param date_from: The date_from of this AccountStatement.  # noqa: E501
        :type: date
        """
        if self._configuration.client_side_validation and date_from is None:
            raise ValueError("Invalid value for `date_from`, must not be `None`")  # noqa: E501

        self._date_from = date_from

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

        The end-date of the statement period  # noqa: E501

        :return: The date_to of this AccountStatement.  # noqa: E501
        :rtype: date
        """
        return self._date_to

    @date_to.setter
    def date_to(self, date_to):
        """Sets the date_to of this AccountStatement.

        The end-date of the statement period  # noqa: E501

        :param date_to: The date_to of this AccountStatement.  # noqa: E501
        :type: date
        """
        if self._configuration.client_side_validation and date_to is None:
            raise ValueError("Invalid value for `date_to`, must not be `None`")  # noqa: E501

        self._date_to = date_to

    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(AccountStatement, 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, AccountStatement):
            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, AccountStatement):
            return True

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