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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.fee
import apimaticcalculatorlatest.models.taxes

class FeeTax(object):

    """Implementation of the 'FeeTax' model.

    TODO: type model description here.

    Attributes:
        product_id (int): ID of the product
        fees (list of Fee): List of models
        taxes (list of Taxes): List of models

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "product_id":'productId',
        "fees":'fees',
        "taxes":'taxes'
    }

    def __init__(self,
                 product_id=None,
                 fees=None,
                 taxes=None):
        """Constructor for the FeeTax class"""

        # Initialize members of the class
        self.product_id = product_id
        self.fees = fees
        self.taxes = taxes


    @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
        product_id = dictionary.get('productId')
        fees = None
        if dictionary.get('fees') != None:
            fees = list()
            for structure in dictionary.get('fees'):
                fees.append(apimaticcalculatorlatest.models.fee.Fee.from_dictionary(structure))
        taxes = None
        if dictionary.get('taxes') != None:
            taxes = list()
            for structure in dictionary.get('taxes'):
                taxes.append(apimaticcalculatorlatest.models.taxes.Taxes.from_dictionary(structure))

        # Return an object of this model
        return cls(product_id,
                   fees,
                   taxes)


