<gh_stars>1-10
# 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 Payment(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, payment_method_id=None, invoice_id=None, organization_id=None, gateway=None, currency=None, nominal_value=None, actual_value=None, remaining_nominal_value=None, payment_received=None, refunded_value=None, refund_id=None, type=None):
        """
        Payment - 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',
            'payment_method_id': 'str',
            'invoice_id': 'str',
            'organization_id': 'str',
            'gateway': 'str',
            'currency': 'str',
            'nominal_value': 'float',
            'actual_value': 'float',
            'remaining_nominal_value': 'float',
            'payment_received': 'datetime',
            'refunded_value': 'float',
            'refund_id': 'str',
            'type': 'str'
        }

        self.attribute_map = {
            'created': 'created',
            'changed_by': 'changedBy',
            'updated': 'updated',
            'id': 'id',
            'crm_id': 'crmID',
            'payment_method_id': 'paymentMethodID',
            'invoice_id': 'invoiceID',
            'organization_id': 'organizationID',
            'gateway': 'gateway',
            'currency': 'currency',
            'nominal_value': 'nominalValue',
            'actual_value': 'actualValue',
            'remaining_nominal_value': 'remainingNominalValue',
            'payment_received': 'paymentReceived',
            'refunded_value': 'refundedValue',
            'refund_id': 'refundID',
            'type': 'type'
        }

        self._created = created
        self._changed_by = changed_by
        self._updated = updated
        self._id = id
        self._crm_id = crm_id
        self._payment_method_id = payment_method_id
        self._invoice_id = invoice_id
        self._organization_id = organization_id
        self._gateway = gateway
        self._currency = currency
        self._nominal_value = nominal_value
        self._actual_value = actual_value
        self._remaining_nominal_value = remaining_nominal_value
        self._payment_received = payment_received
        self._refunded_value = refunded_value
        self._refund_id = refund_id
        self._type = type

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

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

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

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

        self._created = created

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

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

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

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

        self._changed_by = changed_by

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

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

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

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

        self._updated = updated

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

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

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

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

        self._id = id

    @property
    def crm_id(self):
        """
        Gets the crm_id of this Payment.
        { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

    @crm_id.setter
    def crm_id(self, crm_id):
        """
        Sets the crm_id of this Payment.
        { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

        self._crm_id = crm_id

    @property
    def payment_method_id(self):
        """
        Gets the payment_method_id of this Payment.
        { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The payment_method_id of this Payment.
        :rtype: str
        """
        return self._payment_method_id

    @payment_method_id.setter
    def payment_method_id(self, payment_method_id):
        """
        Sets the payment_method_id of this Payment.
        { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param payment_method_id: The payment_method_id of this Payment.
        :type: str
        """

        self._payment_method_id = payment_method_id

    @property
    def invoice_id(self):
        """
        Gets the invoice_id of this Payment.
        { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The invoice_id of this Payment.
        :rtype: str
        """
        return self._invoice_id

    @invoice_id.setter
    def invoice_id(self, invoice_id):
        """
        Sets the invoice_id of this Payment.
        { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param invoice_id: The invoice_id of this Payment.
        :type: str
        """

        self._invoice_id = invoice_id

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

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

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

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

        self._organization_id = organization_id

    @property
    def gateway(self):
        """
        Gets the gateway of this Payment.
        { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The gateway of this Payment.
        :rtype: str
        """
        return self._gateway

    @gateway.setter
    def gateway(self, gateway):
        """
        Sets the gateway of this Payment.
        { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param gateway: The gateway of this Payment.
        :type: str
        """
        allowed_values = ["cybersource_token", "card_vault", "paypal_simple", "locustworld", "free", "coupon", "credit_note", "stripe", "braintree", "balanced", "paypal", "billforward_test", "offline", "trial", "stripeACH", "authorizeNet", "spreedly", "sagePay", "trustCommerce", "payvision", "kash"]
        if gateway not in allowed_values:
            raise ValueError(
                "Invalid value for `gateway` ({0}), must be one of {1}"
                .format(gateway, allowed_values)
            )

        self._gateway = gateway

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

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

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

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

        self._currency = currency

    @property
    def nominal_value(self):
        """
        Gets the nominal_value of this Payment.
        { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The nominal_value of this Payment.
        :rtype: float
        """
        return self._nominal_value

    @nominal_value.setter
    def nominal_value(self, nominal_value):
        """
        Sets the nominal_value of this Payment.
        { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param nominal_value: The nominal_value of this Payment.
        :type: float
        """

        self._nominal_value = nominal_value

    @property
    def actual_value(self):
        """
        Gets the actual_value of this Payment.
        { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The actual_value of this Payment.
        :rtype: float
        """
        return self._actual_value

    @actual_value.setter
    def actual_value(self, actual_value):
        """
        Sets the actual_value of this Payment.
        { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param actual_value: The actual_value of this Payment.
        :type: float
        """

        self._actual_value = actual_value

    @property
    def remaining_nominal_value(self):
        """
        Gets the remaining_nominal_value of this Payment.
        { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The remaining_nominal_value of this Payment.
        :rtype: float
        """
        return self._remaining_nominal_value

    @remaining_nominal_value.setter
    def remaining_nominal_value(self, remaining_nominal_value):
        """
        Sets the remaining_nominal_value of this Payment.
        { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param remaining_nominal_value: The remaining_nominal_value of this Payment.
        :type: float
        """

        self._remaining_nominal_value = remaining_nominal_value

    @property
    def payment_received(self):
        """
        Gets the payment_received of this Payment.
        { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The payment_received of this Payment.
        :rtype: datetime
        """
        return self._payment_received

    @payment_received.setter
    def payment_received(self, payment_received):
        """
        Sets the payment_received of this Payment.
        { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param payment_received: The payment_received of this Payment.
        :type: datetime
        """

        self._payment_received = payment_received

    @property
    def refunded_value(self):
        """
        Gets the refunded_value of this Payment.
        { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The refunded_value of this Payment.
        :rtype: float
        """
        return self._refunded_value

    @refunded_value.setter
    def refunded_value(self, refunded_value):
        """
        Sets the refunded_value of this Payment.
        { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param refunded_value: The refunded_value of this Payment.
        :type: float
        """

        self._refunded_value = refunded_value

    @property
    def refund_id(self):
        """
        Gets the refund_id of this Payment.
        { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The refund_id of this Payment.
        :rtype: str
        """
        return self._refund_id

    @refund_id.setter
    def refund_id(self, refund_id):
        """
        Sets the refund_id of this Payment.
        { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param refund_id: The refund_id of this Payment.
        :type: str
        """

        self._refund_id = refund_id

    @property
    def type(self):
        """
        Gets the type of this Payment.
        { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The type of this Payment.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this Payment.
        { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

        self._type = type

    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 Payment(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, payment_method_id=None, invoice_id=None, organization_id=None, gateway=None, currency=None, nominal_value=None, actual_value=None, remaining_nominal_value=None, payment_received=None, refunded_value=None, refund_id=None, type=None):
        """
        Payment - 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',
            'payment_method_id': 'str',
            'invoice_id': 'str',
            'organization_id': 'str',
            'gateway': 'str',
            'currency': 'str',
            'nominal_value': 'float',
            'actual_value': 'float',
            'remaining_nominal_value': 'float',
            'payment_received': 'datetime',
            'refunded_value': 'float',
            'refund_id': 'str',
            'type': 'str'
        }

        self.attribute_map = {
            'created': 'created',
            'changed_by': 'changedBy',
            'updated': 'updated',
            'id': 'id',
            'crm_id': 'crmID',
            'payment_method_id': 'paymentMethodID',
            'invoice_id': 'invoiceID',
            'organization_id': 'organizationID',
            'gateway': 'gateway',
            'currency': 'currency',
            'nominal_value': 'nominalValue',
            'actual_value': 'actualValue',
            'remaining_nominal_value': 'remainingNominalValue',
            'payment_received': 'paymentReceived',
            'refunded_value': 'refundedValue',
            'refund_id': 'refundID',
            'type': 'type'
        }

        self._created = created
        self._changed_by = changed_by
        self._updated = updated
        self._id = id
        self._crm_id = crm_id
        self._payment_method_id = payment_method_id
        self._invoice_id = invoice_id
        self._organization_id = organization_id
        self._gateway = gateway
        self._currency = currency
        self._nominal_value = nominal_value
        self._actual_value = actual_value
        self._remaining_nominal_value = remaining_nominal_value
        self._payment_received = payment_received
        self._refunded_value = refunded_value
        self._refund_id = refund_id
        self._type = type

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

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

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

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

        self._created = created

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

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

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

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

        self._changed_by = changed_by

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

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

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

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

        self._updated = updated

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

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

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

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

        self._id = id

    @property
    def crm_id(self):
        """
        Gets the crm_id of this Payment.
        { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

    @crm_id.setter
    def crm_id(self, crm_id):
        """
        Sets the crm_id of this Payment.
        { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

        self._crm_id = crm_id

    @property
    def payment_method_id(self):
        """
        Gets the payment_method_id of this Payment.
        { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The payment_method_id of this Payment.
        :rtype: str
        """
        return self._payment_method_id

    @payment_method_id.setter
    def payment_method_id(self, payment_method_id):
        """
        Sets the payment_method_id of this Payment.
        { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param payment_method_id: The payment_method_id of this Payment.
        :type: str
        """

        self._payment_method_id = payment_method_id

    @property
    def invoice_id(self):
        """
        Gets the invoice_id of this Payment.
        { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The invoice_id of this Payment.
        :rtype: str
        """
        return self._invoice_id

    @invoice_id.setter
    def invoice_id(self, invoice_id):
        """
        Sets the invoice_id of this Payment.
        { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param invoice_id: The invoice_id of this Payment.
        :type: str
        """

        self._invoice_id = invoice_id

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

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

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

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

        self._organization_id = organization_id

    @property
    def gateway(self):
        """
        Gets the gateway of this Payment.
        { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The gateway of this Payment.
        :rtype: str
        """
        return self._gateway

    @gateway.setter
    def gateway(self, gateway):
        """
        Sets the gateway of this Payment.
        { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param gateway: The gateway of this Payment.
        :type: str
        """
        allowed_values = ["cybersource_token", "card_vault", "paypal_simple", "locustworld", "free", "coupon", "credit_note", "stripe", "braintree", "balanced", "paypal", "billforward_test", "offline", "trial", "stripeACH", "authorizeNet", "spreedly", "sagePay", "trustCommerce", "payvision", "kash"]
        if gateway not in allowed_values:
            raise ValueError(
                "Invalid value for `gateway` ({0}), must be one of {1}"
                .format(gateway, allowed_values)
            )

        self._gateway = gateway

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

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

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

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

        self._currency = currency

    @property
    def nominal_value(self):
        """
        Gets the nominal_value of this Payment.
        { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The nominal_value of this Payment.
        :rtype: float
        """
        return self._nominal_value

    @nominal_value.setter
    def nominal_value(self, nominal_value):
        """
        Sets the nominal_value of this Payment.
        { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param nominal_value: The nominal_value of this Payment.
        :type: float
        """

        self._nominal_value = nominal_value

    @property
    def actual_value(self):
        """
        Gets the actual_value of this Payment.
        { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The actual_value of this Payment.
        :rtype: float
        """
        return self._actual_value

    @actual_value.setter
    def actual_value(self, actual_value):
        """
        Sets the actual_value of this Payment.
        { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param actual_value: The actual_value of this Payment.
        :type: float
        """

        self._actual_value = actual_value

    @property
    def remaining_nominal_value(self):
        """
        Gets the remaining_nominal_value of this Payment.
        { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The remaining_nominal_value of this Payment.
        :rtype: float
        """
        return self._remaining_nominal_value

    @remaining_nominal_value.setter
    def remaining_nominal_value(self, remaining_nominal_value):
        """
        Sets the remaining_nominal_value of this Payment.
        { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param remaining_nominal_value: The remaining_nominal_value of this Payment.
        :type: float
        """

        self._remaining_nominal_value = remaining_nominal_value

    @property
    def payment_received(self):
        """
        Gets the payment_received of this Payment.
        { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The payment_received of this Payment.
        :rtype: datetime
        """
        return self._payment_received

    @payment_received.setter
    def payment_received(self, payment_received):
        """
        Sets the payment_received of this Payment.
        { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param payment_received: The payment_received of this Payment.
        :type: datetime
        """

        self._payment_received = payment_received

    @property
    def refunded_value(self):
        """
        Gets the refunded_value of this Payment.
        { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The refunded_value of this Payment.
        :rtype: float
        """
        return self._refunded_value

    @refunded_value.setter
    def refunded_value(self, refunded_value):
        """
        Sets the refunded_value of this Payment.
        { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param refunded_value: The refunded_value of this Payment.
        :type: float
        """

        self._refunded_value = refunded_value

    @property
    def refund_id(self):
        """
        Gets the refund_id of this Payment.
        { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The refund_id of this Payment.
        :rtype: str
        """
        return self._refund_id

    @refund_id.setter
    def refund_id(self, refund_id):
        """
        Sets the refund_id of this Payment.
        { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :param refund_id: The refund_id of this Payment.
        :type: str
        """

        self._refund_id = refund_id

    @property
    def type(self):
        """
        Gets the type of this Payment.
        { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

        :return: The type of this Payment.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this Payment.
        { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }

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

        self._type = type

    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. Payment - 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 Payment.         { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }          :return: The created of this Payment.         :rtype: datetime Sets the created of this Payment.         { \"description\" : \"The UTC DateTime when the object was created.\", \"verbs\":[] }          :param created: The created of this Payment.         :type: datetime Gets the changed_by of this Payment.         { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }          :return: The changed_by of this Payment.         :rtype: str Sets the changed_by of this Payment.         { \"description\" : \"ID of the user who last updated the entity.\", \"verbs\":[] }          :param changed_by: The changed_by of this Payment.         :type: str Gets the updated of this Payment.         { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }          :return: The updated of this Payment.         :rtype: datetime Sets the updated of this Payment.         { \"description\" : \"The UTC DateTime when the object was last updated.\", \"verbs\":[] }          :param updated: The updated of this Payment.         :type: datetime Gets the id of this Payment.         { \"description\" : \"ID of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The id of this Payment.         :rtype: str Sets the id of this Payment.         { \"description\" : \"ID of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param id: The id of this Payment.         :type: str Gets the crm_id of this Payment.         { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The crm_id of this Payment.         :rtype: str Sets the crm_id of this Payment.         { \"description\" : \"CRM ID of the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param crm_id: The crm_id of this Payment.         :type: str Gets the payment_method_id of this Payment.         { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The payment_method_id of this Payment.         :rtype: str Sets the payment_method_id of this Payment.         { \"description\" : \"ID of the payment method associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param payment_method_id: The payment_method_id of this Payment.         :type: str Gets the invoice_id of this Payment.         { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The invoice_id of this Payment.         :rtype: str Sets the invoice_id of this Payment.         { \"description\" : \"ID of the invoice associated with the payment. This may be null when a payment is not explicitly associated with an invoice. Payments may be used across multiple invoices.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param invoice_id: The invoice_id of this Payment.         :type: str Gets the organization_id of this Payment.         { \"description\" : \"ID of the organization associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The organization_id of this Payment.         :rtype: str Sets the organization_id of this Payment.         { \"description\" : \"ID of the organization associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param organization_id: The organization_id of this Payment.         :type: str Gets the gateway of this Payment.         { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The gateway of this Payment.         :rtype: str Sets the gateway of this Payment.         { \"description\" : \"Payment gateway associated with the payment\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param gateway: The gateway of this Payment.         :type: str Gets the currency of this Payment.         { \"description\" : \"The currency of the payment specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The currency of this Payment.         :rtype: str Sets the currency of this Payment.         { \"description\" : \"The currency of the payment specified by a three character ISO 4217 currency code.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param currency: The currency of this Payment.         :type: str Gets the nominal_value of this Payment.         { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The nominal_value of this Payment.         :rtype: float Sets the nominal_value of this Payment.         { \"description\" : \"Nominal value of the payment. This is the theoretical value of the payment, thus the value this payment can pay off an invoice. For example a coupon has a nominal value of the discount, and the actual value is zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param nominal_value: The nominal_value of this Payment.         :type: float Gets the actual_value of this Payment.         { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The actual_value of this Payment.         :rtype: float Sets the actual_value of this Payment.         { \"description\" : \"Actual monetary value of the payment. This is real value of the payment amount, thus the amount of currency received for this payment. A coupon has a real value of zero, even though the nominal amount it pays may be greater than zero.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param actual_value: The actual_value of this Payment.         :type: float Gets the remaining_nominal_value of this Payment.         { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The remaining_nominal_value of this Payment.         :rtype: float Sets the remaining_nominal_value of this Payment.         { \"description\" : \"Remaining nominal value of the payment not used. In the case when a payment is used across a range of invoices a payment may be used multiple times, each use reducing the available blance of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param remaining_nominal_value: The remaining_nominal_value of this Payment.         :type: float Gets the payment_received of this Payment.         { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The payment_received of this Payment.         :rtype: datetime Sets the payment_received of this Payment.         { \"description\" : \"UTC DateTime specifying when payment was received for the invoice.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param payment_received: The payment_received of this Payment.         :type: datetime Gets the refunded_value of this Payment.         { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The refunded_value of this Payment.         :rtype: float Sets the refunded_value of this Payment.         { \"description\" : \"Refunded nominal value of the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param refunded_value: The refunded_value of this Payment.         :type: float Gets the refund_id of this Payment.         { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The refund_id of this Payment.         :rtype: str Sets the refund_id of this Payment.         { \"description\" : \"ID of the refund associated with the payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param refund_id: The refund_id of this Payment.         :type: str Gets the type of this Payment.         { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :return: The type of this Payment.         :rtype: str Sets the type of this Payment.         { \"description\" : \"Type of payment.\", \"verbs\":[\"POST\",\"PUT\",\"GET\"] }          :param type: The type of this Payment.         :type: str 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