@@ -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 , 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_branch = 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_branch = None ):
2424 """Create function"""
2525
2626
@@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
4747 api_params ['logging' ] = logging
4848 api_params ['entrypoint' ] = entrypoint
4949 api_params ['commands' ] = commands
50+ api_params ['scopes' ] = scopes
5051 api_params ['installationId' ] = installation_id
5152 api_params ['providerRepositoryId' ] = provider_repository_id
5253 api_params ['providerBranch' ] = provider_branch
@@ -88,7 +89,7 @@ def get(self, function_id):
8889 'content-type' : 'application/json' ,
8990 }, api_params )
9091
91- def update (self , function_id , name , runtime = None , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None ):
92+ 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 ):
9293 """Update function"""
9394
9495
@@ -112,6 +113,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
112113 api_params ['logging' ] = logging
113114 api_params ['entrypoint' ] = entrypoint
114115 api_params ['commands' ] = commands
116+ api_params ['scopes' ] = scopes
115117 api_params ['installationId' ] = installation_id
116118 api_params ['providerRepositoryId' ] = provider_repository_id
117119 api_params ['providerBranch' ] = provider_branch
@@ -247,30 +249,47 @@ def delete_deployment(self, function_id, deployment_id):
247249 'content-type' : 'application/json' ,
248250 }, api_params )
249251
250- def create_build (self , function_id , deployment_id , build_id ):
251- """Create build """
252+ def create_build (self , function_id , deployment_id , build_id = None ):
253+ """Rebuild deployment """
252254
253255
254- api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId} '
256+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build '
255257 api_params = {}
256258 if function_id is None :
257259 raise AppwriteException ('Missing required parameter: "function_id"' )
258260
259261 if deployment_id is None :
260262 raise AppwriteException ('Missing required parameter: "deployment_id"' )
261263
262- if build_id is None :
263- raise AppwriteException ('Missing required parameter: "build_id"' )
264-
265264 api_path = api_path .replace ('{functionId}' , function_id )
266265 api_path = api_path .replace ('{deploymentId}' , deployment_id )
267- api_path = api_path .replace ('{buildId}' , build_id )
268266
267+ api_params ['buildId' ] = build_id
269268
270269 return self .client .call ('post' , api_path , {
271270 'content-type' : 'application/json' ,
272271 }, api_params )
273272
273+ def update_deployment_build (self , function_id , deployment_id ):
274+ """Cancel deployment"""
275+
276+
277+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build'
278+ api_params = {}
279+ if function_id is None :
280+ raise AppwriteException ('Missing required parameter: "function_id"' )
281+
282+ if deployment_id is None :
283+ raise AppwriteException ('Missing required parameter: "deployment_id"' )
284+
285+ api_path = api_path .replace ('{functionId}' , function_id )
286+ api_path = api_path .replace ('{deploymentId}' , deployment_id )
287+
288+
289+ return self .client .call ('patch' , api_path , {
290+ 'content-type' : 'application/json' ,
291+ }, api_params )
292+
274293 def download_deployment (self , function_id , deployment_id ):
275294 """Download Deployment"""
276295
@@ -309,7 +328,7 @@ def list_executions(self, function_id, queries = None, search = None):
309328 'content-type' : 'application/json' ,
310329 }, api_params )
311330
312- def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None ):
331+ def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None , scheduled_at = None ):
313332 """Create execution"""
314333
315334
@@ -325,6 +344,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
325344 api_params ['path' ] = path
326345 api_params ['method' ] = method
327346 api_params ['headers' ] = headers
347+ api_params ['scheduledAt' ] = scheduled_at
328348
329349 return self .client .call ('post' , api_path , {
330350 'content-type' : 'application/json' ,
@@ -350,6 +370,26 @@ def get_execution(self, function_id, execution_id):
350370 'content-type' : 'application/json' ,
351371 }, api_params )
352372
373+ def delete_execution (self , function_id , execution_id ):
374+ """Delete execution"""
375+
376+
377+ api_path = '/functions/{functionId}/executions/{executionId}'
378+ api_params = {}
379+ if function_id is None :
380+ raise AppwriteException ('Missing required parameter: "function_id"' )
381+
382+ if execution_id is None :
383+ raise AppwriteException ('Missing required parameter: "execution_id"' )
384+
385+ api_path = api_path .replace ('{functionId}' , function_id )
386+ api_path = api_path .replace ('{executionId}' , execution_id )
387+
388+
389+ return self .client .call ('delete' , api_path , {
390+ 'content-type' : 'application/json' ,
391+ }, api_params )
392+
353393 def list_variables (self , function_id ):
354394 """List variables"""
355395
0 commit comments