Class: Appwrite::Project

Inherits:
Service show all
Defined in:
lib/appwrite/services/project.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Project

Returns a new instance of Project.



6
7
8
# File 'lib/appwrite/services/project.rb', line 6

def initialize(client)
    @client = client
end

Instance Method Details

#create_android_platform(platform_id:, name:, application_id:) ⇒ PlatformAndroid

Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API.

Parameters:

  • platform_id (String)

    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.

  • name (String)

    Platform name. Max length: 128 chars.

  • application_id (String)

    Android application ID. Max length: 256 chars.

Returns:

  • (PlatformAndroid)


2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
# File 'lib/appwrite/services/project.rb', line 2073

def create_android_platform(platform_id:, name:, application_id:)
    api_path = '/project/platforms/android'

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if application_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
    end

    api_params = {
        platformId: platform_id,
        name: name,
        applicationId: application_id,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformAndroid
    )

end

#create_apple_platform(platform_id:, name:, bundle_identifier:) ⇒ PlatformApple

Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API.

Parameters:

  • platform_id (String)

    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.

  • name (String)

    Platform name. Max length: 128 chars.

  • bundle_identifier (String)

    Apple bundle identifier. Max length: 256 chars.

Returns:

  • (PlatformApple)


2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
# File 'lib/appwrite/services/project.rb', line 2160

def create_apple_platform(platform_id:, name:, bundle_identifier:)
    api_path = '/project/platforms/apple'

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if bundle_identifier.nil?
      raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
    end

    api_params = {
        platformId: platform_id,
        name: name,
        bundleIdentifier: bundle_identifier,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformApple
    )

end

#create_ephemeral_key(scopes:, duration:) ⇒ EphemeralKey

Create a new ephemeral API key. It’s recommended to have multiple API keys with strict scopes for separate functions within your project.

You can also create a standard API key if you need a longer-lived key instead.

Parameters:

  • scopes (Array)

    Key scopes list. Maximum of 100 scopes are allowed.

  • duration (Integer)

    Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.

Returns:

  • (EphemeralKey)


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/appwrite/services/project.rb', line 155

def create_ephemeral_key(scopes:, duration:)
    api_path = '/project/keys/ephemeral'

    if scopes.nil?
      raise Appwrite::Exception.new('Missing required parameter: "scopes"')
    end

    if duration.nil?
      raise Appwrite::Exception.new('Missing required parameter: "duration"')
    end

    api_params = {
        scopes: scopes,
        duration: duration,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::EphemeralKey
    )

end

#create_key(key_id:, name:, scopes:, expire: nil) ⇒ Key

Create a new API key. It’s recommended to have multiple API keys with strict scopes for separate functions within your project.

You can also create an ephemeral API key if you need a short-lived key instead.

Parameters:

  • key_id (String)

    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.

  • name (String)

    Key name. Max length: 128 chars.

  • scopes (Array)

    Key scopes list. Maximum of 100 scopes are allowed.

  • expire (String) (defaults to: nil)

    Expiration time in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.

Returns:

  • (Key)


109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/appwrite/services/project.rb', line 109

def create_key(key_id:, name:, scopes:, expire: nil)
    api_path = '/project/keys'

    if key_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "keyId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if scopes.nil?
      raise Appwrite::Exception.new('Missing required parameter: "scopes"')
    end

    api_params = {
        keyId: key_id,
        name: name,
        scopes: scopes,
        expire: expire,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Key
    )

end

#create_linux_platform(platform_id:, name:, package_name:) ⇒ PlatformLinux

Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API.

Parameters:

  • platform_id (String)

    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.

  • name (String)

    Platform name. Max length: 128 chars.

  • package_name (String)

    Linux package name. Max length: 256 chars.

Returns:

  • (PlatformLinux)


2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
# File 'lib/appwrite/services/project.rb', line 2247

def create_linux_platform(platform_id:, name:, package_name:)
    api_path = '/project/platforms/linux'

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if package_name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "packageName"')
    end

    api_params = {
        platformId: platform_id,
        name: name,
        packageName: package_name,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformLinux
    )

end

#create_mock_phone(number:, otp:) ⇒ MockNumber

Create a new mock phone for your project. Use this endpoint to register a mock phone number and its sign-in OTP for your testers.

Parameters:

  • number (String)

    Phone number to associate with the mock phone. Must be a valid E.164 formatted phone number.

  • otp (String)

    One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.

Returns:

  • (MockNumber)


355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/appwrite/services/project.rb', line 355

def create_mock_phone(number:, otp:)
    api_path = '/project/mock-phones'

    if number.nil?
      raise Appwrite::Exception.new('Missing required parameter: "number"')
    end

    if otp.nil?
      raise Appwrite::Exception.new('Missing required parameter: "otp"')
    end

    api_params = {
        number: number,
        otp: otp,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::MockNumber
    )

end

#create_smtp_test(emails:) ⇒ Object

Send a test email to verify SMTP configuration.

Parameters:

  • emails (Array)

    Array of emails to send test email to. Maximum of 10 emails are allowed.

Returns:



3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
# File 'lib/appwrite/services/project.rb', line 3120

