# coding: utf-8

"""
    The Plaid API

    The Plaid REST API. Please see https://plaid.com/docs/api for more details.  # noqa: E501
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from plaid.generated_plaid.configuration import Configuration


class ExternalPaymentSchedule(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 = {
        'interval': 'str',
        'interval_execution_day': 'float',
        'start_date': 'str'
    }

    attribute_map = {
        'interval': 'interval',
        'interval_execution_day': 'interval_execution_day',
        'start_date': 'start_date'
    }

    def __init__(self, interval=None, interval_execution_day=None, start_date=None, local_vars_configuration=None):  # noqa: E501
        """ExternalPaymentSchedule - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._interval = None
        self._interval_execution_day = None
        self._start_date = None
        self.discriminator = None

        if interval is not None:
            self.interval = interval
        if interval_execution_day is not None:
            self.interval_execution_day = interval_execution_day
        if start_date is not None:
            self.start_date = start_date

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

        The frequency interval of the payment. Valid values are `\"WEEKLY\"` or `\"MONTHLY\"`.  # noqa: E501

        :return: The interval of this ExternalPaymentSchedule.  # noqa: E501
        :rtype: str
        """
        return self._interval

    @interval.setter
    def interval(self, interval):
        """Sets the interval of this ExternalPaymentSchedule.

        The frequency interval of the payment. Valid values are `\"WEEKLY\"` or `\"MONTHLY\"`.  # noqa: E501

        :param interval: The interval of this ExternalPaymentSchedule.  # noqa: E501
        :type interval: str
        """

        self._interval = interval

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

        The day of the interval on which to schedule the payment.  If the payment interval is weekly, `interval_execution_day` should be an integer from 1 (Monday) to 7 (Sunday).  If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on.  # noqa: E501

        :return: The interval_execution_day of this ExternalPaymentSchedule.  # noqa: E501
        :rtype: float
        """
        return self._interval_execution_day

    @interval_execution_day.setter
    def interval_execution_day(self, interval_execution_day):
        """Sets the interval_execution_day of this ExternalPaymentSchedule.

        The day of the interval on which to schedule the payment.  If the payment interval is weekly, `interval_execution_day` should be an integer from 1 (Monday) to 7 (Sunday).  If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on.  # noqa: E501

        :param interval_execution_day: The interval_execution_day of this ExternalPaymentSchedule.  # noqa: E501
        :type interval_execution_day: float
        """

        self._interval_execution_day = interval_execution_day

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

        A date in ISO 8601 format (YYYY-MM-DD). Standing order payments will begin on the first `interval_execution_day` on or after the `start_date`.  If the first `interval_execution_day` on or after the start date is also the same day that `/payment_initiation/payment/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so.  It is not possible to specify an end date for a standing order payment.  To end or modify a standing order payment, the end user should contact their bank.  # noqa: E501

        :return: The start_date of this ExternalPaymentSchedule.  # noqa: E501
        :rtype: str
        """
        return self._start_date

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

        A date in ISO 8601 format (YYYY-MM-DD). Standing order payments will begin on the first `interval_execution_day` on or after the `start_date`.  If the first `interval_execution_day` on or after the start date is also the same day that `/payment_initiation/payment/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so.  It is not possible to specify an end date for a standing order payment.  To end or modify a standing order payment, the end user should contact their bank.  # noqa: E501

        :param start_date: The start_date of this ExternalPaymentSchedule.  # noqa: E501
        :type start_date: str
        """

        self._start_date = start_date

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

        for attr, _ in six.iteritems(self.openapi_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

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

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