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

"""
    mundiapi.models.get_order_item_response

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

class GetOrderItemResponse(object):

    """Implementation of the 'GetOrderItemResponse' model.

    Response object for getting an order item

    Attributes:
        amount (int): TODO: type description here.
        description (string): TODO: type description here.
        quantity (int): TODO: type description here.
        get_seller_response (GetSellerResponse): Seller data

    """

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

    def __init__(self,
                 amount=None,
                 description=None,
                 quantity=None,
                 get_seller_response=None):
        """Constructor for the GetOrderItemResponse class"""

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


    @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")
        quantity = dictionary.get("quantity")
        get_seller_response = mundiapi.models.get_seller_response.GetSellerResponse.from_dictionary(dictionary.get("GetSellerResponse")) if dictionary.get("GetSellerResponse") else None

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