def create_smtp_test(emails:)
    api_path = '/project/smtp/tests'

    if emails.nil?
      raise Appwrite::Exception.new('Missing required parameter: "emails"')
    end

    api_params = {
        emails: emails,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#create_variable(variable_id:, key:, value:, secret: nil) ⇒ Variable

Create a new project environment variable. These variables can be accessed by all functions and sites in the project.

Parameters:

  • variable_id (String)

    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.

  • key (String)

    Variable key. Max length: 255 chars.

  • value (String)

    Variable value. Max length: 8192 chars.

  • []

    secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.

Returns:

  • (Variable)


3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
# File 'lib/appwrite/services/project.rb', line 3287

def create_variable(variable_id:, key:, value:, secret: nil)
    api_path = '/project/variables'

    if variable_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "variableId"')
    end

    if key.nil?
      raise Appwrite::Exception.new('Missing required parameter: "key"')
    end

    if value.nil?
      raise Appwrite::Exception.new('Missing required parameter: "value"')
    end

    api_params = {
        variableId: variable_id,
        key: key,
        value: value,
        secret: secret,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Variable
    )

end

#create_web_platform(platform_id:, name:, hostname:) ⇒ PlatformWeb

Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.

Parameters:

  • platform_id (String)

    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.

  • name (String)

    Platform name. Max length: 128 chars.

  • hostname (String)

    Platform web hostname. Max length: 256 chars.

Returns:

  • (PlatformWeb)


2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
# File 'lib/appwrite/services/project.rb', line 2334

def create_web_platform(platform_id:, name:, hostname:)
    api_path = '/project/platforms/web'

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if hostname.nil?
      raise Appwrite::Exception.new('Missing required parameter: "hostname"')
    end

    api_params = {
        platformId: platform_id,
        name: name,
        hostname: hostname,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformWeb
    )

end

#create_windows_platform(platform_id:, name:, package_identifier_name:) ⇒ PlatformWindows

Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API.

Parameters:

  • platform_id (String)

    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.

  • name (String)

    Platform name. Max length: 128 chars.

  • package_identifier_name (String)

    Windows package identifier name. Max length: 256 chars.

Returns:

  • (PlatformWindows)


2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
# File 'lib/appwrite/services/project.rb', line 2421

def create_windows_platform(platform_id:, name:, package_identifier_name:)
    api_path = '/project/platforms/windows'

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if package_identifier_name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
    end

    api_params = {
        platformId: platform_id,
        name: name,
        packageIdentifierName: package_identifier_name,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformWindows
    )

end

#deleteObject

Delete a project.

Returns:



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/appwrite/services/project.rb', line 14

def delete()
    api_path = '/project'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'DELETE',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#delete_key(key_id:) ⇒ Object

Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.

Parameters:

  • key_id (String)

    Key ID.

Returns:



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/appwrite/services/project.rb', line 265

def delete_key(key_id:)
    api_path = '/project/keys/{keyId}'
        .gsub('{keyId}', key_id)

    if key_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "keyId"')
    end

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'DELETE',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#delete_mock_phone(number:) ⇒ Object

Delete a mock phone by its unique number. This endpoint removes the mock phone and its OTP configuration from the project.

Parameters:

  • number (String)

    Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.

Returns:



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/appwrite/services/project.rb', line 458

def delete_mock_phone(number:)
    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', number)

    if number.nil?
      raise Appwrite::Exception.new('Missing required parameter: "number"')
    end

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'DELETE',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#delete_platform(platform_id:) ⇒ Object

Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project.

Parameters:

  • platform_id (String)

    Platform ID.

Returns:



2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
# File 'lib/appwrite/services/project.rb', line 2565

def delete_platform(platform_id:)
    api_path = '/project/platforms/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'DELETE',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#delete_variable(variable_id:) ⇒ Object

Delete a variable by its unique ID.

Parameters:

  • variable_id (String)

    Variable unique ID.

Returns:



3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
# File 'lib/appwrite/services/project.rb', line 3393

def delete_variable(variable_id:)
    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', variable_id)

    if variable_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "variableId"')
    end

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'DELETE',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

end

#get_email_template(template_id:, locale: nil) ⇒ EmailTemplate

Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details.

Parameters:

  • template_id (EmailTemplateType)

    Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession

  • locale (EmailTemplateLocale) (defaults to: nil)

    Custom email template locale. If left empty, the fallback locale (en) will be used.

Returns:

  • (EmailTemplate)


3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
# File 'lib/appwrite/services/project.rb', line 3226

def get_email_template(template_id:, locale: nil)
    api_path = '/project/templates/email/{templateId}'
        .gsub('{templateId}', template_id)

    if template_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "templateId"')
    end

    api_params = {
        locale: locale,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::EmailTemplate
    )

end

#get_key(key_id:) ⇒ Key

Get a key by its unique ID.

Parameters:

  • key_id (String)

    Key ID.

Returns:

  • (Key)


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/appwrite/services/project.rb', line 190

def get_key(key_id:)
    api_path = '/project/keys/{keyId}'
        .gsub('{keyId}', key_id)

    if key_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "keyId"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Key
    )

end

#get_mock_phone(number:) ⇒ MockNumber

Get a mock phone by its unique number. This endpoint returns the mock phone’s OTP.

Parameters:

  • number (String)

    Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.

Returns:

  • (MockNumber)


391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/appwrite/services/project.rb', line 391

def get_mock_phone(number:)
    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', number)

    if number.nil?
      raise Appwrite::Exception.new('Missing required parameter: "number"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::MockNumber
    )

end

#get_o_auth2_provider(provider_id:) ⇒ OAuth2Github, ...

Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty.

Parameters:

  • provider_id (OAuthProvider)

    OAuth2 provider key. For example: github, google, apple.

Returns:

  • (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)

Raises:



1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
# File 'lib/appwrite/services/project.rb', line 1807

def get_o_auth2_provider(provider_id:)
    api_path = '/project/oauth2/{providerId}'
        .gsub('{providerId}', provider_id)

    if provider_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "providerId"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    response = @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

    unless response.is_a?(Hash)
        raise Exception, "Expected object response when hydrating a response model"
    end

    if response['$id'] == 'github'

        return Models::OAuth2Github.from(map: response)
    end

    if response['$id'] == 'discord'

        return Models::OAuth2Discord.from(map: response)
    end

    if response['$id'] == 'figma'

        return Models::OAuth2Figma.from(map: response)
    end

    if response['$id'] == 'dropbox'

        return Models::OAuth2Dropbox.from(map: response)
    end

    if response['$id'] == 'dailymotion'

        return Models::OAuth2Dailymotion.from(map: response)
    end

    if response['$id'] == 'bitbucket'

        return Models::OAuth2Bitbucket.from(map: response)
    end

    if response['$id'] == 'bitly'

        return Models::OAuth2Bitly.from(map: response)
    end

    if response['$id'] == 'box'

        return Models::OAuth2Box.from(map: response)
    end

    if response['$id'] == 'autodesk'

        return Models::OAuth2Autodesk.from(map: response)
    end

    if response['$id'] == 'google'

        return Models::OAuth2Google.from(map: response)
    end

    if response['$id'] == 'zoom'

        return Models::OAuth2Zoom.from(map: response)
    end

    if response['$id'] == 'zoho'

        return Models::OAuth2Zoho.from(map: response)
    end

    if response['$id'] == 'yandex'

        return Models::OAuth2Yandex.from(map: response)
    end

    if response['$id'] == 'x'

        return Models::OAuth2X.from(map: response)
    end

    if response['$id'] == 'wordpress'

        return Models::OAuth2WordPress.from(map: response)
    end

    if response['$id'] == 'twitch'

        return Models::OAuth2Twitch.from(map: response)
    end

    if response['$id'] == 'stripe'

        return Models::OAuth2Stripe.from(map: response)
    end

    if response['$id'] == 'spotify'

        return Models::OAuth2Spotify.from(map: response)
    end

    if response['$id'] == 'slack'

        return Models::OAuth2Slack.from(map: response)
    end

    if response['$id'] == 'podio'

        return Models::OAuth2Podio.from(map: response)
    end

    if response['$id'] == 'notion'

        return Models::OAuth2Notion.from(map: response)
    end

    if response['$id'] == 'salesforce'

        return Models::OAuth2Salesforce.from(map: response)
    end

    if response['$id'] == 'yahoo'

        return Models::OAuth2Yahoo.from(map: response)
    end

    if response['$id'] == 'linkedin'

        return Models::OAuth2Linkedin.from(map: response)
    end

    if response['$id'] == 'disqus'

        return Models::OAuth2Disqus.from(map: response)
    end

    if response['$id'] == 'amazon'

        return Models::OAuth2Amazon.from(map: response)
    end

    if response['$id'] == 'etsy'

        return Models::OAuth2Etsy.from(map: response)
    end

    if response['$id'] == 'facebook'

        return Models::OAuth2Facebook.from(map: response)
    end

    if response['$id'] == 'tradeshiftBox'

        return Models::OAuth2Tradeshift.from(map: response)
    end

    if response['$id'] == 'paypalSandbox'

        return Models::OAuth2Paypal.from(map: response)
    end

    if response['$id'] == 'gitlab'

        return Models::OAuth2Gitlab.from(map: response)
    end

    if response['$id'] == 'authentik'

        return Models::OAuth2Authentik.from(map: response)
    end

    if response['$id'] == 'auth0'

        return Models::OAuth2Auth0.from(map: response)
    end

    if response['$id'] == 'fusionauth'

        return Models::OAuth2FusionAuth.from(map: response)
    end

    if response['$id'] == 'keycloak'

        return Models::OAuth2Keycloak.from(map: response)
    end

    if response['$id'] == 'oidc'

        return Models::OAuth2Oidc.from(map: response)
    end

    if response['$id'] == 'apple'

        return Models::OAuth2Apple.from(map: response)
    end

    if response['$id'] == 'okta'

        return Models::OAuth2Okta.from(map: response)
    end

    if response['$id'] == 'kick'

        return Models::OAuth2Kick.from(map: response)
    end

    if response['$id'] == 'microsoft'

        return Models::OAuth2Microsoft.from(map: response)
    end

    raise Exception, "Unable to match response to any expected response model"

