import json

from flask import jsonify, session
from requests_oauthlib import OAuth2Session

from settings import TODOIST_CLIENT_ID, TODOIST_CLIENT_SECRET


def get_resources(resource_types: list = ["all"]):
    data = {
        "token": session["oauth_token"],
        "sync_token": "*",
        "resource_types": json.dumps(resource_types),
    }
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session["oauth_token"])
    resources = todoist.post("https://api.todoist.com/sync/v8/sync", data=data).json()
    return resources


def process_commands(commands: list):
    data = {
        "commands": json.dumps(commands),
    }
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session["oauth_token"])
    response = todoist.post("https://api.todoist.com/sync/v8/sync", data=data).json()
    return jsonify(response)

300adb935276e8d2d7db47dcff64f76836c2acf4
<mask token>

<mask token>


def process_commands(commands: list):
    data = {'commands': json.dumps(commands)}
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session['oauth_token'])
    response = todoist.post('https://api.todoist.com/sync/v8/sync', data=data
        ).json()
    return jsonify(response)

<mask token>


def get_resources(resource_types: list=['all']):
    data = {'token': session['oauth_token'], 'sync_token': '*',
        'resource_types': json.dumps(resource_types)}
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session['oauth_token'])
    resources = todoist.post('https://api.todoist.com/sync/v8/sync', data=data
        ).json()
    return resources


def process_commands(commands: list):
    data = {'commands': json.dumps(commands)}
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session['oauth_token'])
    response = todoist.post('https://api.todoist.com/sync/v8/sync', data=data
        ).json()
    return jsonify(response)

import json
from flask import jsonify, session
from requests_oauthlib import OAuth2Session
from settings import TODOIST_CLIENT_ID, TODOIST_CLIENT_SECRET


def get_resources(resource_types: list=['all']):
    data = {'token': session['oauth_token'], 'sync_token': '*',
        'resource_types': json.dumps(resource_types)}
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session['oauth_token'])
    resources = todoist.post('https://api.todoist.com/sync/v8/sync', data=data
        ).json()
    return resources


def process_commands(commands: list):
    data = {'commands': json.dumps(commands)}
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session['oauth_token'])
    response = todoist.post('https://api.todoist.com/sync/v8/sync', data=data
        ).json()
    return jsonify(response)

import json

from flask import jsonify, session
from requests_oauthlib import OAuth2Session

from settings import TODOIST_CLIENT_ID, TODOIST_CLIENT_SECRET


def get_resources(resource_types: list = ["all"]):
    data = {
        "token": session["oauth_token"],
        "sync_token": "*",
        "resource_types": json.dumps(resource_types),
    }
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session["oauth_token"])
    resources = todoist.post("https://api.todoist.com/sync/v8/sync", data=data).json()
    return resources


def process_commands(commands: list):
    data = {
        "commands": json.dumps(commands),
    }
    todoist = OAuth2Session(TODOIST_CLIENT_ID, token=session["oauth_token"])
    response = todoist.post("https://api.todoist.com/sync/v8/sync", data=data).json()
    return jsonify(response)
