Skip to content

Commit 86f4a3c

Browse files
committed
chore: update SDKs to new RC version
1 parent d312ab7 commit 86f4a3c

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def __init__(self):
1313
self._endpoint = 'https://cloud.appwrite.io/v1'
1414
self._global_headers = {
1515
'content-type': '',
16-
'user-agent' : 'AppwritePythonSDK/6.0.0-rc.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
16+
'user-agent' : 'AppwritePythonSDK/6.0.0-rc.2 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
1717
'x-sdk-name': 'Python',
1818
'x-sdk-platform': 'server',
1919
'x-sdk-language': 'python',
20-
'x-sdk-version': '6.0.0-rc.1',
20+
'x-sdk-version': '6.0.0-rc.2',
2121
'X-Appwrite-Response-Format' : '1.6.0',
2222
}
2323

appwrite/services/functions.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def list(self, queries = None, search = None):
2020
'content-type': 'application/json',
2121
}, api_params)
2222

23-
def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None):
23+
def create(self, function_id, name, runtime, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, template_repository = None, template_owner = None, template_root_directory = None, template_version = None, specification = None):
2424
"""Create function"""
2525

2626

@@ -57,6 +57,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
5757
api_params['templateOwner'] = template_owner
5858
api_params['templateRootDirectory'] = template_root_directory
5959
api_params['templateVersion'] = template_version
60+
api_params['specification'] = specification
6061

6162
return self.client.call('post', api_path, {
6263
'content-type': 'application/json',
@@ -73,6 +74,17 @@ def list_runtimes(self):
7374
'content-type': 'application/json',
7475
}, api_params)
7576

77+
def list_specifications(self):
78+
"""List available function runtime specifications"""
79+
80+
81+
api_path = '/functions/specifications'
82+
api_params = {}
83+
84+
return self.client.call('get', api_path, {
85+
'content-type': 'application/json',
86+
}, api_params)
87+
7688
def list_templates(self, runtimes = None, use_cases = None, limit = None, offset = None):
7789
"""List function templates"""
7890

@@ -121,7 +133,7 @@ def get(self, function_id):
121133
'content-type': 'application/json',
122134
}, api_params)
123135

124-
def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None):
136+
def update(self, function_id, name, runtime = None, execute = None, events = None, schedule = None, timeout = None, enabled = None, logging = None, entrypoint = None, commands = None, scopes = None, installation_id = None, provider_repository_id = None, provider_branch = None, provider_silent_mode = None, provider_root_directory = None, specification = None):
125137
"""Update function"""
126138

127139

@@ -151,6 +163,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
151163
api_params['providerBranch'] = provider_branch
152164
api_params['providerSilentMode'] = provider_silent_mode
153165
api_params['providerRootDirectory'] = provider_root_directory
166+
api_params['specification'] = specification
154167

155168
return self.client.call('put', api_path, {
156169
'content-type': 'application/json',
@@ -360,7 +373,7 @@ def list_executions(self, function_id, queries = None, search = None):
360373
'content-type': 'application/json',
361374
}, api_params)
362375

363-
def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None, on_progress = None):
376+
def create_execution(self, function_id, body = None, xasync = None, path = None, method = None, headers = None, scheduled_at = None):
364377
"""Create execution"""
365378

366379

@@ -372,18 +385,15 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
372385
api_path = api_path.replace('{functionId}', function_id)
373386

374387
api_params['body'] = body
375-
api_params['async'] = str(xasync).lower() if type(xasync) is bool else xasync
388+
api_params['async'] = xasync
376389
api_params['path'] = path
377390
api_params['method'] = method
378-
api_params['headers'] = str(headers).lower() if type(headers) is bool else headers
391+
api_params['headers'] = headers
379392
api_params['scheduledAt'] = scheduled_at
380393

381-
382-
upload_id = ''
383-
384-
return self.client.chunked_upload(api_path, {
385-
'content-type': 'multipart/form-data',
386-
}, api_params, param_name, on_progress, upload_id)
394+
return self.client.call('post', api_path, {
395+
'content-type': 'application/json',
396+
}, api_params)
387397

388398
def get_execution(self, function_id, execution_id):
389399
"""Get execution"""

docs/examples/functions/create.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ result = functions.create(
2929
template_repository = '<TEMPLATE_REPOSITORY>', # optional
3030
template_owner = '<TEMPLATE_OWNER>', # optional
3131
template_root_directory = '<TEMPLATE_ROOT_DIRECTORY>', # optional
32-
template_version = '<TEMPLATE_VERSION>' # optional
32+
template_version = '<TEMPLATE_VERSION>', # optional
33+
specification = '' # optional
3334
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from appwrite.client import Client
2+
3+
client = Client()
4+
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
5+
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
6+
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
7+
8+
functions = Functions(client)
9+
10+
result = functions.list_specifications()

docs/examples/functions/update.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ result = functions.update(
2424
provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional
2525
provider_branch = '<PROVIDER_BRANCH>', # optional
2626
provider_silent_mode = False, # optional
27-
provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>' # optional
27+
provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional
28+
specification = '' # optional
2829
)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'appwrite/encoders',
1414
'appwrite/enums',
1515
],
16-
version = '6.0.0-rc.1',
16+
version = '6.0.0-rc.2',
1717
license='BSD-3-Clause',
1818
description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API',
1919
long_description = long_description,
@@ -23,7 +23,7 @@
2323
maintainer = 'Appwrite Team',
2424
maintainer_email = '[email protected]',
2525
url = 'https://appwrite.io/support',
26-
download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.1.tar.gz',
26+
download_url='https://github.com/appwrite/sdk-for-python/archive/6.0.0-rc.2.tar.gz',
2727
install_requires=[
2828
'requests',
2929
],

0 commit comments

Comments
 (0)