end

#get_platform(platform_id:) ⇒ PlatformWeb, ...

Get a platform by its unique ID. This endpoint returns the platform’s details, including its name, type, and key configurations.

Parameters:

  • platform_id (String)

    Platform ID.

Returns:

  • (PlatformWeb, PlatformApple, PlatformAndroid, PlatformWindows, PlatformLinux)

Raises:



2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
# File 'lib/appwrite/services/project.rb', line 2505

def get_platform(platform_id:)
    api_path = '/project/platforms/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    response = @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

    unless response.is_a?(Hash)
        raise Exception, "Expected object response when hydrating a response model"
    end

    if response['type'] == 'web'

        return Models::PlatformWeb.from(map: response)
    end

    if response['type'] == 'apple'

        return Models::PlatformApple.from(map: response)
    end

    if response['type'] == 'android'

        return Models::PlatformAndroid.from(map: response)
    end

    if response['type'] == 'windows'

        return Models::PlatformWindows.from(map: response)
    end

    if response['type'] == 'linux'

        return Models::PlatformLinux.from(map: response)
    end

    raise Exception, "Unable to match response to any expected response model"

end

#get_policy(policy_id:) ⇒ PolicyPasswordDictionary, ...

Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy.

Parameters:

  • policy_id (ProjectPolicy)

    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.

Returns:

  • (PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy)

Raises:



2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
# File 'lib/appwrite/services/project.rb', line 2921

def get_policy(policy_id:)
    api_path = '/project/policies/{policyId}'
        .gsub('{policyId}', policy_id)

    if policy_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "policyId"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    response = @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )

    unless response.is_a?(Hash)
        raise Exception, "Expected object response when hydrating a response model"
    end

    if response['$id'] == 'password-dictionary'

        return Models::PolicyPasswordDictionary.from(map: response)
    end

    if response['$id'] == 'password-history'

        return Models::PolicyPasswordHistory.from(map: response)
    end

    if response['$id'] == 'password-personal-data'

        return Models::PolicyPasswordPersonalData.from(map: response)
    end

    if response['$id'] == 'session-alert'

        return Models::PolicySessionAlert.from(map: response)
    end

    if response['$id'] == 'session-duration'

        return Models::PolicySessionDuration.from(map: response)
    end

    if response['$id'] == 'session-invalidation'

        return Models::PolicySessionInvalidation.from(map: response)
    end

    if response['$id'] == 'session-limit'

        return Models::PolicySessionLimit.from(map: response)
    end

    if response['$id'] == 'user-limit'

        return Models::PolicyUserLimit.from(map: response)
    end

    if response['$id'] == 'membership-privacy'

        return Models::PolicyMembershipPrivacy.from(map: response)
    end

    raise Exception, "Unable to match response to any expected response model"

end

#get_variable(variable_id:) ⇒ Variable

Get a variable by its unique ID.

Parameters:

  • variable_id (String)

    Variable unique ID.

Returns:

  • (Variable)


3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
# File 'lib/appwrite/services/project.rb', line 3328

def get_variable(variable_id:)
    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', variable_id)

    if variable_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "variableId"')
    end

    api_params = {
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Variable
    )

end

#list_email_templates(queries: nil, total: nil) ⇒ EmailTemplateList

Get a list of all custom email templates configured for the project. This endpoint returns an array of all configured email templates and their locales.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](appwrite.io/docs/queries). Only supported methods are limit and offset

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (EmailTemplateList)


3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
# File 'lib/appwrite/services/project.rb', line 3152

def list_email_templates(queries: nil, total: nil)
    api_path = '/project/templates/email'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::EmailTemplateList
    )

end

#list_keys(queries: nil, total: nil) ⇒ KeyList

Get a list of all API keys from the current project.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](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

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (KeyList)


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/appwrite/services/project.rb', line 76

def list_keys(queries: nil, total: nil)
    api_path = '/project/keys'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::KeyList
    )

end

#list_mock_phones(queries: nil, total: nil) ⇒ MockNumberList

Get a list of all mock phones in the project. This endpoint returns an array of all mock phones and their OTPs.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](appwrite.io/docs/queries). Only supported methods are limit and offset

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (MockNumberList)


327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/appwrite/services/project.rb', line 327

def list_mock_phones(queries: nil, total: nil)
    api_path = '/project/mock-phones'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::MockNumberList
    )

end

#list_o_auth2_providers(queries: nil, total: nil) ⇒ OAuth2ProviderList

Get a list of all OAuth2 providers supported by the server, along with the project’s configuration for each. Credential fields are write-only and always returned empty.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](appwrite.io/docs/queries). Only supported methods are limit and offset

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (OAuth2ProviderList)


490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/appwrite/services/project.rb', line 490

def list_o_auth2_providers(queries: nil, total: nil)
    api_path = '/project/oauth2'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2ProviderList
    )

end

#list_platforms(queries: nil, total: nil) ⇒ PlatformList

Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](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

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (PlatformList)


2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/appwrite/services/project.rb', line 2043

def list_platforms(queries: nil, total: nil)
    api_path = '/project/platforms'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformList
    )

end

#list_policies(queries: nil, total: nil) ⇒ PolicyList

Get a list of all project policies and their current configuration.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](appwrite.io/docs/queries). Only supported methods are limit and offset

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (PolicyList)


2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
# File 'lib/appwrite/services/project.rb', line 2595

def list_policies(queries: nil, total: nil)
    api_path = '/project/policies'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PolicyList
    )

end

#list_variables(queries: nil, total: nil) ⇒ VariableList

Get a list of all project environment variables.

Parameters:

  • queries (Array) (defaults to: nil)

    Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret

  • []

    total When set to false, the total count returned will be 0 and will not be calculated.

Returns:

  • (VariableList)


3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
# File 'lib/appwrite/services/project.rb', line 3257

def list_variables(queries: nil, total: nil)
    api_path = '/project/variables'

    api_params = {
        queries: queries,
        total: total,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::VariableList
    )

end

#update_android_platform(platform_id:, name:, application_id:) ⇒ PlatformAndroid

Update an Android platform by its unique ID. Use this endpoint to update the platform’s name or application ID.

Parameters:

  • platform_id (String)

    Platform ID.

  • name (String)

    Platform name. Max length: 128 chars.

  • application_id (String)

    Android application ID. Max length: 256 chars.

Returns:

  • (PlatformAndroid)


2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# File 'lib/appwrite/services/project.rb', line 2116

def update_android_platform(platform_id:, name:, application_id:)
    api_path = '/project/platforms/android/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if application_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "applicationId"')
    end

    api_params = {
        name: name,
        applicationId: application_id,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformAndroid
    )

end

#update_apple_platform(platform_id:, name:, bundle_identifier:) ⇒ PlatformApple

Update an Apple platform by its unique ID. Use this endpoint to update the platform’s name or bundle identifier.

Parameters:

  • platform_id (String)

    Platform ID.

  • name (String)

    Platform name. Max length: 128 chars.

  • bundle_identifier (String)

    Apple bundle identifier. Max length: 256 chars.

