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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.image

class ImageUrlList(object):

    """Implementation of the 'ImageUrlList' model.

    Model with list of URLs for one property

    Attributes:
        product_id (int): Id of the product
        images (list of Image): Images for property

    """

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

    def __init__(self,
                 product_id=None,
                 images=None):
        """Constructor for the ImageUrlList class"""

        # Initialize members of the class
        self.product_id = product_id
        self.images = images


    @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')
        images = None
        if dictionary.get('images') != None:
            images = list()
            for structure in dictionary.get('images'):
                images.append(apimaticcalculatorlatest.models.image.Image.from_dictionary(structure))

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


