# Path: InstagramAPI/src/http/Response/Objects/HdProfilePicUrlInfo.py
# class HdProfilePicUrlInfo(object):
#     def __init__(self, response):
#         self.url = None
#         self.width = None
#         self.height = None
# 
#         self.url = response['url']
#         self.width = response['width']
#         self.height = response['height']
# 
#     def getUrl(self):
#         return self.url
# 
#     def getWidth(self):
#         return self.width
# 
#     def getHeight(self):
#         return self.height
# 
# Path: InstagramAPI/src/http/Response/Response.py
# class Response(object):
#     STATUS_OK = "ok"
#     STATUS_FAIL = "fail"
# 
#     status = None
#     message = None
#     fullResponse = None
# 
#     def setStatus(self, status):
#         self.status = status
# 
#     def getStatus(self):
#         return self.status
# 
#     def setMessage(self, message):
#         self.message = message
# 
#     def getMessage(self):
#         return self.message
# 
#     def setFullResponse(self, response):
#         self.fullResponse = response
# 
#     def getFullResponse(self):
#         return self.fullResponse
# 
#     def isOk(self):
#         return self.getStatus() == Response.STATUS_OK


from InstagramAPI.src.http.Response.Objects.HdProfilePicUrlInfo import HdProfilePicUrlInfo
from .Response import Response
                profile_pics_vers = []
                for profile_pic in response['user']['hd_profile_pic_versions']:
                    profile_pics_vers.append(HdProfilePicUrlInfo(profile_pic))

                self.hd_profile_pic_versions = profile_pics_vers

            self.biography = response['user']['biography']
            self.has_chaining = response['user']['has_chaining']
            self.media_count = response['user']['media_count']
            self.follower_count = response['user']['follower_count']
            self.pk = response['user']['pk']
            self.username = response['user']['username']
            if 'geo_media_count' in response['user']:
                self.geo_media_count = response['user']['geo_media_count']
            self.profile_pic_url = response['user']['profile_pic_url']
            if 'can_see_organic_insights' in response['user']:
                self.can_see_organic_insights = response['user']['can_see_organic_insights']

            self.is_private = response['user']['is_private']
            if 'is_favorite' in response['user']:
                self.is_favorite = response['user']['is_favorite']
            if 'is_verified' in response['user']:
                self.is_favorite = response['user']['is_verified']  # todo possible typo bug
            if 'can_convert_to_business' in response['user']:
                self.can_convert_to_business = response['user']['can_convert_to_business']

            self.is_business = response['user']['is_business']
            if 'show_insights_terms' in response['user']:
                self.show_insights_terms = response['user']['show_insights_terms']


# Path: InstagramAPI/src/http/Response/Objects/HdProfilePicUrlInfo.py
# class HdProfilePicUrlInfo(object):
#     def __init__(self, response):
#         self.url = None
#         self.width = None
#         self.height = None
# 
#         self.url = response['url']
#         self.width = response['width']
#         self.height = response['height']
# 
#     def getUrl(self):
#         return self.url
# 
#     def getWidth(self):
#         return self.width
# 
#     def getHeight(self):
#         return self.height
# 
# Path: InstagramAPI/src/http/Response/Response.py
# class Response(object):
#     STATUS_OK = "ok"
#     STATUS_FAIL = "fail"
# 
#     status = None
#     message = None
#     fullResponse = None
# 
#     def setStatus(self, status):
#         self.status = status
# 
#     def getStatus(self):
#         return self.status
# 
#     def setMessage(self, message):
#         self.message = message
# 
#     def getMessage(self):
#         return self.message
# 
#     def setFullResponse(self, response):
#         self.fullResponse = response
# 
#     def getFullResponse(self):
#         return self.fullResponse
# 
#     def isOk(self):
#         return self.getStatus() == Response.STATUS_OK


# Path: InstagramAPI/src/http/Response/UsernameInfoResponse.py
from InstagramAPI.src.http.Response.Objects.HdProfilePicUrlInfo import HdProfilePicUrlInfo
from .Response import Response

                profile_pics_vers = []
                for profile_pic in response['user']['hd_profile_pic_versions']:
                    profile_pics_vers.append(HdProfilePicUrlInfo(profile_pic))

                self.hd_profile_pic_versions = profile_pics_vers

            self.biography = response['user']['biography']
            self.has_chaining = response['user']['has_chaining']
            self.media_count = response['user']['media_count']
            self.follower_count = response['user']['follower_count']
            self.pk = response['user']['pk']
            self.username = response['user']['username']
            if 'geo_media_count' in response['user']:
                self.geo_media_count = response['user']['geo_media_count']
            self.profile_pic_url = response['user']['profile_pic_url']
            if 'can_see_organic_insights' in response['user']:
                self.can_see_organic_insights = response['user']['can_see_organic_insights']

            self.is_private = response['user']['is_private']
            if 'is_favorite' in response['user']:
                self.is_favorite = response['user']['is_favorite']
            if 'is_verified' in response['user']:
                self.is_favorite = response['user']['is_verified']  # todo possible typo bug
            if 'can_convert_to_business' in response['user']:
                self.can_convert_to_business = response['user']['can_convert_to_business']

            self.is_business = response['user']['is_business']
            if 'show_insights_terms' in response['user']:
                self.show_insights_terms = response['user']['show_insights_terms']


            self.hd_profile_pic_url_info = HdProfilePicUrlInfo(response['user']['hd_profile_pic_url_info'])