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

"""
    mundiapi.models.get_invoice_item_response

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io )
"""
import mundiapi.models.get_pricing_scheme_response
import mundiapi.models.get_price_bracket_response

class GetInvoiceItemResponse(object):

    """Implementation of the 'GetInvoiceItemResponse' model.

    Response object for getting an invoice item

    Attributes:
        amount (int): TODO: type description here.
        description (string): TODO: type description here.
        pricing_scheme (GetPricingSchemeResponse): TODO: type description
            here.
        price_bracket (GetPriceBracketResponse): TODO: type description here.
        quantity (int): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "amount" : "amount",
        "description" : "description",
        "pricing_scheme" : "pricing_scheme",
        "price_bracket" : "price_bracket",
        "quantity" : "quantity"
    }

    def __init__(self,
                 amount=None,
                 description=None,
                 pricing_scheme=None,
                 price_bracket=None,
                 quantity=None):
        """Constructor for the GetInvoiceItemResponse class"""

        # Initialize members of the class
        self.amount = amount
        self.description = description
        self.pricing_scheme = pricing_scheme
        self.price_bracket = price_bracket
        self.quantity = quantity


    @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
        amount = dictionary.get("amount")
        description = dictionary.get("description")
        pricing_scheme = mundiapi.models.get_pricing_scheme_response.GetPricingSchemeResponse.from_dictionary(dictionary.get("pricing_scheme")) if dictionary.get("pricing_scheme") else None
        price_bracket = mundiapi.models.get_price_bracket_response.GetPriceBracketResponse.from_dictionary(dictionary.get("price_bracket")) if dictionary.get("price_bracket") else None
        quantity = dictionary.get("quantity")

        # Return an object of this model
        return cls(amount,
                   description,
                   pricing_scheme,
                   price_bracket,
                   quantity)


