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

"""
instagramapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from instagramapi.api_helper import APIHelper
from instagramapi.models.image_info import ImageInfo


class ImagesData(object):

    """Implementation of the 'ImagesData' model.

    Attributes:
        low_resolution (ImageInfo): The model property of type ImageInfo.
        standard_resolution (ImageInfo): The model property of type ImageInfo.
        thumbnail (ImageInfo): The model property of type ImageInfo.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "low_resolution": 'low_resolution',
        "standard_resolution": 'standard_resolution',
        "thumbnail": 'thumbnail'
    }

    _optionals = [
        'low_resolution',
        'standard_resolution',
        'thumbnail',
    ]

    def __init__(self,
                 low_resolution=APIHelper.SKIP,
                 standard_resolution=APIHelper.SKIP,
                 thumbnail=APIHelper.SKIP):
        """Constructor for the ImagesData class"""

        # Initialize members of the class
        if low_resolution is not APIHelper.SKIP:
            self.low_resolution = low_resolution 
        if standard_resolution is not APIHelper.SKIP:
            self.standard_resolution = standard_resolution 
        if thumbnail is not APIHelper.SKIP:
            self.thumbnail = thumbnail 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        low_resolution = ImageInfo.from_dictionary(dictionary.get('low_resolution')) if 'low_resolution' in dictionary.keys() else APIHelper.SKIP
        standard_resolution = ImageInfo.from_dictionary(dictionary.get('standard_resolution')) if 'standard_resolution' in dictionary.keys() else APIHelper.SKIP
        thumbnail = ImageInfo.from_dictionary(dictionary.get('thumbnail')) if 'thumbnail' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(low_resolution,
                   standard_resolution,
                   thumbnail)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'low_resolution={(self.low_resolution if hasattr(self, "low_resolution") else None)!r}, '
                f'standard_resolution={(self.standard_resolution if hasattr(self, "standard_resolution") else None)!r}, '
                f'thumbnail={(self.thumbnail if hasattr(self, "thumbnail") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'low_resolution={(self.low_resolution if hasattr(self, "low_resolution") else None)!s}, '
                f'standard_resolution={(self.standard_resolution if hasattr(self, "standard_resolution") else None)!s}, '
                f'thumbnail={(self.thumbnail if hasattr(self, "thumbnail") else None)!s})')
