Пример #1
0
    def __init__(self, refresh_token):
        client_id = settings.FYLE_CLIENT_ID
        client_secret = settings.FYLE_CLIENT_SECRET
        base_url = settings.FYLE_BASE_URL

        self.connection = FyleSDK(base_url=base_url,
                                  client_id=client_id,
                                  client_secret=client_secret,
                                  refresh_token=refresh_token)
Пример #2
0
    def __init__(self, refresh_token):
        self.__base_url = os.environ.get("BASE_URL")
        self.__client_id = os.environ.get("CLIENT_ID")
        self.__client_secret = os.environ.get("CLIENT_SECRET")
        self.__refresh_token = refresh_token

        self.__connection = FyleSDK(base_url=self.__base_url,
                                    client_id=self.__client_id,
                                    client_secret=self.__client_secret,
                                    refresh_token=self.__refresh_token)
    def __init__(self, client_id, client_secret, base_url, refresh_token):
        self.__base_url = base_url
        self.__client_id = client_id
        self.__client_secret = client_secret
        self.__refresh_token = refresh_token

        self.__connection = FyleSDK(base_url=self.__base_url,
                                    client_id=self.__client_id,
                                    client_secret=self.__client_secret,
                                    refresh_token=self.__refresh_token)
Пример #4
0
def fyle_connect():
    """
    establish connection with fyle
    :return: fyle_connection
    """
    # Initializing FyleSDK
    fyle_connection = FyleSDK(
        base_url=os.environ.get('FYLE_TPA_BASE_URL'),
        client_id=os.environ.get('FYLE_TPA_CLIENT_ID'),
        client_secret=os.environ.get('FYLE_TPA_CLIENT_SECRET'),
        refresh_token=os.environ.get('FYLE_TPA_REFRESH_TOKEN'))
    return fyle_connection
Пример #5
0
def connect_to_fyle(workspace_id):
    """
    Returns verified instance of Fyle object that can invoke API calls
    :param workspace_id:
    :return:
    """
    refresh_token = FyleCredential.objects.get(
        workspace__id=workspace_id).fyle_auth.refresh_token
    connection = FyleSDK(base_url=FYLE_BASE_URL,
                         client_id=FYLE_CLIENT_ID,
                         client_secret=FYLE_CLIENT_SECRET,
                         refresh_token=refresh_token)
    return connection
Пример #6
0
    def __init__(self, refresh_token, workspace_id=None):
        client_id = settings.FYLE_CLIENT_ID
        client_secret = settings.FYLE_CLIENT_SECRET
        base_url = settings.FYLE_BASE_URL
        self.workspace_id = workspace_id

        self.connection = FyleSDK(
            base_url=base_url,
            client_id=client_id,
            client_secret=client_secret,
            refresh_token=refresh_token,
            jobs_url=settings.FYLE_JOBS_URL
        )
Пример #7
0
 def __init__(self, refresh_token):
     self.connection = FyleSDK(base_url=settings.BASE_URL,
                               client_id=settings.CLIENT_ID,
                               client_secret=settings.CLIENT_SECRET,
                               refresh_token=refresh_token)