Returns:

  • (PlatformApple)


2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
# File 'lib/appwrite/services/project.rb', line 2203

def update_apple_platform(platform_id:, name:, bundle_identifier:)
    api_path = '/project/platforms/apple/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if bundle_identifier.nil?
      raise Appwrite::Exception.new('Missing required parameter: "bundleIdentifier"')
    end

    api_params = {
        name: name,
        bundleIdentifier: bundle_identifier,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformApple
    )

end

#update_auth_method(method_id:, enabled:) ⇒ Project

Update properties of a specific auth method. Use this endpoint to enable or disable a method in your project.

Parameters:

  • method_id (AuthMethod)

    Auth Method ID. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone

  • []

    enabled Auth method status.

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/appwrite/services/project.rb', line 40

def update_auth_method(method_id:, enabled:)
    api_path = '/project/auth-methods/{methodId}'
        .gsub('{methodId}', method_id)

    if method_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "methodId"')
    end

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#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) ⇒ EmailTemplate

Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.

Parameters:

  • template_id (EmailTemplateType)

    Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession

  • locale (EmailTemplateLocale) (defaults to: nil)

    Custom email template locale. If left empty, the fallback locale (en) will be used.

  • subject (String) (defaults to: nil)

    Subject of the email template. Can be up to 255 characters.

  • message (String) (defaults to: nil)

    Plain or HTML body of the email template message. Can be up to 10MB of content.

  • sender_name (String) (defaults to: nil)

    Name of the email sender.

  • sender_email (String) (defaults to: nil)

    Email of the sender.

  • reply_to_email (String) (defaults to: nil)

    Reply to email.

  • reply_to_name (String) (defaults to: nil)

    Reply to name.

Returns:

  • (EmailTemplate)


3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
# File 'lib/appwrite/services/project.rb', line 3186

def update_email_template(template_id:, locale: nil, subject: nil, message: nil, sender_name: nil, sender_email: nil, reply_to_email: nil, reply_to_name: nil)
    api_path = '/project/templates/email'

    if template_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "templateId"')
    end

    api_params = {
        templateId: template_id,
        locale: locale,
        subject: subject,
        message: message,
        senderName: sender_name,
        senderEmail: sender_email,
        replyToEmail: reply_to_email,
        replyToName: reply_to_name,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::EmailTemplate
    )

end

#update_key(key_id:, name:, scopes:, expire: nil) ⇒ Key

Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.

Parameters:

  • key_id (String)

    Key ID.

  • name (String)

    Key name. Max length: 128 chars.

  • scopes (Array)

    Key scopes list. Maximum of 100 scopes are allowed.

  • expire (String) (defaults to: nil)

    Expiration time in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.

Returns:

  • (Key)


223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/appwrite/services/project.rb', line 223

def update_key(key_id:, name:, scopes:, expire: nil)
    api_path = '/project/keys/{keyId}'
        .gsub('{keyId}', key_id)

    if key_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "keyId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if scopes.nil?
      raise Appwrite::Exception.new('Missing required parameter: "scopes"')
    end

    api_params = {
        name: name,
        scopes: scopes,
        expire: expire,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Key
    )

end

#update_labels(labels:) ⇒ Project

Update the project labels. Labels can be used to easily filter projects in an organization.

Parameters:

  • labels (Array)

    Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.

Returns:



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/appwrite/services/project.rb', line 295

def update_labels(labels:)
    api_path = '/project/labels'

    if labels.nil?
      raise Appwrite::Exception.new('Missing required parameter: "labels"')
    end

    api_params = {
        labels: labels,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_linux_platform(platform_id:, name:, package_name:) ⇒ PlatformLinux

Update a Linux platform by its unique ID. Use this endpoint to update the platform’s name or package name.

Parameters:

  • platform_id (String)

    Platform ID.

  • name (String)

    Platform name. Max length: 128 chars.

  • package_name (String)

    Linux package name. Max length: 256 chars.

Returns:

  • (PlatformLinux)


2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
# File 'lib/appwrite/services/project.rb', line 2290

def update_linux_platform(platform_id:, name:, package_name:)
    api_path = '/project/platforms/linux/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if package_name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "packageName"')
    end

    api_params = {
        name: name,
        packageName: package_name,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformLinux
    )

end

#update_membership_privacy_policy(user_id: nil, user_email: nil, user_phone: nil, user_name: nil, user_mfa: nil) ⇒ Project

Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..

Parameters:

  • []

    user_id Set to true if you want make user ID visible to all team members, or false to hide it.

  • []

    user_email Set to true if you want make user email visible to all team members, or false to hide it.

  • []

    user_phone Set to true if you want make user phone number visible to all team members, or false to hide it.

  • []

    user_name Set to true if you want make user name visible to all team members, or false to hide it.

  • []

    user_mfa Set to true if you want make user MFA status visible to all team members, or false to hide it.

Returns:



2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
# File 'lib/appwrite/services/project.rb', line 2627

def update_membership_privacy_policy(user_id: nil, user_email: nil, user_phone: nil, user_name: nil, user_mfa: nil)
    api_path = '/project/policies/membership-privacy'

    api_params = {
        userId: user_id,
        userEmail: user_email,
        userPhone: user_phone,
        userName: user_name,
        userMFA: user_mfa,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_mock_phone(number:, otp:) ⇒ MockNumber

Update a mock phone by its unique number. Use this endpoint to update the mock phone’s OTP.

Parameters:

  • number (String)

    Phone number associated with the mock phone. Must be a valid E.164 formatted phone number.

  • otp (String)

    One-time password (OTP) to associate with the mock phone. Must be a 6-digit numeric code.

Returns:

  • (MockNumber)


422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/appwrite/services/project.rb', line 422

def update_mock_phone(number:, otp:)
    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', number)

    if number.nil?
      raise Appwrite::Exception.new('Missing required parameter: "number"')
    end

    if otp.nil?
      raise Appwrite::Exception.new('Missing required parameter: "otp"')
    end

    api_params = {
        otp: otp,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::MockNumber
    )

end

#update_o_auth2_amazon(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Amazon

Update the project OAuth2 Amazon configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Amazon OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Amazon)


518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/appwrite/services/project.rb', line 518

def update_o_auth2_amazon(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/amazon'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Amazon
    )

end

#update_o_auth2_apple(service_id: nil, key_id: nil, team_id: nil, p8_file: nil, enabled: nil) ⇒ OAuth2Apple

Update the project OAuth2 Apple configuration.

Parameters:

  • service_id (String) (defaults to: nil)

    ‘Service ID’ of Apple OAuth2 app. For example: ip.appwrite.app.web

  • key_id (String) (defaults to: nil)

    ‘Key ID’ of Apple OAuth2 app. For example: P4000000N8

  • team_id (String) (defaults to: nil)

    ‘Team ID’ of Apple OAuth2 app. For example: D4000000R6

  • p8_file (String) (defaults to: nil)

    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—–

  • []

    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.

Returns:

  • (OAuth2Apple)


550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/appwrite/services/project.rb', line 550

def update_o_auth2_apple(service_id: nil, key_id: nil, team_id: nil, p8_file: nil, enabled: nil)
    api_path = '/project/oauth2/apple'

    api_params = {
        serviceId: service_id,
        keyId: key_id,
        teamId: team_id,
        p8File: p8_file,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Apple
    )

end

#update_o_auth2_auth0(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) ⇒ OAuth2Auth0

