# coding: utf-8

"""
    Lotus API

    Lotus is an open-core pricing and billing engine. We enable API companies to automate and optimize their custom usage-based pricing for any metric.  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class SubscriptionRecord(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 = {
        'subscription_id': 'str',
        'start_date': 'datetime',
        'end_date': 'datetime',
        'auto_renew': 'bool',
        'is_new': 'bool',
        'subscription_filters': 'list[SubscriptionFilter]',
        'customer': 'LightweightCustomer',
        'billing_plan': 'LightweightPlanVersion',
        'fully_billed': 'bool',
        'addons': 'list[LightweightAddOnSubscriptionRecord]',
        'metadata': 'dict(str, object)'
    }

    attribute_map = {
        'subscription_id': 'subscription_id',
        'start_date': 'start_date',
        'end_date': 'end_date',
        'auto_renew': 'auto_renew',
        'is_new': 'is_new',
        'subscription_filters': 'subscription_filters',
        'customer': 'customer',
        'billing_plan': 'billing_plan',
        'fully_billed': 'fully_billed',
        'addons': 'addons',
        'metadata': 'metadata'
    }

    def __init__(self, subscription_id=None, start_date=None, end_date=None, auto_renew=None, is_new=None, subscription_filters=None, customer=None, billing_plan=None, fully_billed=None, addons=None, metadata=None):  # noqa: E501
        """SubscriptionRecord - a model defined in Swagger"""  # noqa: E501
        self._subscription_id = None
        self._start_date = None
        self._end_date = None
        self._auto_renew = None
        self._is_new = None
        self._subscription_filters = None
        self._customer = None
        self._billing_plan = None
        self._fully_billed = None
        self._addons = None
        self._metadata = None
        self.discriminator = None
        self.subscription_id = subscription_id
        self.start_date = start_date
        self.end_date = end_date
        self.auto_renew = auto_renew
        self.is_new = is_new
        self.subscription_filters = subscription_filters
        self.customer = customer
        self.billing_plan = billing_plan
        self.fully_billed = fully_billed
        self.addons = addons
        self.metadata = metadata

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


        :return: The subscription_id of this SubscriptionRecord.  # noqa: E501
        :rtype: str
        """
        return self._subscription_id

    @subscription_id.setter
    def subscription_id(self, subscription_id):
        """Sets the subscription_id of this SubscriptionRecord.


        :param subscription_id: The subscription_id of this SubscriptionRecord.  # noqa: E501
        :type: str
        """
        if subscription_id is None:
            raise ValueError("Invalid value for `subscription_id`, must not be `None`")  # noqa: E501

        self._subscription_id = subscription_id

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

        The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.  # noqa: E501

        :return: The start_date of this SubscriptionRecord.  # noqa: E501
        :rtype: datetime
        """
        return self._start_date

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

        The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.  # noqa: E501

        :param start_date: The start_date of this SubscriptionRecord.  # noqa: E501
        :type: datetime
        """
        if start_date is None:
            raise ValueError("Invalid value for `start_date`, must not be `None`")  # noqa: E501

        self._start_date = start_date

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

        The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.  # noqa: E501

        :return: The end_date of this SubscriptionRecord.  # noqa: E501
        :rtype: datetime
        """
        return self._end_date

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

        The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.  # noqa: E501

        :param end_date: The end_date of this SubscriptionRecord.  # noqa: E501
        :type: datetime
        """
        if end_date is None:
            raise ValueError("Invalid value for `end_date`, must not be `None`")  # noqa: E501

        self._end_date = end_date

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

        Whether the subscription automatically renews. Defaults to true.  # noqa: E501

        :return: The auto_renew of this SubscriptionRecord.  # noqa: E501
        :rtype: bool
        """
        return self._auto_renew

    @auto_renew.setter
    def auto_renew(self, auto_renew):
        """Sets the auto_renew of this SubscriptionRecord.

        Whether the subscription automatically renews. Defaults to true.  # noqa: E501

        :param auto_renew: The auto_renew of this SubscriptionRecord.  # noqa: E501
        :type: bool
        """
        if auto_renew is None:
            raise ValueError("Invalid value for `auto_renew`, must not be `None`")  # noqa: E501

        self._auto_renew = auto_renew

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

        Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.  # noqa: E501

        :return: The is_new of this SubscriptionRecord.  # noqa: E501
        :rtype: bool
        """
        return self._is_new

    @is_new.setter
    def is_new(self, is_new):
        """Sets the is_new of this SubscriptionRecord.

        Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.  # noqa: E501

        :param is_new: The is_new of this SubscriptionRecord.  # noqa: E501
        :type: bool
        """
        if is_new is None:
            raise ValueError("Invalid value for `is_new`, must not be `None`")  # noqa: E501

        self._is_new = is_new

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


        :return: The subscription_filters of this SubscriptionRecord.  # noqa: E501
        :rtype: list[SubscriptionFilter]
        """
        return self._subscription_filters

    @subscription_filters.setter
    def subscription_filters(self, subscription_filters):
        """Sets the subscription_filters of this SubscriptionRecord.


        :param subscription_filters: The subscription_filters of this SubscriptionRecord.  # noqa: E501
        :type: list[SubscriptionFilter]
        """
        if subscription_filters is None:
            raise ValueError("Invalid value for `subscription_filters`, must not be `None`")  # noqa: E501

        self._subscription_filters = subscription_filters

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


        :return: The customer of this SubscriptionRecord.  # noqa: E501
        :rtype: LightweightCustomer
        """
        return self._customer

    @customer.setter
    def customer(self, customer):
        """Sets the customer of this SubscriptionRecord.


        :param customer: The customer of this SubscriptionRecord.  # noqa: E501
        :type: LightweightCustomer
        """
        if customer is None:
            raise ValueError("Invalid value for `customer`, must not be `None`")  # noqa: E501

        self._customer = customer

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


        :return: The billing_plan of this SubscriptionRecord.  # noqa: E501
        :rtype: LightweightPlanVersion
        """
        return self._billing_plan

    @billing_plan.setter
    def billing_plan(self, billing_plan):
        """Sets the billing_plan of this SubscriptionRecord.


        :param billing_plan: The billing_plan of this SubscriptionRecord.  # noqa: E501
        :type: LightweightPlanVersion
        """
        if billing_plan is None:
            raise ValueError("Invalid value for `billing_plan`, must not be `None`")  # noqa: E501

        self._billing_plan = billing_plan

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


        :return: The fully_billed of this SubscriptionRecord.  # noqa: E501
        :rtype: bool
        """
        return self._fully_billed

    @fully_billed.setter
    def fully_billed(self, fully_billed):
        """Sets the fully_billed of this SubscriptionRecord.


        :param fully_billed: The fully_billed of this SubscriptionRecord.  # noqa: E501
        :type: bool
        """
        if fully_billed is None:
            raise ValueError("Invalid value for `fully_billed`, must not be `None`")  # noqa: E501

        self._fully_billed = fully_billed

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


        :return: The addons of this SubscriptionRecord.  # noqa: E501
        :rtype: list[LightweightAddOnSubscriptionRecord]
        """
        return self._addons

    @addons.setter
    def addons(self, addons):
        """Sets the addons of this SubscriptionRecord.


        :param addons: The addons of this SubscriptionRecord.  # noqa: E501
        :type: list[LightweightAddOnSubscriptionRecord]
        """
        if addons is None:
            raise ValueError("Invalid value for `addons`, must not be `None`")  # noqa: E501

        self._addons = addons

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


        :return: The metadata of this SubscriptionRecord.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata):
        """Sets the metadata of this SubscriptionRecord.


        :param metadata: The metadata of this SubscriptionRecord.  # noqa: E501
        :type: dict(str, object)
        """
        if metadata is None:
            raise ValueError("Invalid value for `metadata`, must not be `None`")  # noqa: E501

        self._metadata = metadata

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

        return self.__dict__ == other.__dict__

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