# -*- 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.
        subscription_item_id (string): Subscription Item Id
        quantity (int): TODO: type description here.
        name (string): 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',
        "subscription_item_id":'subscription_item_id',
        "quantity":'quantity',
        "name":'name'
    }

    def __init__(self,
                 amount=None,
                 description=None,
                 pricing_scheme=None,
                 price_bracket=None,
                 subscription_item_id=None,
                 quantity=None,
                 name=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.subscription_item_id = subscription_item_id
        self.quantity = quantity
        self.name = name


    @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
        subscription_item_id = dictionary.get('subscription_item_id')
        quantity = dictionary.get('quantity')
        name = dictionary.get('name')

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


