# Path: yak/rest_social_auth/backends/base.py
# class ExtraDataAbstractMixin(object, metaclass=abc.ABCMeta):
#     """
#     Ensure that backends define these methods. Used in pipeline to save extra data on the user model.
#     """
# 
#     @abc.abstractmethod
#     def save_extra_data(response, user):
#         return
# 
#     @abc.abstractmethod
#     def get_profile_image(strategy, details, response, uid, user, social, is_new=False, *args, **kwargs):
#         return
# 
# class ExtraActionsAbstractMixin(object, metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def post(user_social_auth, social_obj):
#         return
# 
#     @abc.abstractmethod
#     def get_friends(user_social_auth):
#         return


from instagram import InstagramAPI, helper
from social_core.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin


class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
    @staticmethod
    def save_extra_data(response, user):
        if response['data']['bio']:
            user.about = response['data']['bio']

        user.save()

    @staticmethod
    def get_profile_image(strategy, details, response, uid, user, social, is_new=False, *args, **kwargs):
        image_url = response['data']['profile_picture']
        return image_url

    @staticmethod
    def post(user_social_auth, social_obj):
        return

    @staticmethod

# Path: yak/rest_social_auth/backends/base.py
# class ExtraDataAbstractMixin(object, metaclass=abc.ABCMeta):
#     """
#     Ensure that backends define these methods. Used in pipeline to save extra data on the user model.
#     """
# 
#     @abc.abstractmethod
#     def save_extra_data(response, user):
#         return
# 
#     @abc.abstractmethod
#     def get_profile_image(strategy, details, response, uid, user, social, is_new=False, *args, **kwargs):
#         return
# 
# class ExtraActionsAbstractMixin(object, metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def post(user_social_auth, social_obj):
#         return
# 
#     @abc.abstractmethod
#     def get_friends(user_social_auth):
#         return


# Path: yak/rest_social_auth/backends/yak_instagram.py
from instagram import InstagramAPI, helper
from social_core.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin



class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
    @staticmethod
    def save_extra_data(response, user):
        if response['data']['bio']:
            user.about = response['data']['bio']

        user.save()

    @staticmethod
    def get_profile_image(strategy, details, response, uid, user, social, is_new=False, *args, **kwargs):
        image_url = response['data']['profile_picture']
        return image_url

    @staticmethod
    def post(user_social_auth, social_obj):
        return

    @staticmethod

    def get_friends(user_social_auth):