appwrite 21.1.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +48 -2
- data/lib/appwrite/enums/backup_services.rb +3 -0
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/database_type.rb +2 -0
- data/lib/appwrite/enums/databases_index_type.rb +10 -0
- data/lib/appwrite/enums/o_auth_provider.rb +1 -0
- data/lib/appwrite/enums/platform_type.rb +11 -0
- data/lib/appwrite/enums/protocol_id.rb +9 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/enums/scopes.rb +8 -0
- data/lib/appwrite/enums/service_id.rb +23 -0
- data/lib/appwrite/enums/{index_type.rb → tables_db_index_type.rb} +1 -1
- data/lib/appwrite/enums/template_reference_type.rb +1 -1
- data/lib/appwrite/models/auth_provider.rb +47 -0
- data/lib/appwrite/models/billing_limits.rb +62 -0
- data/lib/appwrite/models/block.rb +47 -0
- data/lib/appwrite/models/database.rb +2 -0
- data/lib/appwrite/models/dev_key.rb +62 -0
- data/lib/appwrite/models/function.rb +15 -5
- data/lib/appwrite/models/key.rb +67 -0
- data/lib/appwrite/models/key_list.rb +32 -0
- data/lib/appwrite/models/log.rb +5 -0
- data/lib/appwrite/models/mock_number.rb +32 -0
- data/lib/appwrite/models/platform_android.rb +71 -0
- data/lib/appwrite/models/platform_apple.rb +71 -0
- data/lib/appwrite/models/platform_linux.rb +71 -0
- data/lib/appwrite/models/platform_list.rb +32 -0
- data/lib/appwrite/models/platform_web.rb +71 -0
- data/lib/appwrite/models/platform_windows.rb +71 -0
- data/lib/appwrite/models/project.rb +412 -0
- data/lib/appwrite/models/site.rb +20 -5
- data/lib/appwrite/models/user.rb +13 -3
- data/lib/appwrite/models/webhook.rb +87 -0
- data/lib/appwrite/models/webhook_list.rb +32 -0
- data/lib/appwrite/service.rb +1 -1
- data/lib/appwrite/services/account.rb +47 -2
- data/lib/appwrite/services/activities.rb +3 -1
- data/lib/appwrite/services/avatars.rb +9 -1
- data/lib/appwrite/services/backups.rb +13 -1
- data/lib/appwrite/services/databases.rb +133 -7
- data/lib/appwrite/services/functions.rb +41 -7
- data/lib/appwrite/services/graphql.rb +5 -3
- data/lib/appwrite/services/health.rb +22 -117
- data/lib/appwrite/services/locale.rb +9 -1
- data/lib/appwrite/services/messaging.rb +49 -1
- data/lib/appwrite/services/project.rb +1011 -0
- data/lib/appwrite/services/sites.rb +44 -7
- data/lib/appwrite/services/storage.rb +14 -1
- data/lib/appwrite/services/tables_db.rb +133 -7
- data/lib/appwrite/services/teams.rb +14 -1
- data/lib/appwrite/services/tokens.rb +6 -1
- data/lib/appwrite/services/users.rb +85 -2
- data/lib/appwrite/services/webhooks.rb +249 -0
- data/lib/appwrite.rb +23 -1
- metadata +25 -3
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
class Project < Service
|
|
5
|
+
|
|
6
|
+
def initialize(client)
|
|
7
|
+
@client = client
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Get a list of all API keys from the current project.
|
|
11
|
+
#
|
|
12
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes
|
|
13
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
14
|
+
#
|
|
15
|
+
# @return [KeyList]
|
|
16
|
+
def list_keys(queries: nil, total: nil)
|
|
17
|
+
api_path = '/project/keys'
|
|
18
|
+
|
|
19
|
+
api_params = {
|
|
20
|
+
queries: queries,
|
|
21
|
+
total: total,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
api_headers = {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@client.call(
|
|
28
|
+
method: 'GET',
|
|
29
|
+
path: api_path,
|
|
30
|
+
headers: api_headers,
|
|
31
|
+
params: api_params,
|
|
32
|
+
response_type: Models::KeyList
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Create a new API key. It's recommended to have multiple API keys with
|
|
38
|
+
# strict scopes for separate functions within your project.
|
|
39
|
+
#
|
|
40
|
+
# @param [String] key_id Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
41
|
+
# @param [String] name Key name. Max length: 128 chars.
|
|
42
|
+
# @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed.
|
|
43
|
+
# @param [String] expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
|
|
44
|
+
#
|
|
45
|
+
# @return [Key]
|
|
46
|
+
def create_key(key_id:, name:, scopes:, expire: nil)
|
|
47
|
+
api_path = '/project/keys'
|
|
48
|
+
|
|
49
|
+
if key_id.nil?
|
|
50
|
+
raise Appwrite::Exception.new('Missing required parameter: "keyId"')
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if name.nil?
|
|
54
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if scopes.nil?
|
|
58
|
+
raise Appwrite::Exception.new('Missing required parameter: "scopes"')
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
api_params = {
|
|
62
|
+
keyId: key_id,
|
|
63
|
+
name: name,
|
|
64
|
+
scopes: scopes,
|
|
65
|
+
expire: expire,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
api_headers = {
|
|
69
|
+
"content-type": 'application/json',
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@client.call(
|
|
73
|
+
method: 'POST',
|
|
74
|
+
path: api_path,
|
|
75
|
+
headers: api_headers,
|
|
76
|
+
params: api_params,
|
|
77
|
+
response_type: Models::Key
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Get a key by its unique ID.
|
|
83
|
+
#
|
|
84
|
+
# @param [String] key_id Key ID.
|
|
85
|
+
#
|
|
86
|
+
# @return [Key]
|
|
87
|
+
def get_key(key_id:)
|
|
88
|
+
api_path = '/project/keys/{keyId}'
|
|
89
|
+
.gsub('{keyId}', key_id)
|
|
90
|
+
|
|
91
|
+
if key_id.nil?
|
|
92
|
+
raise Appwrite::Exception.new('Missing required parameter: "keyId"')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
api_params = {
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
api_headers = {
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@client.call(
|
|
102
|
+
method: 'GET',
|
|
103
|
+
path: api_path,
|
|
104
|
+
headers: api_headers,
|
|
105
|
+
params: api_params,
|
|
106
|
+
response_type: Models::Key
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Update a key by its unique ID. Use this endpoint to update the name,
|
|
112
|
+
# scopes, or expiration time of an API key.
|
|
113
|
+
#
|
|
114
|
+
# @param [String] key_id Key ID.
|
|
115
|
+
# @param [String] name Key name. Max length: 128 chars.
|
|
116
|
+
# @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed.
|
|
117
|
+
# @param [String] expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
|
|
118
|
+
#
|
|
119
|
+
# @return [Key]
|
|
120
|
+
def update_key(key_id:, name:, scopes:, expire: nil)
|
|
121
|
+
api_path = '/project/keys/{keyId}'
|
|
122
|
+
.gsub('{keyId}', key_id)
|
|
123
|
+
|
|
124
|
+
if key_id.nil?
|
|
125
|
+
raise Appwrite::Exception.new('Missing required parameter: "keyId"')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if name.nil?
|
|
129
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if scopes.nil?
|
|
133
|
+
raise Appwrite::Exception.new('Missing required parameter: "scopes"')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
api_params = {
|
|
137
|
+
name: name,
|
|
138
|
+
scopes: scopes,
|
|
139
|
+
expire: expire,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
api_headers = {
|
|
143
|
+
"content-type": 'application/json',
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@client.call(
|
|
147
|
+
method: 'PUT',
|
|
148
|
+
path: api_path,
|
|
149
|
+
headers: api_headers,
|
|
150
|
+
params: api_params,
|
|
151
|
+
response_type: Models::Key
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Delete a key by its unique ID. Once deleted, the key can no longer be used
|
|
157
|
+
# to authenticate API calls.
|
|
158
|
+
#
|
|
159
|
+
# @param [String] key_id Key ID.
|
|
160
|
+
#
|
|
161
|
+
# @return []
|
|
162
|
+
def delete_key(key_id:)
|
|
163
|
+
api_path = '/project/keys/{keyId}'
|
|
164
|
+
.gsub('{keyId}', key_id)
|
|
165
|
+
|
|
166
|
+
if key_id.nil?
|
|
167
|
+
raise Appwrite::Exception.new('Missing required parameter: "keyId"')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
api_params = {
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
api_headers = {
|
|
174
|
+
"content-type": 'application/json',
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@client.call(
|
|
178
|
+
method: 'DELETE',
|
|
179
|
+
path: api_path,
|
|
180
|
+
headers: api_headers,
|
|
181
|
+
params: api_params,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Update the project labels. Labels can be used to easily filter projects in
|
|
187
|
+
# an organization.
|
|
188
|
+
#
|
|
189
|
+
# @param [Array] labels Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
|
|
190
|
+
#
|
|
191
|
+
# @return [Project]
|
|
192
|
+
def update_labels(labels:)
|
|
193
|
+
api_path = '/project/labels'
|
|
194
|
+
|
|
195
|
+
if labels.nil?
|
|
196
|
+
raise Appwrite::Exception.new('Missing required parameter: "labels"')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
api_params = {
|
|
200
|
+
labels: labels,
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
api_headers = {
|
|
204
|
+
"content-type": 'application/json',
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@client.call(
|
|
208
|
+
method: 'PUT',
|
|
209
|
+
path: api_path,
|
|
210
|
+
headers: api_headers,
|
|
211
|
+
params: api_params,
|
|
212
|
+
response_type: Models::Project
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Get a list of all platforms in the project. This endpoint returns an array
|
|
218
|
+
# of all platforms and their configurations.
|
|
219
|
+
#
|
|
220
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName
|
|
221
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
222
|
+
#
|
|
223
|
+
# @return [PlatformList]
|
|
224
|
+
def list_platforms(queries: nil, total: nil)
|
|
225
|
+
api_path = '/project/platforms'
|
|
226
|
+
|
|
227
|
+
api_params = {
|
|
228
|
+
queries: queries,
|
|
229
|
+
total: total,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
api_headers = {
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@client.call(
|
|
236
|
+
method: 'GET',
|
|
237
|
+
path: api_path,
|
|
238
|
+
headers: api_headers,
|
|
239
|
+
params: api_params,
|
|
240
|
+
response_type: Models::PlatformList
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Create a new Android platform for your project. Use this endpoint to
|
|
246
|
+
# register a new Android platform where your users will run your application
|
|
247
|
+
# which will interact with the Appwrite API.
|
|
248
|
+
#
|
|
249
|
+
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
250
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
251
|
+
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
252
|
+
#
|
|
253
|
+
# @return [PlatformAndroid]
|
|
254
|
+
def create_android_platform(platform_id:, name:, application_id:)
|
|
255
|
+
api_path = '/project/platforms/android'
|
|
256
|
+
|
|
257
|
+
if platform_id.nil?
|
|
258
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if name.nil?
|
|
262
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if application_id.nil?
|
|
266
|
+
raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
api_params = {
|
|
270
|
+
platformId: platform_id,
|
|
271
|
+
name: name,
|
|
272
|
+
applicationId: application_id,
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
api_headers = {
|
|
276
|
+
"content-type": 'application/json',
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@client.call(
|
|
280
|
+
method: 'POST',
|
|
281
|
+
path: api_path,
|
|
282
|
+
headers: api_headers,
|
|
283
|
+
params: api_params,
|
|
284
|
+
response_type: Models::PlatformAndroid
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Update an Android platform by its unique ID. Use this endpoint to update
|
|
290
|
+
# the platform's name or application ID.
|
|
291
|
+
#
|
|
292
|
+
# @param [String] platform_id Platform ID.
|
|
293
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
294
|
+
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
295
|
+
#
|
|
296
|
+
# @return [PlatformAndroid]
|
|
297
|
+
def update_android_platform(platform_id:, name:, application_id:)
|
|
298
|
+
api_path = '/project/platforms/android/{platformId}'
|
|
299
|
+
.gsub('{platformId}', platform_id)
|
|
300
|
+
|
|
301
|
+
if platform_id.nil?
|
|
302
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
if name.nil?
|
|
306
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
if application_id.nil?
|
|
310
|
+
raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
api_params = {
|
|
314
|
+
name: name,
|
|
315
|
+
applicationId: application_id,
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
api_headers = {
|
|
319
|
+
"content-type": 'application/json',
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@client.call(
|
|
323
|
+
method: 'PUT',
|
|
324
|
+
path: api_path,
|
|
325
|
+
headers: api_headers,
|
|
326
|
+
params: api_params,
|
|
327
|
+
response_type: Models::PlatformAndroid
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Create a new Apple platform for your project. Use this endpoint to register
|
|
333
|
+
# a new Apple platform where your users will run your application which will
|
|
334
|
+
# interact with the Appwrite API.
|
|
335
|
+
#
|
|
336
|
+
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
337
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
338
|
+
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
339
|
+
#
|
|
340
|
+
# @return [PlatformApple]
|
|
341
|
+
def create_apple_platform(platform_id:, name:, bundle_identifier:)
|
|
342
|
+
api_path = '/project/platforms/apple'
|
|
343
|
+
|
|
344
|
+
if platform_id.nil?
|
|
345
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
if name.nil?
|
|
349
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
if bundle_identifier.nil?
|
|
353
|
+
raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
api_params = {
|
|
357
|
+
platformId: platform_id,
|
|
358
|
+
name: name,
|
|
359
|
+
bundleIdentifier: bundle_identifier,
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
api_headers = {
|
|
363
|
+
"content-type": 'application/json',
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@client.call(
|
|
367
|
+
method: 'POST',
|
|
368
|
+
path: api_path,
|
|
369
|
+
headers: api_headers,
|
|
370
|
+
params: api_params,
|
|
371
|
+
response_type: Models::PlatformApple
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# Update an Apple platform by its unique ID. Use this endpoint to update the
|
|
377
|
+
# platform's name or bundle identifier.
|
|
378
|
+
#
|
|
379
|
+
# @param [String] platform_id Platform ID.
|
|
380
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
381
|
+
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
382
|
+
#
|
|
383
|
+
# @return [PlatformApple]
|
|
384
|
+
def update_apple_platform(platform_id:, name:, bundle_identifier:)
|
|
385
|
+
api_path = '/project/platforms/apple/{platformId}'
|
|
386
|
+
.gsub('{platformId}', platform_id)
|
|
387
|
+
|
|
388
|
+
if platform_id.nil?
|
|
389
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
if name.nil?
|
|
393
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
if bundle_identifier.nil?
|
|
397
|
+
raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
api_params = {
|
|
401
|
+
name: name,
|
|
402
|
+
bundleIdentifier: bundle_identifier,
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
api_headers = {
|
|
406
|
+
"content-type": 'application/json',
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
@client.call(
|
|
410
|
+
method: 'PUT',
|
|
411
|
+
path: api_path,
|
|
412
|
+
headers: api_headers,
|
|
413
|
+
params: api_params,
|
|
414
|
+
response_type: Models::PlatformApple
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# Create a new Linux platform for your project. Use this endpoint to register
|
|
420
|
+
# a new Linux platform where your users will run your application which will
|
|
421
|
+
# interact with the Appwrite API.
|
|
422
|
+
#
|
|
423
|
+
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
424
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
425
|
+
# @param [String] package_name Linux package name. Max length: 256 chars.
|
|
426
|
+
#
|
|
427
|
+
# @return [PlatformLinux]
|
|
428
|
+
def create_linux_platform(platform_id:, name:, package_name:)
|
|
429
|
+
api_path = '/project/platforms/linux'
|
|
430
|
+
|
|
431
|
+
if platform_id.nil?
|
|
432
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
if name.nil?
|
|
436
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
if package_name.nil?
|
|
440
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageName"')
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
api_params = {
|
|
444
|
+
platformId: platform_id,
|
|
445
|
+
name: name,
|
|
446
|
+
packageName: package_name,
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
api_headers = {
|
|
450
|
+
"content-type": 'application/json',
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
@client.call(
|
|
454
|
+
method: 'POST',
|
|
455
|
+
path: api_path,
|
|
456
|
+
headers: api_headers,
|
|
457
|
+
params: api_params,
|
|
458
|
+
response_type: Models::PlatformLinux
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
# Update a Linux platform by its unique ID. Use this endpoint to update the
|
|
464
|
+
# platform's name or package name.
|
|
465
|
+
#
|
|
466
|
+
# @param [String] platform_id Platform ID.
|
|
467
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
468
|
+
# @param [String] package_name Linux package name. Max length: 256 chars.
|
|
469
|
+
#
|
|
470
|
+
# @return [PlatformLinux]
|
|
471
|
+
def update_linux_platform(platform_id:, name:, package_name:)
|
|
472
|
+
api_path = '/project/platforms/linux/{platformId}'
|
|
473
|
+
.gsub('{platformId}', platform_id)
|
|
474
|
+
|
|
475
|
+
if platform_id.nil?
|
|
476
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
if name.nil?
|
|
480
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
if package_name.nil?
|
|
484
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageName"')
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
api_params = {
|
|
488
|
+
name: name,
|
|
489
|
+
packageName: package_name,
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
api_headers = {
|
|
493
|
+
"content-type": 'application/json',
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
@client.call(
|
|
497
|
+
method: 'PUT',
|
|
498
|
+
path: api_path,
|
|
499
|
+
headers: api_headers,
|
|
500
|
+
params: api_params,
|
|
501
|
+
response_type: Models::PlatformLinux
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
# Create a new web platform for your project. Use this endpoint to register a
|
|
507
|
+
# new platform where your users will run your application which will interact
|
|
508
|
+
# with the Appwrite API.
|
|
509
|
+
#
|
|
510
|
+
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
511
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
512
|
+
# @param [String] hostname Platform web hostname. Max length: 256 chars.
|
|
513
|
+
#
|
|
514
|
+
# @return [PlatformWeb]
|
|
515
|
+
def create_web_platform(platform_id:, name:, hostname:)
|
|
516
|
+
api_path = '/project/platforms/web'
|
|
517
|
+
|
|
518
|
+
if platform_id.nil?
|
|
519
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
if name.nil?
|
|
523
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
524
|
+
end
|
|
525
|
+
|
|
526
|
+
if hostname.nil?
|
|
527
|
+
raise Appwrite::Exception.new('Missing required parameter: "hostname"')
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
api_params = {
|
|
531
|
+
platformId: platform_id,
|
|
532
|
+
name: name,
|
|
533
|
+
hostname: hostname,
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
api_headers = {
|
|
537
|
+
"content-type": 'application/json',
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
@client.call(
|
|
541
|
+
method: 'POST',
|
|
542
|
+
path: api_path,
|
|
543
|
+
headers: api_headers,
|
|
544
|
+
params: api_params,
|
|
545
|
+
response_type: Models::PlatformWeb
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
# Update a web platform by its unique ID. Use this endpoint to update the
|
|
551
|
+
# platform's name or hostname.
|
|
552
|
+
#
|
|
553
|
+
# @param [String] platform_id Platform ID.
|
|
554
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
555
|
+
# @param [String] hostname Platform web hostname. Max length: 256 chars.
|
|
556
|
+
#
|
|
557
|
+
# @return [PlatformWeb]
|
|
558
|
+
def update_web_platform(platform_id:, name:, hostname:)
|
|
559
|
+
api_path = '/project/platforms/web/{platformId}'
|
|
560
|
+
.gsub('{platformId}', platform_id)
|
|
561
|
+
|
|
562
|
+
if platform_id.nil?
|
|
563
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
if name.nil?
|
|
567
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
if hostname.nil?
|
|
571
|
+
raise Appwrite::Exception.new('Missing required parameter: "hostname"')
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
api_params = {
|
|
575
|
+
name: name,
|
|
576
|
+
hostname: hostname,
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
api_headers = {
|
|
580
|
+
"content-type": 'application/json',
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
@client.call(
|
|
584
|
+
method: 'PUT',
|
|
585
|
+
path: api_path,
|
|
586
|
+
headers: api_headers,
|
|
587
|
+
params: api_params,
|
|
588
|
+
response_type: Models::PlatformWeb
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
# Create a new Windows platform for your project. Use this endpoint to
|
|
594
|
+
# register a new Windows platform where your users will run your application
|
|
595
|
+
# which will interact with the Appwrite API.
|
|
596
|
+
#
|
|
597
|
+
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
598
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
599
|
+
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
600
|
+
#
|
|
601
|
+
# @return [PlatformWindows]
|
|
602
|
+
def create_windows_platform(platform_id:, name:, package_identifier_name:)
|
|
603
|
+
api_path = '/project/platforms/windows'
|
|
604
|
+
|
|
605
|
+
if platform_id.nil?
|
|
606
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
607
|
+
end
|
|
608
|
+
|
|
609
|
+
if name.nil?
|
|
610
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
if package_identifier_name.nil?
|
|
614
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
api_params = {
|
|
618
|
+
platformId: platform_id,
|
|
619
|
+
name: name,
|
|
620
|
+
packageIdentifierName: package_identifier_name,
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
api_headers = {
|
|
624
|
+
"content-type": 'application/json',
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@client.call(
|
|
628
|
+
method: 'POST',
|
|
629
|
+
path: api_path,
|
|
630
|
+
headers: api_headers,
|
|
631
|
+
params: api_params,
|
|
632
|
+
response_type: Models::PlatformWindows
|
|
633
|
+
)
|
|
634
|
+
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
# Update a Windows platform by its unique ID. Use this endpoint to update the
|
|
638
|
+
# platform's name or package identifier name.
|
|
639
|
+
#
|
|
640
|
+
# @param [String] platform_id Platform ID.
|
|
641
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
642
|
+
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
643
|
+
#
|
|
644
|
+
# @return [PlatformWindows]
|
|
645
|
+
def update_windows_platform(platform_id:, name:, package_identifier_name:)
|
|
646
|
+
api_path = '/project/platforms/windows/{platformId}'
|
|
647
|
+
.gsub('{platformId}', platform_id)
|
|
648
|
+
|
|
649
|
+
if platform_id.nil?
|
|
650
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
if name.nil?
|
|
654
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
655
|
+
end
|
|
656
|
+
|
|
657
|
+
if package_identifier_name.nil?
|
|
658
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
api_params = {
|
|
662
|
+
name: name,
|
|
663
|
+
packageIdentifierName: package_identifier_name,
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
api_headers = {
|
|
667
|
+
"content-type": 'application/json',
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
@client.call(
|
|
671
|
+
method: 'PUT',
|
|
672
|
+
path: api_path,
|
|
673
|
+
headers: api_headers,
|
|
674
|
+
params: api_params,
|
|
675
|
+
response_type: Models::PlatformWindows
|
|
676
|
+
)
|
|
677
|
+
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
# Get a platform by its unique ID. This endpoint returns the platform's
|
|
681
|
+
# details, including its name, type, and key configurations.
|
|
682
|
+
#
|
|
683
|
+
# @param [String] platform_id Platform ID.
|
|
684
|
+
#
|
|
685
|
+
# @return [PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux]
|
|
686
|
+
def get_platform(platform_id:)
|
|
687
|
+
api_path = '/project/platforms/{platformId}'
|
|
688
|
+
.gsub('{platformId}', platform_id)
|
|
689
|
+
|
|
690
|
+
if platform_id.nil?
|
|
691
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
api_params = {
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
api_headers = {
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
response = @client.call(
|
|
701
|
+
method: 'GET',
|
|
702
|
+
path: api_path,
|
|
703
|
+
headers: api_headers,
|
|
704
|
+
params: api_params,
|
|
705
|
+
)
|
|
706
|
+
|
|
707
|
+
unless response.is_a?(Hash)
|
|
708
|
+
raise Exception, "Expected object response when hydrating a response model"
|
|
709
|
+
end
|
|
710
|
+
|
|
711
|
+
if response['type'] == 'web'
|
|
712
|
+
|
|
713
|
+
return Models::PlatformWeb.from(map: response)
|
|
714
|
+
end
|
|
715
|
+
|
|
716
|
+
if response['type'] == 'apple'
|
|
717
|
+
|
|
718
|
+
return Models::PlatformApple.from(map: response)
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
if response['type'] == 'android'
|
|
722
|
+
|
|
723
|
+
return Models::PlatformAndroid.from(map: response)
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
if response['type'] == 'windows'
|
|
727
|
+
|
|
728
|
+
return Models::PlatformWindows.from(map: response)
|
|
729
|
+
end
|
|
730
|
+
|
|
731
|
+
if response['type'] == 'linux'
|
|
732
|
+
|
|
733
|
+
return Models::PlatformLinux.from(map: response)
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
raise Exception, "Unable to match response to any expected response model"
|
|
737
|
+
|
|
738
|
+
end
|
|
739
|
+
|
|
740
|
+
# Delete a platform by its unique ID. This endpoint removes the platform and
|
|
741
|
+
# all its configurations from the project.
|
|
742
|
+
#
|
|
743
|
+
# @param [String] platform_id Platform ID.
|
|
744
|
+
#
|
|
745
|
+
# @return []
|
|
746
|
+
def delete_platform(platform_id:)
|
|
747
|
+
api_path = '/project/platforms/{platformId}'
|
|
748
|
+
.gsub('{platformId}', platform_id)
|
|
749
|
+
|
|
750
|
+
if platform_id.nil?
|
|
751
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
api_params = {
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
api_headers = {
|
|
758
|
+
"content-type": 'application/json',
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@client.call(
|
|
762
|
+
method: 'DELETE',
|
|
763
|
+
path: api_path,
|
|
764
|
+
headers: api_headers,
|
|
765
|
+
params: api_params,
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
end
|
|
769
|
+
|
|
770
|
+
# Update the status of a specific protocol. Use this endpoint to enable or
|
|
771
|
+
# disable a protocol in your project.
|
|
772
|
+
#
|
|
773
|
+
# @param [ProtocolId] protocol_id Protocol name. Can be one of: rest, graphql, websocket
|
|
774
|
+
# @param [] enabled Protocol status.
|
|
775
|
+
#
|
|
776
|
+
# @return [Project]
|
|
777
|
+
def update_protocol_status(protocol_id:, enabled:)
|
|
778
|
+
api_path = '/project/protocols/{protocolId}/status'
|
|
779
|
+
.gsub('{protocolId}', protocol_id)
|
|
780
|
+
|
|
781
|
+
if protocol_id.nil?
|
|
782
|
+
raise Appwrite::Exception.new('Missing required parameter: "protocolId"')
|
|
783
|
+
end
|
|
784
|
+
|
|
785
|
+
if enabled.nil?
|
|
786
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
787
|
+
end
|
|
788
|
+
|
|
789
|
+
api_params = {
|
|
790
|
+
enabled: enabled,
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
api_headers = {
|
|
794
|
+
"content-type": 'application/json',
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
@client.call(
|
|
798
|
+
method: 'PATCH',
|
|
799
|
+
path: api_path,
|
|
800
|
+
headers: api_headers,
|
|
801
|
+
params: api_params,
|
|
802
|
+
response_type: Models::Project
|
|
803
|
+
)
|
|
804
|
+
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
# Update the status of a specific service. Use this endpoint to enable or
|
|
808
|
+
# disable a service in your project.
|
|
809
|
+
#
|
|
810
|
+
# @param [ServiceId] service_id Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging
|
|
811
|
+
# @param [] enabled Service status.
|
|
812
|
+
#
|
|
813
|
+
# @return [Project]
|
|
814
|
+
def update_service_status(service_id:, enabled:)
|
|
815
|
+
api_path = '/project/services/{serviceId}/status'
|
|
816
|
+
.gsub('{serviceId}', service_id)
|
|
817
|
+
|
|
818
|
+
if service_id.nil?
|
|
819
|
+
raise Appwrite::Exception.new('Missing required parameter: "serviceId"')
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
if enabled.nil?
|
|
823
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
api_params = {
|
|
827
|
+
enabled: enabled,
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
api_headers = {
|
|
831
|
+
"content-type": 'application/json',
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
@client.call(
|
|
835
|
+
method: 'PATCH',
|
|
836
|
+
path: api_path,
|
|
837
|
+
headers: api_headers,
|
|
838
|
+
params: api_params,
|
|
839
|
+
response_type: Models::Project
|
|
840
|
+
)
|
|
841
|
+
|
|
842
|
+
end
|
|
843
|
+
|
|
844
|
+
# Get a list of all project environment variables.
|
|
845
|
+
#
|
|
846
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
|
|
847
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
848
|
+
#
|
|
849
|
+
# @return [VariableList]
|
|
850
|
+
def list_variables(queries: nil, total: nil)
|
|
851
|
+
api_path = '/project/variables'
|
|
852
|
+
|
|
853
|
+
api_params = {
|
|
854
|
+
queries: queries,
|
|
855
|
+
total: total,
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
api_headers = {
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
@client.call(
|
|
862
|
+
method: 'GET',
|
|
863
|
+
path: api_path,
|
|
864
|
+
headers: api_headers,
|
|
865
|
+
params: api_params,
|
|
866
|
+
response_type: Models::VariableList
|
|
867
|
+
)
|
|
868
|
+
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
# Create a new project environment variable. These variables can be accessed
|
|
872
|
+
# by all functions and sites in the project.
|
|
873
|
+
#
|
|
874
|
+
# @param [String] variable_id Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
875
|
+
# @param [String] key Variable key. Max length: 255 chars.
|
|
876
|
+
# @param [String] value Variable value. Max length: 8192 chars.
|
|
877
|
+
# @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
878
|
+
#
|
|
879
|
+
# @return [Variable]
|
|
880
|
+
def create_variable(variable_id:, key:, value:, secret: nil)
|
|
881
|
+
api_path = '/project/variables'
|
|
882
|
+
|
|
883
|
+
if variable_id.nil?
|
|
884
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
if key.nil?
|
|
888
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
889
|
+
end
|
|
890
|
+
|
|
891
|
+
if value.nil?
|
|
892
|
+
raise Appwrite::Exception.new('Missing required parameter: "value"')
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
api_params = {
|
|
896
|
+
variableId: variable_id,
|
|
897
|
+
key: key,
|
|
898
|
+
value: value,
|
|
899
|
+
secret: secret,
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
api_headers = {
|
|
903
|
+
"content-type": 'application/json',
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
@client.call(
|
|
907
|
+
method: 'POST',
|
|
908
|
+
path: api_path,
|
|
909
|
+
headers: api_headers,
|
|
910
|
+
params: api_params,
|
|
911
|
+
response_type: Models::Variable
|
|
912
|
+
)
|
|
913
|
+
|
|
914
|
+
end
|
|
915
|
+
|
|
916
|
+
# Get a variable by its unique ID.
|
|
917
|
+
#
|
|
918
|
+
# @param [String] variable_id Variable ID.
|
|
919
|
+
#
|
|
920
|
+
# @return [Variable]
|
|
921
|
+
def get_variable(variable_id:)
|
|
922
|
+
api_path = '/project/variables/{variableId}'
|
|
923
|
+
.gsub('{variableId}', variable_id)
|
|
924
|
+
|
|
925
|
+
if variable_id.nil?
|
|
926
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
|
927
|
+
end
|
|
928
|
+
|
|
929
|
+
api_params = {
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
api_headers = {
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
@client.call(
|
|
936
|
+
method: 'GET',
|
|
937
|
+
path: api_path,
|
|
938
|
+
headers: api_headers,
|
|
939
|
+
params: api_params,
|
|
940
|
+
response_type: Models::Variable
|
|
941
|
+
)
|
|
942
|
+
|
|
943
|
+
end
|
|
944
|
+
|
|
945
|
+
# Update variable by its unique ID.
|
|
946
|
+
#
|
|
947
|
+
# @param [String] variable_id Variable ID.
|
|
948
|
+
# @param [String] key Variable key. Max length: 255 chars.
|
|
949
|
+
# @param [String] value Variable value. Max length: 8192 chars.
|
|
950
|
+
# @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
951
|
+
#
|
|
952
|
+
# @return [Variable]
|
|
953
|
+
def update_variable(variable_id:, key: nil, value: nil, secret: nil)
|
|
954
|
+
api_path = '/project/variables/{variableId}'
|
|
955
|
+
.gsub('{variableId}', variable_id)
|
|
956
|
+
|
|
957
|
+
if variable_id.nil?
|
|
958
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
|
959
|
+
end
|
|
960
|
+
|
|
961
|
+
api_params = {
|
|
962
|
+
key: key,
|
|
963
|
+
value: value,
|
|
964
|
+
secret: secret,
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
api_headers = {
|
|
968
|
+
"content-type": 'application/json',
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
@client.call(
|
|
972
|
+
method: 'PUT',
|
|
973
|
+
path: api_path,
|
|
974
|
+
headers: api_headers,
|
|
975
|
+
params: api_params,
|
|
976
|
+
response_type: Models::Variable
|
|
977
|
+
)
|
|
978
|
+
|
|
979
|
+
end
|
|
980
|
+
|
|
981
|
+
# Delete a variable by its unique ID.
|
|
982
|
+
#
|
|
983
|
+
# @param [String] variable_id Variable ID.
|
|
984
|
+
#
|
|
985
|
+
# @return []
|
|
986
|
+
def delete_variable(variable_id:)
|
|
987
|
+
api_path = '/project/variables/{variableId}'
|
|
988
|
+
.gsub('{variableId}', variable_id)
|
|
989
|
+
|
|
990
|
+
if variable_id.nil?
|
|
991
|
+
raise Appwrite::Exception.new('Missing required parameter: "variableId"')
|
|
992
|
+
end
|
|
993
|
+
|
|
994
|
+
api_params = {
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
api_headers = {
|
|
998
|
+
"content-type": 'application/json',
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
@client.call(
|
|
1002
|
+
method: 'DELETE',
|
|
1003
|
+
path: api_path,
|
|
1004
|
+
headers: api_headers,
|
|
1005
|
+
params: api_params,
|
|
1006
|
+
)
|
|
1007
|
+
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
end
|
|
1011
|
+
end
|