Update the project OAuth2 Auth0 configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Auth0 OAuth2 app. For example: <CLIENT_SECRET>

  • endpoint (String) (defaults to: nil)

    Domain of Auth0 instance. For example: example.us.auth0.com

  • []

    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.

Returns:

  • (OAuth2Auth0)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/appwrite/services/project.rb', line 583

def update_o_auth2_auth0(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
    api_path = '/project/oauth2/auth0'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        endpoint: endpoint,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Auth0
    )

end

#update_o_auth2_authentik(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) ⇒ OAuth2Authentik

Update the project OAuth2 Authentik configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Authentik OAuth2 app. For example: <CLIENT_SECRET>

  • endpoint (String) (defaults to: nil)

    Domain of Authentik instance. For example: example.authentik.com

  • []

    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.

Returns:

  • (OAuth2Authentik)


615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/appwrite/services/project.rb', line 615

def update_o_auth2_authentik(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
    api_path = '/project/oauth2/authentik'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        endpoint: endpoint,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Authentik
    )

end

#update_o_auth2_autodesk(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Autodesk

Update the project OAuth2 Autodesk configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Autodesk OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Autodesk)


646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/appwrite/services/project.rb', line 646

def update_o_auth2_autodesk(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/autodesk'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Autodesk
    )

end

#update_o_auth2_bitbucket(key: nil, secret: nil, enabled: nil) ⇒ OAuth2Bitbucket

Update the project OAuth2 Bitbucket configuration.

Parameters:

  • key (String) (defaults to: nil)

    ‘Key’ of Bitbucket OAuth2 app. For example: Knt70000000000ByRc

  • secret (String) (defaults to: nil)

    ‘Secret’ of Bitbucket OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Bitbucket)


676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/appwrite/services/project.rb', line 676

def update_o_auth2_bitbucket(key: nil, secret: nil, enabled: nil)
    api_path = '/project/oauth2/bitbucket'

    api_params = {
        key: key,
        secret: secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Bitbucket
    )

end

#update_o_auth2_bitly(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Bitly

Update the project OAuth2 Bitly configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Bitly OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Bitly)


706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/appwrite/services/project.rb', line 706

def update_o_auth2_bitly(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/bitly'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Bitly
    )

end

#update_o_auth2_box(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Box

Update the project OAuth2 Box configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Box OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Box)


736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/appwrite/services/project.rb', line 736

def update_o_auth2_box(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/box'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Box
    )

end

#update_o_auth2_dailymotion(api_key: nil, api_secret: nil, enabled: nil) ⇒ OAuth2Dailymotion

Update the project OAuth2 Dailymotion configuration.

Parameters:

  • api_key (String) (defaults to: nil)

    ‘API Key’ of Dailymotion OAuth2 app. For example: 07a9000000000000067f

  • api_secret (String) (defaults to: nil)

    ‘API Secret’ of Dailymotion OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Dailymotion)


766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/appwrite/services/project.rb', line 766

def update_o_auth2_dailymotion(api_key: nil, api_secret: nil, enabled: nil)
    api_path = '/project/oauth2/dailymotion'

    api_params = {
        apiKey: api_key,
        apiSecret: api_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Dailymotion
    )

end

#update_o_auth2_discord(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Discord

Update the project OAuth2 Discord configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Discord OAuth2 app. For example: 950722000000343754

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Discord OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Discord)


796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'lib/appwrite/services/project.rb', line 796

def update_o_auth2_discord(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/discord'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Discord
    )

end

#update_o_auth2_disqus(public_key: nil, secret_key: nil, enabled: nil) ⇒ OAuth2Disqus

Update the project OAuth2 Disqus configuration.

Parameters:

  • public_key (String) (defaults to: nil)

    ‘Public Key, also known as API Key’ of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX

  • secret_key (String) (defaults to: nil)

    ‘Secret Key, also known as API Secret’ of Disqus OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Disqus)


826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/appwrite/services/project.rb', line 826

def update_o_auth2_disqus(public_key: nil, secret_key: nil, enabled: nil)
    api_path = '/project/oauth2/disqus'

    api_params = {
        publicKey: public_key,
        secretKey: secret_key,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Disqus
    )

end

#update_o_auth2_dropbox(app_key: nil, app_secret: nil, enabled: nil) ⇒ OAuth2Dropbox

Update the project OAuth2 Dropbox configuration.

Parameters:

  • app_key (String) (defaults to: nil)

    ‘App Key’ of Dropbox OAuth2 app. For example: jl000000000009t

  • app_secret (String) (defaults to: nil)

    ‘App Secret’ of Dropbox OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Dropbox)


856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
# File 'lib/appwrite/services/project.rb', line 856

def update_o_auth2_dropbox(app_key: nil, app_secret: nil, enabled: nil)
    api_path = '/project/oauth2/dropbox'

    api_params = {
        appKey: app_key,
        appSecret: app_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Dropbox
    )

end

#update_o_auth2_etsy(key_string: nil, shared_secret: nil, enabled: nil) ⇒ OAuth2Etsy

Update the project OAuth2 Etsy configuration.

Parameters:

  • key_string (String) (defaults to: nil)

    ‘Keystring’ of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2

  • shared_secret (String) (defaults to: nil)

    ‘Shared Secret’ of Etsy OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Etsy)


886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
# File 'lib/appwrite/services/project.rb', line 886

def update_o_auth2_etsy(key_string: nil, shared_secret: nil, enabled: nil)
    api_path = '/project/oauth2/etsy'

    api_params = {
        keyString: key_string,
        sharedSecret: shared_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Etsy
    )

end

#update_o_auth2_facebook(app_id: nil, app_secret: nil, enabled: nil) ⇒ OAuth2Facebook

Update the project OAuth2 Facebook configuration.

Parameters:

  • app_id (String) (defaults to: nil)

    ‘App ID’ of Facebook OAuth2 app. For example: 260600000007694

  • app_secret (String) (defaults to: nil)

    ‘App Secret’ of Facebook OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Facebook)


916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
# File 'lib/appwrite/services/project.rb', line 916

def update_o_auth2_facebook(app_id: nil, app_secret: nil, enabled: nil)
    api_path = '/project/oauth2/facebook'

    api_params = {
        appId: app_id,
        appSecret: app_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Facebook
    )

end

#update_o_auth2_figma(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Figma

Update the project OAuth2 Figma configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Figma OAuth2 app. For example: byay5H0000000000VtiI40

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Figma OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Figma)


946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
# File 'lib/appwrite/services/project.rb', line 946

def update_o_auth2_figma(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/figma'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Figma
    )

end

#update_o_auth2_fusion_auth(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil) ⇒ OAuth2FusionAuth

Update the project OAuth2 FusionAuth configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of FusionAuth OAuth2 app. For example: <CLIENT_SECRET>

  • endpoint (String) (defaults to: nil)

    Domain of FusionAuth instance. For example: example.fusionauth.io

  • []

    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.

Returns:

  • (OAuth2FusionAuth)


977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
# File 'lib/appwrite/services/project.rb', line 977

def update_o_auth2_fusion_auth(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil)
    api_path = '/project/oauth2/fusionauth'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        endpoint: endpoint,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2FusionAuth
    )

end

#update_o_auth2_git_hub(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Github

Update the project OAuth2 GitHub configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘OAuth2 app Client ID, or App ID’ of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of GitHub OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Github)


1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/appwrite/services/project.rb', line 1008

def update_o_auth2_git_hub(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/github'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Github
    )

