appwrite 23.0.0 → 23.1.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 +28 -2
- data/lib/appwrite/enums/auth_method.rb +13 -0
- data/lib/appwrite/enums/build_runtime.rb +1 -0
- data/lib/appwrite/enums/email_template_locale.rb +137 -0
- data/lib/appwrite/enums/email_template_type.rb +13 -0
- data/lib/appwrite/enums/o_auth_provider.rb +5 -0
- data/lib/appwrite/enums/project_policy.rb +15 -0
- data/lib/appwrite/enums/proxy_resource_type.rb +8 -0
- data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +8 -0
- data/lib/appwrite/enums/proxy_rule_status.rb +9 -0
- data/lib/appwrite/enums/runtime.rb +1 -0
- data/lib/appwrite/enums/scopes.rb +44 -31
- data/lib/appwrite/enums/secure.rb +8 -0
- data/lib/appwrite/enums/status_code.rb +10 -0
- data/lib/appwrite/models/attribute_bigint.rb +96 -0
- data/lib/appwrite/models/block.rb +28 -3
- data/lib/appwrite/models/column_bigint.rb +96 -0
- data/lib/appwrite/models/email_template.rb +62 -0
- data/lib/appwrite/models/email_template_list.rb +32 -0
- data/lib/appwrite/models/ephemeral_key.rb +67 -0
- data/lib/appwrite/models/membership.rb +5 -0
- data/lib/appwrite/models/mock_number.rb +18 -8
- data/lib/appwrite/models/mock_number_list.rb +32 -0
- data/lib/appwrite/models/o_auth2_amazon.rb +42 -0
- data/lib/appwrite/models/o_auth2_apple.rb +52 -0
- data/lib/appwrite/models/o_auth2_auth0.rb +47 -0
- data/lib/appwrite/models/o_auth2_authentik.rb +47 -0
- data/lib/appwrite/models/o_auth2_autodesk.rb +42 -0
- data/lib/appwrite/models/o_auth2_bitbucket.rb +42 -0
- data/lib/appwrite/models/o_auth2_bitly.rb +42 -0
- data/lib/appwrite/models/o_auth2_box.rb +42 -0
- data/lib/appwrite/models/o_auth2_dailymotion.rb +42 -0
- data/lib/appwrite/models/o_auth2_discord.rb +42 -0
- data/lib/appwrite/models/o_auth2_disqus.rb +42 -0
- data/lib/appwrite/models/o_auth2_dropbox.rb +42 -0
- data/lib/appwrite/models/o_auth2_etsy.rb +42 -0
- data/lib/appwrite/models/o_auth2_facebook.rb +42 -0
- data/lib/appwrite/models/o_auth2_figma.rb +42 -0
- data/lib/appwrite/models/o_auth2_fusion_auth.rb +47 -0
- data/lib/appwrite/models/o_auth2_github.rb +42 -0
- data/lib/appwrite/models/o_auth2_gitlab.rb +47 -0
- data/lib/appwrite/models/o_auth2_google.rb +42 -0
- data/lib/appwrite/models/o_auth2_keycloak.rb +52 -0
- data/lib/appwrite/models/o_auth2_kick.rb +42 -0
- data/lib/appwrite/models/o_auth2_linkedin.rb +42 -0
- data/lib/appwrite/models/o_auth2_microsoft.rb +47 -0
- data/lib/appwrite/models/o_auth2_notion.rb +42 -0
- data/lib/appwrite/models/o_auth2_oidc.rb +62 -0
- data/lib/appwrite/models/o_auth2_okta.rb +52 -0
- data/lib/appwrite/models/o_auth2_paypal.rb +42 -0
- data/lib/appwrite/models/o_auth2_podio.rb +42 -0
- data/lib/appwrite/models/o_auth2_provider_list.rb +32 -0
- data/lib/appwrite/models/o_auth2_salesforce.rb +42 -0
- data/lib/appwrite/models/o_auth2_slack.rb +42 -0
- data/lib/appwrite/models/o_auth2_spotify.rb +42 -0
- data/lib/appwrite/models/o_auth2_stripe.rb +42 -0
- data/lib/appwrite/models/o_auth2_tradeshift.rb +42 -0
- data/lib/appwrite/models/o_auth2_twitch.rb +42 -0
- data/lib/appwrite/models/o_auth2_word_press.rb +42 -0
- data/lib/appwrite/models/o_auth2_x.rb +42 -0
- data/lib/appwrite/models/o_auth2_yahoo.rb +42 -0
- data/lib/appwrite/models/o_auth2_yandex.rb +42 -0
- data/lib/appwrite/models/o_auth2_zoho.rb +42 -0
- data/lib/appwrite/models/o_auth2_zoom.rb +42 -0
- data/lib/appwrite/models/policy_list.rb +32 -0
- data/lib/appwrite/models/policy_membership_privacy.rb +52 -0
- data/lib/appwrite/models/policy_password_dictionary.rb +32 -0
- data/lib/appwrite/models/policy_password_history.rb +32 -0
- data/lib/appwrite/models/policy_password_personal_data.rb +32 -0
- data/lib/appwrite/models/policy_session_alert.rb +32 -0
- data/lib/appwrite/models/policy_session_duration.rb +32 -0
- data/lib/appwrite/models/policy_session_invalidation.rb +32 -0
- data/lib/appwrite/models/policy_session_limit.rb +32 -0
- data/lib/appwrite/models/policy_user_limit.rb +32 -0
- data/lib/appwrite/models/project.rb +20 -5
- data/lib/appwrite/models/proxy_rule.rb +127 -0
- data/lib/appwrite/models/proxy_rule_list.rb +32 -0
- data/lib/appwrite/services/account.rb +1 -1
- data/lib/appwrite/services/databases.rb +126 -0
- data/lib/appwrite/services/functions.rb +13 -7
- data/lib/appwrite/services/project.rb +2695 -288
- data/lib/appwrite/services/proxy.rb +303 -0
- data/lib/appwrite/services/sites.rb +13 -7
- data/lib/appwrite/services/tables_db.rb +120 -0
- data/lib/appwrite.rb +69 -0
- metadata +71 -2
|
@@ -7,6 +7,66 @@ module Appwrite
|
|
|
7
7
|
@client = client
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
# Delete a project.
|
|
11
|
+
#
|
|
12
|
+
#
|
|
13
|
+
# @return []
|
|
14
|
+
def delete()
|
|
15
|
+
api_path = '/project'
|
|
16
|
+
|
|
17
|
+
api_params = {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
api_headers = {
|
|
21
|
+
"content-type": 'application/json',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@client.call(
|
|
25
|
+
method: 'DELETE',
|
|
26
|
+
path: api_path,
|
|
27
|
+
headers: api_headers,
|
|
28
|
+
params: api_params,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Update properties of a specific auth method. Use this endpoint to enable or
|
|
34
|
+
# disable a method in your project.
|
|
35
|
+
#
|
|
36
|
+
# @param [AuthMethod] method_id Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone
|
|
37
|
+
# @param [] enabled Auth method status.
|
|
38
|
+
#
|
|
39
|
+
# @return [Project]
|
|
40
|
+
def update_auth_method(method_id:, enabled:)
|
|
41
|
+
api_path = '/project/auth-methods/{methodId}'
|
|
42
|
+
.gsub('{methodId}', method_id)
|
|
43
|
+
|
|
44
|
+
if method_id.nil?
|
|
45
|
+
raise Appwrite::Exception.new('Missing required parameter: "methodId"')
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
if enabled.nil?
|
|
49
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
api_params = {
|
|
53
|
+
enabled: enabled,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
api_headers = {
|
|
57
|
+
"content-type": 'application/json',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@client.call(
|
|
61
|
+
method: 'PATCH',
|
|
62
|
+
path: api_path,
|
|
63
|
+
headers: api_headers,
|
|
64
|
+
params: api_params,
|
|
65
|
+
response_type: Models::Project
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
end
|
|
69
|
+
|
|
10
70
|
# Get a list of all API keys from the current project.
|
|
11
71
|
#
|
|
12
72
|
# @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
|
|
@@ -36,6 +96,9 @@ module Appwrite
|
|
|
36
96
|
|
|
37
97
|
# Create a new API key. It's recommended to have multiple API keys with
|
|
38
98
|
# strict scopes for separate functions within your project.
|
|
99
|
+
#
|
|
100
|
+
# You can also create an ephemeral API key if you need a short-lived key
|
|
101
|
+
# instead.
|
|
39
102
|
#
|
|
40
103
|
# @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
104
|
# @param [String] name Key name. Max length: 128 chars.
|
|
@@ -79,6 +142,46 @@ module Appwrite
|
|
|
79
142
|
|
|
80
143
|
end
|
|
81
144
|
|
|
145
|
+
# Create a new ephemeral API key. It's recommended to have multiple API keys
|
|
146
|
+
# with strict scopes for separate functions within your project.
|
|
147
|
+
#
|
|
148
|
+
# You can also create a standard API key if you need a longer-lived key
|
|
149
|
+
# instead.
|
|
150
|
+
#
|
|
151
|
+
# @param [Array] scopes Key scopes list. Maximum of 100 scopes are allowed.
|
|
152
|
+
# @param [Integer] duration Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.
|
|
153
|
+
#
|
|
154
|
+
# @return [EphemeralKey]
|
|
155
|
+
def create_ephemeral_key(scopes:, duration:)
|
|
156
|
+
api_path = '/project/keys/ephemeral'
|
|
157
|
+
|
|
158
|
+
if scopes.nil?
|
|
159
|
+
raise Appwrite::Exception.new('Missing required parameter: "scopes"')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if duration.nil?
|
|
163
|
+
raise Appwrite::Exception.new('Missing required parameter: "duration"')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
api_params = {
|
|
167
|
+
scopes: scopes,
|
|
168
|
+
duration: duration,
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
api_headers = {
|
|
172
|
+
"content-type": 'application/json',
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@client.call(
|
|
176
|
+
method: 'POST',
|
|
177
|
+
path: api_path,
|
|
178
|
+
headers: api_headers,
|
|
179
|
+
params: api_params,
|
|
180
|
+
response_type: Models::EphemeralKey
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
82
185
|
# Get a key by its unique ID.
|
|
83
186
|
#
|
|
84
187
|
# @param [String] key_id Key ID.
|
|
@@ -214,15 +317,15 @@ module Appwrite
|
|
|
214
317
|
|
|
215
318
|
end
|
|
216
319
|
|
|
217
|
-
# Get a list of all
|
|
218
|
-
# of all
|
|
320
|
+
# Get a list of all mock phones in the project. This endpoint returns an
|
|
321
|
+
# array of all mock phones and their OTPs.
|
|
219
322
|
#
|
|
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).
|
|
323
|
+
# @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). Only supported methods are limit and offset
|
|
221
324
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
222
325
|
#
|
|
223
|
-
# @return [
|
|
224
|
-
def
|
|
225
|
-
api_path = '/project/
|
|
326
|
+
# @return [MockNumberList]
|
|
327
|
+
def list_mock_phones(queries: nil, total: nil)
|
|
328
|
+
api_path = '/project/mock-phones'
|
|
226
329
|
|
|
227
330
|
api_params = {
|
|
228
331
|
queries: queries,
|
|
@@ -237,39 +340,32 @@ module Appwrite
|
|
|
237
340
|
path: api_path,
|
|
238
341
|
headers: api_headers,
|
|
239
342
|
params: api_params,
|
|
240
|
-
response_type: Models::
|
|
343
|
+
response_type: Models::MockNumberList
|
|
241
344
|
)
|
|
242
345
|
|
|
243
346
|
end
|
|
244
347
|
|
|
245
|
-
# Create a new
|
|
246
|
-
#
|
|
247
|
-
# which will interact with the Appwrite API.
|
|
348
|
+
# Create a new mock phone for your project. Use this endpoint to register a
|
|
349
|
+
# mock phone number and its sign-in OTP for your testers.
|
|
248
350
|
#
|
|
249
|
-
# @param [String]
|
|
250
|
-
# @param [String]
|
|
251
|
-
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
351
|
+
# @param [String] number Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number.
|
|
352
|
+
# @param [String] otp One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.
|
|
252
353
|
#
|
|
253
|
-
# @return [
|
|
254
|
-
def
|
|
255
|
-
api_path = '/project/
|
|
256
|
-
|
|
257
|
-
if platform_id.nil?
|
|
258
|
-
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
259
|
-
end
|
|
354
|
+
# @return [MockNumber]
|
|
355
|
+
def create_mock_phone(number:, otp:)
|
|
356
|
+
api_path = '/project/mock-phones'
|
|
260
357
|
|
|
261
|
-
if
|
|
262
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
358
|
+
if number.nil?
|
|
359
|
+
raise Appwrite::Exception.new('Missing required parameter: "number"')
|
|
263
360
|
end
|
|
264
361
|
|
|
265
|
-
if
|
|
266
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
362
|
+
if otp.nil?
|
|
363
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
267
364
|
end
|
|
268
365
|
|
|
269
366
|
api_params = {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
applicationId: application_id,
|
|
367
|
+
number: number,
|
|
368
|
+
otp: otp,
|
|
273
369
|
}
|
|
274
370
|
|
|
275
371
|
api_headers = {
|
|
@@ -281,82 +377,62 @@ module Appwrite
|
|
|
281
377
|
path: api_path,
|
|
282
378
|
headers: api_headers,
|
|
283
379
|
params: api_params,
|
|
284
|
-
response_type: Models::
|
|
380
|
+
response_type: Models::MockNumber
|
|
285
381
|
)
|
|
286
382
|
|
|
287
383
|
end
|
|
288
384
|
|
|
289
|
-
#
|
|
290
|
-
#
|
|
385
|
+
# Get a mock phone by its unique number. This endpoint returns the mock
|
|
386
|
+
# phone's OTP.
|
|
291
387
|
#
|
|
292
|
-
# @param [String]
|
|
293
|
-
# @param [String] name Platform name. Max length: 128 chars.
|
|
294
|
-
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
388
|
+
# @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.
|
|
295
389
|
#
|
|
296
|
-
# @return [
|
|
297
|
-
def
|
|
298
|
-
api_path = '/project/
|
|
299
|
-
.gsub('{
|
|
390
|
+
# @return [MockNumber]
|
|
391
|
+
def get_mock_phone(number:)
|
|
392
|
+
api_path = '/project/mock-phones/{number}'
|
|
393
|
+
.gsub('{number}', number)
|
|
300
394
|
|
|
301
|
-
if
|
|
302
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
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"')
|
|
395
|
+
if number.nil?
|
|
396
|
+
raise Appwrite::Exception.new('Missing required parameter: "number"')
|
|
311
397
|
end
|
|
312
398
|
|
|
313
399
|
api_params = {
|
|
314
|
-
name: name,
|
|
315
|
-
applicationId: application_id,
|
|
316
400
|
}
|
|
317
401
|
|
|
318
402
|
api_headers = {
|
|
319
|
-
"content-type": 'application/json',
|
|
320
403
|
}
|
|
321
404
|
|
|
322
405
|
@client.call(
|
|
323
|
-
method: '
|
|
406
|
+
method: 'GET',
|
|
324
407
|
path: api_path,
|
|
325
408
|
headers: api_headers,
|
|
326
409
|
params: api_params,
|
|
327
|
-
response_type: Models::
|
|
410
|
+
response_type: Models::MockNumber
|
|
328
411
|
)
|
|
329
412
|
|
|
330
413
|
end
|
|
331
414
|
|
|
332
|
-
#
|
|
333
|
-
#
|
|
334
|
-
# interact with the Appwrite API.
|
|
415
|
+
# Update a mock phone by its unique number. Use this endpoint to update the
|
|
416
|
+
# mock phone's OTP.
|
|
335
417
|
#
|
|
336
|
-
# @param [String]
|
|
337
|
-
# @param [String]
|
|
338
|
-
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
418
|
+
# @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.
|
|
419
|
+
# @param [String] otp One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.
|
|
339
420
|
#
|
|
340
|
-
# @return [
|
|
341
|
-
def
|
|
342
|
-
api_path = '/project/
|
|
343
|
-
|
|
344
|
-
if platform_id.nil?
|
|
345
|
-
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
346
|
-
end
|
|
421
|
+
# @return [MockNumber]
|
|
422
|
+
def update_mock_phone(number:, otp:)
|
|
423
|
+
api_path = '/project/mock-phones/{number}'
|
|
424
|
+
.gsub('{number}', number)
|
|
347
425
|
|
|
348
|
-
if
|
|
349
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
426
|
+
if number.nil?
|
|
427
|
+
raise Appwrite::Exception.new('Missing required parameter: "number"')
|
|
350
428
|
end
|
|
351
429
|
|
|
352
|
-
if
|
|
353
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
430
|
+
if otp.nil?
|
|
431
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
|
354
432
|
end
|
|
355
433
|
|
|
356
434
|
api_params = {
|
|
357
|
-
|
|
358
|
-
name: name,
|
|
359
|
-
bundleIdentifier: bundle_identifier,
|
|
435
|
+
otp: otp,
|
|
360
436
|
}
|
|
361
437
|
|
|
362
438
|
api_headers = {
|
|
@@ -364,42 +440,30 @@ module Appwrite
|
|
|
364
440
|
}
|
|
365
441
|
|
|
366
442
|
@client.call(
|
|
367
|
-
method: '
|
|
443
|
+
method: 'PUT',
|
|
368
444
|
path: api_path,
|
|
369
445
|
headers: api_headers,
|
|
370
446
|
params: api_params,
|
|
371
|
-
response_type: Models::
|
|
447
|
+
response_type: Models::MockNumber
|
|
372
448
|
)
|
|
373
449
|
|
|
374
450
|
end
|
|
375
451
|
|
|
376
|
-
#
|
|
377
|
-
#
|
|
452
|
+
# Delete a mock phone by its unique number. This endpoint removes the mock
|
|
453
|
+
# phone and its OTP configuration from the project.
|
|
378
454
|
#
|
|
379
|
-
# @param [String]
|
|
380
|
-
# @param [String] name Platform name. Max length: 128 chars.
|
|
381
|
-
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
455
|
+
# @param [String] number Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.
|
|
382
456
|
#
|
|
383
|
-
# @return [
|
|
384
|
-
def
|
|
385
|
-
api_path = '/project/
|
|
386
|
-
.gsub('{
|
|
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
|
|
457
|
+
# @return []
|
|
458
|
+
def delete_mock_phone(number:)
|
|
459
|
+
api_path = '/project/mock-phones/{number}'
|
|
460
|
+
.gsub('{number}', number)
|
|
395
461
|
|
|
396
|
-
if
|
|
397
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
462
|
+
if number.nil?
|
|
463
|
+
raise Appwrite::Exception.new('Missing required parameter: "number"')
|
|
398
464
|
end
|
|
399
465
|
|
|
400
466
|
api_params = {
|
|
401
|
-
name: name,
|
|
402
|
-
bundleIdentifier: bundle_identifier,
|
|
403
467
|
}
|
|
404
468
|
|
|
405
469
|
api_headers = {
|
|
@@ -407,43 +471,57 @@ module Appwrite
|
|
|
407
471
|
}
|
|
408
472
|
|
|
409
473
|
@client.call(
|
|
410
|
-
method: '
|
|
474
|
+
method: 'DELETE',
|
|
411
475
|
path: api_path,
|
|
412
476
|
headers: api_headers,
|
|
413
477
|
params: api_params,
|
|
414
|
-
response_type: Models::PlatformApple
|
|
415
478
|
)
|
|
416
479
|
|
|
417
480
|
end
|
|
418
481
|
|
|
419
|
-
#
|
|
420
|
-
#
|
|
421
|
-
#
|
|
482
|
+
# Get a list of all OAuth2 providers supported by the server, along with the
|
|
483
|
+
# project's configuration for each. Credential fields are write-only and
|
|
484
|
+
# always returned empty.
|
|
422
485
|
#
|
|
423
|
-
# @param [
|
|
424
|
-
# @param [
|
|
425
|
-
# @param [String] package_name Linux package name. Max length: 256 chars.
|
|
486
|
+
# @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). Only supported methods are limit and offset
|
|
487
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
426
488
|
#
|
|
427
|
-
# @return [
|
|
428
|
-
def
|
|
429
|
-
api_path = '/project/
|
|
489
|
+
# @return [OAuth2ProviderList]
|
|
490
|
+
def list_o_auth2_providers(queries: nil, total: nil)
|
|
491
|
+
api_path = '/project/oauth2'
|
|
430
492
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
493
|
+
api_params = {
|
|
494
|
+
queries: queries,
|
|
495
|
+
total: total,
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
api_headers = {
|
|
499
|
+
}
|
|
434
500
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
501
|
+
@client.call(
|
|
502
|
+
method: 'GET',
|
|
503
|
+
path: api_path,
|
|
504
|
+
headers: api_headers,
|
|
505
|
+
params: api_params,
|
|
506
|
+
response_type: Models::OAuth2ProviderList
|
|
507
|
+
)
|
|
438
508
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
# Update the project OAuth2 Amazon configuration.
|
|
512
|
+
#
|
|
513
|
+
# @param [String] client_id 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2
|
|
514
|
+
# @param [String] client_secret 'Client Secret' of Amazon OAuth2 app. For example: <CLIENT_SECRET>
|
|
515
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
516
|
+
#
|
|
517
|
+
# @return [OAuth2Amazon]
|
|
518
|
+
def update_o_auth2_amazon(client_id: nil, client_secret: nil, enabled: nil)
|
|
519
|
+
api_path = '/project/oauth2/amazon'
|
|
442
520
|
|
|
443
521
|
api_params = {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
522
|
+
clientId: client_id,
|
|
523
|
+
clientSecret: client_secret,
|
|
524
|
+
enabled: enabled,
|
|
447
525
|
}
|
|
448
526
|
|
|
449
527
|
api_headers = {
|
|
@@ -451,42 +529,33 @@ module Appwrite
|
|
|
451
529
|
}
|
|
452
530
|
|
|
453
531
|
@client.call(
|
|
454
|
-
method: '
|
|
532
|
+
method: 'PATCH',
|
|
455
533
|
path: api_path,
|
|
456
534
|
headers: api_headers,
|
|
457
535
|
params: api_params,
|
|
458
|
-
response_type: Models::
|
|
536
|
+
response_type: Models::OAuth2Amazon
|
|
459
537
|
)
|
|
460
538
|
|
|
461
539
|
end
|
|
462
540
|
|
|
463
|
-
# Update
|
|
464
|
-
# platform's name or package name.
|
|
541
|
+
# Update the project OAuth2 Apple configuration.
|
|
465
542
|
#
|
|
466
|
-
# @param [String]
|
|
467
|
-
# @param [String]
|
|
468
|
-
# @param [String]
|
|
543
|
+
# @param [String] service_id 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web
|
|
544
|
+
# @param [String] key_id 'Key ID' of Apple OAuth2 app. For example: P4000000N8
|
|
545
|
+
# @param [String] team_id 'Team ID' of Apple OAuth2 app. For example: D4000000R6
|
|
546
|
+
# @param [String] p8_file Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----
|
|
547
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
469
548
|
#
|
|
470
|
-
# @return [
|
|
471
|
-
def
|
|
472
|
-
api_path = '/project/
|
|
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
|
|
549
|
+
# @return [OAuth2Apple]
|
|
550
|
+
def update_o_auth2_apple(service_id: nil, key_id: nil, team_id: nil, p8_file: nil, enabled: nil)
|
|
551
|
+
api_path = '/project/oauth2/apple'
|
|
486
552
|
|
|
487
553
|
api_params = {
|
|
488
|
-
|
|
489
|
-
|
|
554
|
+
serviceId: service_id,
|
|
555
|
+
keyId: key_id,
|
|
556
|
+
teamId: team_id,
|
|
557
|
+
p8File: p8_file,
|
|
558
|
+
enabled: enabled,
|
|
490
559
|
}
|
|
491
560
|
|
|
492
561
|
api_headers = {
|
|
@@ -494,43 +563,2244 @@ module Appwrite
|
|
|
494
563
|
}
|
|
495
564
|
|
|
496
565
|
@client.call(
|
|
497
|
-
method: '
|
|
566
|
+
method: 'PATCH',
|
|
498
567
|
path: api_path,
|
|
499
568
|
headers: api_headers,
|
|
500
569
|
params: api_params,
|
|
501
|
-
response_type: Models::
|
|
570
|
+
response_type: Models::OAuth2Apple
|
|
502
571
|
)
|
|
503
572
|
|
|
504
573
|
end
|
|
505
574
|
|
|
506
|
-
#
|
|
507
|
-
# new platform where your users will run your application which will interact
|
|
508
|
-
# with the Appwrite API.
|
|
575
|
+
# Update the project OAuth2 Auth0 configuration.
|
|
509
576
|
#
|
|
510
|
-
# @param [String]
|
|
511
|
-
# @param [String]
|
|
512
|
-
# @param [String]
|
|
577
|
+
# @param [String] client_id 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq
|
|
578
|
+
# @param [String] client_secret 'Client Secret' of Auth0 OAuth2 app. For example: <CLIENT_SECRET>
|
|
579
|
+
# @param [String] endpoint Domain of Auth0 instance. For example: example.us.auth0.com
|
|
580
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
513
581
|
#
|
|
514
|
-
# @return [
|
|
515
|
-
def
|
|
516
|
-
api_path = '/project/
|
|
582
|
+
# @return [OAuth2Auth0]
|
|
583
|
+
def update_o_auth2_auth0(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
|
|
584
|
+
api_path = '/project/oauth2/auth0'
|
|
585
|
+
|
|
586
|
+
api_params = {
|
|
587
|
+
clientId: client_id,
|
|
588
|
+
clientSecret: client_secret,
|
|
589
|
+
endpoint: endpoint,
|
|
590
|
+
enabled: enabled,
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
api_headers = {
|
|
594
|
+
"content-type": 'application/json',
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
@client.call(
|
|
598
|
+
method: 'PATCH',
|
|
599
|
+
path: api_path,
|
|
600
|
+
headers: api_headers,
|
|
601
|
+
params: api_params,
|
|
602
|
+
response_type: Models::OAuth2Auth0
|
|
603
|
+
)
|
|
604
|
+
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
# Update the project OAuth2 Authentik configuration.
|
|
608
|
+
#
|
|
609
|
+
# @param [String] client_id 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv
|
|
610
|
+
# @param [String] client_secret 'Client Secret' of Authentik OAuth2 app. For example: <CLIENT_SECRET>
|
|
611
|
+
# @param [String] endpoint Domain of Authentik instance. For example: example.authentik.com
|
|
612
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
613
|
+
#
|
|
614
|
+
# @return [OAuth2Authentik]
|
|
615
|
+
def update_o_auth2_authentik(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
|
|
616
|
+
api_path = '/project/oauth2/authentik'
|
|
617
|
+
|
|
618
|
+
api_params = {
|
|
619
|
+
clientId: client_id,
|
|
620
|
+
clientSecret: client_secret,
|
|
621
|
+
endpoint: endpoint,
|
|
622
|
+
enabled: enabled,
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
api_headers = {
|
|
626
|
+
"content-type": 'application/json',
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
@client.call(
|
|
630
|
+
method: 'PATCH',
|
|
631
|
+
path: api_path,
|
|
632
|
+
headers: api_headers,
|
|
633
|
+
params: api_params,
|
|
634
|
+
response_type: Models::OAuth2Authentik
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
end
|
|
638
|
+
|
|
639
|
+
# Update the project OAuth2 Autodesk configuration.
|
|
640
|
+
#
|
|
641
|
+
# @param [String] client_id 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7
|
|
642
|
+
# @param [String] client_secret 'Client Secret' of Autodesk OAuth2 app. For example: <CLIENT_SECRET>
|
|
643
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
644
|
+
#
|
|
645
|
+
# @return [OAuth2Autodesk]
|
|
646
|
+
def update_o_auth2_autodesk(client_id: nil, client_secret: nil, enabled: nil)
|
|
647
|
+
api_path = '/project/oauth2/autodesk'
|
|
648
|
+
|
|
649
|
+
api_params = {
|
|
650
|
+
clientId: client_id,
|
|
651
|
+
clientSecret: client_secret,
|
|
652
|
+
enabled: enabled,
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
api_headers = {
|
|
656
|
+
"content-type": 'application/json',
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
@client.call(
|
|
660
|
+
method: 'PATCH',
|
|
661
|
+
path: api_path,
|
|
662
|
+
headers: api_headers,
|
|
663
|
+
params: api_params,
|
|
664
|
+
response_type: Models::OAuth2Autodesk
|
|
665
|
+
)
|
|
666
|
+
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# Update the project OAuth2 Bitbucket configuration.
|
|
670
|
+
#
|
|
671
|
+
# @param [String] key 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc
|
|
672
|
+
# @param [String] secret 'Secret' of Bitbucket OAuth2 app. For example: <CLIENT_SECRET>
|
|
673
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
674
|
+
#
|
|
675
|
+
# @return [OAuth2Bitbucket]
|
|
676
|
+
def update_o_auth2_bitbucket(key: nil, secret: nil, enabled: nil)
|
|
677
|
+
api_path = '/project/oauth2/bitbucket'
|
|
678
|
+
|
|
679
|
+
api_params = {
|
|
680
|
+
key: key,
|
|
681
|
+
secret: secret,
|
|
682
|
+
enabled: enabled,
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
api_headers = {
|
|
686
|
+
"content-type": 'application/json',
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
@client.call(
|
|
690
|
+
method: 'PATCH',
|
|
691
|
+
path: api_path,
|
|
692
|
+
headers: api_headers,
|
|
693
|
+
params: api_params,
|
|
694
|
+
response_type: Models::OAuth2Bitbucket
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
end
|
|
698
|
+
|
|
699
|
+
# Update the project OAuth2 Bitly configuration.
|
|
700
|
+
#
|
|
701
|
+
# @param [String] client_id 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b
|
|
702
|
+
# @param [String] client_secret 'Client Secret' of Bitly OAuth2 app. For example: <CLIENT_SECRET>
|
|
703
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
704
|
+
#
|
|
705
|
+
# @return [OAuth2Bitly]
|
|
706
|
+
def update_o_auth2_bitly(client_id: nil, client_secret: nil, enabled: nil)
|
|
707
|
+
api_path = '/project/oauth2/bitly'
|
|
708
|
+
|
|
709
|
+
api_params = {
|
|
710
|
+
clientId: client_id,
|
|
711
|
+
clientSecret: client_secret,
|
|
712
|
+
enabled: enabled,
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
api_headers = {
|
|
716
|
+
"content-type": 'application/json',
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
@client.call(
|
|
720
|
+
method: 'PATCH',
|
|
721
|
+
path: api_path,
|
|
722
|
+
headers: api_headers,
|
|
723
|
+
params: api_params,
|
|
724
|
+
response_type: Models::OAuth2Bitly
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
end
|
|
728
|
+
|
|
729
|
+
# Update the project OAuth2 Box configuration.
|
|
730
|
+
#
|
|
731
|
+
# @param [String] client_id 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y
|
|
732
|
+
# @param [String] client_secret 'Client Secret' of Box OAuth2 app. For example: <CLIENT_SECRET>
|
|
733
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
734
|
+
#
|
|
735
|
+
# @return [OAuth2Box]
|
|
736
|
+
def update_o_auth2_box(client_id: nil, client_secret: nil, enabled: nil)
|
|
737
|
+
api_path = '/project/oauth2/box'
|
|
738
|
+
|
|
739
|
+
api_params = {
|
|
740
|
+
clientId: client_id,
|
|
741
|
+
clientSecret: client_secret,
|
|
742
|
+
enabled: enabled,
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
api_headers = {
|
|
746
|
+
"content-type": 'application/json',
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
@client.call(
|
|
750
|
+
method: 'PATCH',
|
|
751
|
+
path: api_path,
|
|
752
|
+
headers: api_headers,
|
|
753
|
+
params: api_params,
|
|
754
|
+
response_type: Models::OAuth2Box
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
end
|
|
758
|
+
|
|
759
|
+
# Update the project OAuth2 Dailymotion configuration.
|
|
760
|
+
#
|
|
761
|
+
# @param [String] api_key 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f
|
|
762
|
+
# @param [String] api_secret 'API Secret' of Dailymotion OAuth2 app. For example: <CLIENT_SECRET>
|
|
763
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
764
|
+
#
|
|
765
|
+
# @return [OAuth2Dailymotion]
|
|
766
|
+
def update_o_auth2_dailymotion(api_key: nil, api_secret: nil, enabled: nil)
|
|
767
|
+
api_path = '/project/oauth2/dailymotion'
|
|
768
|
+
|
|
769
|
+
api_params = {
|
|
770
|
+
apiKey: api_key,
|
|
771
|
+
apiSecret: api_secret,
|
|
772
|
+
enabled: enabled,
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
api_headers = {
|
|
776
|
+
"content-type": 'application/json',
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
@client.call(
|
|
780
|
+
method: 'PATCH',
|
|
781
|
+
path: api_path,
|
|
782
|
+
headers: api_headers,
|
|
783
|
+
params: api_params,
|
|
784
|
+
response_type: Models::OAuth2Dailymotion
|
|
785
|
+
)
|
|
786
|
+
|
|
787
|
+
end
|
|
788
|
+
|
|
789
|
+
# Update the project OAuth2 Discord configuration.
|
|
790
|
+
#
|
|
791
|
+
# @param [String] client_id 'Client ID' of Discord OAuth2 app. For example: 950722000000343754
|
|
792
|
+
# @param [String] client_secret 'Client Secret' of Discord OAuth2 app. For example: <CLIENT_SECRET>
|
|
793
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
794
|
+
#
|
|
795
|
+
# @return [OAuth2Discord]
|
|
796
|
+
def update_o_auth2_discord(client_id: nil, client_secret: nil, enabled: nil)
|
|
797
|
+
api_path = '/project/oauth2/discord'
|
|
798
|
+
|
|
799
|
+
api_params = {
|
|
800
|
+
clientId: client_id,
|
|
801
|
+
clientSecret: client_secret,
|
|
802
|
+
enabled: enabled,
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
api_headers = {
|
|
806
|
+
"content-type": 'application/json',
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
@client.call(
|
|
810
|
+
method: 'PATCH',
|
|
811
|
+
path: api_path,
|
|
812
|
+
headers: api_headers,
|
|
813
|
+
params: api_params,
|
|
814
|
+
response_type: Models::OAuth2Discord
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
# Update the project OAuth2 Disqus configuration.
|
|
820
|
+
#
|
|
821
|
+
# @param [String] public_key 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX
|
|
822
|
+
# @param [String] secret_key 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: <CLIENT_SECRET>
|
|
823
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
824
|
+
#
|
|
825
|
+
# @return [OAuth2Disqus]
|
|
826
|
+
def update_o_auth2_disqus(public_key: nil, secret_key: nil, enabled: nil)
|
|
827
|
+
api_path = '/project/oauth2/disqus'
|
|
828
|
+
|
|
829
|
+
api_params = {
|
|
830
|
+
publicKey: public_key,
|
|
831
|
+
secretKey: secret_key,
|
|
832
|
+
enabled: enabled,
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
api_headers = {
|
|
836
|
+
"content-type": 'application/json',
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
@client.call(
|
|
840
|
+
method: 'PATCH',
|
|
841
|
+
path: api_path,
|
|
842
|
+
headers: api_headers,
|
|
843
|
+
params: api_params,
|
|
844
|
+
response_type: Models::OAuth2Disqus
|
|
845
|
+
)
|
|
846
|
+
|
|
847
|
+
end
|
|
848
|
+
|
|
849
|
+
# Update the project OAuth2 Dropbox configuration.
|
|
850
|
+
#
|
|
851
|
+
# @param [String] app_key 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t
|
|
852
|
+
# @param [String] app_secret 'App Secret' of Dropbox OAuth2 app. For example: <CLIENT_SECRET>
|
|
853
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
854
|
+
#
|
|
855
|
+
# @return [OAuth2Dropbox]
|
|
856
|
+
def update_o_auth2_dropbox(app_key: nil, app_secret: nil, enabled: nil)
|
|
857
|
+
api_path = '/project/oauth2/dropbox'
|
|
858
|
+
|
|
859
|
+
api_params = {
|
|
860
|
+
appKey: app_key,
|
|
861
|
+
appSecret: app_secret,
|
|
862
|
+
enabled: enabled,
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
api_headers = {
|
|
866
|
+
"content-type": 'application/json',
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
@client.call(
|
|
870
|
+
method: 'PATCH',
|
|
871
|
+
path: api_path,
|
|
872
|
+
headers: api_headers,
|
|
873
|
+
params: api_params,
|
|
874
|
+
response_type: Models::OAuth2Dropbox
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
end
|
|
878
|
+
|
|
879
|
+
# Update the project OAuth2 Etsy configuration.
|
|
880
|
+
#
|
|
881
|
+
# @param [String] key_string 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2
|
|
882
|
+
# @param [String] shared_secret 'Shared Secret' of Etsy OAuth2 app. For example: <CLIENT_SECRET>
|
|
883
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
884
|
+
#
|
|
885
|
+
# @return [OAuth2Etsy]
|
|
886
|
+
def update_o_auth2_etsy(key_string: nil, shared_secret: nil, enabled: nil)
|
|
887
|
+
api_path = '/project/oauth2/etsy'
|
|
888
|
+
|
|
889
|
+
api_params = {
|
|
890
|
+
keyString: key_string,
|
|
891
|
+
sharedSecret: shared_secret,
|
|
892
|
+
enabled: enabled,
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
api_headers = {
|
|
896
|
+
"content-type": 'application/json',
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
@client.call(
|
|
900
|
+
method: 'PATCH',
|
|
901
|
+
path: api_path,
|
|
902
|
+
headers: api_headers,
|
|
903
|
+
params: api_params,
|
|
904
|
+
response_type: Models::OAuth2Etsy
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
end
|
|
908
|
+
|
|
909
|
+
# Update the project OAuth2 Facebook configuration.
|
|
910
|
+
#
|
|
911
|
+
# @param [String] app_id 'App ID' of Facebook OAuth2 app. For example: 260600000007694
|
|
912
|
+
# @param [String] app_secret 'App Secret' of Facebook OAuth2 app. For example: <CLIENT_SECRET>
|
|
913
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
914
|
+
#
|
|
915
|
+
# @return [OAuth2Facebook]
|
|
916
|
+
def update_o_auth2_facebook(app_id: nil, app_secret: nil, enabled: nil)
|
|
917
|
+
api_path = '/project/oauth2/facebook'
|
|
918
|
+
|
|
919
|
+
api_params = {
|
|
920
|
+
appId: app_id,
|
|
921
|
+
appSecret: app_secret,
|
|
922
|
+
enabled: enabled,
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
api_headers = {
|
|
926
|
+
"content-type": 'application/json',
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
@client.call(
|
|
930
|
+
method: 'PATCH',
|
|
931
|
+
path: api_path,
|
|
932
|
+
headers: api_headers,
|
|
933
|
+
params: api_params,
|
|
934
|
+
response_type: Models::OAuth2Facebook
|
|
935
|
+
)
|
|
936
|
+
|
|
937
|
+
end
|
|
938
|
+
|
|
939
|
+
# Update the project OAuth2 Figma configuration.
|
|
940
|
+
#
|
|
941
|
+
# @param [String] client_id 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40
|
|
942
|
+
# @param [String] client_secret 'Client Secret' of Figma OAuth2 app. For example: <CLIENT_SECRET>
|
|
943
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
944
|
+
#
|
|
945
|
+
# @return [OAuth2Figma]
|
|
946
|
+
def update_o_auth2_figma(client_id: nil, client_secret: nil, enabled: nil)
|
|
947
|
+
api_path = '/project/oauth2/figma'
|
|
948
|
+
|
|
949
|
+
api_params = {
|
|
950
|
+
clientId: client_id,
|
|
951
|
+
clientSecret: client_secret,
|
|
952
|
+
enabled: enabled,
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
api_headers = {
|
|
956
|
+
"content-type": 'application/json',
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
@client.call(
|
|
960
|
+
method: 'PATCH',
|
|
961
|
+
path: api_path,
|
|
962
|
+
headers: api_headers,
|
|
963
|
+
params: api_params,
|
|
964
|
+
response_type: Models::OAuth2Figma
|
|
965
|
+
)
|
|
966
|
+
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
# Update the project OAuth2 FusionAuth configuration.
|
|
970
|
+
#
|
|
971
|
+
# @param [String] client_id 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097
|
|
972
|
+
# @param [String] client_secret 'Client Secret' of FusionAuth OAuth2 app. For example: <CLIENT_SECRET>
|
|
973
|
+
# @param [String] endpoint Domain of FusionAuth instance. For example: example.fusionauth.io
|
|
974
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
975
|
+
#
|
|
976
|
+
# @return [OAuth2FusionAuth]
|
|
977
|
+
def update_o_auth2_fusion_auth(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
|
|
978
|
+
api_path = '/project/oauth2/fusionauth'
|
|
979
|
+
|
|
980
|
+
api_params = {
|
|
981
|
+
clientId: client_id,
|
|
982
|
+
clientSecret: client_secret,
|
|
983
|
+
endpoint: endpoint,
|
|
984
|
+
enabled: enabled,
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
api_headers = {
|
|
988
|
+
"content-type": 'application/json',
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
@client.call(
|
|
992
|
+
method: 'PATCH',
|
|
993
|
+
path: api_path,
|
|
994
|
+
headers: api_headers,
|
|
995
|
+
params: api_params,
|
|
996
|
+
response_type: Models::OAuth2FusionAuth
|
|
997
|
+
)
|
|
998
|
+
|
|
999
|
+
end
|
|
1000
|
+
|
|
1001
|
+
# Update the project OAuth2 GitHub configuration.
|
|
1002
|
+
#
|
|
1003
|
+
# @param [String] client_id 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006
|
|
1004
|
+
# @param [String] client_secret 'Client Secret' of GitHub OAuth2 app. For example: <CLIENT_SECRET>
|
|
1005
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1006
|
+
#
|
|
1007
|
+
# @return [OAuth2Github]
|
|
1008
|
+
def update_o_auth2_git_hub(client_id: nil, client_secret: nil, enabled: nil)
|
|
1009
|
+
api_path = '/project/oauth2/github'
|
|
1010
|
+
|
|
1011
|
+
api_params = {
|
|
1012
|
+
clientId: client_id,
|
|
1013
|
+
clientSecret: client_secret,
|
|
1014
|
+
enabled: enabled,
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
api_headers = {
|
|
1018
|
+
"content-type": 'application/json',
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
@client.call(
|
|
1022
|
+
method: 'PATCH',
|
|
1023
|
+
path: api_path,
|
|
1024
|
+
headers: api_headers,
|
|
1025
|
+
params: api_params,
|
|
1026
|
+
response_type: Models::OAuth2Github
|
|
1027
|
+
)
|
|
1028
|
+
|
|
1029
|
+
end
|
|
1030
|
+
|
|
1031
|
+
# Update the project OAuth2 Gitlab configuration.
|
|
1032
|
+
#
|
|
1033
|
+
# @param [String] application_id 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252
|
|
1034
|
+
# @param [String] secret 'Secret' of Gitlab OAuth2 app. For example: <CLIENT_SECRET>
|
|
1035
|
+
# @param [String] endpoint Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com
|
|
1036
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1037
|
+
#
|
|
1038
|
+
# @return [OAuth2Gitlab]
|
|
1039
|
+
def update_o_auth2_gitlab(application_id: nil, secret: nil, endpoint: nil, enabled: nil)
|
|
1040
|
+
api_path = '/project/oauth2/gitlab'
|
|
1041
|
+
|
|
1042
|
+
api_params = {
|
|
1043
|
+
applicationId: application_id,
|
|
1044
|
+
secret: secret,
|
|
1045
|
+
endpoint: endpoint,
|
|
1046
|
+
enabled: enabled,
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
api_headers = {
|
|
1050
|
+
"content-type": 'application/json',
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
@client.call(
|
|
1054
|
+
method: 'PATCH',
|
|
1055
|
+
path: api_path,
|
|
1056
|
+
headers: api_headers,
|
|
1057
|
+
params: api_params,
|
|
1058
|
+
response_type: Models::OAuth2Gitlab
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1061
|
+
end
|
|
1062
|
+
|
|
1063
|
+
# Update the project OAuth2 Google configuration.
|
|
1064
|
+
#
|
|
1065
|
+
# @param [String] client_id 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com
|
|
1066
|
+
# @param [String] client_secret 'Client Secret' of Google OAuth2 app. For example: <CLIENT_SECRET>
|
|
1067
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1068
|
+
#
|
|
1069
|
+
# @return [OAuth2Google]
|
|
1070
|
+
def update_o_auth2_google(client_id: nil, client_secret: nil, enabled: nil)
|
|
1071
|
+
api_path = '/project/oauth2/google'
|
|
1072
|
+
|
|
1073
|
+
api_params = {
|
|
1074
|
+
clientId: client_id,
|
|
1075
|
+
clientSecret: client_secret,
|
|
1076
|
+
enabled: enabled,
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
api_headers = {
|
|
1080
|
+
"content-type": 'application/json',
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
@client.call(
|
|
1084
|
+
method: 'PATCH',
|
|
1085
|
+
path: api_path,
|
|
1086
|
+
headers: api_headers,
|
|
1087
|
+
params: api_params,
|
|
1088
|
+
response_type: Models::OAuth2Google
|
|
1089
|
+
)
|
|
1090
|
+
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
# Update the project OAuth2 Keycloak configuration.
|
|
1094
|
+
#
|
|
1095
|
+
# @param [String] client_id 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app
|
|
1096
|
+
# @param [String] client_secret 'Client Secret' of Keycloak OAuth2 app. For example: <CLIENT_SECRET>
|
|
1097
|
+
# @param [String] endpoint Domain of Keycloak instance. For example: keycloak.example.com
|
|
1098
|
+
# @param [String] realm_name Keycloak realm name. For example: appwrite-realm
|
|
1099
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1100
|
+
#
|
|
1101
|
+
# @return [OAuth2Keycloak]
|
|
1102
|
+
def update_o_auth2_keycloak(client_id: nil, client_secret: nil, endpoint: nil, realm_name: nil, enabled: nil)
|
|
1103
|
+
api_path = '/project/oauth2/keycloak'
|
|
1104
|
+
|
|
1105
|
+
api_params = {
|
|
1106
|
+
clientId: client_id,
|
|
1107
|
+
clientSecret: client_secret,
|
|
1108
|
+
endpoint: endpoint,
|
|
1109
|
+
realmName: realm_name,
|
|
1110
|
+
enabled: enabled,
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
api_headers = {
|
|
1114
|
+
"content-type": 'application/json',
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
@client.call(
|
|
1118
|
+
method: 'PATCH',
|
|
1119
|
+
path: api_path,
|
|
1120
|
+
headers: api_headers,
|
|
1121
|
+
params: api_params,
|
|
1122
|
+
response_type: Models::OAuth2Keycloak
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
end
|
|
1126
|
+
|
|
1127
|
+
# Update the project OAuth2 Kick configuration.
|
|
1128
|
+
#
|
|
1129
|
+
# @param [String] client_id 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32
|
|
1130
|
+
# @param [String] client_secret 'Client Secret' of Kick OAuth2 app. For example: <CLIENT_SECRET>
|
|
1131
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1132
|
+
#
|
|
1133
|
+
# @return [OAuth2Kick]
|
|
1134
|
+
def update_o_auth2_kick(client_id: nil, client_secret: nil, enabled: nil)
|
|
1135
|
+
api_path = '/project/oauth2/kick'
|
|
1136
|
+
|
|
1137
|
+
api_params = {
|
|
1138
|
+
clientId: client_id,
|
|
1139
|
+
clientSecret: client_secret,
|
|
1140
|
+
enabled: enabled,
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
api_headers = {
|
|
1144
|
+
"content-type": 'application/json',
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
@client.call(
|
|
1148
|
+
method: 'PATCH',
|
|
1149
|
+
path: api_path,
|
|
1150
|
+
headers: api_headers,
|
|
1151
|
+
params: api_params,
|
|
1152
|
+
response_type: Models::OAuth2Kick
|
|
1153
|
+
)
|
|
1154
|
+
|
|
1155
|
+
end
|
|
1156
|
+
|
|
1157
|
+
# Update the project OAuth2 Linkedin configuration.
|
|
1158
|
+
#
|
|
1159
|
+
# @param [String] client_id 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv
|
|
1160
|
+
# @param [String] primary_client_secret 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: <CLIENT_SECRET>
|
|
1161
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1162
|
+
#
|
|
1163
|
+
# @return [OAuth2Linkedin]
|
|
1164
|
+
def update_o_auth2_linkedin(client_id: nil, primary_client_secret: nil, enabled: nil)
|
|
1165
|
+
api_path = '/project/oauth2/linkedin'
|
|
1166
|
+
|
|
1167
|
+
api_params = {
|
|
1168
|
+
clientId: client_id,
|
|
1169
|
+
primaryClientSecret: primary_client_secret,
|
|
1170
|
+
enabled: enabled,
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
api_headers = {
|
|
1174
|
+
"content-type": 'application/json',
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
@client.call(
|
|
1178
|
+
method: 'PATCH',
|
|
1179
|
+
path: api_path,
|
|
1180
|
+
headers: api_headers,
|
|
1181
|
+
params: api_params,
|
|
1182
|
+
response_type: Models::OAuth2Linkedin
|
|
1183
|
+
)
|
|
1184
|
+
|
|
1185
|
+
end
|
|
1186
|
+
|
|
1187
|
+
# Update the project OAuth2 Microsoft configuration.
|
|
1188
|
+
#
|
|
1189
|
+
# @param [String] application_id 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444
|
|
1190
|
+
# @param [String] application_secret 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: <CLIENT_SECRET>
|
|
1191
|
+
# @param [String] tenant Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common
|
|
1192
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1193
|
+
#
|
|
1194
|
+
# @return [OAuth2Microsoft]
|
|
1195
|
+
def update_o_auth2_microsoft(application_id: nil, application_secret: nil, tenant: nil, enabled: nil)
|
|
1196
|
+
api_path = '/project/oauth2/microsoft'
|
|
1197
|
+
|
|
1198
|
+
api_params = {
|
|
1199
|
+
applicationId: application_id,
|
|
1200
|
+
applicationSecret: application_secret,
|
|
1201
|
+
tenant: tenant,
|
|
1202
|
+
enabled: enabled,
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
api_headers = {
|
|
1206
|
+
"content-type": 'application/json',
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
@client.call(
|
|
1210
|
+
method: 'PATCH',
|
|
1211
|
+
path: api_path,
|
|
1212
|
+
headers: api_headers,
|
|
1213
|
+
params: api_params,
|
|
1214
|
+
response_type: Models::OAuth2Microsoft
|
|
1215
|
+
)
|
|
1216
|
+
|
|
1217
|
+
end
|
|
1218
|
+
|
|
1219
|
+
# Update the project OAuth2 Notion configuration.
|
|
1220
|
+
#
|
|
1221
|
+
# @param [String] oauth_client_id 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3
|
|
1222
|
+
# @param [String] oauth_client_secret 'OAuth Client Secret' of Notion OAuth2 app. For example: <CLIENT_SECRET>
|
|
1223
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1224
|
+
#
|
|
1225
|
+
# @return [OAuth2Notion]
|
|
1226
|
+
def update_o_auth2_notion(oauth_client_id: nil, oauth_client_secret: nil, enabled: nil)
|
|
1227
|
+
api_path = '/project/oauth2/notion'
|
|
1228
|
+
|
|
1229
|
+
api_params = {
|
|
1230
|
+
oauthClientId: oauth_client_id,
|
|
1231
|
+
oauthClientSecret: oauth_client_secret,
|
|
1232
|
+
enabled: enabled,
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
api_headers = {
|
|
1236
|
+
"content-type": 'application/json',
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
@client.call(
|
|
1240
|
+
method: 'PATCH',
|
|
1241
|
+
path: api_path,
|
|
1242
|
+
headers: api_headers,
|
|
1243
|
+
params: api_params,
|
|
1244
|
+
response_type: Models::OAuth2Notion
|
|
1245
|
+
)
|
|
1246
|
+
|
|
1247
|
+
end
|
|
1248
|
+
|
|
1249
|
+
# Update the project OAuth2 Oidc configuration.
|
|
1250
|
+
#
|
|
1251
|
+
# @param [String] client_id 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG
|
|
1252
|
+
# @param [String] client_secret 'Client Secret' of Oidc OAuth2 app. For example: <CLIENT_SECRET>
|
|
1253
|
+
# @param [String] well_known_url OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration
|
|
1254
|
+
# @param [String] authorization_url OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize
|
|
1255
|
+
# @param [String] token_url OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token
|
|
1256
|
+
# @param [String] user_info_url OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo
|
|
1257
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1258
|
+
#
|
|
1259
|
+
# @return [OAuth2Oidc]
|
|
1260
|
+
def update_o_auth2_oidc(client_id: nil, client_secret: nil, well_known_url: nil, authorization_url: nil, token_url: nil, user_info_url: nil, enabled: nil)
|
|
1261
|
+
api_path = '/project/oauth2/oidc'
|
|
1262
|
+
|
|
1263
|
+
api_params = {
|
|
1264
|
+
clientId: client_id,
|
|
1265
|
+
clientSecret: client_secret,
|
|
1266
|
+
wellKnownURL: well_known_url,
|
|
1267
|
+
authorizationURL: authorization_url,
|
|
1268
|
+
tokenURL: token_url,
|
|
1269
|
+
userInfoURL: user_info_url,
|
|
1270
|
+
enabled: enabled,
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
api_headers = {
|
|
1274
|
+
"content-type": 'application/json',
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
@client.call(
|
|
1278
|
+
method: 'PATCH',
|
|
1279
|
+
path: api_path,
|
|
1280
|
+
headers: api_headers,
|
|
1281
|
+
params: api_params,
|
|
1282
|
+
response_type: Models::OAuth2Oidc
|
|
1283
|
+
)
|
|
1284
|
+
|
|
1285
|
+
end
|
|
1286
|
+
|
|
1287
|
+
# Update the project OAuth2 Okta configuration.
|
|
1288
|
+
#
|
|
1289
|
+
# @param [String] client_id 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698
|
|
1290
|
+
# @param [String] client_secret 'Client Secret' of Okta OAuth2 app. For example: <CLIENT_SECRET>
|
|
1291
|
+
# @param [String] domain Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/
|
|
1292
|
+
# @param [String] authorization_server_id Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z
|
|
1293
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1294
|
+
#
|
|
1295
|
+
# @return [OAuth2Okta]
|
|
1296
|
+
def update_o_auth2_okta(client_id: nil, client_secret: nil, domain: nil, authorization_server_id: nil, enabled: nil)
|
|
1297
|
+
api_path = '/project/oauth2/okta'
|
|
1298
|
+
|
|
1299
|
+
api_params = {
|
|
1300
|
+
clientId: client_id,
|
|
1301
|
+
clientSecret: client_secret,
|
|
1302
|
+
domain: domain,
|
|
1303
|
+
authorizationServerId: authorization_server_id,
|
|
1304
|
+
enabled: enabled,
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
api_headers = {
|
|
1308
|
+
"content-type": 'application/json',
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
@client.call(
|
|
1312
|
+
method: 'PATCH',
|
|
1313
|
+
path: api_path,
|
|
1314
|
+
headers: api_headers,
|
|
1315
|
+
params: api_params,
|
|
1316
|
+
response_type: Models::OAuth2Okta
|
|
1317
|
+
)
|
|
1318
|
+
|
|
1319
|
+
end
|
|
1320
|
+
|
|
1321
|
+
# Update the project OAuth2 Paypal configuration.
|
|
1322
|
+
#
|
|
1323
|
+
# @param [String] client_id 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB
|
|
1324
|
+
# @param [String] secret_key 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: <CLIENT_SECRET>
|
|
1325
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1326
|
+
#
|
|
1327
|
+
# @return [OAuth2Paypal]
|
|
1328
|
+
def update_o_auth2_paypal(client_id: nil, secret_key: nil, enabled: nil)
|
|
1329
|
+
api_path = '/project/oauth2/paypal'
|
|
1330
|
+
|
|
1331
|
+
api_params = {
|
|
1332
|
+
clientId: client_id,
|
|
1333
|
+
secretKey: secret_key,
|
|
1334
|
+
enabled: enabled,
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
api_headers = {
|
|
1338
|
+
"content-type": 'application/json',
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
@client.call(
|
|
1342
|
+
method: 'PATCH',
|
|
1343
|
+
path: api_path,
|
|
1344
|
+
headers: api_headers,
|
|
1345
|
+
params: api_params,
|
|
1346
|
+
response_type: Models::OAuth2Paypal
|
|
1347
|
+
)
|
|
1348
|
+
|
|
1349
|
+
end
|
|
1350
|
+
|
|
1351
|
+
# Update the project OAuth2 PaypalSandbox configuration.
|
|
1352
|
+
#
|
|
1353
|
+
# @param [String] client_id 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB
|
|
1354
|
+
# @param [String] secret_key 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: <CLIENT_SECRET>
|
|
1355
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1356
|
+
#
|
|
1357
|
+
# @return [OAuth2Paypal]
|
|
1358
|
+
def update_o_auth2_paypal_sandbox(client_id: nil, secret_key: nil, enabled: nil)
|
|
1359
|
+
api_path = '/project/oauth2/paypalSandbox'
|
|
1360
|
+
|
|
1361
|
+
api_params = {
|
|
1362
|
+
clientId: client_id,
|
|
1363
|
+
secretKey: secret_key,
|
|
1364
|
+
enabled: enabled,
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
api_headers = {
|
|
1368
|
+
"content-type": 'application/json',
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
@client.call(
|
|
1372
|
+
method: 'PATCH',
|
|
1373
|
+
path: api_path,
|
|
1374
|
+
headers: api_headers,
|
|
1375
|
+
params: api_params,
|
|
1376
|
+
response_type: Models::OAuth2Paypal
|
|
1377
|
+
)
|
|
1378
|
+
|
|
1379
|
+
end
|
|
1380
|
+
|
|
1381
|
+
# Update the project OAuth2 Podio configuration.
|
|
1382
|
+
#
|
|
1383
|
+
# @param [String] client_id 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app
|
|
1384
|
+
# @param [String] client_secret 'Client Secret' of Podio OAuth2 app. For example: <CLIENT_SECRET>
|
|
1385
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1386
|
+
#
|
|
1387
|
+
# @return [OAuth2Podio]
|
|
1388
|
+
def update_o_auth2_podio(client_id: nil, client_secret: nil, enabled: nil)
|
|
1389
|
+
api_path = '/project/oauth2/podio'
|
|
1390
|
+
|
|
1391
|
+
api_params = {
|
|
1392
|
+
clientId: client_id,
|
|
1393
|
+
clientSecret: client_secret,
|
|
1394
|
+
enabled: enabled,
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
api_headers = {
|
|
1398
|
+
"content-type": 'application/json',
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
@client.call(
|
|
1402
|
+
method: 'PATCH',
|
|
1403
|
+
path: api_path,
|
|
1404
|
+
headers: api_headers,
|
|
1405
|
+
params: api_params,
|
|
1406
|
+
response_type: Models::OAuth2Podio
|
|
1407
|
+
)
|
|
1408
|
+
|
|
1409
|
+
end
|
|
1410
|
+
|
|
1411
|
+
# Update the project OAuth2 Salesforce configuration.
|
|
1412
|
+
#
|
|
1413
|
+
# @param [String] customer_key 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq
|
|
1414
|
+
# @param [String] customer_secret 'Consumer Secret' of Salesforce OAuth2 app. For example: <CLIENT_SECRET>
|
|
1415
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1416
|
+
#
|
|
1417
|
+
# @return [OAuth2Salesforce]
|
|
1418
|
+
def update_o_auth2_salesforce(customer_key: nil, customer_secret: nil, enabled: nil)
|
|
1419
|
+
api_path = '/project/oauth2/salesforce'
|
|
1420
|
+
|
|
1421
|
+
api_params = {
|
|
1422
|
+
customerKey: customer_key,
|
|
1423
|
+
customerSecret: customer_secret,
|
|
1424
|
+
enabled: enabled,
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
api_headers = {
|
|
1428
|
+
"content-type": 'application/json',
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
@client.call(
|
|
1432
|
+
method: 'PATCH',
|
|
1433
|
+
path: api_path,
|
|
1434
|
+
headers: api_headers,
|
|
1435
|
+
params: api_params,
|
|
1436
|
+
response_type: Models::OAuth2Salesforce
|
|
1437
|
+
)
|
|
1438
|
+
|
|
1439
|
+
end
|
|
1440
|
+
|
|
1441
|
+
# Update the project OAuth2 Slack configuration.
|
|
1442
|
+
#
|
|
1443
|
+
# @param [String] client_id 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023
|
|
1444
|
+
# @param [String] client_secret 'Client Secret' of Slack OAuth2 app. For example: <CLIENT_SECRET>
|
|
1445
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1446
|
+
#
|
|
1447
|
+
# @return [OAuth2Slack]
|
|
1448
|
+
def update_o_auth2_slack(client_id: nil, client_secret: nil, enabled: nil)
|
|
1449
|
+
api_path = '/project/oauth2/slack'
|
|
1450
|
+
|
|
1451
|
+
api_params = {
|
|
1452
|
+
clientId: client_id,
|
|
1453
|
+
clientSecret: client_secret,
|
|
1454
|
+
enabled: enabled,
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
api_headers = {
|
|
1458
|
+
"content-type": 'application/json',
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
@client.call(
|
|
1462
|
+
method: 'PATCH',
|
|
1463
|
+
path: api_path,
|
|
1464
|
+
headers: api_headers,
|
|
1465
|
+
params: api_params,
|
|
1466
|
+
response_type: Models::OAuth2Slack
|
|
1467
|
+
)
|
|
1468
|
+
|
|
1469
|
+
end
|
|
1470
|
+
|
|
1471
|
+
# Update the project OAuth2 Spotify configuration.
|
|
1472
|
+
#
|
|
1473
|
+
# @param [String] client_id 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace
|
|
1474
|
+
# @param [String] client_secret 'Client Secret' of Spotify OAuth2 app. For example: <CLIENT_SECRET>
|
|
1475
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1476
|
+
#
|
|
1477
|
+
# @return [OAuth2Spotify]
|
|
1478
|
+
def update_o_auth2_spotify(client_id: nil, client_secret: nil, enabled: nil)
|
|
1479
|
+
api_path = '/project/oauth2/spotify'
|
|
1480
|
+
|
|
1481
|
+
api_params = {
|
|
1482
|
+
clientId: client_id,
|
|
1483
|
+
clientSecret: client_secret,
|
|
1484
|
+
enabled: enabled,
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
api_headers = {
|
|
1488
|
+
"content-type": 'application/json',
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
@client.call(
|
|
1492
|
+
method: 'PATCH',
|
|
1493
|
+
path: api_path,
|
|
1494
|
+
headers: api_headers,
|
|
1495
|
+
params: api_params,
|
|
1496
|
+
response_type: Models::OAuth2Spotify
|
|
1497
|
+
)
|
|
1498
|
+
|
|
1499
|
+
end
|
|
1500
|
+
|
|
1501
|
+
# Update the project OAuth2 Stripe configuration.
|
|
1502
|
+
#
|
|
1503
|
+
# @param [String] client_id 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR
|
|
1504
|
+
# @param [String] api_secret_key 'API Secret Key' of Stripe OAuth2 app. For example: <CLIENT_SECRET>
|
|
1505
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1506
|
+
#
|
|
1507
|
+
# @return [OAuth2Stripe]
|
|
1508
|
+
def update_o_auth2_stripe(client_id: nil, api_secret_key: nil, enabled: nil)
|
|
1509
|
+
api_path = '/project/oauth2/stripe'
|
|
1510
|
+
|
|
1511
|
+
api_params = {
|
|
1512
|
+
clientId: client_id,
|
|
1513
|
+
apiSecretKey: api_secret_key,
|
|
1514
|
+
enabled: enabled,
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
api_headers = {
|
|
1518
|
+
"content-type": 'application/json',
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
@client.call(
|
|
1522
|
+
method: 'PATCH',
|
|
1523
|
+
path: api_path,
|
|
1524
|
+
headers: api_headers,
|
|
1525
|
+
params: api_params,
|
|
1526
|
+
response_type: Models::OAuth2Stripe
|
|
1527
|
+
)
|
|
1528
|
+
|
|
1529
|
+
end
|
|
1530
|
+
|
|
1531
|
+
# Update the project OAuth2 Tradeshift configuration.
|
|
1532
|
+
#
|
|
1533
|
+
# @param [String] oauth2_client_id 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app
|
|
1534
|
+
# @param [String] oauth2_client_secret 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: <CLIENT_SECRET>
|
|
1535
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1536
|
+
#
|
|
1537
|
+
# @return [OAuth2Tradeshift]
|
|
1538
|
+
def update_o_auth2_tradeshift(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil)
|
|
1539
|
+
api_path = '/project/oauth2/tradeshift'
|
|
1540
|
+
|
|
1541
|
+
api_params = {
|
|
1542
|
+
oauth2ClientId: oauth2_client_id,
|
|
1543
|
+
oauth2ClientSecret: oauth2_client_secret,
|
|
1544
|
+
enabled: enabled,
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
api_headers = {
|
|
1548
|
+
"content-type": 'application/json',
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
@client.call(
|
|
1552
|
+
method: 'PATCH',
|
|
1553
|
+
path: api_path,
|
|
1554
|
+
headers: api_headers,
|
|
1555
|
+
params: api_params,
|
|
1556
|
+
response_type: Models::OAuth2Tradeshift
|
|
1557
|
+
)
|
|
1558
|
+
|
|
1559
|
+
end
|
|
1560
|
+
|
|
1561
|
+
# Update the project OAuth2 Tradeshift Sandbox configuration.
|
|
1562
|
+
#
|
|
1563
|
+
# @param [String] oauth2_client_id 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app
|
|
1564
|
+
# @param [String] oauth2_client_secret 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: <CLIENT_SECRET>
|
|
1565
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1566
|
+
#
|
|
1567
|
+
# @return [OAuth2Tradeshift]
|
|
1568
|
+
def update_o_auth2_tradeshift_sandbox(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil)
|
|
1569
|
+
api_path = '/project/oauth2/tradeshiftBox'
|
|
1570
|
+
|
|
1571
|
+
api_params = {
|
|
1572
|
+
oauth2ClientId: oauth2_client_id,
|
|
1573
|
+
oauth2ClientSecret: oauth2_client_secret,
|
|
1574
|
+
enabled: enabled,
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
api_headers = {
|
|
1578
|
+
"content-type": 'application/json',
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
@client.call(
|
|
1582
|
+
method: 'PATCH',
|
|
1583
|
+
path: api_path,
|
|
1584
|
+
headers: api_headers,
|
|
1585
|
+
params: api_params,
|
|
1586
|
+
response_type: Models::OAuth2Tradeshift
|
|
1587
|
+
)
|
|
1588
|
+
|
|
1589
|
+
end
|
|
1590
|
+
|
|
1591
|
+
# Update the project OAuth2 Twitch configuration.
|
|
1592
|
+
#
|
|
1593
|
+
# @param [String] client_id 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p
|
|
1594
|
+
# @param [String] client_secret 'Client Secret' of Twitch OAuth2 app. For example: <CLIENT_SECRET>
|
|
1595
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1596
|
+
#
|
|
1597
|
+
# @return [OAuth2Twitch]
|
|
1598
|
+
def update_o_auth2_twitch(client_id: nil, client_secret: nil, enabled: nil)
|
|
1599
|
+
api_path = '/project/oauth2/twitch'
|
|
1600
|
+
|
|
1601
|
+
api_params = {
|
|
1602
|
+
clientId: client_id,
|
|
1603
|
+
clientSecret: client_secret,
|
|
1604
|
+
enabled: enabled,
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
api_headers = {
|
|
1608
|
+
"content-type": 'application/json',
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
@client.call(
|
|
1612
|
+
method: 'PATCH',
|
|
1613
|
+
path: api_path,
|
|
1614
|
+
headers: api_headers,
|
|
1615
|
+
params: api_params,
|
|
1616
|
+
response_type: Models::OAuth2Twitch
|
|
1617
|
+
)
|
|
1618
|
+
|
|
1619
|
+
end
|
|
1620
|
+
|
|
1621
|
+
# Update the project OAuth2 WordPress configuration.
|
|
1622
|
+
#
|
|
1623
|
+
# @param [String] client_id 'Client ID' of WordPress OAuth2 app. For example: 130005
|
|
1624
|
+
# @param [String] client_secret 'Client Secret' of WordPress OAuth2 app. For example: <CLIENT_SECRET>
|
|
1625
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1626
|
+
#
|
|
1627
|
+
# @return [OAuth2WordPress]
|
|
1628
|
+
def update_o_auth2_word_press(client_id: nil, client_secret: nil, enabled: nil)
|
|
1629
|
+
api_path = '/project/oauth2/wordpress'
|
|
1630
|
+
|
|
1631
|
+
api_params = {
|
|
1632
|
+
clientId: client_id,
|
|
1633
|
+
clientSecret: client_secret,
|
|
1634
|
+
enabled: enabled,
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
api_headers = {
|
|
1638
|
+
"content-type": 'application/json',
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
@client.call(
|
|
1642
|
+
method: 'PATCH',
|
|
1643
|
+
path: api_path,
|
|
1644
|
+
headers: api_headers,
|
|
1645
|
+
params: api_params,
|
|
1646
|
+
response_type: Models::OAuth2WordPress
|
|
1647
|
+
)
|
|
1648
|
+
|
|
1649
|
+
end
|
|
1650
|
+
|
|
1651
|
+
# Update the project OAuth2 X configuration.
|
|
1652
|
+
#
|
|
1653
|
+
# @param [String] customer_key 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT
|
|
1654
|
+
# @param [String] secret_key 'Secret Key' of X OAuth2 app. For example: <CLIENT_SECRET>
|
|
1655
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1656
|
+
#
|
|
1657
|
+
# @return [OAuth2X]
|
|
1658
|
+
def update_o_auth2_x(customer_key: nil, secret_key: nil, enabled: nil)
|
|
1659
|
+
api_path = '/project/oauth2/x'
|
|
1660
|
+
|
|
1661
|
+
api_params = {
|
|
1662
|
+
customerKey: customer_key,
|
|
1663
|
+
secretKey: secret_key,
|
|
1664
|
+
enabled: enabled,
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
api_headers = {
|
|
1668
|
+
"content-type": 'application/json',
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
@client.call(
|
|
1672
|
+
method: 'PATCH',
|
|
1673
|
+
path: api_path,
|
|
1674
|
+
headers: api_headers,
|
|
1675
|
+
params: api_params,
|
|
1676
|
+
response_type: Models::OAuth2X
|
|
1677
|
+
)
|
|
1678
|
+
|
|
1679
|
+
end
|
|
1680
|
+
|
|
1681
|
+
# Update the project OAuth2 Yahoo configuration.
|
|
1682
|
+
#
|
|
1683
|
+
# @param [String] client_id 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm
|
|
1684
|
+
# @param [String] client_secret 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: <CLIENT_SECRET>
|
|
1685
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1686
|
+
#
|
|
1687
|
+
# @return [OAuth2Yahoo]
|
|
1688
|
+
def update_o_auth2_yahoo(client_id: nil, client_secret: nil, enabled: nil)
|
|
1689
|
+
api_path = '/project/oauth2/yahoo'
|
|
1690
|
+
|
|
1691
|
+
api_params = {
|
|
1692
|
+
clientId: client_id,
|
|
1693
|
+
clientSecret: client_secret,
|
|
1694
|
+
enabled: enabled,
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
api_headers = {
|
|
1698
|
+
"content-type": 'application/json',
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
@client.call(
|
|
1702
|
+
method: 'PATCH',
|
|
1703
|
+
path: api_path,
|
|
1704
|
+
headers: api_headers,
|
|
1705
|
+
params: api_params,
|
|
1706
|
+
response_type: Models::OAuth2Yahoo
|
|
1707
|
+
)
|
|
1708
|
+
|
|
1709
|
+
end
|
|
1710
|
+
|
|
1711
|
+
# Update the project OAuth2 Yandex configuration.
|
|
1712
|
+
#
|
|
1713
|
+
# @param [String] client_id 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c
|
|
1714
|
+
# @param [String] client_secret 'Client Secret' of Yandex OAuth2 app. For example: <CLIENT_SECRET>
|
|
1715
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1716
|
+
#
|
|
1717
|
+
# @return [OAuth2Yandex]
|
|
1718
|
+
def update_o_auth2_yandex(client_id: nil, client_secret: nil, enabled: nil)
|
|
1719
|
+
api_path = '/project/oauth2/yandex'
|
|
1720
|
+
|
|
1721
|
+
api_params = {
|
|
1722
|
+
clientId: client_id,
|
|
1723
|
+
clientSecret: client_secret,
|
|
1724
|
+
enabled: enabled,
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
api_headers = {
|
|
1728
|
+
"content-type": 'application/json',
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
@client.call(
|
|
1732
|
+
method: 'PATCH',
|
|
1733
|
+
path: api_path,
|
|
1734
|
+
headers: api_headers,
|
|
1735
|
+
params: api_params,
|
|
1736
|
+
response_type: Models::OAuth2Yandex
|
|
1737
|
+
)
|
|
1738
|
+
|
|
1739
|
+
end
|
|
1740
|
+
|
|
1741
|
+
# Update the project OAuth2 Zoho configuration.
|
|
1742
|
+
#
|
|
1743
|
+
# @param [String] client_id 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B
|
|
1744
|
+
# @param [String] client_secret 'Client Secret' of Zoho OAuth2 app. For example: <CLIENT_SECRET>
|
|
1745
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1746
|
+
#
|
|
1747
|
+
# @return [OAuth2Zoho]
|
|
1748
|
+
def update_o_auth2_zoho(client_id: nil, client_secret: nil, enabled: nil)
|
|
1749
|
+
api_path = '/project/oauth2/zoho'
|
|
1750
|
+
|
|
1751
|
+
api_params = {
|
|
1752
|
+
clientId: client_id,
|
|
1753
|
+
clientSecret: client_secret,
|
|
1754
|
+
enabled: enabled,
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
api_headers = {
|
|
1758
|
+
"content-type": 'application/json',
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
@client.call(
|
|
1762
|
+
method: 'PATCH',
|
|
1763
|
+
path: api_path,
|
|
1764
|
+
headers: api_headers,
|
|
1765
|
+
params: api_params,
|
|
1766
|
+
response_type: Models::OAuth2Zoho
|
|
1767
|
+
)
|
|
1768
|
+
|
|
1769
|
+
end
|
|
1770
|
+
|
|
1771
|
+
# Update the project OAuth2 Zoom configuration.
|
|
1772
|
+
#
|
|
1773
|
+
# @param [String] client_id 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ
|
|
1774
|
+
# @param [String] client_secret 'Client Secret' of Zoom OAuth2 app. For example: <CLIENT_SECRET>
|
|
1775
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1776
|
+
#
|
|
1777
|
+
# @return [OAuth2Zoom]
|
|
1778
|
+
def update_o_auth2_zoom(client_id: nil, client_secret: nil, enabled: nil)
|
|
1779
|
+
api_path = '/project/oauth2/zoom'
|
|
1780
|
+
|
|
1781
|
+
api_params = {
|
|
1782
|
+
clientId: client_id,
|
|
1783
|
+
clientSecret: client_secret,
|
|
1784
|
+
enabled: enabled,
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
api_headers = {
|
|
1788
|
+
"content-type": 'application/json',
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
@client.call(
|
|
1792
|
+
method: 'PATCH',
|
|
1793
|
+
path: api_path,
|
|
1794
|
+
headers: api_headers,
|
|
1795
|
+
params: api_params,
|
|
1796
|
+
response_type: Models::OAuth2Zoom
|
|
1797
|
+
)
|
|
1798
|
+
|
|
1799
|
+
end
|
|
1800
|
+
|
|
1801
|
+
# Get a single OAuth2 provider configuration. Credential fields (client
|
|
1802
|
+
# secret, p8 file, key/team IDs) are write-only and always returned empty.
|
|
1803
|
+
#
|
|
1804
|
+
# @param [OAuthProvider] provider_id OAuth2 provider key. For example: github, google, apple.
|
|
1805
|
+
#
|
|
1806
|
+
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft]
|
|
1807
|
+
def get_o_auth2_provider(provider_id:)
|
|
1808
|
+
api_path = '/project/oauth2/{providerId}'
|
|
1809
|
+
.gsub('{providerId}', provider_id)
|
|
1810
|
+
|
|
1811
|
+
if provider_id.nil?
|
|
1812
|
+
raise Appwrite::Exception.new('Missing required parameter: "providerId"')
|
|
1813
|
+
end
|
|
1814
|
+
|
|
1815
|
+
api_params = {
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
api_headers = {
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
response = @client.call(
|
|
1822
|
+
method: 'GET',
|
|
1823
|
+
path: api_path,
|
|
1824
|
+
headers: api_headers,
|
|
1825
|
+
params: api_params,
|
|
1826
|
+
)
|
|
1827
|
+
|
|
1828
|
+
unless response.is_a?(Hash)
|
|
1829
|
+
raise Exception, "Expected object response when hydrating a response model"
|
|
1830
|
+
end
|
|
1831
|
+
|
|
1832
|
+
if response['$id'] == 'github'
|
|
1833
|
+
|
|
1834
|
+
return Models::OAuth2Github.from(map: response)
|
|
1835
|
+
end
|
|
1836
|
+
|
|
1837
|
+
if response['$id'] == 'discord'
|
|
1838
|
+
|
|
1839
|
+
return Models::OAuth2Discord.from(map: response)
|
|
1840
|
+
end
|
|
1841
|
+
|
|
1842
|
+
if response['$id'] == 'figma'
|
|
1843
|
+
|
|
1844
|
+
return Models::OAuth2Figma.from(map: response)
|
|
1845
|
+
end
|
|
1846
|
+
|
|
1847
|
+
if response['$id'] == 'dropbox'
|
|
1848
|
+
|
|
1849
|
+
return Models::OAuth2Dropbox.from(map: response)
|
|
1850
|
+
end
|
|
1851
|
+
|
|
1852
|
+
if response['$id'] == 'dailymotion'
|
|
1853
|
+
|
|
1854
|
+
return Models::OAuth2Dailymotion.from(map: response)
|
|
1855
|
+
end
|
|
1856
|
+
|
|
1857
|
+
if response['$id'] == 'bitbucket'
|
|
1858
|
+
|
|
1859
|
+
return Models::OAuth2Bitbucket.from(map: response)
|
|
1860
|
+
end
|
|
1861
|
+
|
|
1862
|
+
if response['$id'] == 'bitly'
|
|
1863
|
+
|
|
1864
|
+
return Models::OAuth2Bitly.from(map: response)
|
|
1865
|
+
end
|
|
1866
|
+
|
|
1867
|
+
if response['$id'] == 'box'
|
|
1868
|
+
|
|
1869
|
+
return Models::OAuth2Box.from(map: response)
|
|
1870
|
+
end
|
|
1871
|
+
|
|
1872
|
+
if response['$id'] == 'autodesk'
|
|
1873
|
+
|
|
1874
|
+
return Models::OAuth2Autodesk.from(map: response)
|
|
1875
|
+
end
|
|
1876
|
+
|
|
1877
|
+
if response['$id'] == 'google'
|
|
1878
|
+
|
|
1879
|
+
return Models::OAuth2Google.from(map: response)
|
|
1880
|
+
end
|
|
1881
|
+
|
|
1882
|
+
if response['$id'] == 'zoom'
|
|
1883
|
+
|
|
1884
|
+
return Models::OAuth2Zoom.from(map: response)
|
|
1885
|
+
end
|
|
1886
|
+
|
|
1887
|
+
if response['$id'] == 'zoho'
|
|
1888
|
+
|
|
1889
|
+
return Models::OAuth2Zoho.from(map: response)
|
|
1890
|
+
end
|
|
1891
|
+
|
|
1892
|
+
if response['$id'] == 'yandex'
|
|
1893
|
+
|
|
1894
|
+
return Models::OAuth2Yandex.from(map: response)
|
|
1895
|
+
end
|
|
1896
|
+
|
|
1897
|
+
if response['$id'] == 'x'
|
|
1898
|
+
|
|
1899
|
+
return Models::OAuth2X.from(map: response)
|
|
1900
|
+
end
|
|
1901
|
+
|
|
1902
|
+
if response['$id'] == 'wordpress'
|
|
1903
|
+
|
|
1904
|
+
return Models::OAuth2WordPress.from(map: response)
|
|
1905
|
+
end
|
|
1906
|
+
|
|
1907
|
+
if response['$id'] == 'twitch'
|
|
1908
|
+
|
|
1909
|
+
return Models::OAuth2Twitch.from(map: response)
|
|
1910
|
+
end
|
|
1911
|
+
|
|
1912
|
+
if response['$id'] == 'stripe'
|
|
1913
|
+
|
|
1914
|
+
return Models::OAuth2Stripe.from(map: response)
|
|
1915
|
+
end
|
|
1916
|
+
|
|
1917
|
+
if response['$id'] == 'spotify'
|
|
1918
|
+
|
|
1919
|
+
return Models::OAuth2Spotify.from(map: response)
|
|
1920
|
+
end
|
|
1921
|
+
|
|
1922
|
+
if response['$id'] == 'slack'
|
|
1923
|
+
|
|
1924
|
+
return Models::OAuth2Slack.from(map: response)
|
|
1925
|
+
end
|
|
1926
|
+
|
|
1927
|
+
if response['$id'] == 'podio'
|
|
1928
|
+
|
|
1929
|
+
return Models::OAuth2Podio.from(map: response)
|
|
1930
|
+
end
|
|
1931
|
+
|
|
1932
|
+
if response['$id'] == 'notion'
|
|
1933
|
+
|
|
1934
|
+
return Models::OAuth2Notion.from(map: response)
|
|
1935
|
+
end
|
|
1936
|
+
|
|
1937
|
+
if response['$id'] == 'salesforce'
|
|
1938
|
+
|
|
1939
|
+
return Models::OAuth2Salesforce.from(map: response)
|
|
1940
|
+
end
|
|
1941
|
+
|
|
1942
|
+
if response['$id'] == 'yahoo'
|
|
1943
|
+
|
|
1944
|
+
return Models::OAuth2Yahoo.from(map: response)
|
|
1945
|
+
end
|
|
1946
|
+
|
|
1947
|
+
if response['$id'] == 'linkedin'
|
|
1948
|
+
|
|
1949
|
+
return Models::OAuth2Linkedin.from(map: response)
|
|
1950
|
+
end
|
|
1951
|
+
|
|
1952
|
+
if response['$id'] == 'disqus'
|
|
1953
|
+
|
|
1954
|
+
return Models::OAuth2Disqus.from(map: response)
|
|
1955
|
+
end
|
|
1956
|
+
|
|
1957
|
+
if response['$id'] == 'amazon'
|
|
1958
|
+
|
|
1959
|
+
return Models::OAuth2Amazon.from(map: response)
|
|
1960
|
+
end
|
|
1961
|
+
|
|
1962
|
+
if response['$id'] == 'etsy'
|
|
1963
|
+
|
|
1964
|
+
return Models::OAuth2Etsy.from(map: response)
|
|
1965
|
+
end
|
|
1966
|
+
|
|
1967
|
+
if response['$id'] == 'facebook'
|
|
1968
|
+
|
|
1969
|
+
return Models::OAuth2Facebook.from(map: response)
|
|
1970
|
+
end
|
|
1971
|
+
|
|
1972
|
+
if response['$id'] == 'tradeshiftBox'
|
|
1973
|
+
|
|
1974
|
+
return Models::OAuth2Tradeshift.from(map: response)
|
|
1975
|
+
end
|
|
1976
|
+
|
|
1977
|
+
if response['$id'] == 'paypalSandbox'
|
|
1978
|
+
|
|
1979
|
+
return Models::OAuth2Paypal.from(map: response)
|
|
1980
|
+
end
|
|
1981
|
+
|
|
1982
|
+
if response['$id'] == 'gitlab'
|
|
1983
|
+
|
|
1984
|
+
return Models::OAuth2Gitlab.from(map: response)
|
|
1985
|
+
end
|
|
1986
|
+
|
|
1987
|
+
if response['$id'] == 'authentik'
|
|
1988
|
+
|
|
1989
|
+
return Models::OAuth2Authentik.from(map: response)
|
|
1990
|
+
end
|
|
1991
|
+
|
|
1992
|
+
if response['$id'] == 'auth0'
|
|
1993
|
+
|
|
1994
|
+
return Models::OAuth2Auth0.from(map: response)
|
|
1995
|
+
end
|
|
1996
|
+
|
|
1997
|
+
if response['$id'] == 'fusionauth'
|
|
1998
|
+
|
|
1999
|
+
return Models::OAuth2FusionAuth.from(map: response)
|
|
2000
|
+
end
|
|
2001
|
+
|
|
2002
|
+
if response['$id'] == 'keycloak'
|
|
2003
|
+
|
|
2004
|
+
return Models::OAuth2Keycloak.from(map: response)
|
|
2005
|
+
end
|
|
2006
|
+
|
|
2007
|
+
if response['$id'] == 'oidc'
|
|
2008
|
+
|
|
2009
|
+
return Models::OAuth2Oidc.from(map: response)
|
|
2010
|
+
end
|
|
2011
|
+
|
|
2012
|
+
if response['$id'] == 'apple'
|
|
2013
|
+
|
|
2014
|
+
return Models::OAuth2Apple.from(map: response)
|
|
2015
|
+
end
|
|
2016
|
+
|
|
2017
|
+
if response['$id'] == 'okta'
|
|
2018
|
+
|
|
2019
|
+
return Models::OAuth2Okta.from(map: response)
|
|
2020
|
+
end
|
|
2021
|
+
|
|
2022
|
+
if response['$id'] == 'kick'
|
|
2023
|
+
|
|
2024
|
+
return Models::OAuth2Kick.from(map: response)
|
|
2025
|
+
end
|
|
2026
|
+
|
|
2027
|
+
if response['$id'] == 'microsoft'
|
|
2028
|
+
|
|
2029
|
+
return Models::OAuth2Microsoft.from(map: response)
|
|
2030
|
+
end
|
|
2031
|
+
|
|
2032
|
+
raise Exception, "Unable to match response to any expected response model"
|
|
2033
|
+
|
|
2034
|
+
end
|
|
2035
|
+
|
|
2036
|
+
# Get a list of all platforms in the project. This endpoint returns an array
|
|
2037
|
+
# of all platforms and their configurations.
|
|
2038
|
+
#
|
|
2039
|
+
# @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
|
|
2040
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
2041
|
+
#
|
|
2042
|
+
# @return [PlatformList]
|
|
2043
|
+
def list_platforms(queries: nil, total: nil)
|
|
2044
|
+
api_path = '/project/platforms'
|
|
2045
|
+
|
|
2046
|
+
api_params = {
|
|
2047
|
+
queries: queries,
|
|
2048
|
+
total: total,
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
api_headers = {
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
@client.call(
|
|
2055
|
+
method: 'GET',
|
|
2056
|
+
path: api_path,
|
|
2057
|
+
headers: api_headers,
|
|
2058
|
+
params: api_params,
|
|
2059
|
+
response_type: Models::PlatformList
|
|
2060
|
+
)
|
|
2061
|
+
|
|
2062
|
+
end
|
|
2063
|
+
|
|
2064
|
+
# Create a new Android platform for your project. Use this endpoint to
|
|
2065
|
+
# register a new Android platform where your users will run your application
|
|
2066
|
+
# which will interact with the Appwrite API.
|
|
2067
|
+
#
|
|
2068
|
+
# @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.
|
|
2069
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2070
|
+
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
2071
|
+
#
|
|
2072
|
+
# @return [PlatformAndroid]
|
|
2073
|
+
def create_android_platform(platform_id:, name:, application_id:)
|
|
2074
|
+
api_path = '/project/platforms/android'
|
|
2075
|
+
|
|
2076
|
+
if platform_id.nil?
|
|
2077
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2078
|
+
end
|
|
2079
|
+
|
|
2080
|
+
if name.nil?
|
|
2081
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2082
|
+
end
|
|
2083
|
+
|
|
2084
|
+
if application_id.nil?
|
|
2085
|
+
raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
|
|
2086
|
+
end
|
|
2087
|
+
|
|
2088
|
+
api_params = {
|
|
2089
|
+
platformId: platform_id,
|
|
2090
|
+
name: name,
|
|
2091
|
+
applicationId: application_id,
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
api_headers = {
|
|
2095
|
+
"content-type": 'application/json',
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
@client.call(
|
|
2099
|
+
method: 'POST',
|
|
2100
|
+
path: api_path,
|
|
2101
|
+
headers: api_headers,
|
|
2102
|
+
params: api_params,
|
|
2103
|
+
response_type: Models::PlatformAndroid
|
|
2104
|
+
)
|
|
2105
|
+
|
|
2106
|
+
end
|
|
2107
|
+
|
|
2108
|
+
# Update an Android platform by its unique ID. Use this endpoint to update
|
|
2109
|
+
# the platform's name or application ID.
|
|
2110
|
+
#
|
|
2111
|
+
# @param [String] platform_id Platform ID.
|
|
2112
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2113
|
+
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
2114
|
+
#
|
|
2115
|
+
# @return [PlatformAndroid]
|
|
2116
|
+
def update_android_platform(platform_id:, name:, application_id:)
|
|
2117
|
+
api_path = '/project/platforms/android/{platformId}'
|
|
2118
|
+
.gsub('{platformId}', platform_id)
|
|
2119
|
+
|
|
2120
|
+
if platform_id.nil?
|
|
2121
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2122
|
+
end
|
|
2123
|
+
|
|
2124
|
+
if name.nil?
|
|
2125
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2126
|
+
end
|
|
2127
|
+
|
|
2128
|
+
if application_id.nil?
|
|
2129
|
+
raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
|
|
2130
|
+
end
|
|
2131
|
+
|
|
2132
|
+
api_params = {
|
|
2133
|
+
name: name,
|
|
2134
|
+
applicationId: application_id,
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
api_headers = {
|
|
2138
|
+
"content-type": 'application/json',
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
@client.call(
|
|
2142
|
+
method: 'PUT',
|
|
2143
|
+
path: api_path,
|
|
2144
|
+
headers: api_headers,
|
|
2145
|
+
params: api_params,
|
|
2146
|
+
response_type: Models::PlatformAndroid
|
|
2147
|
+
)
|
|
2148
|
+
|
|
2149
|
+
end
|
|
2150
|
+
|
|
2151
|
+
# Create a new Apple platform for your project. Use this endpoint to register
|
|
2152
|
+
# a new Apple platform where your users will run your application which will
|
|
2153
|
+
# interact with the Appwrite API.
|
|
2154
|
+
#
|
|
2155
|
+
# @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.
|
|
2156
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2157
|
+
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
2158
|
+
#
|
|
2159
|
+
# @return [PlatformApple]
|
|
2160
|
+
def create_apple_platform(platform_id:, name:, bundle_identifier:)
|
|
2161
|
+
api_path = '/project/platforms/apple'
|
|
2162
|
+
|
|
2163
|
+
if platform_id.nil?
|
|
2164
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2165
|
+
end
|
|
2166
|
+
|
|
2167
|
+
if name.nil?
|
|
2168
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2169
|
+
end
|
|
2170
|
+
|
|
2171
|
+
if bundle_identifier.nil?
|
|
2172
|
+
raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
|
|
2173
|
+
end
|
|
2174
|
+
|
|
2175
|
+
api_params = {
|
|
2176
|
+
platformId: platform_id,
|
|
2177
|
+
name: name,
|
|
2178
|
+
bundleIdentifier: bundle_identifier,
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
api_headers = {
|
|
2182
|
+
"content-type": 'application/json',
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
@client.call(
|
|
2186
|
+
method: 'POST',
|
|
2187
|
+
path: api_path,
|
|
2188
|
+
headers: api_headers,
|
|
2189
|
+
params: api_params,
|
|
2190
|
+
response_type: Models::PlatformApple
|
|
2191
|
+
)
|
|
2192
|
+
|
|
2193
|
+
end
|
|
2194
|
+
|
|
2195
|
+
# Update an Apple platform by its unique ID. Use this endpoint to update the
|
|
2196
|
+
# platform's name or bundle identifier.
|
|
2197
|
+
#
|
|
2198
|
+
# @param [String] platform_id Platform ID.
|
|
2199
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2200
|
+
# @param [String] bundle_identifier Apple bundle identifier. Max length: 256 chars.
|
|
2201
|
+
#
|
|
2202
|
+
# @return [PlatformApple]
|
|
2203
|
+
def update_apple_platform(platform_id:, name:, bundle_identifier:)
|
|
2204
|
+
api_path = '/project/platforms/apple/{platformId}'
|
|
2205
|
+
.gsub('{platformId}', platform_id)
|
|
2206
|
+
|
|
2207
|
+
if platform_id.nil?
|
|
2208
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2209
|
+
end
|
|
2210
|
+
|
|
2211
|
+
if name.nil?
|
|
2212
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2213
|
+
end
|
|
2214
|
+
|
|
2215
|
+
if bundle_identifier.nil?
|
|
2216
|
+
raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
|
|
2217
|
+
end
|
|
2218
|
+
|
|
2219
|
+
api_params = {
|
|
2220
|
+
name: name,
|
|
2221
|
+
bundleIdentifier: bundle_identifier,
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
api_headers = {
|
|
2225
|
+
"content-type": 'application/json',
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
@client.call(
|
|
2229
|
+
method: 'PUT',
|
|
2230
|
+
path: api_path,
|
|
2231
|
+
headers: api_headers,
|
|
2232
|
+
params: api_params,
|
|
2233
|
+
response_type: Models::PlatformApple
|
|
2234
|
+
)
|
|
2235
|
+
|
|
2236
|
+
end
|
|
2237
|
+
|
|
2238
|
+
# Create a new Linux platform for your project. Use this endpoint to register
|
|
2239
|
+
# a new Linux platform where your users will run your application which will
|
|
2240
|
+
# interact with the Appwrite API.
|
|
2241
|
+
#
|
|
2242
|
+
# @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.
|
|
2243
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2244
|
+
# @param [String] package_name Linux package name. Max length: 256 chars.
|
|
2245
|
+
#
|
|
2246
|
+
# @return [PlatformLinux]
|
|
2247
|
+
def create_linux_platform(platform_id:, name:, package_name:)
|
|
2248
|
+
api_path = '/project/platforms/linux'
|
|
2249
|
+
|
|
2250
|
+
if platform_id.nil?
|
|
2251
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2252
|
+
end
|
|
2253
|
+
|
|
2254
|
+
if name.nil?
|
|
2255
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2256
|
+
end
|
|
2257
|
+
|
|
2258
|
+
if package_name.nil?
|
|
2259
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageName"')
|
|
2260
|
+
end
|
|
2261
|
+
|
|
2262
|
+
api_params = {
|
|
2263
|
+
platformId: platform_id,
|
|
2264
|
+
name: name,
|
|
2265
|
+
packageName: package_name,
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
api_headers = {
|
|
2269
|
+
"content-type": 'application/json',
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
@client.call(
|
|
2273
|
+
method: 'POST',
|
|
2274
|
+
path: api_path,
|
|
2275
|
+
headers: api_headers,
|
|
2276
|
+
params: api_params,
|
|
2277
|
+
response_type: Models::PlatformLinux
|
|
2278
|
+
)
|
|
2279
|
+
|
|
2280
|
+
end
|
|
2281
|
+
|
|
2282
|
+
# Update a Linux platform by its unique ID. Use this endpoint to update the
|
|
2283
|
+
# platform's name or package name.
|
|
2284
|
+
#
|
|
2285
|
+
# @param [String] platform_id Platform ID.
|
|
2286
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2287
|
+
# @param [String] package_name Linux package name. Max length: 256 chars.
|
|
2288
|
+
#
|
|
2289
|
+
# @return [PlatformLinux]
|
|
2290
|
+
def update_linux_platform(platform_id:, name:, package_name:)
|
|
2291
|
+
api_path = '/project/platforms/linux/{platformId}'
|
|
2292
|
+
.gsub('{platformId}', platform_id)
|
|
2293
|
+
|
|
2294
|
+
if platform_id.nil?
|
|
2295
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2296
|
+
end
|
|
2297
|
+
|
|
2298
|
+
if name.nil?
|
|
2299
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2300
|
+
end
|
|
2301
|
+
|
|
2302
|
+
if package_name.nil?
|
|
2303
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageName"')
|
|
2304
|
+
end
|
|
2305
|
+
|
|
2306
|
+
api_params = {
|
|
2307
|
+
name: name,
|
|
2308
|
+
packageName: package_name,
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
api_headers = {
|
|
2312
|
+
"content-type": 'application/json',
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
@client.call(
|
|
2316
|
+
method: 'PUT',
|
|
2317
|
+
path: api_path,
|
|
2318
|
+
headers: api_headers,
|
|
2319
|
+
params: api_params,
|
|
2320
|
+
response_type: Models::PlatformLinux
|
|
2321
|
+
)
|
|
2322
|
+
|
|
2323
|
+
end
|
|
2324
|
+
|
|
2325
|
+
# Create a new web platform for your project. Use this endpoint to register a
|
|
2326
|
+
# new platform where your users will run your application which will interact
|
|
2327
|
+
# with the Appwrite API.
|
|
2328
|
+
#
|
|
2329
|
+
# @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.
|
|
2330
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2331
|
+
# @param [String] hostname Platform web hostname. Max length: 256 chars.
|
|
2332
|
+
#
|
|
2333
|
+
# @return [PlatformWeb]
|
|
2334
|
+
def create_web_platform(platform_id:, name:, hostname:)
|
|
2335
|
+
api_path = '/project/platforms/web'
|
|
2336
|
+
|
|
2337
|
+
if platform_id.nil?
|
|
2338
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2339
|
+
end
|
|
2340
|
+
|
|
2341
|
+
if name.nil?
|
|
2342
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2343
|
+
end
|
|
2344
|
+
|
|
2345
|
+
if hostname.nil?
|
|
2346
|
+
raise Appwrite::Exception.new('Missing required parameter: "hostname"')
|
|
2347
|
+
end
|
|
2348
|
+
|
|
2349
|
+
api_params = {
|
|
2350
|
+
platformId: platform_id,
|
|
2351
|
+
name: name,
|
|
2352
|
+
hostname: hostname,
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
api_headers = {
|
|
2356
|
+
"content-type": 'application/json',
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
@client.call(
|
|
2360
|
+
method: 'POST',
|
|
2361
|
+
path: api_path,
|
|
2362
|
+
headers: api_headers,
|
|
2363
|
+
params: api_params,
|
|
2364
|
+
response_type: Models::PlatformWeb
|
|
2365
|
+
)
|
|
2366
|
+
|
|
2367
|
+
end
|
|
2368
|
+
|
|
2369
|
+
# Update a web platform by its unique ID. Use this endpoint to update the
|
|
2370
|
+
# platform's name or hostname.
|
|
2371
|
+
#
|
|
2372
|
+
# @param [String] platform_id Platform ID.
|
|
2373
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2374
|
+
# @param [String] hostname Platform web hostname. Max length: 256 chars.
|
|
2375
|
+
#
|
|
2376
|
+
# @return [PlatformWeb]
|
|
2377
|
+
def update_web_platform(platform_id:, name:, hostname:)
|
|
2378
|
+
api_path = '/project/platforms/web/{platformId}'
|
|
2379
|
+
.gsub('{platformId}', platform_id)
|
|
2380
|
+
|
|
2381
|
+
if platform_id.nil?
|
|
2382
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2383
|
+
end
|
|
2384
|
+
|
|
2385
|
+
if name.nil?
|
|
2386
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2387
|
+
end
|
|
2388
|
+
|
|
2389
|
+
if hostname.nil?
|
|
2390
|
+
raise Appwrite::Exception.new('Missing required parameter: "hostname"')
|
|
2391
|
+
end
|
|
2392
|
+
|
|
2393
|
+
api_params = {
|
|
2394
|
+
name: name,
|
|
2395
|
+
hostname: hostname,
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
api_headers = {
|
|
2399
|
+
"content-type": 'application/json',
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
@client.call(
|
|
2403
|
+
method: 'PUT',
|
|
2404
|
+
path: api_path,
|
|
2405
|
+
headers: api_headers,
|
|
2406
|
+
params: api_params,
|
|
2407
|
+
response_type: Models::PlatformWeb
|
|
2408
|
+
)
|
|
2409
|
+
|
|
2410
|
+
end
|
|
2411
|
+
|
|
2412
|
+
# Create a new Windows platform for your project. Use this endpoint to
|
|
2413
|
+
# register a new Windows platform where your users will run your application
|
|
2414
|
+
# which will interact with the Appwrite API.
|
|
2415
|
+
#
|
|
2416
|
+
# @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.
|
|
2417
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2418
|
+
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
2419
|
+
#
|
|
2420
|
+
# @return [PlatformWindows]
|
|
2421
|
+
def create_windows_platform(platform_id:, name:, package_identifier_name:)
|
|
2422
|
+
api_path = '/project/platforms/windows'
|
|
2423
|
+
|
|
2424
|
+
if platform_id.nil?
|
|
2425
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2426
|
+
end
|
|
2427
|
+
|
|
2428
|
+
if name.nil?
|
|
2429
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2430
|
+
end
|
|
2431
|
+
|
|
2432
|
+
if package_identifier_name.nil?
|
|
2433
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
|
|
2434
|
+
end
|
|
2435
|
+
|
|
2436
|
+
api_params = {
|
|
2437
|
+
platformId: platform_id,
|
|
2438
|
+
name: name,
|
|
2439
|
+
packageIdentifierName: package_identifier_name,
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
api_headers = {
|
|
2443
|
+
"content-type": 'application/json',
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
@client.call(
|
|
2447
|
+
method: 'POST',
|
|
2448
|
+
path: api_path,
|
|
2449
|
+
headers: api_headers,
|
|
2450
|
+
params: api_params,
|
|
2451
|
+
response_type: Models::PlatformWindows
|
|
2452
|
+
)
|
|
2453
|
+
|
|
2454
|
+
end
|
|
2455
|
+
|
|
2456
|
+
# Update a Windows platform by its unique ID. Use this endpoint to update the
|
|
2457
|
+
# platform's name or package identifier name.
|
|
2458
|
+
#
|
|
2459
|
+
# @param [String] platform_id Platform ID.
|
|
2460
|
+
# @param [String] name Platform name. Max length: 128 chars.
|
|
2461
|
+
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
2462
|
+
#
|
|
2463
|
+
# @return [PlatformWindows]
|
|
2464
|
+
def update_windows_platform(platform_id:, name:, package_identifier_name:)
|
|
2465
|
+
api_path = '/project/platforms/windows/{platformId}'
|
|
2466
|
+
.gsub('{platformId}', platform_id)
|
|
2467
|
+
|
|
2468
|
+
if platform_id.nil?
|
|
2469
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2470
|
+
end
|
|
2471
|
+
|
|
2472
|
+
if name.nil?
|
|
2473
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
2474
|
+
end
|
|
2475
|
+
|
|
2476
|
+
if package_identifier_name.nil?
|
|
2477
|
+
raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
|
|
2478
|
+
end
|
|
2479
|
+
|
|
2480
|
+
api_params = {
|
|
2481
|
+
name: name,
|
|
2482
|
+
packageIdentifierName: package_identifier_name,
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
api_headers = {
|
|
2486
|
+
"content-type": 'application/json',
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
@client.call(
|
|
2490
|
+
method: 'PUT',
|
|
2491
|
+
path: api_path,
|
|
2492
|
+
headers: api_headers,
|
|
2493
|
+
params: api_params,
|
|
2494
|
+
response_type: Models::PlatformWindows
|
|
2495
|
+
)
|
|
2496
|
+
|
|
2497
|
+
end
|
|
2498
|
+
|
|
2499
|
+
# Get a platform by its unique ID. This endpoint returns the platform's
|
|
2500
|
+
# details, including its name, type, and key configurations.
|
|
2501
|
+
#
|
|
2502
|
+
# @param [String] platform_id Platform ID.
|
|
2503
|
+
#
|
|
2504
|
+
# @return [PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux]
|
|
2505
|
+
def get_platform(platform_id:)
|
|
2506
|
+
api_path = '/project/platforms/{platformId}'
|
|
2507
|
+
.gsub('{platformId}', platform_id)
|
|
2508
|
+
|
|
2509
|
+
if platform_id.nil?
|
|
2510
|
+
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2511
|
+
end
|
|
2512
|
+
|
|
2513
|
+
api_params = {
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
api_headers = {
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
response = @client.call(
|
|
2520
|
+
method: 'GET',
|
|
2521
|
+
path: api_path,
|
|
2522
|
+
headers: api_headers,
|
|
2523
|
+
params: api_params,
|
|
2524
|
+
)
|
|
2525
|
+
|
|
2526
|
+
unless response.is_a?(Hash)
|
|
2527
|
+
raise Exception, "Expected object response when hydrating a response model"
|
|
2528
|
+
end
|
|
2529
|
+
|
|
2530
|
+
if response['type'] == 'web'
|
|
2531
|
+
|
|
2532
|
+
return Models::PlatformWeb.from(map: response)
|
|
2533
|
+
end
|
|
2534
|
+
|
|
2535
|
+
if response['type'] == 'apple'
|
|
2536
|
+
|
|
2537
|
+
return Models::PlatformApple.from(map: response)
|
|
2538
|
+
end
|
|
2539
|
+
|
|
2540
|
+
if response['type'] == 'android'
|
|
2541
|
+
|
|
2542
|
+
return Models::PlatformAndroid.from(map: response)
|
|
2543
|
+
end
|
|
2544
|
+
|
|
2545
|
+
if response['type'] == 'windows'
|
|
2546
|
+
|
|
2547
|
+
return Models::PlatformWindows.from(map: response)
|
|
2548
|
+
end
|
|
2549
|
+
|
|
2550
|
+
if response['type'] == 'linux'
|
|
2551
|
+
|
|
2552
|
+
return Models::PlatformLinux.from(map: response)
|
|
2553
|
+
end
|
|
2554
|
+
|
|
2555
|
+
raise Exception, "Unable to match response to any expected response model"
|
|
2556
|
+
|
|
2557
|
+
end
|
|
2558
|
+
|
|
2559
|
+
# Delete a platform by its unique ID. This endpoint removes the platform and
|
|
2560
|
+
# all its configurations from the project.
|
|
2561
|
+
#
|
|
2562
|
+
# @param [String] platform_id Platform ID.
|
|
2563
|
+
#
|
|
2564
|
+
# @return []
|
|
2565
|
+
def delete_platform(platform_id:)
|
|
2566
|
+
api_path = '/project/platforms/{platformId}'
|
|
2567
|
+
.gsub('{platformId}', platform_id)
|
|
517
2568
|
|
|
518
2569
|
if platform_id.nil?
|
|
519
2570
|
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
520
2571
|
end
|
|
521
2572
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
2573
|
+
api_params = {
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
api_headers = {
|
|
2577
|
+
"content-type": 'application/json',
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
@client.call(
|
|
2581
|
+
method: 'DELETE',
|
|
2582
|
+
path: api_path,
|
|
2583
|
+
headers: api_headers,
|
|
2584
|
+
params: api_params,
|
|
2585
|
+
)
|
|
2586
|
+
|
|
2587
|
+
end
|
|
2588
|
+
|
|
2589
|
+
# Get a list of all project policies and their current configuration.
|
|
2590
|
+
#
|
|
2591
|
+
# @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). Only supported methods are limit and offset
|
|
2592
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
2593
|
+
#
|
|
2594
|
+
# @return [PolicyList]
|
|
2595
|
+
def list_policies(queries: nil, total: nil)
|
|
2596
|
+
api_path = '/project/policies'
|
|
2597
|
+
|
|
2598
|
+
api_params = {
|
|
2599
|
+
queries: queries,
|
|
2600
|
+
total: total,
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
api_headers = {
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
@client.call(
|
|
2607
|
+
method: 'GET',
|
|
2608
|
+
path: api_path,
|
|
2609
|
+
headers: api_headers,
|
|
2610
|
+
params: api_params,
|
|
2611
|
+
response_type: Models::PolicyList
|
|
2612
|
+
)
|
|
2613
|
+
|
|
2614
|
+
end
|
|
2615
|
+
|
|
2616
|
+
# Updating this policy allows you to control if team members can see other
|
|
2617
|
+
# members information. When enabled, all team members can see ID, name,
|
|
2618
|
+
# email, phone number, and MFA status of other members..
|
|
2619
|
+
#
|
|
2620
|
+
# @param [] user_id Set to true if you want make user ID visible to all team members, or false to hide it.
|
|
2621
|
+
# @param [] user_email Set to true if you want make user email visible to all team members, or false to hide it.
|
|
2622
|
+
# @param [] user_phone Set to true if you want make user phone number visible to all team members, or false to hide it.
|
|
2623
|
+
# @param [] user_name Set to true if you want make user name visible to all team members, or false to hide it.
|
|
2624
|
+
# @param [] user_mfa Set to true if you want make user MFA status visible to all team members, or false to hide it.
|
|
2625
|
+
#
|
|
2626
|
+
# @return [Project]
|
|
2627
|
+
def update_membership_privacy_policy(user_id: nil, user_email: nil, user_phone: nil, user_name: nil, user_mfa: nil)
|
|
2628
|
+
api_path = '/project/policies/membership-privacy'
|
|
2629
|
+
|
|
2630
|
+
api_params = {
|
|
2631
|
+
userId: user_id,
|
|
2632
|
+
userEmail: user_email,
|
|
2633
|
+
userPhone: user_phone,
|
|
2634
|
+
userName: user_name,
|
|
2635
|
+
userMFA: user_mfa,
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
api_headers = {
|
|
2639
|
+
"content-type": 'application/json',
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
@client.call(
|
|
2643
|
+
method: 'PATCH',
|
|
2644
|
+
path: api_path,
|
|
2645
|
+
headers: api_headers,
|
|
2646
|
+
params: api_params,
|
|
2647
|
+
response_type: Models::Project
|
|
2648
|
+
)
|
|
2649
|
+
|
|
2650
|
+
end
|
|
2651
|
+
|
|
2652
|
+
# Updating this policy allows you to control if new passwords are checked
|
|
2653
|
+
# against most common passwords dictionary. When enabled, and user changes
|
|
2654
|
+
# their password, password must not be contained in the dictionary.
|
|
2655
|
+
#
|
|
2656
|
+
# @param [] enabled Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid.
|
|
2657
|
+
#
|
|
2658
|
+
# @return [Project]
|
|
2659
|
+
def update_password_dictionary_policy(enabled:)
|
|
2660
|
+
api_path = '/project/policies/password-dictionary'
|
|
2661
|
+
|
|
2662
|
+
if enabled.nil?
|
|
2663
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
2664
|
+
end
|
|
2665
|
+
|
|
2666
|
+
api_params = {
|
|
2667
|
+
enabled: enabled,
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
api_headers = {
|
|
2671
|
+
"content-type": 'application/json',
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
@client.call(
|
|
2675
|
+
method: 'PATCH',
|
|
2676
|
+
path: api_path,
|
|
2677
|
+
headers: api_headers,
|
|
2678
|
+
params: api_params,
|
|
2679
|
+
response_type: Models::Project
|
|
2680
|
+
)
|
|
2681
|
+
|
|
2682
|
+
end
|
|
2683
|
+
|
|
2684
|
+
# Updates one of password strength policies. Based on total length
|
|
2685
|
+
# configured, previous password hashes are stored, and users cannot choose a
|
|
2686
|
+
# new password that is already stored in the passwird history list, when
|
|
2687
|
+
# updating an user password, or setting new one through password recovery.
|
|
2688
|
+
#
|
|
2689
|
+
# Keep in mind, while password history policy is disabled, the history is not
|
|
2690
|
+
# being stored. Enabling the policy will not have any history on existing
|
|
2691
|
+
# users, and it will only start to collect and enforce the policy on password
|
|
2692
|
+
# changes since the policy is enabled.
|
|
2693
|
+
#
|
|
2694
|
+
# @param [Integer] total Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit.
|
|
2695
|
+
#
|
|
2696
|
+
# @return [Project]
|
|
2697
|
+
def update_password_history_policy(total:)
|
|
2698
|
+
api_path = '/project/policies/password-history'
|
|
2699
|
+
|
|
2700
|
+
if total.nil?
|
|
2701
|
+
raise Appwrite::Exception.new('Missing required parameter: "total"')
|
|
2702
|
+
end
|
|
2703
|
+
|
|
2704
|
+
api_params = {
|
|
2705
|
+
total: total,
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
api_headers = {
|
|
2709
|
+
"content-type": 'application/json',
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
@client.call(
|
|
2713
|
+
method: 'PATCH',
|
|
2714
|
+
path: api_path,
|
|
2715
|
+
headers: api_headers,
|
|
2716
|
+
params: api_params,
|
|
2717
|
+
response_type: Models::Project
|
|
2718
|
+
)
|
|
2719
|
+
|
|
2720
|
+
end
|
|
2721
|
+
|
|
2722
|
+
# Updating this policy allows you to control if password strength is checked
|
|
2723
|
+
# against personal data. When enabled, and user sets or changes their
|
|
2724
|
+
# password, the password must not contain user ID, name, email or phone
|
|
2725
|
+
# number.
|
|
2726
|
+
#
|
|
2727
|
+
# @param [] enabled Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid.
|
|
2728
|
+
#
|
|
2729
|
+
# @return [Project]
|
|
2730
|
+
def update_password_personal_data_policy(enabled:)
|
|
2731
|
+
api_path = '/project/policies/password-personal-data'
|
|
2732
|
+
|
|
2733
|
+
if enabled.nil?
|
|
2734
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
2735
|
+
end
|
|
2736
|
+
|
|
2737
|
+
api_params = {
|
|
2738
|
+
enabled: enabled,
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
api_headers = {
|
|
2742
|
+
"content-type": 'application/json',
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
@client.call(
|
|
2746
|
+
method: 'PATCH',
|
|
2747
|
+
path: api_path,
|
|
2748
|
+
headers: api_headers,
|
|
2749
|
+
params: api_params,
|
|
2750
|
+
response_type: Models::Project
|
|
2751
|
+
)
|
|
2752
|
+
|
|
2753
|
+
end
|
|
2754
|
+
|
|
2755
|
+
# Updating this policy allows you to control if email alert is sent upon
|
|
2756
|
+
# session creation. When enabled, and user signs into their account, they
|
|
2757
|
+
# will be sent an email notification. There is an exception, the first
|
|
2758
|
+
# session after a new sign up does not trigger an alert, even if the policy
|
|
2759
|
+
# is enabled.
|
|
2760
|
+
#
|
|
2761
|
+
# @param [] enabled Toggle session alert policy. Set to true if you want users to receive email notifications when a sessions are created for their users, or false to not send email alerts.
|
|
2762
|
+
#
|
|
2763
|
+
# @return [Project]
|
|
2764
|
+
def update_session_alert_policy(enabled:)
|
|
2765
|
+
api_path = '/project/policies/session-alert'
|
|
2766
|
+
|
|
2767
|
+
if enabled.nil?
|
|
2768
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
2769
|
+
end
|
|
2770
|
+
|
|
2771
|
+
api_params = {
|
|
2772
|
+
enabled: enabled,
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
api_headers = {
|
|
2776
|
+
"content-type": 'application/json',
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
@client.call(
|
|
2780
|
+
method: 'PATCH',
|
|
2781
|
+
path: api_path,
|
|
2782
|
+
headers: api_headers,
|
|
2783
|
+
params: api_params,
|
|
2784
|
+
response_type: Models::Project
|
|
2785
|
+
)
|
|
2786
|
+
|
|
2787
|
+
end
|
|
2788
|
+
|
|
2789
|
+
# Update maximum duration how long sessions created within a project should
|
|
2790
|
+
# stay active for.
|
|
2791
|
+
#
|
|
2792
|
+
# @param [Integer] duration Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds.
|
|
2793
|
+
#
|
|
2794
|
+
# @return [Project]
|
|
2795
|
+
def update_session_duration_policy(duration:)
|
|
2796
|
+
api_path = '/project/policies/session-duration'
|
|
525
2797
|
|
|
526
|
-
if
|
|
527
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
2798
|
+
if duration.nil?
|
|
2799
|
+
raise Appwrite::Exception.new('Missing required parameter: "duration"')
|
|
528
2800
|
end
|
|
529
2801
|
|
|
530
2802
|
api_params = {
|
|
531
|
-
|
|
532
|
-
name: name,
|
|
533
|
-
hostname: hostname,
|
|
2803
|
+
duration: duration,
|
|
534
2804
|
}
|
|
535
2805
|
|
|
536
2806
|
api_headers = {
|
|
@@ -538,42 +2808,31 @@ module Appwrite
|
|
|
538
2808
|
}
|
|
539
2809
|
|
|
540
2810
|
@client.call(
|
|
541
|
-
method: '
|
|
2811
|
+
method: 'PATCH',
|
|
542
2812
|
path: api_path,
|
|
543
2813
|
headers: api_headers,
|
|
544
2814
|
params: api_params,
|
|
545
|
-
response_type: Models::
|
|
2815
|
+
response_type: Models::Project
|
|
546
2816
|
)
|
|
547
2817
|
|
|
548
2818
|
end
|
|
549
2819
|
|
|
550
|
-
#
|
|
551
|
-
#
|
|
2820
|
+
# Updating this policy allows you to control if existing sessions should be
|
|
2821
|
+
# invalidated when a password of a user is changed. When enabled, and user
|
|
2822
|
+
# changes their password, they will be logged out of all their devices.
|
|
552
2823
|
#
|
|
553
|
-
# @param [
|
|
554
|
-
# @param [String] name Platform name. Max length: 128 chars.
|
|
555
|
-
# @param [String] hostname Platform web hostname. Max length: 256 chars.
|
|
2824
|
+
# @param [] enabled Toggle session invalidation policy. Set to true if you want password change to invalidate all sessions of an user, or false to keep sessions active.
|
|
556
2825
|
#
|
|
557
|
-
# @return [
|
|
558
|
-
def
|
|
559
|
-
api_path = '/project/
|
|
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
|
|
2826
|
+
# @return [Project]
|
|
2827
|
+
def update_session_invalidation_policy(enabled:)
|
|
2828
|
+
api_path = '/project/policies/session-invalidation'
|
|
569
2829
|
|
|
570
|
-
if
|
|
571
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
2830
|
+
if enabled.nil?
|
|
2831
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
572
2832
|
end
|
|
573
2833
|
|
|
574
2834
|
api_params = {
|
|
575
|
-
|
|
576
|
-
hostname: hostname,
|
|
2835
|
+
enabled: enabled,
|
|
577
2836
|
}
|
|
578
2837
|
|
|
579
2838
|
api_headers = {
|
|
@@ -581,43 +2840,30 @@ module Appwrite
|
|
|
581
2840
|
}
|
|
582
2841
|
|
|
583
2842
|
@client.call(
|
|
584
|
-
method: '
|
|
2843
|
+
method: 'PATCH',
|
|
585
2844
|
path: api_path,
|
|
586
2845
|
headers: api_headers,
|
|
587
2846
|
params: api_params,
|
|
588
|
-
response_type: Models::
|
|
2847
|
+
response_type: Models::Project
|
|
589
2848
|
)
|
|
590
2849
|
|
|
591
2850
|
end
|
|
592
2851
|
|
|
593
|
-
#
|
|
594
|
-
#
|
|
595
|
-
# which will interact with the Appwrite API.
|
|
2852
|
+
# Update the maximum number of sessions allowed per user. When the limit is
|
|
2853
|
+
# hit, the oldest session will be deleted to make room for new one.
|
|
596
2854
|
#
|
|
597
|
-
# @param [
|
|
598
|
-
# @param [String] name Platform name. Max length: 128 chars.
|
|
599
|
-
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
2855
|
+
# @param [Integer] total Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit.
|
|
600
2856
|
#
|
|
601
|
-
# @return [
|
|
602
|
-
def
|
|
603
|
-
api_path = '/project/
|
|
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
|
|
2857
|
+
# @return [Project]
|
|
2858
|
+
def update_session_limit_policy(total:)
|
|
2859
|
+
api_path = '/project/policies/session-limit'
|
|
612
2860
|
|
|
613
|
-
if
|
|
614
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
2861
|
+
if total.nil?
|
|
2862
|
+
raise Appwrite::Exception.new('Missing required parameter: "total"')
|
|
615
2863
|
end
|
|
616
2864
|
|
|
617
2865
|
api_params = {
|
|
618
|
-
|
|
619
|
-
name: name,
|
|
620
|
-
packageIdentifierName: package_identifier_name,
|
|
2866
|
+
total: total,
|
|
621
2867
|
}
|
|
622
2868
|
|
|
623
2869
|
api_headers = {
|
|
@@ -625,42 +2871,31 @@ module Appwrite
|
|
|
625
2871
|
}
|
|
626
2872
|
|
|
627
2873
|
@client.call(
|
|
628
|
-
method: '
|
|
2874
|
+
method: 'PATCH',
|
|
629
2875
|
path: api_path,
|
|
630
2876
|
headers: api_headers,
|
|
631
2877
|
params: api_params,
|
|
632
|
-
response_type: Models::
|
|
2878
|
+
response_type: Models::Project
|
|
633
2879
|
)
|
|
634
2880
|
|
|
635
2881
|
end
|
|
636
2882
|
|
|
637
|
-
# Update
|
|
638
|
-
#
|
|
2883
|
+
# Update the maximum number of users in the project. When the limit is hit or
|
|
2884
|
+
# amount of existing users already exceeded the limit, all users remain
|
|
2885
|
+
# active, but new user sign up will be prohibited.
|
|
639
2886
|
#
|
|
640
|
-
# @param [
|
|
641
|
-
# @param [String] name Platform name. Max length: 128 chars.
|
|
642
|
-
# @param [String] package_identifier_name Windows package identifier name. Max length: 256 chars.
|
|
2887
|
+
# @param [Integer] total Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit.
|
|
643
2888
|
#
|
|
644
|
-
# @return [
|
|
645
|
-
def
|
|
646
|
-
api_path = '/project/
|
|
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
|
|
2889
|
+
# @return [Project]
|
|
2890
|
+
def update_user_limit_policy(total:)
|
|
2891
|
+
api_path = '/project/policies/user-limit'
|
|
656
2892
|
|
|
657
|
-
if
|
|
658
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
2893
|
+
if total.nil?
|
|
2894
|
+
raise Appwrite::Exception.new('Missing required parameter: "total"')
|
|
659
2895
|
end
|
|
660
2896
|
|
|
661
2897
|
api_params = {
|
|
662
|
-
|
|
663
|
-
packageIdentifierName: package_identifier_name,
|
|
2898
|
+
total: total,
|
|
664
2899
|
}
|
|
665
2900
|
|
|
666
2901
|
api_headers = {
|
|
@@ -668,27 +2903,27 @@ module Appwrite
|
|
|
668
2903
|
}
|
|
669
2904
|
|
|
670
2905
|
@client.call(
|
|
671
|
-
method: '
|
|
2906
|
+
method: 'PATCH',
|
|
672
2907
|
path: api_path,
|
|
673
2908
|
headers: api_headers,
|
|
674
2909
|
params: api_params,
|
|
675
|
-
response_type: Models::
|
|
2910
|
+
response_type: Models::Project
|
|
676
2911
|
)
|
|
677
2912
|
|
|
678
2913
|
end
|
|
679
2914
|
|
|
680
|
-
# Get a
|
|
681
|
-
#
|
|
2915
|
+
# Get a policy by its unique ID. This endpoint returns the current
|
|
2916
|
+
# configuration for the requested project policy.
|
|
682
2917
|
#
|
|
683
|
-
# @param [
|
|
2918
|
+
# @param [ProjectPolicy] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy.
|
|
684
2919
|
#
|
|
685
|
-
# @return [
|
|
686
|
-
def
|
|
687
|
-
api_path = '/project/
|
|
688
|
-
.gsub('{
|
|
2920
|
+
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy]
|
|
2921
|
+
def get_policy(policy_id:)
|
|
2922
|
+
api_path = '/project/policies/{policyId}'
|
|
2923
|
+
.gsub('{policyId}', policy_id)
|
|
689
2924
|
|
|
690
|
-
if
|
|
691
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
|
2925
|
+
if policy_id.nil?
|
|
2926
|
+
raise Appwrite::Exception.new('Missing required parameter: "policyId"')
|
|
692
2927
|
end
|
|
693
2928
|
|
|
694
2929
|
api_params = {
|
|
@@ -708,74 +2943,64 @@ module Appwrite
|
|
|
708
2943
|
raise Exception, "Expected object response when hydrating a response model"
|
|
709
2944
|
end
|
|
710
2945
|
|
|
711
|
-
if response['
|
|
2946
|
+
if response['$id'] == 'password-dictionary'
|
|
712
2947
|
|
|
713
|
-
return Models::
|
|
2948
|
+
return Models::PolicyPasswordDictionary.from(map: response)
|
|
714
2949
|
end
|
|
715
2950
|
|
|
716
|
-
if response['
|
|
2951
|
+
if response['$id'] == 'password-history'
|
|
717
2952
|
|
|
718
|
-
return Models::
|
|
2953
|
+
return Models::PolicyPasswordHistory.from(map: response)
|
|
719
2954
|
end
|
|
720
2955
|
|
|
721
|
-
if response['
|
|
2956
|
+
if response['$id'] == 'password-personal-data'
|
|
722
2957
|
|
|
723
|
-
return Models::
|
|
2958
|
+
return Models::PolicyPasswordPersonalData.from(map: response)
|
|
724
2959
|
end
|
|
725
2960
|
|
|
726
|
-
if response['
|
|
2961
|
+
if response['$id'] == 'session-alert'
|
|
727
2962
|
|
|
728
|
-
return Models::
|
|
2963
|
+
return Models::PolicySessionAlert.from(map: response)
|
|
729
2964
|
end
|
|
730
2965
|
|
|
731
|
-
if response['
|
|
2966
|
+
if response['$id'] == 'session-duration'
|
|
732
2967
|
|
|
733
|
-
return Models::
|
|
2968
|
+
return Models::PolicySessionDuration.from(map: response)
|
|
734
2969
|
end
|
|
735
2970
|
|
|
736
|
-
|
|
2971
|
+
if response['$id'] == 'session-invalidation'
|
|
737
2972
|
|
|
738
|
-
|
|
2973
|
+
return Models::PolicySessionInvalidation.from(map: response)
|
|
2974
|
+
end
|
|
739
2975
|
|
|
740
|
-
|
|
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)
|
|
2976
|
+
if response['$id'] == 'session-limit'
|
|
749
2977
|
|
|
750
|
-
|
|
751
|
-
raise Appwrite::Exception.new('Missing required parameter: "platformId"')
|
|
2978
|
+
return Models::PolicySessionLimit.from(map: response)
|
|
752
2979
|
end
|
|
753
2980
|
|
|
754
|
-
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
api_headers = {
|
|
758
|
-
"content-type": 'application/json',
|
|
759
|
-
}
|
|
2981
|
+
if response['$id'] == 'user-limit'
|
|
760
2982
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
2983
|
+
return Models::PolicyUserLimit.from(map: response)
|
|
2984
|
+
end
|
|
2985
|
+
|
|
2986
|
+
if response['$id'] == 'membership-privacy'
|
|
2987
|
+
|
|
2988
|
+
return Models::PolicyMembershipPrivacy.from(map: response)
|
|
2989
|
+
end
|
|
2990
|
+
|
|
2991
|
+
raise Exception, "Unable to match response to any expected response model"
|
|
767
2992
|
|
|
768
2993
|
end
|
|
769
2994
|
|
|
770
|
-
# Update
|
|
2995
|
+
# Update properties of a specific protocol. Use this endpoint to enable or
|
|
771
2996
|
# disable a protocol in your project.
|
|
772
2997
|
#
|
|
773
2998
|
# @param [ProtocolId] protocol_id Protocol name. Can be one of: rest, graphql, websocket
|
|
774
2999
|
# @param [] enabled Protocol status.
|
|
775
3000
|
#
|
|
776
3001
|
# @return [Project]
|
|
777
|
-
def
|
|
778
|
-
api_path = '/project/protocols/{protocolId}
|
|
3002
|
+
def update_protocol(protocol_id:, enabled:)
|
|
3003
|
+
api_path = '/project/protocols/{protocolId}'
|
|
779
3004
|
.gsub('{protocolId}', protocol_id)
|
|
780
3005
|
|
|
781
3006
|
if protocol_id.nil?
|
|
@@ -804,15 +3029,15 @@ module Appwrite
|
|
|
804
3029
|
|
|
805
3030
|
end
|
|
806
3031
|
|
|
807
|
-
# Update
|
|
3032
|
+
# Update properties of a specific service. Use this endpoint to enable or
|
|
808
3033
|
# disable a service in your project.
|
|
809
3034
|
#
|
|
810
3035
|
# @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
3036
|
# @param [] enabled Service status.
|
|
812
3037
|
#
|
|
813
3038
|
# @return [Project]
|
|
814
|
-
def
|
|
815
|
-
api_path = '/project/services/{serviceId}
|
|
3039
|
+
def update_service(service_id:, enabled:)
|
|
3040
|
+
api_path = '/project/services/{serviceId}'
|
|
816
3041
|
.gsub('{serviceId}', service_id)
|
|
817
3042
|
|
|
818
3043
|
if service_id.nil?
|
|
@@ -841,6 +3066,188 @@ module Appwrite
|
|
|
841
3066
|
|
|
842
3067
|
end
|
|
843
3068
|
|
|
3069
|
+
# Update the SMTP configuration for your project. Use this endpoint to
|
|
3070
|
+
# configure your project's SMTP provider with your custom settings for
|
|
3071
|
+
# sending transactional emails.
|
|
3072
|
+
#
|
|
3073
|
+
# @param [String] host SMTP server hostname (domain)
|
|
3074
|
+
# @param [Integer] port SMTP server port
|
|
3075
|
+
# @param [String] username SMTP server username. Leave empty for no authorization.
|
|
3076
|
+
# @param [String] password SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only).
|
|
3077
|
+
# @param [String] sender_email Email address shown in inbox as the sender of the email.
|
|
3078
|
+
# @param [String] sender_name Name shown in inbox as the sender of the email.
|
|
3079
|
+
# @param [String] reply_to_email Email used when user replies to the email.
|
|
3080
|
+
# @param [String] reply_to_name Name used when user replies to the email.
|
|
3081
|
+
# @param [Secure] secure Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption.
|
|
3082
|
+
# @param [] enabled Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates.
|
|
3083
|
+
#
|
|
3084
|
+
# @return [Project]
|
|
3085
|
+
def update_smtp(host: nil, port: nil, username: nil, password: nil, sender_email: nil, sender_name: nil, reply_to_email: nil, reply_to_name: nil, secure: nil, enabled: nil)
|
|
3086
|
+
api_path = '/project/smtp'
|
|
3087
|
+
|
|
3088
|
+
api_params = {
|
|
3089
|
+
host: host,
|
|
3090
|
+
port: port,
|
|
3091
|
+
username: username,
|
|
3092
|
+
password: password,
|
|
3093
|
+
senderEmail: sender_email,
|
|
3094
|
+
senderName: sender_name,
|
|
3095
|
+
replyToEmail: reply_to_email,
|
|
3096
|
+
replyToName: reply_to_name,
|
|
3097
|
+
secure: secure,
|
|
3098
|
+
enabled: enabled,
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
api_headers = {
|
|
3102
|
+
"content-type": 'application/json',
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
@client.call(
|
|
3106
|
+
method: 'PATCH',
|
|
3107
|
+
path: api_path,
|
|
3108
|
+
headers: api_headers,
|
|
3109
|
+
params: api_params,
|
|
3110
|
+
response_type: Models::Project
|
|
3111
|
+
)
|
|
3112
|
+
|
|
3113
|
+
end
|
|
3114
|
+
|
|
3115
|
+
# Send a test email to verify SMTP configuration.
|
|
3116
|
+
#
|
|
3117
|
+
# @param [Array] emails Array of emails to send test email to. Maximum of 10 emails are allowed.
|
|
3118
|
+
#
|
|
3119
|
+
# @return []
|
|
3120
|
+
def create_smtp_test(emails:)
|
|
3121
|
+
api_path = '/project/smtp/tests'
|
|
3122
|
+
|
|
3123
|
+
if emails.nil?
|
|
3124
|
+
raise Appwrite::Exception.new('Missing required parameter: "emails"')
|
|
3125
|
+
end
|
|
3126
|
+
|
|
3127
|
+
api_params = {
|
|
3128
|
+
emails: emails,
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
api_headers = {
|
|
3132
|
+
"content-type": 'application/json',
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
@client.call(
|
|
3136
|
+
method: 'POST',
|
|
3137
|
+
path: api_path,
|
|
3138
|
+
headers: api_headers,
|
|
3139
|
+
params: api_params,
|
|
3140
|
+
)
|
|
3141
|
+
|
|
3142
|
+
end
|
|
3143
|
+
|
|
3144
|
+
# Get a list of all custom email templates configured for the project. This
|
|
3145
|
+
# endpoint returns an array of all configured email templates and their
|
|
3146
|
+
# locales.
|
|
3147
|
+
#
|
|
3148
|
+
# @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). Only supported methods are limit and offset
|
|
3149
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
3150
|
+
#
|
|
3151
|
+
# @return [EmailTemplateList]
|
|
3152
|
+
def list_email_templates(queries: nil, total: nil)
|
|
3153
|
+
api_path = '/project/templates/email'
|
|
3154
|
+
|
|
3155
|
+
api_params = {
|
|
3156
|
+
queries: queries,
|
|
3157
|
+
total: total,
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
api_headers = {
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
@client.call(
|
|
3164
|
+
method: 'GET',
|
|
3165
|
+
path: api_path,
|
|
3166
|
+
headers: api_headers,
|
|
3167
|
+
params: api_params,
|
|
3168
|
+
response_type: Models::EmailTemplateList
|
|
3169
|
+
)
|
|
3170
|
+
|
|
3171
|
+
end
|
|
3172
|
+
|
|
3173
|
+
# Update a custom email template for the specified locale and type. Use this
|
|
3174
|
+
# endpoint to modify the content of your email templates.
|
|
3175
|
+
#
|
|
3176
|
+
# @param [EmailTemplateType] template_id Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
|
|
3177
|
+
# @param [EmailTemplateLocale] locale Custom email template locale. If left empty, the fallback locale (en) will be used.
|
|
3178
|
+
# @param [String] subject Subject of the email template. Can be up to 255 characters.
|
|
3179
|
+
# @param [String] message Plain or HTML body of the email template message. Can be up to 10MB of content.
|
|
3180
|
+
# @param [String] sender_name Name of the email sender.
|
|
3181
|
+
# @param [String] sender_email Email of the sender.
|
|
3182
|
+
# @param [String] reply_to_email Reply to email.
|
|
3183
|
+
# @param [String] reply_to_name Reply to name.
|
|
3184
|
+
#
|
|
3185
|
+
# @return [EmailTemplate]
|
|
3186
|
+
def update_email_template(template_id:, locale: nil, subject: nil, message: nil, sender_name: nil, sender_email: nil, reply_to_email: nil, reply_to_name: nil)
|
|
3187
|
+
api_path = '/project/templates/email'
|
|
3188
|
+
|
|
3189
|
+
if template_id.nil?
|
|
3190
|
+
raise Appwrite::Exception.new('Missing required parameter: "templateId"')
|
|
3191
|
+
end
|
|
3192
|
+
|
|
3193
|
+
api_params = {
|
|
3194
|
+
templateId: template_id,
|
|
3195
|
+
locale: locale,
|
|
3196
|
+
subject: subject,
|
|
3197
|
+
message: message,
|
|
3198
|
+
senderName: sender_name,
|
|
3199
|
+
senderEmail: sender_email,
|
|
3200
|
+
replyToEmail: reply_to_email,
|
|
3201
|
+
replyToName: reply_to_name,
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
api_headers = {
|
|
3205
|
+
"content-type": 'application/json',
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
@client.call(
|
|
3209
|
+
method: 'PATCH',
|
|
3210
|
+
path: api_path,
|
|
3211
|
+
headers: api_headers,
|
|
3212
|
+
params: api_params,
|
|
3213
|
+
response_type: Models::EmailTemplate
|
|
3214
|
+
)
|
|
3215
|
+
|
|
3216
|
+
end
|
|
3217
|
+
|
|
3218
|
+
# Get a custom email template for the specified locale and type. This
|
|
3219
|
+
# endpoint returns the template content, subject, and other configuration
|
|
3220
|
+
# details.
|
|
3221
|
+
#
|
|
3222
|
+
# @param [EmailTemplateType] template_id Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
|
|
3223
|
+
# @param [EmailTemplateLocale] locale Custom email template locale. If left empty, the fallback locale (en) will be used.
|
|
3224
|
+
#
|
|
3225
|
+
# @return [EmailTemplate]
|
|
3226
|
+
def get_email_template(template_id:, locale: nil)
|
|
3227
|
+
api_path = '/project/templates/email/{templateId}'
|
|
3228
|
+
.gsub('{templateId}', template_id)
|
|
3229
|
+
|
|
3230
|
+
if template_id.nil?
|
|
3231
|
+
raise Appwrite::Exception.new('Missing required parameter: "templateId"')
|
|
3232
|
+
end
|
|
3233
|
+
|
|
3234
|
+
api_params = {
|
|
3235
|
+
locale: locale,
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
api_headers = {
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
@client.call(
|
|
3242
|
+
method: 'GET',
|
|
3243
|
+
path: api_path,
|
|
3244
|
+
headers: api_headers,
|
|
3245
|
+
params: api_params,
|
|
3246
|
+
response_type: Models::EmailTemplate
|
|
3247
|
+
)
|
|
3248
|
+
|
|
3249
|
+
end
|
|
3250
|
+
|
|
844
3251
|
# Get a list of all project environment variables.
|
|
845
3252
|
#
|
|
846
3253
|
# @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
|
|
@@ -871,7 +3278,7 @@ module Appwrite
|
|
|
871
3278
|
# Create a new project environment variable. These variables can be accessed
|
|
872
3279
|
# by all functions and sites in the project.
|
|
873
3280
|
#
|
|
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.
|
|
3281
|
+
# @param [String] variable_id Variable unique 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
3282
|
# @param [String] key Variable key. Max length: 255 chars.
|
|
876
3283
|
# @param [String] value Variable value. Max length: 8192 chars.
|
|
877
3284
|
# @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -915,7 +3322,7 @@ module Appwrite
|
|
|
915
3322
|
|
|
916
3323
|
# Get a variable by its unique ID.
|
|
917
3324
|
#
|
|
918
|
-
# @param [String] variable_id Variable ID.
|
|
3325
|
+
# @param [String] variable_id Variable unique ID.
|
|
919
3326
|
#
|
|
920
3327
|
# @return [Variable]
|
|
921
3328
|
def get_variable(variable_id:)
|
|
@@ -944,7 +3351,7 @@ module Appwrite
|
|
|
944
3351
|
|
|
945
3352
|
# Update variable by its unique ID.
|
|
946
3353
|
#
|
|
947
|
-
# @param [String] variable_id Variable ID.
|
|
3354
|
+
# @param [String] variable_id Variable unique ID.
|
|
948
3355
|
# @param [String] key Variable key. Max length: 255 chars.
|
|
949
3356
|
# @param [String] value Variable value. Max length: 8192 chars.
|
|
950
3357
|
# @param [] secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -980,7 +3387,7 @@ module Appwrite
|
|
|
980
3387
|
|
|
981
3388
|
# Delete a variable by its unique ID.
|
|
982
3389
|
#
|
|
983
|
-
# @param [String] variable_id Variable ID.
|
|
3390
|
+
# @param [String] variable_id Variable unique ID.
|
|
984
3391
|
#
|
|
985
3392
|
# @return []
|
|
986
3393
|
def delete_variable(variable_id:)
|