# coding: utf-8

"""
    Hydrogen Proton API

    Financial engineering module of Hydrogen Atom  # noqa: E501

    OpenAPI spec version: 1.8.0
    Contact: info@hydrogenplatform.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class FinancialStatementAnalysisRequest(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_length': 'str',
        'period_month': 'int',
        'end_date': 'date',
        'client_id': 'str',
        'accounting_method': 'str',
        'period_year': 'int',
        'currency_conversion': 'str',
        'history_frequency_interval': 'str',
        'start_date': 'date',
        'period_type': 'str',
        'currency_code': 'str',
        'show_history': 'bool',
        'stat_names': 'list[str]',
        'period_quarter': 'int',
        'statement_type': 'str'
    }

    attribute_map = {
        'period_length': 'period_length',
        'period_month': 'period_month',
        'end_date': 'end_date',
        'client_id': 'client_id',
        'accounting_method': 'accounting_method',
        'period_year': 'period_year',
        'currency_conversion': 'currency_conversion',
        'history_frequency_interval': 'history_frequency_interval',
        'start_date': 'start_date',
        'period_type': 'period_type',
        'currency_code': 'currency_code',
        'show_history': 'show_history',
        'stat_names': 'stat_names',
        'period_quarter': 'period_quarter',
        'statement_type': 'statement_type'
    }

    def __init__(self, period_length='quarterly', period_month=None, end_date=None, client_id=None, accounting_method=None, period_year=None, currency_conversion=None, history_frequency_interval='month', start_date=None, period_type=None, currency_code=None, show_history=False, stat_names=None, period_quarter=None, statement_type='all'):  # noqa: E501
        """FinancialStatementAnalysisRequest - a model defined in Swagger"""  # noqa: E501

        self._period_length = None
        self._period_month = None
        self._end_date = None
        self._client_id = None
        self._accounting_method = None
        self._period_year = None
        self._currency_conversion = None
        self._history_frequency_interval = None
        self._start_date = None
        self._period_type = None
        self._currency_code = None
        self._show_history = None
        self._stat_names = None
        self._period_quarter = None
        self._statement_type = None
        self.discriminator = None

        if period_length is not None:
            self.period_length = period_length
        if period_month is not None:
            self.period_month = period_month
        if end_date is not None:
            self.end_date = end_date
        if client_id is not None:
            self.client_id = client_id
        self.accounting_method = accounting_method
        if period_year is not None:
            self.period_year = period_year
        if currency_conversion is not None:
            self.currency_conversion = currency_conversion
        if history_frequency_interval is not None:
            self.history_frequency_interval = history_frequency_interval
        if start_date is not None:
            self.start_date = start_date
        if period_type is not None:
            self.period_type = period_type
        if currency_code is not None:
            self.currency_code = currency_code
        if show_history is not None:
            self.show_history = show_history
        if stat_names is not None:
            self.stat_names = stat_names
        if period_quarter is not None:
            self.period_quarter = period_quarter
        if statement_type is not None:
            self.statement_type = statement_type

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


        :return: The period_length of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._period_length

    @period_length.setter
    def period_length(self, period_length):
        """Sets the period_length of this FinancialStatementAnalysisRequest.


        :param period_length: The period_length of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["annual", "quarterly", "monthly", "ytd", "qtd", "mtd"]  # noqa: E501
        if period_length not in allowed_values:
            raise ValueError(
                "Invalid value for `period_length` ({0}), must be one of {1}"  # noqa: E501
                .format(period_length, allowed_values)
            )

        self._period_length = period_length

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


        :return: The period_month of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: int
        """
        return self._period_month

    @period_month.setter
    def period_month(self, period_month):
        """Sets the period_month of this FinancialStatementAnalysisRequest.


        :param period_month: The period_month of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: int
        """
        if period_month is not None and period_month > 12:  # noqa: E501
            raise ValueError("Invalid value for `period_month`, must be a value less than or equal to `12`")  # noqa: E501
        if period_month is not None and period_month < 1:  # noqa: E501
            raise ValueError("Invalid value for `period_month`, must be a value greater than or equal to `1`")  # noqa: E501

        self._period_month = period_month

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


        :return: The end_date of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: date
        """
        return self._end_date

    @end_date.setter
    def end_date(self, end_date):
        """Sets the end_date of this FinancialStatementAnalysisRequest.


        :param end_date: The end_date of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: date
        """

        self._end_date = end_date

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


        :return: The client_id of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._client_id

    @client_id.setter
    def client_id(self, client_id):
        """Sets the client_id of this FinancialStatementAnalysisRequest.


        :param client_id: The client_id of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """

        self._client_id = client_id

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


        :return: The accounting_method of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._accounting_method

    @accounting_method.setter
    def accounting_method(self, accounting_method):
        """Sets the accounting_method of this FinancialStatementAnalysisRequest.


        :param accounting_method: The accounting_method of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """
        if accounting_method is None:
            raise ValueError("Invalid value for `accounting_method`, must not be `None`")  # noqa: E501
        allowed_values = ["accrual", "cash"]  # noqa: E501
        if accounting_method not in allowed_values:
            raise ValueError(
                "Invalid value for `accounting_method` ({0}), must be one of {1}"  # noqa: E501
                .format(accounting_method, allowed_values)
            )

        self._accounting_method = accounting_method

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


        :return: The period_year of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: int
        """
        return self._period_year

    @period_year.setter
    def period_year(self, period_year):
        """Sets the period_year of this FinancialStatementAnalysisRequest.


        :param period_year: The period_year of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: int
        """

        self._period_year = period_year

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


        :return: The currency_conversion of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._currency_conversion

    @currency_conversion.setter
    def currency_conversion(self, currency_conversion):
        """Sets the currency_conversion of this FinancialStatementAnalysisRequest.


        :param currency_conversion: The currency_conversion of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """

        self._currency_conversion = currency_conversion

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


        :return: The history_frequency_interval of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._history_frequency_interval

    @history_frequency_interval.setter
    def history_frequency_interval(self, history_frequency_interval):
        """Sets the history_frequency_interval of this FinancialStatementAnalysisRequest.


        :param history_frequency_interval: The history_frequency_interval of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["day", "week", "month", "quarter", "year"]  # noqa: E501
        if history_frequency_interval not in allowed_values:
            raise ValueError(
                "Invalid value for `history_frequency_interval` ({0}), must be one of {1}"  # noqa: E501
                .format(history_frequency_interval, allowed_values)
            )

        self._history_frequency_interval = history_frequency_interval

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


        :return: The start_date of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: date
        """
        return self._start_date

    @start_date.setter
    def start_date(self, start_date):
        """Sets the start_date of this FinancialStatementAnalysisRequest.


        :param start_date: The start_date of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: date
        """

        self._start_date = start_date

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


        :return: The period_type of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._period_type

    @period_type.setter
    def period_type(self, period_type):
        """Sets the period_type of this FinancialStatementAnalysisRequest.


        :param period_type: The period_type of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["calendar", "fiscal"]  # noqa: E501
        if period_type not in allowed_values:
            raise ValueError(
                "Invalid value for `period_type` ({0}), must be one of {1}"  # noqa: E501
                .format(period_type, allowed_values)
            )

        self._period_type = period_type

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


        :return: The currency_code of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._currency_code

    @currency_code.setter
    def currency_code(self, currency_code):
        """Sets the currency_code of this FinancialStatementAnalysisRequest.


        :param currency_code: The currency_code of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """

        self._currency_code = currency_code

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


        :return: The show_history of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: bool
        """
        return self._show_history

    @show_history.setter
    def show_history(self, show_history):
        """Sets the show_history of this FinancialStatementAnalysisRequest.


        :param show_history: The show_history of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: bool
        """

        self._show_history = show_history

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


        :return: The stat_names of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: list[str]
        """
        return self._stat_names

    @stat_names.setter
    def stat_names(self, stat_names):
        """Sets the stat_names of this FinancialStatementAnalysisRequest.


        :param stat_names: The stat_names of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: list[str]
        """
        allowed_values = ["cash", "accounts_receivable", "total_assets", "accounts_payable", "total_liabilities", "total_equity", "total_revenue", "cogs", "total_expenses", "operating_income", "gross_profit", "net_income", "ebitda"]  # noqa: E501
        if not set(stat_names).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `stat_names` [{0}], must be a subset of [{1}]"  # noqa: E501
                .format(", ".join(map(str, set(stat_names) - set(allowed_values))),  # noqa: E501
                        ", ".join(map(str, allowed_values)))
            )

        self._stat_names = stat_names

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


        :return: The period_quarter of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: int
        """
        return self._period_quarter

    @period_quarter.setter
    def period_quarter(self, period_quarter):
        """Sets the period_quarter of this FinancialStatementAnalysisRequest.


        :param period_quarter: The period_quarter of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: int
        """
        if period_quarter is not None and period_quarter > 4:  # noqa: E501
            raise ValueError("Invalid value for `period_quarter`, must be a value less than or equal to `4`")  # noqa: E501
        if period_quarter is not None and period_quarter < 1:  # noqa: E501
            raise ValueError("Invalid value for `period_quarter`, must be a value greater than or equal to `1`")  # noqa: E501

        self._period_quarter = period_quarter

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


        :return: The statement_type of this FinancialStatementAnalysisRequest.  # noqa: E501
        :rtype: str
        """
        return self._statement_type

    @statement_type.setter
    def statement_type(self, statement_type):
        """Sets the statement_type of this FinancialStatementAnalysisRequest.


        :param statement_type: The statement_type of this FinancialStatementAnalysisRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["income_statement", "balance_sheet", "all"]  # noqa: E501
        if statement_type not in allowed_values:
            raise ValueError(
                "Invalid value for `statement_type` ({0}), must be one of {1}"  # noqa: E501
                .format(statement_type, allowed_values)
            )

        self._statement_type = statement_type

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

        return self.__dict__ == other.__dict__

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