# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

    OpenAPI spec version: 3.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from cardpay.model.plan_quantity import PlanQuantity  # noqa: F401,E501


class ResponsePlanData(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 = {
        "id": "str",
        "name": "str",
        "created": "datetime",
        "status": "str",
        "period": "str",
        "interval": "int",
        "currency": "str",
        "amount": "float",
        "retries": "int",
        "pricing_model": "str",
        "quantity": "list[PlanQuantity]",
    }

    attribute_map = {
        "id": "id",
        "name": "name",
        "created": "created",
        "status": "status",
        "period": "period",
        "interval": "interval",
        "currency": "currency",
        "amount": "amount",
        "retries": "retries",
        "pricing_model": "pricing_model",
        "quantity": "quantity",
    }

    def __init__(
        self,
        id=None,
        name=None,
        created=None,
        status=None,
        period=None,
        interval=None,
        currency=None,
        amount=None,
        retries=None,
        pricing_model=None,
        quantity=None,
    ):  # noqa: E501
        """ResponsePlanData - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._name = None
        self._created = None
        self._status = None
        self._period = None
        self._interval = None
        self._currency = None
        self._amount = None
        self._retries = None
        self._pricing_model = None
        self._quantity = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if created is not None:
            self.created = created
        if status is not None:
            self.status = status
        if period is not None:
            self.period = period
        if interval is not None:
            self.interval = interval
        if currency is not None:
            self.currency = currency
        if amount is not None:
            self.amount = amount
        if retries is not None:
            self.retries = retries
        if pricing_model is not None:
            self.pricing_model = pricing_model
        if quantity is not None:
            self.quantity = quantity

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

        ID of created plan  # noqa: E501

        :return: The id of this ResponsePlanData.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        ID of created plan  # noqa: E501

        :param id: The id of this ResponsePlanData.  # noqa: E501
        :type: str
        """

        self._id = id

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

        Name of created plan  # noqa: E501

        :return: The name of this ResponsePlanData.  # noqa: E501
        :rtype: str
        """
        return self._name

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

        Name of created plan  # noqa: E501

        :param name: The name of this ResponsePlanData.  # noqa: E501
        :type: str
        """

        self._name = name

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

        Creation time, [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format  # noqa: E501

        :return: The created of this ResponsePlanData.  # noqa: E501
        :rtype: datetime
        """
        return self._created

    @created.setter
    def created(self, created):
        """Sets the created of this ResponsePlanData.

        Creation time, [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format  # noqa: E501

        :param created: The created of this ResponsePlanData.  # noqa: E501
        :type: datetime
        """

        self._created = created

    class Status(object):
        ACTIVE = "ACTIVE"
        INACTIVE = "INACTIVE"

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

        Status of created plan: 'ACTIVE' or 'INACTIVE'  # noqa: E501

        :return: The status of this ResponsePlanData.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this ResponsePlanData.

        Status of created plan: 'ACTIVE' or 'INACTIVE'  # noqa: E501

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

        self._status = status

    class Period(object):
        MINUTE = "minute"
        DAY = "day"
        WEEK = "week"
        MONTH = "month"
        YEAR = "year"

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

        Period of created plan  # noqa: E501

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

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

        Period of created plan  # noqa: E501

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

        self._period = period

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

        Interval of plan  # noqa: E501

        :return: The interval of this ResponsePlanData.  # noqa: E501
        :rtype: int
        """
        return self._interval

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

        Interval of plan  # noqa: E501

        :param interval: The interval of this ResponsePlanData.  # noqa: E501
        :type: int
        """

        self._interval = interval

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

        [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of created plan  # noqa: E501

        :return: The currency of this ResponsePlanData.  # noqa: E501
        :rtype: str
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this ResponsePlanData.

        [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of created plan  # noqa: E501

        :param currency: The currency of this ResponsePlanData.  # noqa: E501
        :type: str
        """

        self._currency = currency

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

        The total amount of created plan  # noqa: E501

        :return: The amount of this ResponsePlanData.  # noqa: E501
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this ResponsePlanData.

        The total amount of created plan  # noqa: E501

        :param amount: The amount of this ResponsePlanData.  # noqa: E501
        :type: float
        """

        self._amount = amount

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

        Number of daily basis retry attempts in case of payment has not been captured successfully, from 1 to 15 attempts  # noqa: E501

        :return: The retries of this ResponsePlanData.  # noqa: E501
        :rtype: int
        """
        return self._retries

    @retries.setter
    def retries(self, retries):
        """Sets the retries of this ResponsePlanData.

        Number of daily basis retry attempts in case of payment has not been captured successfully, from 1 to 15 attempts  # noqa: E501

        :param retries: The retries of this ResponsePlanData.  # noqa: E501
        :type: int
        """

        self._retries = retries

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

        Parameter regulates the price calculation pricing_model depending on the number of units. Possible values: `FIXED` `TIERED` `VOLUME`  # noqa: E501

        :return: The pricing_model of this ResponsePlanData.  # noqa: E501
        :rtype: str
        """
        return self._pricing_model

    @pricing_model.setter
    def pricing_model(self, pricing_model):
        """Sets the pricing_model of this ResponsePlanData.

        Parameter regulates the price calculation pricing_model depending on the number of units. Possible values: `FIXED` `TIERED` `VOLUME`  # noqa: E501

        :param pricing_model: The pricing_model of this ResponsePlanData.  # noqa: E501
        :type: str
        """

        self._pricing_model = pricing_model

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

        Array with units params  # noqa: E501

        :return: The quantity of this ResponsePlanData.  # noqa: E501
        :rtype: list[PlanQuantity]
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this ResponsePlanData.

        Array with units params  # noqa: E501

        :param quantity: The quantity of this ResponsePlanData.  # noqa: E501
        :type: list[PlanQuantity]
        """

        self._quantity = quantity

    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:
                if value is not None:
                    result[attr] = value
        if issubclass(ResponsePlanData, 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, ResponsePlanData):
            return False

        return self.__dict__ == other.__dict__

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