How to use the appwrite.service.Service function in appwrite

To help you get started, we’ve selected a few appwrite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appwrite / sdk-for-python / appwrite / services / avatars.py View on Github external
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',
github appwrite / sdk-for-python / appwrite / services / locale.py View on Github external
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"""
github appwrite / sdk-for-python / appwrite / services / database.py View on Github external
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',
github appwrite / sdk-for-python / appwrite / services / auth.py View on Github external
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',
github appwrite / sdk-for-python / appwrite / services / users.py View on Github external
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',
github appwrite / sdk-for-python / appwrite / services / storage.py View on Github external
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',
github appwrite / sdk-for-python / appwrite / services / projects.py View on Github external
from ..service import Service


class Projects(Service):

    def __init__(self, client):
        super(Projects, self).__init__(client)

    def list_projects(self):
        """List Projects"""

        params = {}
        path = '/projects'

        return self.client.call('get', path, {
            'content-type': 'application/json',
        }, params)

    def create_project(self, name, team_id, description='', logo='', url='', legal_name='', legal_country='', legal_state='', legal_city='', legal_address='', legal_tax_id=''):
        """Create Project"""
github appwrite / sdk-for-python / appwrite / services / teams.py View on Github external
from ..service import Service


class Teams(Service):

    def __init__(self, client):
        super(Teams, self).__init__(client)

    def list(self, search='', limit=25, offset=0, order_type='ASC'):
        """List Teams"""

        params = {}
        path = '/teams'
        params['search'] = search
        params['limit'] = limit
        params['offset'] = offset
        params['orderType'] = order_type

        return self.client.call('get', path, {
            'content-type': 'application/json',
github appwrite / sdk-for-python / appwrite / services / account.py View on Github external
from ..service import Service


class Account(Service):

    def get(self):
        """Get Account"""

        params = {}
        path = '/account'

        return self.client.call('get', path, {
        }, params)

    def delete(self):
        """Delete Account"""

        params = {}
        path = '/account'