# coding: utf-8

"""
    BillForward REST API


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

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from pprint import pformat
from six import iteritems
import re


class CouponDefinition(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, created=None, changed_by=None, updated=None, id=None, crm_id=None, organization_id=None, name=None, description=None, customer_code=None, target=None, currency=None, definition_valid_from=None, definition_valid_till=None, instance_duration_period=None, instance_duration=None, fixed_end_date=None, state=None, modifiers=None, rules=None):
        """
        CouponDefinition - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'created': 'datetime',
            'changed_by': 'str',
            'updated': 'datetime',
            'id': 'str',
            'crm_id': 'str',
            'organization_id': 'str',
            'name': 'str',
            'description': 'str',
            'customer_code': 'str',
            'target': 'str',
            'currency': 'str',
            'definition_valid_from': 'datetime',
            'definition_valid_till': 'datetime',
            'instance_duration_period': 'str',
            'instance_duration': 'int',
            'fixed_end_date': 'datetime',
            'state': 'str',
            'modifiers': 'list[CouponModifierBase]',
            'rules': 'list[CouponRule]'
        }

        self.attribute_map = {
            'created': 'created',
            'changed_by': 'changedBy',
            'updated': 'updated',
            'id': 'id',
            'crm_id': 'crmID',
            'organization_id': 'organizationID',
            'name': 'name',
            'description': 'description',
            'customer_code': 'customerCode',
            'target': 'target',
            'currency': 'currency',
            'definition_valid_from': 'definitionValidFrom',
            'definition_valid_till': 'definitionValidTill',
            'instance_duration_period': 'instanceDurationPeriod',
            'instance_duration': 'instanceDuration',
            'fixed_end_date': 'fixedEndDate',
            'state': 'state',
            'modifiers': 'modifiers',
            'rules': 'rules'
        }

        self._created = created
        self._changed_by = changed_by
        self._updated = updated
        self._id = id
        self._crm_id = crm_id
        self._organization_id = organization_id
        self._name = name
        self._description = description
        self._customer_code = customer_code
        self._target = target
        self._currency = currency
        self._definition_valid_from = definition_valid_from
        self._definition_valid_till = definition_valid_till
        self._instance_duration_period = instance_duration_period
        self._instance_duration = instance_duration
        self._fixed_end_date = fixed_end_date
        self._state = state
        self._modifiers = modifiers
        self._rules = rules

    @property
    def created(self):
        """
        Gets the created of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }

        :return: The created of this CouponDefinition.
        :rtype: datetime
        """
        return self._created

    @created.setter
    def created(self, created):
        """
        Sets the created of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }

        :param created: The created of this CouponDefinition.
        :type: datetime
        """

        self._created = created

    @property
    def changed_by(self):
        """
        Gets the changed_by of this CouponDefinition.
        { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }

        :return: The changed_by of this CouponDefinition.
        :rtype: str
        """
        return self._changed_by

    @changed_by.setter
    def changed_by(self, changed_by):
        """
        Sets the changed_by of this CouponDefinition.
        { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }

        :param changed_by: The changed_by of this CouponDefinition.
        :type: str
        """

        self._changed_by = changed_by

    @property
    def updated(self):
        """
        Gets the updated of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }

        :return: The updated of this CouponDefinition.
        :rtype: datetime
        """
        return self._updated

    @updated.setter
    def updated(self, updated):
        """
        Sets the updated of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }

        :param updated: The updated of this CouponDefinition.
        :type: datetime
        """

        self._updated = updated

    @property
    def id(self):
        """
        Gets the id of this CouponDefinition.
        { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The id of this CouponDefinition.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this CouponDefinition.
        { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param id: The id of this CouponDefinition.
        :type: str
        """

        self._id = id

    @property
    def crm_id(self):
        """
        Gets the crm_id of this CouponDefinition.
        { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The crm_id of this CouponDefinition.
        :rtype: str
        """
        return self._crm_id

    @crm_id.setter
    def crm_id(self, crm_id):
        """
        Sets the crm_id of this CouponDefinition.
        { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param crm_id: The crm_id of this CouponDefinition.
        :type: str
        """

        self._crm_id = crm_id

    @property
    def organization_id(self):
        """
        Gets the organization_id of this CouponDefinition.
        { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The organization_id of this CouponDefinition.
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """
        Sets the organization_id of this CouponDefinition.
        { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param organization_id: The organization_id of this CouponDefinition.
        :type: str
        """

        self._organization_id = organization_id

    @property
    def name(self):
        """
        Gets the name of this CouponDefinition.
        { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The name of this CouponDefinition.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this CouponDefinition.
        { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param name: The name of this CouponDefinition.
        :type: str
        """

        self._name = name

    @property
    def description(self):
        """
        Gets the description of this CouponDefinition.
        { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The description of this CouponDefinition.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """
        Sets the description of this CouponDefinition.
        { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param description: The description of this CouponDefinition.
        :type: str
        """

        self._description = description

    @property
    def customer_code(self):
        """
        Gets the customer_code of this CouponDefinition.
        { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The customer_code of this CouponDefinition.
        :rtype: str
        """
        return self._customer_code

    @customer_code.setter
    def customer_code(self, customer_code):
        """
        Sets the customer_code of this CouponDefinition.
        { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param customer_code: The customer_code of this CouponDefinition.
        :type: str
        """

        self._customer_code = customer_code

    @property
    def target(self):
        """
        Gets the target of this CouponDefinition.
        { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The target of this CouponDefinition.
        :rtype: str
        """
        return self._target

    @target.setter
    def target(self, target):
        """
        Sets the target of this CouponDefinition.
        { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param target: The target of this CouponDefinition.
        :type: str
        """
        allowed_values = ["product", "account"]
        if target not in allowed_values:
            raise ValueError(
                "Invalid value for `target` ({0}), must be one of {1}"
                .format(target, allowed_values)
            )

        self._target = target

    @property
    def currency(self):
        """
        Gets the currency of this CouponDefinition.
        { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The currency of this CouponDefinition.
        :rtype: str
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """
        Sets the currency of this CouponDefinition.
        { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param currency: The currency of this CouponDefinition.
        :type: str
        """

        self._currency = currency

    @property
    def definition_valid_from(self):
        """
        Gets the definition_valid_from of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The definition_valid_from of this CouponDefinition.
        :rtype: datetime
        """
        return self._definition_valid_from

    @definition_valid_from.setter
    def definition_valid_from(self, definition_valid_from):
        """
        Sets the definition_valid_from of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param definition_valid_from: The definition_valid_from of this CouponDefinition.
        :type: datetime
        """

        self._definition_valid_from = definition_valid_from

    @property
    def definition_valid_till(self):
        """
        Gets the definition_valid_till of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The definition_valid_till of this CouponDefinition.
        :rtype: datetime
        """
        return self._definition_valid_till

    @definition_valid_till.setter
    def definition_valid_till(self, definition_valid_till):
        """
        Sets the definition_valid_till of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param definition_valid_till: The definition_valid_till of this CouponDefinition.
        :type: datetime
        """

        self._definition_valid_till = definition_valid_till

    @property
    def instance_duration_period(self):
        """
        Gets the instance_duration_period of this CouponDefinition.
        { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The instance_duration_period of this CouponDefinition.
        :rtype: str
        """
        return self._instance_duration_period

    @instance_duration_period.setter
    def instance_duration_period(self, instance_duration_period):
        """
        Sets the instance_duration_period of this CouponDefinition.
        { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param instance_duration_period: The instance_duration_period of this CouponDefinition.
        :type: str
        """
        allowed_values = ["minutes", "hours", "days", "months", "years", "periods"]
        if instance_duration_period not in allowed_values:
            raise ValueError(
                "Invalid value for `instance_duration_period` ({0}), must be one of {1}"
                .format(instance_duration_period, allowed_values)
            )

        self._instance_duration_period = instance_duration_period

    @property
    def instance_duration(self):
        """
        Gets the instance_duration of this CouponDefinition.
        { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The instance_duration of this CouponDefinition.
        :rtype: int
        """
        return self._instance_duration

    @instance_duration.setter
    def instance_duration(self, instance_duration):
        """
        Sets the instance_duration of this CouponDefinition.
        { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param instance_duration: The instance_duration of this CouponDefinition.
        :type: int
        """

        self._instance_duration = instance_duration

    @property
    def fixed_end_date(self):
        """
        Gets the fixed_end_date of this CouponDefinition.
        { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The fixed_end_date of this CouponDefinition.
        :rtype: datetime
        """
        return self._fixed_end_date

    @fixed_end_date.setter
    def fixed_end_date(self, fixed_end_date):
        """
        Sets the fixed_end_date of this CouponDefinition.
        { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param fixed_end_date: The fixed_end_date of this CouponDefinition.
        :type: datetime
        """

        self._fixed_end_date = fixed_end_date

    @property
    def state(self):
        """
        Gets the state of this CouponDefinition.
        { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The state of this CouponDefinition.
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """
        Sets the state of this CouponDefinition.
        { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param state: The state of this CouponDefinition.
        :type: str
        """
        allowed_values = ["development", "production", "deleted"]
        if state not in allowed_values:
            raise ValueError(
                "Invalid value for `state` ({0}), must be one of {1}"
                .format(state, allowed_values)
            )

        self._state = state

    @property
    def modifiers(self):
        """
        Gets the modifiers of this CouponDefinition.
        { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The modifiers of this CouponDefinition.
        :rtype: list[CouponModifierBase]
        """
        return self._modifiers

    @modifiers.setter
    def modifiers(self, modifiers):
        """
        Sets the modifiers of this CouponDefinition.
        { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param modifiers: The modifiers of this CouponDefinition.
        :type: list[CouponModifierBase]
        """

        self._modifiers = modifiers

    @property
    def rules(self):
        """
        Gets the rules of this CouponDefinition.
        { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The rules of this CouponDefinition.
        :rtype: list[CouponRule]
        """
        return self._rules

    @rules.setter
    def rules(self, rules):
        """
        Sets the rules of this CouponDefinition.
        { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param rules: The rules of this CouponDefinition.
        :type: list[CouponRule]
        """

        self._rules = rules

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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

# coding: utf-8

"""
    BillForward REST API


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

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from pprint import pformat
from six import iteritems
import re


class CouponDefinition(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, created=None, changed_by=None, updated=None, id=None, crm_id=None, organization_id=None, name=None, description=None, customer_code=None, target=None, currency=None, definition_valid_from=None, definition_valid_till=None, instance_duration_period=None, instance_duration=None, fixed_end_date=None, state=None, modifiers=None, rules=None):
        """
        CouponDefinition - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'created': 'datetime',
            'changed_by': 'str',
            'updated': 'datetime',
            'id': 'str',
            'crm_id': 'str',
            'organization_id': 'str',
            'name': 'str',
            'description': 'str',
            'customer_code': 'str',
            'target': 'str',
            'currency': 'str',
            'definition_valid_from': 'datetime',
            'definition_valid_till': 'datetime',
            'instance_duration_period': 'str',
            'instance_duration': 'int',
            'fixed_end_date': 'datetime',
            'state': 'str',
            'modifiers': 'list[CouponModifierBase]',
            'rules': 'list[CouponRule]'
        }

        self.attribute_map = {
            'created': 'created',
            'changed_by': 'changedBy',
            'updated': 'updated',
            'id': 'id',
            'crm_id': 'crmID',
            'organization_id': 'organizationID',
            'name': 'name',
            'description': 'description',
            'customer_code': 'customerCode',
            'target': 'target',
            'currency': 'currency',
            'definition_valid_from': 'definitionValidFrom',
            'definition_valid_till': 'definitionValidTill',
            'instance_duration_period': 'instanceDurationPeriod',
            'instance_duration': 'instanceDuration',
            'fixed_end_date': 'fixedEndDate',
            'state': 'state',
            'modifiers': 'modifiers',
            'rules': 'rules'
        }

        self._created = created
        self._changed_by = changed_by
        self._updated = updated
        self._id = id
        self._crm_id = crm_id
        self._organization_id = organization_id
        self._name = name
        self._description = description
        self._customer_code = customer_code
        self._target = target
        self._currency = currency
        self._definition_valid_from = definition_valid_from
        self._definition_valid_till = definition_valid_till
        self._instance_duration_period = instance_duration_period
        self._instance_duration = instance_duration
        self._fixed_end_date = fixed_end_date
        self._state = state
        self._modifiers = modifiers
        self._rules = rules

    @property
    def created(self):
        """
        Gets the created of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }

        :return: The created of this CouponDefinition.
        :rtype: datetime
        """
        return self._created

    @created.setter
    def created(self, created):
        """
        Sets the created of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }

        :param created: The created of this CouponDefinition.
        :type: datetime
        """

        self._created = created

    @property
    def changed_by(self):
        """
        Gets the changed_by of this CouponDefinition.
        { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }

        :return: The changed_by of this CouponDefinition.
        :rtype: str
        """
        return self._changed_by

    @changed_by.setter
    def changed_by(self, changed_by):
        """
        Sets the changed_by of this CouponDefinition.
        { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }

        :param changed_by: The changed_by of this CouponDefinition.
        :type: str
        """

        self._changed_by = changed_by

    @property
    def updated(self):
        """
        Gets the updated of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }

        :return: The updated of this CouponDefinition.
        :rtype: datetime
        """
        return self._updated

    @updated.setter
    def updated(self, updated):
        """
        Sets the updated of this CouponDefinition.
        { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }

        :param updated: The updated of this CouponDefinition.
        :type: datetime
        """

        self._updated = updated

    @property
    def id(self):
        """
        Gets the id of this CouponDefinition.
        { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The id of this CouponDefinition.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this CouponDefinition.
        { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param id: The id of this CouponDefinition.
        :type: str
        """

        self._id = id

    @property
    def crm_id(self):
        """
        Gets the crm_id of this CouponDefinition.
        { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The crm_id of this CouponDefinition.
        :rtype: str
        """
        return self._crm_id

    @crm_id.setter
    def crm_id(self, crm_id):
        """
        Sets the crm_id of this CouponDefinition.
        { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param crm_id: The crm_id of this CouponDefinition.
        :type: str
        """

        self._crm_id = crm_id

    @property
    def organization_id(self):
        """
        Gets the organization_id of this CouponDefinition.
        { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The organization_id of this CouponDefinition.
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """
        Sets the organization_id of this CouponDefinition.
        { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param organization_id: The organization_id of this CouponDefinition.
        :type: str
        """

        self._organization_id = organization_id

    @property
    def name(self):
        """
        Gets the name of this CouponDefinition.
        { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The name of this CouponDefinition.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this CouponDefinition.
        { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param name: The name of this CouponDefinition.
        :type: str
        """

        self._name = name

    @property
    def description(self):
        """
        Gets the description of this CouponDefinition.
        { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The description of this CouponDefinition.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """
        Sets the description of this CouponDefinition.
        { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param description: The description of this CouponDefinition.
        :type: str
        """

        self._description = description

    @property
    def customer_code(self):
        """
        Gets the customer_code of this CouponDefinition.
        { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The customer_code of this CouponDefinition.
        :rtype: str
        """
        return self._customer_code

    @customer_code.setter
    def customer_code(self, customer_code):
        """
        Sets the customer_code of this CouponDefinition.
        { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param customer_code: The customer_code of this CouponDefinition.
        :type: str
        """

        self._customer_code = customer_code

    @property
    def target(self):
        """
        Gets the target of this CouponDefinition.
        { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The target of this CouponDefinition.
        :rtype: str
        """
        return self._target

    @target.setter
    def target(self, target):
        """
        Sets the target of this CouponDefinition.
        { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param target: The target of this CouponDefinition.
        :type: str
        """
        allowed_values = ["product", "account"]
        if target not in allowed_values:
            raise ValueError(
                "Invalid value for `target` ({0}), must be one of {1}"
                .format(target, allowed_values)
            )

        self._target = target

    @property
    def currency(self):
        """
        Gets the currency of this CouponDefinition.
        { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The currency of this CouponDefinition.
        :rtype: str
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """
        Sets the currency of this CouponDefinition.
        { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param currency: The currency of this CouponDefinition.
        :type: str
        """

        self._currency = currency

    @property
    def definition_valid_from(self):
        """
        Gets the definition_valid_from of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The definition_valid_from of this CouponDefinition.
        :rtype: datetime
        """
        return self._definition_valid_from

    @definition_valid_from.setter
    def definition_valid_from(self, definition_valid_from):
        """
        Sets the definition_valid_from of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param definition_valid_from: The definition_valid_from of this CouponDefinition.
        :type: datetime
        """

        self._definition_valid_from = definition_valid_from

    @property
    def definition_valid_till(self):
        """
        Gets the definition_valid_till of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The definition_valid_till of this CouponDefinition.
        :rtype: datetime
        """
        return self._definition_valid_till

    @definition_valid_till.setter
    def definition_valid_till(self, definition_valid_till):
        """
        Sets the definition_valid_till of this CouponDefinition.
        { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param definition_valid_till: The definition_valid_till of this CouponDefinition.
        :type: datetime
        """

        self._definition_valid_till = definition_valid_till

    @property
    def instance_duration_period(self):
        """
        Gets the instance_duration_period of this CouponDefinition.
        { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The instance_duration_period of this CouponDefinition.
        :rtype: str
        """
        return self._instance_duration_period

    @instance_duration_period.setter
    def instance_duration_period(self, instance_duration_period):
        """
        Sets the instance_duration_period of this CouponDefinition.
        { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param instance_duration_period: The instance_duration_period of this CouponDefinition.
        :type: str
        """
        allowed_values = ["minutes", "hours", "days", "months", "years", "periods"]
        if instance_duration_period not in allowed_values:
            raise ValueError(
                "Invalid value for `instance_duration_period` ({0}), must be one of {1}"
                .format(instance_duration_period, allowed_values)
            )

        self._instance_duration_period = instance_duration_period

    @property
    def instance_duration(self):
        """
        Gets the instance_duration of this CouponDefinition.
        { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The instance_duration of this CouponDefinition.
        :rtype: int
        """
        return self._instance_duration

    @instance_duration.setter
    def instance_duration(self, instance_duration):
        """
        Sets the instance_duration of this CouponDefinition.
        { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param instance_duration: The instance_duration of this CouponDefinition.
        :type: int
        """

        self._instance_duration = instance_duration

    @property
    def fixed_end_date(self):
        """
        Gets the fixed_end_date of this CouponDefinition.
        { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The fixed_end_date of this CouponDefinition.
        :rtype: datetime
        """
        return self._fixed_end_date

    @fixed_end_date.setter
    def fixed_end_date(self, fixed_end_date):
        """
        Sets the fixed_end_date of this CouponDefinition.
        { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param fixed_end_date: The fixed_end_date of this CouponDefinition.
        :type: datetime
        """

        self._fixed_end_date = fixed_end_date

    @property
    def state(self):
        """
        Gets the state of this CouponDefinition.
        { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The state of this CouponDefinition.
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """
        Sets the state of this CouponDefinition.
        { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param state: The state of this CouponDefinition.
        :type: str
        """
        allowed_values = ["development", "production", "deleted"]
        if state not in allowed_values:
            raise ValueError(
                "Invalid value for `state` ({0}), must be one of {1}"
                .format(state, allowed_values)
            )

        self._state = state

    @property
    def modifiers(self):
        """
        Gets the modifiers of this CouponDefinition.
        { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The modifiers of this CouponDefinition.
        :rtype: list[CouponModifierBase]
        """
        return self._modifiers

    @modifiers.setter
    def modifiers(self, modifiers):
        """
        Sets the modifiers of this CouponDefinition.
        { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param modifiers: The modifiers of this CouponDefinition.
        :type: list[CouponModifierBase]
        """

        self._modifiers = modifiers

    @property
    def rules(self):
        """
        Gets the rules of this CouponDefinition.
        { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The rules of this CouponDefinition.
        :rtype: list[CouponRule]
        """
        return self._rules

    @rules.setter
    def rules(self, rules):
        """
        Sets the rules of this CouponDefinition.
        { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param rules: The rules of this CouponDefinition.
        :type: list[CouponRule]
        """

        self._rules = rules

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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

# coding: utf-8 BillForward REST API       OpenAPI spec version: 1.0.0          Generated by: https://github.com/swagger-api/swagger-codegen.git      Licensed under the Apache License, Version 2.0 (the "License");     you may not use this file except in compliance with the License.     You may obtain a copy of the License at          http://www.apache.org/licenses/LICENSE-2.0      Unless required by applicable law or agreed to in writing, software     distributed under the License is distributed on an "AS IS" BASIS,     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     See the License for the specific language governing permissions and     limitations under the License. NOTE: This class is auto generated by the swagger code generator program.     Do not edit the class manually. CouponDefinition - a model defined in Swagger          :param dict swaggerTypes: The key is attribute name                                   and the value is attribute type.         :param dict attributeMap: The key is attribute name                                   and the value is json key in definition. Gets the created of this CouponDefinition.         { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }          :return: The created of this CouponDefinition.         :rtype: datetime Sets the created of this CouponDefinition.         { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }          :param created: The created of this CouponDefinition.         :type: datetime Gets the changed_by of this CouponDefinition.         { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }          :return: The changed_by of this CouponDefinition.         :rtype: str Sets the changed_by of this CouponDefinition.         { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }          :param changed_by: The changed_by of this CouponDefinition.         :type: str Gets the updated of this CouponDefinition.         { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }          :return: The updated of this CouponDefinition.         :rtype: datetime Sets the updated of this CouponDefinition.         { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }          :param updated: The updated of this CouponDefinition.         :type: datetime Gets the id of this CouponDefinition.         { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The id of this CouponDefinition.         :rtype: str Sets the id of this CouponDefinition.         { \"description\" : \"ID of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param id: The id of this CouponDefinition.         :type: str Gets the crm_id of this CouponDefinition.         { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The crm_id of this CouponDefinition.         :rtype: str Sets the crm_id of this CouponDefinition.         { \"description\" : \"CRM ID of the product-rate-plan.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param crm_id: The crm_id of this CouponDefinition.         :type: str Gets the organization_id of this CouponDefinition.         { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The organization_id of this CouponDefinition.         :rtype: str Sets the organization_id of this CouponDefinition.         { \"description\" : \"ID of the organization associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param organization_id: The organization_id of this CouponDefinition.         :type: str Gets the name of this CouponDefinition.         { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The name of this CouponDefinition.         :rtype: str Sets the name of this CouponDefinition.         { \"description\" : \"The human readable name of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param name: The name of this CouponDefinition.         :type: str Gets the description of this CouponDefinition.         { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The description of this CouponDefinition.         :rtype: str Sets the description of this CouponDefinition.         { \"description\" : \"The human readable description of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param description: The description of this CouponDefinition.         :type: str Gets the customer_code of this CouponDefinition.         { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The customer_code of this CouponDefinition.         :rtype: str Sets the customer_code of this CouponDefinition.         { \"description\" : \"The customerCode associated with the organization.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param customer_code: The customer_code of this CouponDefinition.         :type: str Gets the target of this CouponDefinition.         { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The target of this CouponDefinition.         :rtype: str Sets the target of this CouponDefinition.         { \"description\" : \"The target of the coupon-definition. Currently coupon-definitions can only target products.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param target: The target of this CouponDefinition.         :type: str Gets the currency of this CouponDefinition.         { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The currency of this CouponDefinition.         :rtype: str Sets the currency of this CouponDefinition.         { \"description\" : \"The currency of the coupon-definition specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param currency: The currency of this CouponDefinition.         :type: str Gets the definition_valid_from of this CouponDefinition.         { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The definition_valid_from of this CouponDefinition.         :rtype: datetime Sets the definition_valid_from of this CouponDefinition.         { \"description\" : \"The UTC DateTime that the coupon-definition is valid from.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param definition_valid_from: The definition_valid_from of this CouponDefinition.         :type: datetime Gets the definition_valid_till of this CouponDefinition.         { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The definition_valid_till of this CouponDefinition.         :rtype: datetime Sets the definition_valid_till of this CouponDefinition.         { \"description\" : \"The UTC DateTime that the coupon-definition is valid until.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param definition_valid_till: The definition_valid_till of this CouponDefinition.         :type: datetime Gets the instance_duration_period of this CouponDefinition.         { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The instance_duration_period of this CouponDefinition.         :rtype: str Sets the instance_duration_period of this CouponDefinition.         { \"description\" : \"instanceDurationPeriod\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param instance_duration_period: The instance_duration_period of this CouponDefinition.         :type: str Gets the instance_duration of this CouponDefinition.         { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The instance_duration of this CouponDefinition.         :rtype: int Sets the instance_duration of this CouponDefinition.         { \"description\" : \"instanceDuration\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param instance_duration: The instance_duration of this CouponDefinition.         :type: int Gets the fixed_end_date of this CouponDefinition.         { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The fixed_end_date of this CouponDefinition.         :rtype: datetime Sets the fixed_end_date of this CouponDefinition.         { \"description\" : \"The UTC DateTime specifying the fixed end date of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param fixed_end_date: The fixed_end_date of this CouponDefinition.         :type: datetime Gets the state of this CouponDefinition.         { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The state of this CouponDefinition.         :rtype: str Sets the state of this CouponDefinition.         { \"description\" : \"The current state of the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param state: The state of this CouponDefinition.         :type: str Gets the modifiers of this CouponDefinition.         { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The modifiers of this CouponDefinition.         :rtype: list[CouponModifierBase] Sets the modifiers of this CouponDefinition.         { \"description\" : \"The collection of coupon-modifiers associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param modifiers: The modifiers of this CouponDefinition.         :type: list[CouponModifierBase] Gets the rules of this CouponDefinition.         { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The rules of this CouponDefinition.         :rtype: list[CouponRule] Sets the rules of this CouponDefinition.         { \"description\" : \"The collection of coupon-rules associated with the coupon-definition.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param rules: The rules of this CouponDefinition.         :type: list[CouponRule] Returns the model properties as a dict Returns the string representation of the model For `print` and `pprint` Returns true if both objects are equal Returns true if both objects are not equal