end

#update_o_auth2_gitlab(application_id: nil, secret: nil, endpoint: nil, enabled: nil) ⇒ OAuth2Gitlab

Update the project OAuth2 Gitlab configuration.

Parameters:

  • application_id (String) (defaults to: nil)

    ‘Application ID’ of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252

  • secret (String) (defaults to: nil)

    ‘Secret’ of Gitlab OAuth2 app. For example: <CLIENT_SECRET>

  • endpoint (String) (defaults to: nil)

    Endpoint URL of self-hosted GitLab instance. For example: gitlab.com

  • []

    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.

Returns:

  • (OAuth2Gitlab)


1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/appwrite/services/project.rb', line 1039

def update_o_auth2_gitlab(application_id: nil, secret: nil, endpoint: nil, enabled: nil)
    api_path = '/project/oauth2/gitlab'

    api_params = {
        applicationId: application_id,
        secret: secret,
        endpoint: endpoint,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Gitlab
    )

end

#update_o_auth2_google(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Google

Update the project OAuth2 Google configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Google OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Google)


1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/appwrite/services/project.rb', line 1070

def update_o_auth2_google(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/google'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Google
    )

end

#update_o_auth2_keycloak(client_id: nil, client_secret: nil, endpoint: nil, realm_name: nil, enabled: nil) ⇒ OAuth2Keycloak

Update the project OAuth2 Keycloak configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Keycloak OAuth2 app. For example: appwrite-o0000000st-app

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Keycloak OAuth2 app. For example: <CLIENT_SECRET>

  • endpoint (String) (defaults to: nil)

    Domain of Keycloak instance. For example: keycloak.example.com

  • realm_name (String) (defaults to: nil)

    Keycloak realm name. For example: appwrite-realm

  • []

    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.

Returns:

  • (OAuth2Keycloak)


1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/appwrite/services/project.rb', line 1102

def update_o_auth2_keycloak(client_id: nil, client_secret: nil, endpoint: nil, realm_name: nil, enabled: nil)
    api_path = '/project/oauth2/keycloak'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        endpoint: endpoint,
        realmName: realm_name,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Keycloak
    )

end

#update_o_auth2_kick(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Kick

Update the project OAuth2 Kick configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Kick OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Kick)


1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
# File 'lib/appwrite/services/project.rb', line 1134

def update_o_auth2_kick(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/kick'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Kick
    )

end

#update_o_auth2_linkedin(client_id: nil, primary_client_secret: nil, enabled: nil) ⇒ OAuth2Linkedin

Update the project OAuth2 Linkedin configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Linkedin OAuth2 app. For example: 770000000000dv

  • primary_client_secret (String) (defaults to: nil)

    ‘Primary Client Secret or Secondary Client Secret’ of Linkedin OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Linkedin)


1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
# File 'lib/appwrite/services/project.rb', line 1164

def update_o_auth2_linkedin(client_id: nil, primary_client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/linkedin'

    api_params = {
        clientId: client_id,
        primaryClientSecret: primary_client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Linkedin
    )

end

#update_o_auth2_microsoft(application_id: nil, application_secret: nil, tenant: nil, enabled: nil) ⇒ OAuth2Microsoft

Update the project OAuth2 Microsoft configuration.

Parameters:

  • application_id (String) (defaults to: nil)

    ‘Entra ID Application ID, also known as Client ID’ of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444

  • application_secret (String) (defaults to: nil)

    ‘Entra ID Application Secret, also known as Client Secret’ of Microsoft OAuth2 app. For example: <CLIENT_SECRET>

  • tenant (String) (defaults to: nil)

    Microsoft Entra ID tenant identifier. Use ‘common’, ‘organizations’, ‘consumers’ or a specific tenant ID. For example: common

  • []

    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.

Returns:

  • (OAuth2Microsoft)


1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
# File 'lib/appwrite/services/project.rb', line 1195

def update_o_auth2_microsoft(application_id: nil, application_secret: nil, tenant: nil, enabled: nil)
    api_path = '/project/oauth2/microsoft'

    api_params = {
        applicationId: application_id,
        applicationSecret: application_secret,
        tenant: tenant,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Microsoft
    )

end

#update_o_auth2_notion(oauth_client_id: nil, oauth_client_secret: nil, enabled: nil) ⇒ OAuth2Notion

Update the project OAuth2 Notion configuration.

Parameters:

  • oauth_client_id (String) (defaults to: nil)

    ‘OAuth Client ID’ of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3

  • oauth_client_secret (String) (defaults to: nil)

    ‘OAuth Client Secret’ of Notion OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Notion)


1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
# File 'lib/appwrite/services/project.rb', line 1226

def update_o_auth2_notion(oauth_client_id: nil, oauth_client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/notion'

    api_params = {
        oauthClientId: oauth_client_id,
        oauthClientSecret: oauth_client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Notion
    )

end

#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) ⇒ OAuth2Oidc

Update the project OAuth2 Oidc configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Oidc OAuth2 app. For example: <CLIENT_SECRET>

  • well_known_url (String) (defaults to: nil)

    OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: myoauth.com/.well-known/openid-configuration

  • authorization_url (String) (defaults to: nil)

    OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: myoauth.com/oauth2/authorize

  • token_url (String) (defaults to: nil)

    OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: myoauth.com/oauth2/token

  • user_info_url (String) (defaults to: nil)

    OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: myoauth.com/oauth2/userinfo

  • []

    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.

Returns:

  • (OAuth2Oidc)


1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
# File 'lib/appwrite/services/project.rb', line 1260

def update_o_auth2_oidc(client_id: nil, client_secret: nil, well_known_url: nil, authorization_url: nil, token_url: nil, user_info_url: nil, enabled: nil)
    api_path = '/project/oauth2/oidc'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        wellKnownURL: well_known_url,
        authorizationURL: authorization_url,
        tokenURL: token_url,
        userInfoURL: ,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Oidc
    )

end

#update_o_auth2_okta(client_id: nil, client_secret: nil, domain: nil, authorization_server_id: nil, enabled: nil) ⇒ OAuth2Okta

Update the project OAuth2 Okta configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Okta OAuth2 app. For example: 0oa00000000000000698

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Okta OAuth2 app. For example: <CLIENT_SECRET>

  • domain (String) (defaults to: nil)

    Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or trial-6400025.okta.com/

  • authorization_server_id (String) (defaults to: nil)

    Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z

  • []

    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.

Returns:

  • (OAuth2Okta)


1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
# File 'lib/appwrite/services/project.rb', line 1296

def update_o_auth2_okta(client_id: nil, client_secret: nil, domain: nil, authorization_server_id: nil, enabled: nil)
    api_path = '/project/oauth2/okta'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        domain: domain,
        authorizationServerId: authorization_server_id,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Okta
    )

end

#update_o_auth2_paypal(client_id: nil, secret_key: nil, enabled: nil) ⇒ OAuth2Paypal

Update the project OAuth2 Paypal configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB

  • secret_key (String) (defaults to: nil)

    ‘Secret Key 1 or Secret Key 2’ of Paypal OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Paypal)


1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
# File 'lib/appwrite/services/project.rb', line 1328

def update_o_auth2_paypal(client_id: nil, secret_key: nil, enabled: nil)
    api_path = '/project/oauth2/paypal'

    api_params = {
        clientId: client_id,
        secretKey: secret_key,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Paypal
    )

end

#update_o_auth2_paypal_sandbox(client_id: nil, secret_key: nil, enabled: nil) ⇒ OAuth2Paypal

