# 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 .Response import Response


class ConfigureResponse(Response):
    def __init__(self, response):
        self.upload_id = None
        self.media_id = None
        self.image_url = None
        self.media_code = None

        if self.STATUS_OK == response['status']:
            self.upload_id = response['upload_id']
            self.media_id = response['media']['id']

            # TODO see fix at danleyb2/Instagram-API#20
            self.image_url = response['media']['image_versions2']['candidates']['0']['url']
            self.media_code = response['media']['code']

# 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/ConfigureResponse.py
from .Response import Response



class ConfigureResponse(Response):
    def __init__(self, response):
        self.upload_id = None
        self.media_id = None
        self.image_url = None
        self.media_code = None

        if self.STATUS_OK == response['status']:
            self.upload_id = response['upload_id']
            self.media_id = response['media']['id']

            # TODO see fix at danleyb2/Instagram-API#20
            self.image_url = response['media']['image_versions2']['candidates']['0']['url']
            self.media_code = response['media']['code']

        else: