# -*- coding: utf-8 -*-

"""
    apimaticcalculatorlatest

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""


class SplitPayment(object):

    """Implementation of the 'SplitPayment' model.

    TODO: type model description here.

    Attributes:
        deposit_type (DepositTypeEnum): First payment deposit type.
        value (float): First payment value
        second_payment_days (int): Number of days before check-in when second
            payment is required.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "deposit_type":'depositType',
        "value":'value',
        "second_payment_days":'secondPaymentDays'
    }

    def __init__(self,
                 deposit_type=None,
                 value=None,
                 second_payment_days=None):
        """Constructor for the SplitPayment class"""

        # Initialize members of the class
        self.deposit_type = deposit_type
        self.value = value
        self.second_payment_days = second_payment_days


    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object as
            obtained from the deserialization of the server's response. The keys
            MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        deposit_type = dictionary.get('depositType')
        value = dictionary.get('value')
        second_payment_days = dictionary.get('secondPaymentDays')

        # Return an object of this model
        return cls(deposit_type,
                   value,
                   second_payment_days)