Update the project OAuth2 PaypalSandbox configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB

  • secret_key (String) (defaults to: nil)

    ‘Secret Key 1 or Secret Key 2’ of PaypalSandbox OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Paypal)


1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
# File 'lib/appwrite/services/project.rb', line 1358

def update_o_auth2_paypal_sandbox(client_id: nil, secret_key: nil, enabled: nil)
    api_path = '/project/oauth2/paypalSandbox'

    api_params = {
        clientId: client_id,
        secretKey: secret_key,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Paypal
    )

end

#update_o_auth2_podio(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Podio

Update the project OAuth2 Podio configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Podio OAuth2 app. For example: appwrite-o0000000st-app

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Podio OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Podio)


1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
# File 'lib/appwrite/services/project.rb', line 1388

def update_o_auth2_podio(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/podio'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Podio
    )

end

#update_o_auth2_salesforce(customer_key: nil, customer_secret: nil, enabled: nil) ⇒ OAuth2Salesforce

Update the project OAuth2 Salesforce configuration.

Parameters:

  • customer_key (String) (defaults to: nil)

    ‘Consumer Key’ of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq

  • customer_secret (String) (defaults to: nil)

    ‘Consumer Secret’ of Salesforce OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Salesforce)


1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
# File 'lib/appwrite/services/project.rb', line 1418

def update_o_auth2_salesforce(customer_key: nil, customer_secret: nil, enabled: nil)
    api_path = '/project/oauth2/salesforce'

    api_params = {
        customerKey: customer_key,
        customerSecret: customer_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Salesforce
    )

end

#update_o_auth2_slack(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Slack

Update the project OAuth2 Slack configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Slack OAuth2 app. For example: 23000000089.15000000000023

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Slack OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Slack)


1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'lib/appwrite/services/project.rb', line 1448

def update_o_auth2_slack(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/slack'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Slack
    )

end

#update_o_auth2_spotify(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Spotify

Update the project OAuth2 Spotify configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Spotify OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Spotify)


1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/appwrite/services/project.rb', line 1478

def update_o_auth2_spotify(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/spotify'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Spotify
    )

end

#update_o_auth2_stripe(client_id: nil, api_secret_key: nil, enabled: nil) ⇒ OAuth2Stripe

Update the project OAuth2 Stripe configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR

  • api_secret_key (String) (defaults to: nil)

    ‘API Secret Key’ of Stripe OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Stripe)


1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
# File 'lib/appwrite/services/project.rb', line 1508

def update_o_auth2_stripe(client_id: nil, api_secret_key: nil, enabled: nil)
    api_path = '/project/oauth2/stripe'

    api_params = {
        clientId: client_id,
        apiSecretKey: api_secret_key,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Stripe
    )

end

#update_o_auth2_tradeshift(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil) ⇒ OAuth2Tradeshift

Update the project OAuth2 Tradeshift configuration.

Parameters:

  • oauth2_client_id (String) (defaults to: nil)

    ‘OAuth2 Client ID’ of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app

  • oauth2_client_secret (String) (defaults to: nil)

    ‘OAuth2 Client Secret’ of Tradeshift OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Tradeshift)


1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
# File 'lib/appwrite/services/project.rb', line 1538

def update_o_auth2_tradeshift(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/tradeshift'

    api_params = {
        oauth2ClientId: oauth2_client_id,
        oauth2ClientSecret: oauth2_client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Tradeshift
    )

end

#update_o_auth2_tradeshift_sandbox(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil) ⇒ OAuth2Tradeshift

Update the project OAuth2 Tradeshift Sandbox configuration.

Parameters:

  • oauth2_client_id (String) (defaults to: nil)

    ‘OAuth2 Client ID’ of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app

  • oauth2_client_secret (String) (defaults to: nil)

    ‘OAuth2 Client Secret’ of Tradeshift Sandbox OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Tradeshift)


1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'lib/appwrite/services/project.rb', line 1568

def update_o_auth2_tradeshift_sandbox(oauth2_client_id: nil, oauth2_client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/tradeshiftBox'

    api_params = {
        oauth2ClientId: oauth2_client_id,
        oauth2ClientSecret: oauth2_client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Tradeshift
    )

end

#update_o_auth2_twitch(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Twitch

Update the project OAuth2 Twitch configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Twitch OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Twitch)


1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
# File 'lib/appwrite/services/project.rb', line 1598

def update_o_auth2_twitch(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/twitch'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Twitch
    )

end

#update_o_auth2_word_press(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2WordPress

Update the project OAuth2 WordPress configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of WordPress OAuth2 app. For example: 130005

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of WordPress OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2WordPress)


1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
# File 'lib/appwrite/services/project.rb', line 1628

def update_o_auth2_word_press(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/wordpress'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2WordPress
    )

end

#update_o_auth2_x(customer_key: nil, secret_key: nil, enabled: nil) ⇒ OAuth2X

Update the project OAuth2 X configuration.

Parameters:

  • customer_key (String) (defaults to: nil)

    ‘Customer Key’ of X OAuth2 app. For example: slzZV0000000000000NFLaWT

  • secret_key (String) (defaults to: nil)

    ‘Secret Key’ of X OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2X)


1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/appwrite/services/project.rb', line 1658

def update_o_auth2_x(customer_key: nil, secret_key: nil, enabled: nil)
    api_path = '/project/oauth2/x'

    api_params = {
        customerKey: customer_key,
        secretKey: secret_key,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2X
    )

end

#update_o_auth2_yahoo(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Yahoo

Update the project OAuth2 Yahoo configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID, also known as Customer Key’ of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm

  • client_secret (String) (defaults to: nil)

    ‘Client Secret, also known as Customer Secret’ of Yahoo OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Yahoo)


1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/appwrite/services/project.rb', line 1688

def update_o_auth2_yahoo(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/yahoo'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Yahoo
    )

end

#update_o_auth2_yandex(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Yandex

Update the project OAuth2 Yandex configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Yandex OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Yandex)


1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
# File 'lib/appwrite/services/project.rb', line 1718

def update_o_auth2_yandex(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/yandex'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Yandex
    )

end

#update_o_auth2_zoho(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Zoho

Update the project OAuth2 Zoho configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Zoho OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Zoho)


1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
# File 'lib/appwrite/services/project.rb', line 1748

def update_o_auth2_zoho(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/zoho'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Zoho
    )

end

#update_o_auth2_zoom(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Zoom

Update the project OAuth2 Zoom configuration.

Parameters:

  • client_id (String) (defaults to: nil)

    ‘Client ID’ of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ

  • client_secret (String) (defaults to: nil)

    ‘Client Secret’ of Zoom OAuth2 app. For example: <CLIENT_SECRET>

  • []

    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.

Returns:

  • (OAuth2Zoom)


1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
# File 'lib/appwrite/services/project.rb', line 1778

def update_o_auth2_zoom(client_id: nil, client_secret: nil, enabled: nil)
    api_path = '/project/oauth2/zoom'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Zoom
    )

end

#update_password_dictionary_policy(enabled:) ⇒ Project

Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.

Parameters:

  • []

    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.

Returns:



2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
# File 'lib/appwrite/services/project.rb', line 2659

def update_password_dictionary_policy(enabled:)
    api_path = '/project/policies/password-dictionary'

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_password_history_policy(total:) ⇒ Project

Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery.

Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.

Parameters:

  • total (Integer)

    Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit.

Returns:



