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

"""
instagramapi

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


class UserShortInfo(object):

    """Implementation of the 'UserShortInfo' model.

    Attributes:
        full_name (str): User full name
        id (str): User ID
        profile_picture (str): URL to user profile picture
        username (str): User name, nickname

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "full_name": 'full_name',
        "id": 'id',
        "profile_picture": 'profile_picture',
        "username": 'username'
    }

    _optionals = [
        'full_name',
        'id',
        'profile_picture',
        'username',
    ]

    def __init__(self,
                 full_name=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 profile_picture=APIHelper.SKIP,
                 username=APIHelper.SKIP):
        """Constructor for the UserShortInfo class"""

        # Initialize members of the class
        if full_name is not APIHelper.SKIP:
            self.full_name = full_name 
        if id is not APIHelper.SKIP:
            self.id = id 
        if profile_picture is not APIHelper.SKIP:
            self.profile_picture = profile_picture 
        if username is not APIHelper.SKIP:
            self.username = username 

    @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
        full_name = dictionary.get("full_name") if dictionary.get("full_name") else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        profile_picture = dictionary.get("profile_picture") if dictionary.get("profile_picture") else APIHelper.SKIP
        username = dictionary.get("username") if dictionary.get("username") else APIHelper.SKIP
        # Return an object of this model
        return cls(full_name,
                   id,
                   profile_picture,
                   username)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'full_name={(self.full_name if hasattr(self, "full_name") else None)!r}, '
                f'id={(self.id if hasattr(self, "id") else None)!r}, '
                f'profile_picture={(self.profile_picture if hasattr(self, "profile_picture") else None)!r}, '
                f'username={(self.username if hasattr(self, "username") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'full_name={(self.full_name if hasattr(self, "full_name") else None)!s}, '
                f'id={(self.id if hasattr(self, "id") else None)!s}, '
                f'profile_picture={(self.profile_picture if hasattr(self, "profile_picture") else None)!s}, '
                f'username={(self.username if hasattr(self, "username") else None)!s})')
