Method: Appwrite::Functions#create
- Defined in:
- lib/appwrite/services/functions.rb
#create(function_id:, name:, execute:, runtime:, vars: nil, events: nil, schedule: nil, timeout: nil) ⇒ Function
Create a new function. You can pass a list of [permissions](/docs/permissions) to allow different project users or team with access to execute the function using the client API.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/appwrite/services/functions.rb', line 56 def create(function_id:, name:, execute:, runtime:, vars: nil, events: nil, schedule: nil, timeout: nil) if function_id.nil? raise Appwrite::Exception.new('Missing required parameter: "functionId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end if execute.nil? raise Appwrite::Exception.new('Missing required parameter: "execute"') end if runtime.nil? raise Appwrite::Exception.new('Missing required parameter: "runtime"') end path = '/functions' params = { functionId: function_id, name: name, execute: execute, runtime: runtime, vars: vars, events: events, schedule: schedule, timeout: timeout, } headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: path, headers: headers, params: params, response_type: Models::Function ) end |