2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
# File 'lib/appwrite/services/project.rb', line 2697

def update_password_history_policy(total:)
    api_path = '/project/policies/password-history'

    if total.nil?
      raise Appwrite::Exception.new('Missing required parameter: "total"')
    end

    api_params = {
        total: total,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_password_personal_data_policy(enabled:) ⇒ Project

Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.

Parameters:

  • []

    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.

Returns:



2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
# File 'lib/appwrite/services/project.rb', line 2730

def update_password_personal_data_policy(enabled:)
    api_path = '/project/policies/password-personal-data'

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_protocol(protocol_id:, enabled:) ⇒ Project

Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project.

Parameters:

  • protocol_id (ProtocolId)

    Protocol name. Can be one of: rest, graphql, websocket

  • []

    enabled Protocol status.

Returns:



3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
# File 'lib/appwrite/services/project.rb', line 3002

def update_protocol(protocol_id:, enabled:)
    api_path = '/project/protocols/{protocolId}'
        .gsub('{protocolId}', protocol_id)

    if protocol_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "protocolId"')
    end

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_service(service_id:, enabled:) ⇒ Project

Update properties of a specific service. Use this endpoint to enable or disable a service in your project.

Parameters:

  • service_id (ServiceId)

    Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging

  • []

    enabled Service status.

Returns:



3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
# File 'lib/appwrite/services/project.rb', line 3039

def update_service(service_id:, enabled:)
    api_path = '/project/services/{serviceId}'
        .gsub('{serviceId}', service_id)

    if service_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "serviceId"')
    end

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_session_alert_policy(enabled:) ⇒ Project

Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled.

Parameters:

  • []

    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.

Returns:



2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
# File 'lib/appwrite/services/project.rb', line 2764

def update_session_alert_policy(enabled:)
    api_path = '/project/policies/session-alert'

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_session_duration_policy(duration:) ⇒ Project

Update maximum duration how long sessions created within a project should stay active for.

Parameters:

  • duration (Integer)

    Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds.

Returns:



2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
# File 'lib/appwrite/services/project.rb', line 2795

def update_session_duration_policy(duration:)
    api_path = '/project/policies/session-duration'

    if duration.nil?
      raise Appwrite::Exception.new('Missing required parameter: "duration"')
    end

    api_params = {
        duration: duration,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_session_invalidation_policy(enabled:) ⇒ Project

Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices.

Parameters:

  • []

    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.

Returns:



2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
# File 'lib/appwrite/services/project.rb', line 2827

def update_session_invalidation_policy(enabled:)
    api_path = '/project/policies/session-invalidation'

    if enabled.nil?
      raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

    api_params = {
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_session_limit_policy(total:) ⇒ Project

Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.

Parameters:

  • total (Integer)

    Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit.

Returns:



2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
# File 'lib/appwrite/services/project.rb', line 2858

def update_session_limit_policy(total:)
    api_path = '/project/policies/session-limit'

    if total.nil?
      raise Appwrite::Exception.new('Missing required parameter: "total"')
    end

    api_params = {
        total: total,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#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) ⇒ Project

Update the SMTP configuration for your project. Use this endpoint to configure your project’s SMTP provider with your custom settings for sending transactional emails.

Parameters:

  • host (String) (defaults to: nil)

    SMTP server hostname (domain)

  • port (Integer) (defaults to: nil)

    SMTP server port

  • username (String) (defaults to: nil)

    SMTP server username. Leave empty for no authorization.

  • password (String) (defaults to: nil)

    SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only).

  • sender_email (String) (defaults to: nil)

    Email address shown in inbox as the sender of the email.

  • sender_name (String) (defaults to: nil)

    Name shown in inbox as the sender of the email.

  • reply_to_email (String) (defaults to: nil)

    Email used when user replies to the email.

  • reply_to_name (String) (defaults to: nil)

    Name used when user replies to the email.

  • secure (Secure) (defaults to: nil)

    Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption.

  • []

    enabled Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates.

Returns:



3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
# File 'lib/appwrite/services/project.rb', line 3085

def update_smtp(host: nil, port: nil, username: nil, password: nil, sender_email: nil, sender_name: nil, reply_to_email: nil, reply_to_name: nil, secure: nil, enabled: nil)
    api_path = '/project/smtp'

    api_params = {
        host: host,
        port: port,
        username: username,
        password: password,
        senderEmail: sender_email,
        senderName: sender_name,
        replyToEmail: reply_to_email,
        replyToName: reply_to_name,
        secure: secure,
        enabled: enabled,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_user_limit_policy(total:) ⇒ Project

Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.

Parameters:

  • total (Integer)

    Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit.

Returns:



2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
# File 'lib/appwrite/services/project.rb', line 2890

def update_user_limit_policy(total:)
    api_path = '/project/policies/user-limit'

    if total.nil?
      raise Appwrite::Exception.new('Missing required parameter: "total"')
    end

    api_params = {
        total: total,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )

end

#update_variable(variable_id:, key: nil, value: nil, secret: nil) ⇒ Variable

Update variable by its unique ID.

Parameters:

  • variable_id (String)

    Variable unique ID.

  • key (String) (defaults to: nil)

    Variable key. Max length: 255 chars.

  • value (String) (defaults to: nil)

    Variable value. Max length: 8192 chars.

  • []

    secret Secret variables can be updated or deleted, but only projects can read them during build and runtime.

Returns:

  • (Variable)


3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
# File 'lib/appwrite/services/project.rb', line 3360

def update_variable(variable_id:, key: nil, value: nil, secret: nil)
    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', variable_id)

    if variable_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "variableId"')
    end

    api_params = {
        key: key,
        value: value,
        secret: secret,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Variable
    )

end

#update_web_platform(platform_id:, name:, hostname:) ⇒ PlatformWeb

Update a web platform by its unique ID. Use this endpoint to update the platform’s name or hostname.

Parameters:

  • platform_id (String)

    Platform ID.

  • name (String)

    Platform name. Max length: 128 chars.

  • hostname (String)

    Platform web hostname. Max length: 256 chars.

Returns:

  • (PlatformWeb)


2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
# File 'lib/appwrite/services/project.rb', line 2377

def update_web_platform(platform_id:, name:, hostname:)
    api_path = '/project/platforms/web/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if hostname.nil?
      raise Appwrite::Exception.new('Missing required parameter: "hostname"')
    end

    api_params = {
        name: name,
        hostname: hostname,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformWeb
    )

end

#update_windows_platform(platform_id:, name:, package_identifier_name:) ⇒ PlatformWindows

Update a Windows platform by its unique ID. Use this endpoint to update the platform’s name or package identifier name.

Parameters:

  • platform_id (String)

    Platform ID.

  • name (String)

    Platform name. Max length: 128 chars.

  • package_identifier_name (String)

    Windows package identifier name. Max length: 256 chars.

Returns:

  • (PlatformWindows)


2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
# File 'lib/appwrite/services/project.rb', line 2464

def update_windows_platform(platform_id:, name:, package_identifier_name:)
    api_path = '/project/platforms/windows/{platformId}'
        .gsub('{platformId}', platform_id)

    if platform_id.nil?
      raise Appwrite::Exception.new('Missing required parameter: "platformId"')
    end

    if name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "name"')
    end

    if package_identifier_name.nil?
      raise Appwrite::Exception.new('Missing required parameter: "packageIdentifierName"')
    end

    api_params = {
        name: name,
        packageIdentifierName: package_identifier_name,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::PlatformWindows
    )

end