# 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 GoalWithdrawalConfig(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 = {
        'with_start_reference': 'str',
        'with_amount': 'float',
        'with_inflation': 'float',
        'with_start_period': 'int',
        'with_end_period': 'int',
        'with_end_reference': 'str',
        'with_frequency': 'str'
    }

    attribute_map = {
        'with_start_reference': 'with_start_reference',
        'with_amount': 'with_amount',
        'with_inflation': 'with_inflation',
        'with_start_period': 'with_start_period',
        'with_end_period': 'with_end_period',
        'with_end_reference': 'with_end_reference',
        'with_frequency': 'with_frequency'
    }

    def __init__(self, with_start_reference='a_end', with_amount=None, with_inflation=0.0, with_start_period=0, with_end_period=0, with_end_reference='d_end', with_frequency='year'):  # noqa: E501
        """GoalWithdrawalConfig - a model defined in Swagger"""  # noqa: E501

        self._with_start_reference = None
        self._with_amount = None
        self._with_inflation = None
        self._with_start_period = None
        self._with_end_period = None
        self._with_end_reference = None
        self._with_frequency = None
        self.discriminator = None

        if with_start_reference is not None:
            self.with_start_reference = with_start_reference
        if with_amount is not None:
            self.with_amount = with_amount
        if with_inflation is not None:
            self.with_inflation = with_inflation
        if with_start_period is not None:
            self.with_start_period = with_start_period
        if with_end_period is not None:
            self.with_end_period = with_end_period
        if with_end_reference is not None:
            self.with_end_reference = with_end_reference
        if with_frequency is not None:
            self.with_frequency = with_frequency

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


        :return: The with_start_reference of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: str
        """
        return self._with_start_reference

    @with_start_reference.setter
    def with_start_reference(self, with_start_reference):
        """Sets the with_start_reference of this GoalWithdrawalConfig.


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

        self._with_start_reference = with_start_reference

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


        :return: The with_amount of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: float
        """
        return self._with_amount

    @with_amount.setter
    def with_amount(self, with_amount):
        """Sets the with_amount of this GoalWithdrawalConfig.


        :param with_amount: The with_amount of this GoalWithdrawalConfig.  # noqa: E501
        :type: float
        """
        if with_amount is not None and with_amount < 0:  # noqa: E501
            raise ValueError("Invalid value for `with_amount`, must be a value greater than or equal to `0`")  # noqa: E501

        self._with_amount = with_amount

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


        :return: The with_inflation of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: float
        """
        return self._with_inflation

    @with_inflation.setter
    def with_inflation(self, with_inflation):
        """Sets the with_inflation of this GoalWithdrawalConfig.


        :param with_inflation: The with_inflation of this GoalWithdrawalConfig.  # noqa: E501
        :type: float
        """
        if with_inflation is not None and with_inflation < -1:  # noqa: E501
            raise ValueError("Invalid value for `with_inflation`, must be a value greater than or equal to `-1`")  # noqa: E501

        self._with_inflation = with_inflation

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


        :return: The with_start_period of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: int
        """
        return self._with_start_period

    @with_start_period.setter
    def with_start_period(self, with_start_period):
        """Sets the with_start_period of this GoalWithdrawalConfig.


        :param with_start_period: The with_start_period of this GoalWithdrawalConfig.  # noqa: E501
        :type: int
        """

        self._with_start_period = with_start_period

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


        :return: The with_end_period of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: int
        """
        return self._with_end_period

    @with_end_period.setter
    def with_end_period(self, with_end_period):
        """Sets the with_end_period of this GoalWithdrawalConfig.


        :param with_end_period: The with_end_period of this GoalWithdrawalConfig.  # noqa: E501
        :type: int
        """

        self._with_end_period = with_end_period

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


        :return: The with_end_reference of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: str
        """
        return self._with_end_reference

    @with_end_reference.setter
    def with_end_reference(self, with_end_reference):
        """Sets the with_end_reference of this GoalWithdrawalConfig.


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

        self._with_end_reference = with_end_reference

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


        :return: The with_frequency of this GoalWithdrawalConfig.  # noqa: E501
        :rtype: str
        """
        return self._with_frequency

    @with_frequency.setter
    def with_frequency(self, with_frequency):
        """Sets the with_frequency of this GoalWithdrawalConfig.


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

        self._with_frequency = with_frequency

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

        return self.__dict__ == other.__dict__

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