Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from appwrite.client import Client
from appwrite.services.foo import Foo
from appwrite.services.bar import Bar
from appwrite.services.general import General
client = Client()
foo = Foo(client)
bar = Bar(client)
general = General(client)
client.add_header('Origin', 'http://localhost')
client.set_self_signed()
# Foo Tests
print("GET:/v1/mock/tests/foo:passed")
response = foo.post('string', 123, ['string in array'])
print(response['result'])
response = foo.put('string', 123, ['string in array'])
print(response['result'])
from appwrite.client import Client
from appwrite.services.foo import Foo
from appwrite.services.bar import Bar
from appwrite.services.general import General
client = Client()
foo = Foo(client)
bar = Bar(client)
general = General(client)
client.add_header('Origin', 'http://localhost')
client.set_self_signed()
# Foo Tests
print("GET:/v1/mock/tests/foo:passed")
response = foo.post('string', 123, ['string in array'])
print(response['result'])
response = foo.put('string', 123, ['string in array'])
print(response['result'])
response = foo.patch('string', 123, ['string in array'])
from appwrite.client import Client
from appwrite.services.foo import Foo
from appwrite.services.bar import Bar
from appwrite.services.general import General
client = Client()
foo = Foo(client)
bar = Bar(client)
general = General(client)
client.add_header('Origin', 'http://localhost')
client.set_self_signed()
# Foo Tests
print("GET:/v1/mock/tests/foo:passed")
response = foo.post('string', 123, ['string in array'])
print(response['result'])
response = foo.put('string', 123, ['string in array'])
print(response['result'])
from appwrite.client import Client
from appwrite.services.foo import Foo
from appwrite.services.bar import Bar
from appwrite.services.general import General
client = Client()
foo = Foo(client)
bar = Bar(client)
general = General(client)
client.add_header('Origin', 'http://localhost')
client.set_self_signed()
# Foo Tests
print("GET:/v1/mock/tests/foo:passed")
response = foo.post('string', 123, ['string in array'])
print(response['result'])
response = foo.put('string', 123, ['string in array'])
print(response['result'])
response = foo.patch('string', 123, ['string in array'])
print(response['result'])
from ..service import Service
class Avatars(Service):
def __init__(self, client):
super(Avatars, self).__init__(client)
def get_browser(self, code, width=100, height=100, quality=100):
"""Get Browser Icon"""
params = {}
path = '/avatars/browsers/{code}'
path = path.replace('{code}', code)
params['width'] = width
params['height'] = height
params['quality'] = quality
return self.client.call('get', path, {
'content-type': 'application/json',
from ..service import Service
class Locale(Service):
def __init__(self, client):
super(Locale, self).__init__(client)
def get(self):
"""Get User Locale"""
params = {}
path = '/locale'
return self.client.call('get', path, {
'content-type': 'application/json',
}, params)
def get_continents(self):
"""List Continents"""
from ..service import Service
class Database(Service):
def __init__(self, client):
super(Database, self).__init__(client)
def list_collections(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Collections"""
params = {}
path = '/database/collections'
params['search'] = search
params['limit'] = limit
params['offset'] = offset
params['orderType'] = order_type
return self.client.call('get', path, {
'content-type': 'application/json',
from ..service import Service
class Auth(Service):
def __init__(self, client):
super(Auth, self).__init__(client)
def login(self, email, password, success='', failure=''):
"""Login"""
params = {}
path = '/auth/login'
params['email'] = email
params['password'] = password
params['success'] = success
params['failure'] = failure
return self.client.call('post', path, {
'content-type': 'application/json',
from ..service import Service
class Users(Service):
def __init__(self, client):
super(Users, self).__init__(client)
def list(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Users"""
params = {}
path = '/users'
params['search'] = search
params['limit'] = limit
params['offset'] = offset
params['orderType'] = order_type
return self.client.call('get', path, {
'content-type': 'application/json',
from ..service import Service
class Storage(Service):
def __init__(self, client):
super(Storage, self).__init__(client)
def list_files(self, search='', limit=25, offset=0, order_type='ASC'):
"""List Files"""
params = {}
path = '/storage/files'
params['search'] = search
params['limit'] = limit
params['offset'] = offset
params['orderType'] = order_type
return self.client.call('get', path, {
'content-type': 'application/json',