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