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

"""
billbeeapi

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


class BillbeeInterfacesBillbeeAPIModelProductImage(object):

    """Implementation of the 'Billbee.Interfaces.BillbeeAPI.Model.ProductImage' model.

    TODO: type model description here.

    Attributes:
        url (string): The url to the image
        is_default_image (bool): True if the image is / should be the default
            image
        position (int): The order of this image
        external_id (string): The id of this image from the original system

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "url": 'Url',
        "is_default_image": 'IsDefaultImage',
        "position": 'Position',
        "external_id": 'ExternalId'
    }

    def __init__(self,
                 url=None,
                 is_default_image=None,
                 position=None,
                 external_id=None):
        """Constructor for the BillbeeInterfacesBillbeeAPIModelProductImage class"""

        # Initialize members of the class
        self.url = url
        self.is_default_image = is_default_image
        self.position = position
        self.external_id = external_id

    @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
        url = dictionary.get('Url')
        is_default_image = dictionary.get('IsDefaultImage')
        position = dictionary.get('Position')
        external_id = dictionary.get('ExternalId')

        # Return an object of this model
        return cls(url,
                   is_default_image,
                   position,
                   external_id)
