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.



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

def initialize(client)
    @client = client
end

Instance Method Details

#create_android_platform(platform_id:, name:, application_id:, fingerprints: nil) ⇒ 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.

  • fingerprints (Array) (defaults to: nil) —

    SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with ./gradlew signingReport.

Returns:

  • (PlatformAndroid)


3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
# File 'lib/appwrite/services/project.rb', line 3717

def create_android_platform(
    platform_id:,
    name:,
    application_id:,
    fingerprints: nil
)
    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_path = '/project/platforms/android'

    api_params = {
        platformId: platform_id,
        name: name,
        applicationId: application_id,
        fingerprints: fingerprints,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
# File 'lib/appwrite/services/project.rb', line 3819

def create_apple_platform(
    platform_id:,
    name:,
    bundle_identifier:
)
    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_path = '/project/platforms/apple'

    api_params = {
        platformId: platform_id,
        name: name,
        bundleIdentifier: bundle_identifier,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#create_environment(environment_id:, name:, resources: nil) ⇒ Environment

Create a new environment of the project. An environment is a separate project in the same organization and region, with its own resources and users. Its usage is billed under the project it belongs to. Requests act in the environment when they carry the project's ID in the X-Appwrite-Project header and the environment's ID in the X-Appwrite-Environment header; the environment has no project ID of its own to pass.

Pass resources to copy the project into the environment. The environment is returned at once and the copy runs as a migration of the environment, listed by its migrations routes and announced on its migrations.* realtime events; a resource whose ID can be chosen keeps it. Users are copied newest first and at most 90 of them, so the environment keeps room under its limit of 100 users for test accounts, and the memberships of users left behind are not copied.

Parameters:

  • environment_id (String) —

    Environment ID, unique within the project and passed in the X-Appwrite-Environment header to act in the environment. Choose a custom ID such as staging, or generate a random ID with ID.unique(). Valid chars are a-z, 0-9, and hyphen. Can't start with a special char. Max length is 36 chars.

  • name (String) —

    Environment name. Max length: 128 chars.

  • resources (Array) (defaults to: nil) —

    Resources to copy from the project into the environment, by type. A structural type such as database, table, column, index, bucket, team, function or site copies the structure and its settings; row, file, user, membership, deployment and site-deployment copy what it holds. A function or site is copied with its active deployment; add deployment or site-deployment to copy every deployment. Users are copied newest first and at most 90 of them, leaving room under the limit of 100 users of an environment for test accounts; the memberships of users left behind are not copied. Leave empty for an empty environment. Maximum of 100 types.

Returns:

  • (Environment)


150
151
152
153
154
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
184
# File 'lib/appwrite/services/project.rb', line 150

def create_environment(
    environment_id:,
    name:,
    resources: nil
)
    if environment_id.nil?
        raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
    end

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

    api_path = '/project/environments'

    api_params = {
        environmentId: environment_id,
        name: name,
        resources: resources,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Environment
    )
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 200 scopes are allowed.

  • duration (Integer) —

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

Returns:

  • (EphemeralKey)


331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/appwrite/services/project.rb', line 331

def create_ephemeral_key(
    scopes:,
    duration:
)
    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_path = '/project/keys/ephemeral'

    api_params = {
        scopes: scopes,
        duration: duration,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#create_ldap_test(username: nil, password: nil) ⇒ Object

Test the stored LDAP configuration against the directory without signing anyone in. Connects to the directory, binds as the service account and reads the base DN. Pass a username to also look the user up and check the required group, and a password to also verify it. The error names the step that failed.

Parameters:

  • username (String) (defaults to: nil) —

    Username to look up in the directory. Leave empty to test the connection and service account only.

  • password (String) (defaults to: nil) —

    Password of the user to verify. Only used together with a username.

Returns:

  • []



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/appwrite/services/project.rb', line 605

def create_ldap_test(
    username: nil,
    password: nil
)
    api_path = '/project/ldap/tests'

    api_params = {
        username: username,
        password: password,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )
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)


3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
# File 'lib/appwrite/services/project.rb', line 3916

def create_linux_platform(
    platform_id:,
    name:,
    package_name:
)
    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_path = '/project/platforms/linux'

    api_params = {
        platformId: platform_id,
        name: name,
        packageName: package_name,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/appwrite/services/project.rb', line 669

def create_mock_phone(
    number:,
    otp:
)
    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_path = '/project/mock-phones'

    api_params = {
        number: number,
        otp: otp,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:

  • []



5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
# File 'lib/appwrite/services/project.rb', line 5451

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

    api_path = '/project/smtp/tests'

    api_params = {
        emails: emails,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#create_variable(variable_id:, key:, value:, secret: nil, description: 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. Letters, digits and underscores only, must not start with a digit. 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.

  • description (String) (defaults to: nil) —

    Optional description for the variable.

Returns:

  • (Variable)


5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
# File 'lib/appwrite/services/project.rb', line 5644

def create_variable(
    variable_id:,
    key:,
    value:,
    secret: nil,
    description: nil
)
    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_path = '/project/variables'

    api_params = {
        variableId: variable_id,
        key: key,
        value: value,
        secret: secret,
        description: description,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#create_video_profile(profile_id:, name:, video_bit_rate:, audio_bit_rate:, width:, height:, codec: nil) ⇒ VideoProfile

Create a video profile (POST /v1/project/videos/profiles) describing an encoding target: output dimensions, video/audio bitrates, and encode codec. Only codecs enabled on this instance are accepted; the default is h264. A disabled codec is rejected. Creating a profile with the same width, height, bitrates, and codec fails with video_profile_already_exists. Bitrates are in bits per second and must be multiples of 1000. Renditions are encoded against a profile.

Parameters:

  • profile_id (String) —

    Video profile 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) —

    Video profile name.

  • video_bit_rate (Integer) —

    Target video bitrate in bits per second. Must be a multiple of 1000.

  • audio_bit_rate (Integer) —

    Target audio bitrate in bits per second. Must be a multiple of 1000.

  • width (Integer) —

    Target video width in pixels. Must be an even number.

  • height (Integer) —

    Target video height in pixels. Must be an even number.

  • codec (VideoCodecId) (defaults to: nil) —

    Video encode codec. Codecs not enabled on this instance are rejected. Defaults to h264.

Returns:

  • (VideoProfile)


5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
# File 'lib/appwrite/services/project.rb', line 5849

def create_video_profile(
    profile_id:,
    name:,
    video_bit_rate:,
    audio_bit_rate:,
    width:,
    height:,
    codec: nil
)
    if profile_id.nil?
        raise Appwrite::Exception.new('Missing required parameter: "profileId"')
    end

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

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

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

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

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

    api_path = '/project/videos/profiles'

    api_params = {
        profileId: profile_id,
        name: name,
        videoBitRate: video_bit_rate,
        audioBitRate: audio_bit_rate,
        width: width,
        height: height,
        codec: codec,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::VideoProfile
    )
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)


4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
# File 'lib/appwrite/services/project.rb', line 4013

def create_web_platform(
    platform_id:,
    name:,
    hostname:
)
    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_path = '/project/platforms/web'

    api_params = {
        platformId: platform_id,
        name: name,
        hostname: hostname,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
# File 'lib/appwrite/services/project.rb', line 4110

def create_windows_platform(
    platform_id:,
    name:,
    package_identifier_name:
)
    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_path = '/project/platforms/windows'

    api_params = {
        platformId: platform_id,
        name: name,
        packageIdentifierName: package_identifier_name,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#delete ⇒ Object

Delete a project.

Returns:

  • []



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/appwrite/services/project.rb', line 36

def delete()
    api_path = '/project'

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#delete_environment(environment_id:) ⇒ Object

Delete an environment of the project, with all of its resources and users.

Parameters:

  • environment_id (String) —

    Environment ID.

Returns:

  • []



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

def delete_environment(
    environment_id:
)
    if environment_id.nil? || environment_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
    end

    api_path = '/project/environments/{environmentId}'
        .gsub('{environmentId}', @client.encode_path(environment_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:

  • []



456
457
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 456

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

    api_path = '/project/keys/{keyId}'
        .gsub('{keyId}', @client.encode_path(key_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:

  • []



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/appwrite/services/project.rb', line 782

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

    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', @client.encode_path(number))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#delete_passwords ⇒ Object

Delete all passwords in the project, forcing every user to reset their password. Any password set before this request stops working for email and password sign-in immediately: signing in returns a user_password_reset_required error until the user sets a new password through password recovery, or until a new password is set for them with the Users API. Existing sessions are not affected; call the delete sessions endpoint to sign users out as well. Users without a password and API keys are not affected by this action.

Returns:

  • []



3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
# File 'lib/appwrite/services/project.rb', line 3656

def delete_passwords()
    api_path = '/project/passwords'

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:

  • []



4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
# File 'lib/appwrite/services/project.rb', line 4266

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

    api_path = '/project/platforms/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#delete_sessions ⇒ Object

Delete all sessions in the project. Any session created before this request will be invalidated immediately: users will be signed out of every active client (web, mobile, server SDKs, JWTs), and will be able to sign in again afterwards. API keys are not affected by this action.

Returns:

  • []



5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
# File 'lib/appwrite/services/project.rb', line 5369

def delete_sessions()
    api_path = '/project/sessions'

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:

  • []



5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
# File 'lib/appwrite/services/project.rb', line 5769

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

    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', @client.encode_path(variable_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#delete_video_profile(profile_id:) ⇒ Object

Delete a video profile by its unique ID (DELETE /v1/project/videos/profiles/:profileId). Renditions already encoded against it are left in place.

Parameters:

  • profile_id (String) —

    Video profile unique ID.

Returns:

  • []



6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
# File 'lib/appwrite/services/project.rb', line 6002

def delete_video_profile(
    profile_id:
)
    if profile_id.nil? || profile_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "profileId"')
    end

    api_path = '/project/videos/profiles/{profileId}'
        .gsub('{profileId}', @client.encode_path(profile_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#get ⇒ Project

Get a project.

Returns:



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

def get()
    api_path = '/project'

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )
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 (ProjectEmailTemplateId) —

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

  • locale (ProjectEmailTemplateLocale) (defaults to: nil) —

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

Returns:

  • (EmailTemplate)


5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
# File 'lib/appwrite/services/project.rb', line 5574

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

    api_path = '/project/templates/email/{templateId}'
        .gsub('{templateId}', @client.encode_path(template_id))

    api_params = {
        locale: locale,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#get_environment(environment_id:) ⇒ Environment

Get an environment of the project by its ID, the one passed in the X-Appwrite-Environment header to act in it.

Parameters:

  • environment_id (String) —

    Environment ID.

Returns:

  • (Environment)


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

def get_environment(
    environment_id:
)
    if environment_id.nil? || environment_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
    end

    api_path = '/project/environments/{environmentId}'
        .gsub('{environmentId}', @client.encode_path(environment_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#get_key(key_id:) ⇒ Key

Get a key by its unique ID.

Parameters:

  • key_id (String) —

    Key ID.

Returns:

  • (Key)


370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/appwrite/services/project.rb', line 370

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

    api_path = '/project/keys/{keyId}'
        .gsub('{keyId}', @client.encode_path(key_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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)


709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
# File 'lib/appwrite/services/project.rb', line 709

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

    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', @client.encode_path(number))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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 (ProjectOAuthProviderId) —

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

Returns:

  • (OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Instagram, OAuth2Patreon, OAuth2Strava, OAuth2VK, OAuth2Netlify, OAuth2Railway, OAuth2Reddit, OAuth2Vercel, OAuth2Atlassian, OAuth2Line, OAuth2Linear, OAuth2Roblox, OAuth2WorkOS, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao, OAuth2Naver, OAuth2Vipps)

Raises:



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
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
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
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
# File 'lib/appwrite/services/project.rb', line 3294

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

    api_path = '/project/oauth2/{providerId}'
        .gsub('{providerId}', @client.encode_path(provider_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    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'] == 'webflow'

        return Models::OAuth2Webflow.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'] == 'huggingface'

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return Models::OAuth2Cloudflare.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'] == 'tradeshift'

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

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

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

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

        return Models::OAuth2Paypal.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

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

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

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

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

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

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

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

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

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

        return Models::OAuth2Vipps.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:



4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
# File 'lib/appwrite/services/project.rb', line 4204

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

    api_path = '/project/platforms/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    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 (ProjectPolicyId) —

    Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, password-rotation, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email, deny-realtime-guests, passkey, account-devices.

Returns:

  • (PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyDenyRealtimeGuests, PolicyPasskey, PolicyAccountDevices)

Raises:



5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
# File 'lib/appwrite/services/project.rb', line 5090

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

    api_path = '/project/policies/{policyId}'
        .gsub('{policyId}', @client.encode_path(policy_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    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-strength'

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

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

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

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

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

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

        return Models::PolicyPasswordRotation.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

    if response['$id'] == 'mfa-factors'

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

    if response['$id'] == 'deny-aliased-email'

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

    if response['$id'] == 'deny-disposable-email'

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

    if response['$id'] == 'deny-free-email'

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

    if response['$id'] == 'deny-corporate-email'

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

    if response['$id'] == 'deny-realtime-guests'

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

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

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

    if response['$id'] == 'account-devices'

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

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

#get_prefs ⇒ Preferences

Get the project preferences. Preferences are a key-value object stored on the project for anyone working on it.

Returns:

  • (Preferences)


5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
# File 'lib/appwrite/services/project.rb', line 5226

def get_prefs()
    api_path = '/project/prefs'

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#get_variable(variable_id:) ⇒ Variable

Get a variable by its unique ID.

Parameters:

  • variable_id (String) —

    Variable unique ID.

Returns:

  • (Variable)


5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
# File 'lib/appwrite/services/project.rb', line 5693

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

    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', @client.encode_path(variable_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#get_video_profile(profile_id:) ⇒ VideoProfile

Get a video profile by its unique ID (GET /v1/project/videos/profiles/:profileId).

Parameters:

  • profile_id (String) —

    Video profile unique ID.

Returns:

  • (VideoProfile)


5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
# File 'lib/appwrite/services/project.rb', line 5916

def get_video_profile(
    profile_id:
)
    if profile_id.nil? || profile_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "profileId"')
    end

    api_path = '/project/videos/profiles/{profileId}'
        .gsub('{profileId}', @client.encode_path(profile_id))

    api_params = {}

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::VideoProfile
    )
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. 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)


5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
# File 'lib/appwrite/services/project.rb', line 5486

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#list_environments(queries: nil, total: nil) ⇒ EnvironmentList

Get a list of all environments of the project. You can use the query params to filter your results. An environment is listed by its ID, the one passed in the X-Appwrite-Environment header to act in it.

Parameters:

  • queries (Array) (defaults to: nil) —

    Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: $id, name, search

  • [] —

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

Returns:

  • (EnvironmentList)


104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/appwrite/services/project.rb', line 104

def list_environments(
    queries: nil,
    total: nil
)
    api_path = '/project/environments'

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::EnvironmentList
    )
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. 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)


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

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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. 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)


637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# File 'lib/appwrite/services/project.rb', line 637

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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. 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)


816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/appwrite/services/project.rb', line 816

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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. 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)


3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
# File 'lib/appwrite/services/project.rb', line 3682

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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. 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)


4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
# File 'lib/appwrite/services/project.rb', line 4298

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

    @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. 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)


5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
# File 'lib/appwrite/services/project.rb', line 5609

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

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#list_video_profiles(queries: nil, total: nil) ⇒ VideoProfileList

Get a list of video profiles in the current project (GET /v1/project/videos/profiles). Every profile is returned regardless of codec. Filter with queries, for example Query.equal('codec', ['h264']) for one encode ladder, or on name, width, height, videoBitRate and audioBitRate. Search with Query.search() on the search attribute.

Parameters:

  • queries (Array) (defaults to: nil) —

    Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, codec, width, height, videoBitRate, audioBitRate, search

  • [] —

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

Returns:

  • (VideoProfileList)


5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
# File 'lib/appwrite/services/project.rb', line 5806

def list_video_profiles(
    queries: nil,
    total: nil
)
    api_path = '/project/videos/profiles'

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

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "accept": 'application/json',
    }

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

#update_account_devices_policy(enabled:) ⇒ Project

Update whether account devices are enabled for the project. When enabled, a browser can create an account device that holds multiple sessions and switch between them. When disabled, account devices can no longer be created, so each browser is limited to a single active session.

Parameters:

  • [] —

    enabled Set to true to allow account devices, or false to disable them for this project.

Returns:



4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
# File 'lib/appwrite/services/project.rb', line 4331

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

    api_path = '/project/policies/account-devices'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

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

Update an Android platform by its unique ID. Use this endpoint to update the platform's name, application ID or signing certificate fingerprints.

Parameters:

  • platform_id (String) —

    Platform ID.

  • name (String) —

    Platform name. Max length: 128 chars.

  • application_id (String) —

    Android application ID. Max length: 256 chars.

  • fingerprints (Array) (defaults to: nil) —

    SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with ./gradlew signingReport. Omit to keep the current list, or pass an empty array to clear it.

Returns:

  • (PlatformAndroid)


3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
# File 'lib/appwrite/services/project.rb', line 3768

def update_android_platform(
    platform_id:,
    name:,
    application_id:,
    fingerprints: nil
)
    if platform_id.nil? || platform_id == ''
        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_path = '/project/platforms/android/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {
        name: name,
        applicationId: application_id,
        fingerprints: fingerprints,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
# File 'lib/appwrite/services/project.rb', line 3867

def update_apple_platform(
    platform_id:,
    name:,
    bundle_identifier:
)
    if platform_id.nil? || platform_id == ''
        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_path = '/project/platforms/apple/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {
        name: name,
        bundleIdentifier: bundle_identifier,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 (ProjectAuthMethodId) —

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

  • [] —

    enabled Auth method status.

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/appwrite/services/project.rb', line 62

def update_auth_method(
    method_id:,
    enabled:
)
    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_path = '/project/auth-methods/{methodId}'
        .gsub('{methodId}', @client.encode_path(method_id))

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_deny_aliased_email_policy(enabled:) ⇒ Project

Configures if aliased emails such as subaddresses and emails with suffixes are denied during new users sign-ups and email updates.

Parameters:

  • [] —

    enabled Set whether or not to block aliased emails during signup and email updates.

Returns:



4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
# File 'lib/appwrite/services/project.rb', line 4365

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

    api_path = '/project/policies/deny-aliased-email'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_deny_corporate_email_policy(enabled:) ⇒ Project

Configures if only corporate email addresses (non-free and non-disposable domains) are allowed during new user sign-ups and email updates.

Parameters:

  • [] —

    enabled Set whether or not to restrict sign-ups and email updates to corporate email addresses only.

Returns:



4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
# File 'lib/appwrite/services/project.rb', line 4399

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

    api_path = '/project/policies/deny-corporate-email'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_deny_disposable_email_policy(enabled:) ⇒ Project

Configures if disposable emails from known temporary domains are denied during new users sign-ups and email updates.

Parameters:

  • [] —

    enabled Set whether or not to block disposable email addresses during signup and email updates.

Returns:



4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
# File 'lib/appwrite/services/project.rb', line 4433

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

    api_path = '/project/policies/deny-disposable-email'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_deny_free_email_policy(enabled:) ⇒ Project

Configures if emails from free providers such as Gmail or Yahoo are denied during new users sign-ups and email updates.

Parameters:

  • [] —

    enabled Set whether or not to block free email addresses during signup and email updates.

Returns:



4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
# File 'lib/appwrite/services/project.rb', line 4467

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

    api_path = '/project/policies/deny-free-email'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_deny_realtime_guests_policy(enabled:) ⇒ Project

Configures if guests, connections without a signed-in user, may subscribe to realtime channels. When enabled, a guest can still connect and sign in over the connection, but cannot subscribe until it does.

Parameters:

  • [] —

    enabled Set whether or not to stop guests from subscribing to realtime channels.

Returns:



4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
# File 'lib/appwrite/services/project.rb', line 4502

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

    api_path = '/project/policies/deny-realtime-guests'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 (ProjectEmailTemplateId) —

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

  • locale (ProjectEmailTemplateLocale) (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. Pass an empty string to clear a previously set value.

  • reply_to_email (String) (defaults to: nil) —

    Reply to email. Pass an empty string to clear a previously set value.

  • reply_to_name (String) (defaults to: nil) —

    Reply to name.

Returns:

  • (EmailTemplate)


5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
# File 'lib/appwrite/services/project.rb', line 5524

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
)
    if template_id.nil?
        raise Appwrite::Exception.new('Missing required parameter: "templateId"')
    end

    api_path = '/project/templates/email'

    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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_environment(environment_id:, name:) ⇒ Environment

Update the name of an environment of the project. The environment ID cannot be changed.

Parameters:

  • environment_id (String) —

    Environment ID.

  • name (String) —

    Environment name. Max length: 128 chars.

Returns:

  • (Environment)


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 225

def update_environment(
    environment_id:,
    name:
)
    if environment_id.nil? || environment_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
    end

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

    api_path = '/project/environments/{environmentId}'
        .gsub('{environmentId}', @client.encode_path(environment_id))

    api_params = {
        name: name,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_key(key_id:, name:, scopes:, expire: nil, description: 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 200 scopes are allowed.

  • expire (String) (defaults to: nil) —

    Expiration time in ISO 8601 format. Use null for unlimited expiration.

  • description (String) (defaults to: nil) —

    Optional description for the key.

Returns:

  • (Key)


406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
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
# File 'lib/appwrite/services/project.rb', line 406

def update_key(
    key_id:,
    name:,
    scopes:,
    expire: nil,
    description: nil
)
    if key_id.nil? || key_id == ''
        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_path = '/project/keys/{keyId}'
        .gsub('{keyId}', @client.encode_path(key_id))

    api_params = {
        name: name,
        scopes: scopes,
        expire: expire,
        description: description,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:



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

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

    api_path = '/project/labels'

    api_params = {
        labels: labels,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_ldap(enabled: nil, hosts: nil, port: nil, encryption: nil, verification: nil, certificate: nil, timeout: nil, base_dn: nil, bind_dn: nil, bind_password: nil, user_filter: nil, required_group_dn: nil, id_attribute: nil, email_attribute: nil, name_attribute: nil, phone_attribute: nil) ⇒ Project

Update the LDAP configuration for your project. Use this endpoint to connect your project to an LDAP directory, such as OpenLDAP or Active Directory, so users can sign in with their directory credentials. Omitted parameters keep their stored value. Enabling LDAP connects to the directory and binds as the service account, so a project cannot be left enabled with a configuration that cannot sign anyone in.

Parameters:

  • [] —

    enabled Enable or disable LDAP sign-in. Enabling connects to the directory to validate the configuration.

  • hosts (Array) (defaults to: nil) —

    Directory hostnames or IP addresses, tried in order until one answers. IPv6 addresses can be written with or without square brackets. Maximum of 10 hosts are allowed. For example: ["ldap.example.com"]

  • port (Integer) (defaults to: nil) —

    Directory port. Defaults to 636 for LDAPS and 389 otherwise.

  • encryption (ProjectLDAPEncryption) (defaults to: nil) —

    Transport encryption. Use "ldaps" for TLS from the first byte, "starttls" to upgrade a plain connection, or "none" for a trusted network only. Allowed values are: none, ldaps, starttls. Defaults to ldaps.

  • [] —

    verification Certificate verification, false for disabled or true for enabled. Defaults to true. Has no effect when encryption is none.

  • certificate (String) (defaults to: nil) —

    Certificate in PEM format of the authority that signed the directory certificate, or the directory certificate itself when it is self-signed. Several certificates can be given one after another. Leave empty to use the system trust store. Pass an empty string to clear a previously set value.

  • timeout (Integer) (defaults to: nil) —

    Seconds to wait for the directory to connect and answer each operation. Maximum is 30 seconds. Defaults to 10.

  • base_dn (String) (defaults to: nil) —

    Subtree the user search starts from. For example: ou=people,dc=example,dc=com

  • bind_dn (String) (defaults to: nil) —

    Service account used to search for users. Pass an empty string if the directory allows anonymous search. For example: cn=appwrite,ou=services,dc=example,dc=com

  • bind_password (String) (defaults to: nil) —

    Service account password. This property is stored securely and cannot be read in future (write-only). Required again when hosts, port, encryption, verification, certificate or bindDn change.

  • user_filter (String) (defaults to: nil) —

    LDAP filter that finds the user signing in. username is replaced with the username they enter and must appear at least once. Pass an empty string to use the default, (uid=username). For example: (sAMAccountName=username) on Active Directory, or (|(uid=username)(mail=username)) to accept a username or an email address.

  • required_group_dn (String) (defaults to: nil) —

    Group a user must belong to in order to sign in, checked on every sign-in. Pass an empty string to allow every user the directory authenticates. For example: cn=staff,ou=groups,dc=example,dc=com

  • id_attribute (String) (defaults to: nil) —

    Attribute holding the identifier that stays the same when an entry is renamed or moved. Defaults to entryUUID; use objectGUID on Active Directory.

  • email_attribute (String) (defaults to: nil) —

    Attribute holding the email address. Defaults to mail.

  • name_attribute (String) (defaults to: nil) —

    Attribute holding the display name. Defaults to cn.

  • phone_attribute (String) (defaults to: nil) —

    Attribute holding the phone number, in international format. Leave empty, the default, to leave the phone unmapped. For example: mobile

Returns:



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/appwrite/services/project.rb', line 541

def update_ldap(
    enabled: nil,
    hosts: nil,
    port: nil,
    encryption: nil,
    verification: nil,
    certificate: nil,
    timeout: nil,
    base_dn: nil,
    bind_dn: nil,
    bind_password: nil,
    user_filter: nil,
    required_group_dn: nil,
    id_attribute: nil,
    email_attribute: nil,
    name_attribute: nil,
    phone_attribute: nil
)
    api_path = '/project/ldap'

    api_params = {
        enabled: enabled,
        hosts: hosts,
        port: port,
        encryption: encryption,
        verification: verification,
        certificate: certificate,
        timeout: timeout,
        baseDn: base_dn,
        bindDn: bind_dn,
        bindPassword: bind_password,
        userFilter: user_filter,
        requiredGroupDn: required_group_dn,
        idAttribute: id_attribute,
        emailAttribute: email_attribute,
        nameAttribute: name_attribute,
        phoneAttribute: phone_attribute,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        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)


3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
# File 'lib/appwrite/services/project.rb', line 3964

def update_linux_platform(
    platform_id:,
    name:,
    package_name:
)
    if platform_id.nil? || platform_id == ''
        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_path = '/project/platforms/linux/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {
        name: name,
        packageName: package_name,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, user_accessed_at: 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.

  • [] —

    user_accessed_at Set to true if you want make user last access time visible to all team members, or false to hide it.

Returns:



4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
# File 'lib/appwrite/services/project.rb', line 4542

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

    api_params = {
        userId: user_id,
        userEmail: user_email,
        userPhone: user_phone,
        userName: user_name,
        userMFA: user_mfa,
        userAccessedAt: user_accessed_at,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_mfa_factors_policy(totp: nil, email: nil, phone: nil, custom: nil) ⇒ Project

Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback.

Parameters:

  • [] —

    totp Set to true to allow TOTP to complete an MFA challenge, or false to disable it.

  • [] —

    email Set to true to allow email to complete an MFA challenge, or false to disable it.

  • [] —

    phone Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it.

  • [] —

    custom Set to true to allow the custom factor to complete an MFA challenge, or false to disable it.

Returns:



4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
# File 'lib/appwrite/services/project.rb', line 4588

def update_mfa_factors_policy(
    totp: nil,
    email: nil,
    phone: nil,
    custom: nil
)
    api_path = '/project/policies/mfa-factors'

    api_params = {
        totp: totp,
        email: email,
        phone: phone,
        custom: custom,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
# File 'lib/appwrite/services/project.rb', line 742

def update_mock_phone(
    number:,
    otp:
)
    if number.nil? || number == ''
        raise Appwrite::Exception.new('Missing required parameter: "number"')
    end

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

    api_path = '/project/mock-phones/{number}'
        .gsub('{number}', @client.encode_path(number))

    api_params = {
        otp: otp,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: 79ffe4000000000000000000000000000000000000000000000000000002de55

  • [] —

    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)


930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/appwrite/services/project.rb', line 930

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, native_client_ids: nil, native_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 Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.

  • native_client_ids (Array) (defaults to: nil) —

    App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.

  • [] —

    native_enabled Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code.

Returns:

  • (OAuth2Apple)


969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
# File 'lib/appwrite/services/project.rb', line 969

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

    api_params = {
        serviceId: service_id,
        keyId: key_id,
        teamId: team_id,
        p8File: p8_file,
        enabled: enabled,
        nativeClientIds: native_client_ids,
        nativeEnabled: native_enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_appwrite(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Appwrite

Update the project OAuth2 Appwrite configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93

  • [] —

    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:

  • (OAuth2Appwrite)


1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
# File 'lib/appwrite/services/project.rb', line 1012

def update_o_auth2_appwrite(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/appwrite'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_atlassian(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Atlassian

Update the project OAuth2 Atlassian configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Atlassian OAuth2 app. For example: uQ7mZ3s0000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Atlassian OAuth2 app. For example: ATOA0000000000000000000000000000000000000000000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Atlassian)


1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/appwrite/services/project.rb', line 1047

def update_o_auth2_atlassian(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/atlassian'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_auth0(client_id: nil, client_secret: nil, endpoint: nil, enabled: nil, prompt: 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: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF

  • 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.

  • prompt (Array) (defaults to: nil) —

    Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default.

Returns:

  • (OAuth2Auth0)


1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/appwrite/services/project.rb', line 1084

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        endpoint: endpoint,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK

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


1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/appwrite/services/project.rb', line 1124

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: 7I000000000000MW

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: NMfLZJ00000000000000000000TLQdDx

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: a13e250000000000000000000000000000d73095

  • [] —

    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)


1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
# File 'lib/appwrite/services/project.rb', line 1231

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: OKM1f100000000000000000000eshEif

  • [] —

    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)


1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
# File 'lib/appwrite/services/project.rb', line 1266

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_cloudflare(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Cloudflare

Update the project OAuth2 Cloudflare configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f

  • [] —

    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:

  • (OAuth2Cloudflare)


1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
# File 'lib/appwrite/services/project.rb', line 1301

def update_o_auth2_cloudflare(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/cloudflare'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Cloudflare
    )
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: a399a90000000000000000000000000000d90639

  • [] —

    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)


1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
# File 'lib/appwrite/services/project.rb', line 1336

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: 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: YmPXnM000000000000000000002zFg5D

  • [] —

    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.

  • prompt (Array) (defaults to: nil) —

    Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default.

Returns:

  • (OAuth2Discord)


1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
# File 'lib/appwrite/services/project.rb', line 1372

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: W7Bykj00000000000000000000000000000000000000000000000000003o43w9

  • [] —

    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)


1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
# File 'lib/appwrite/services/project.rb', line 1409

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: g200000000000vw

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: tp000000ru

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: 2d0b2800000000000000000000d38af4

  • [] —

    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)


1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
# File 'lib/appwrite/services/project.rb', line 1514

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: yEpOYn0000000000000000004iIsU5

  • [] —

    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)


1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
# File 'lib/appwrite/services/project.rb', line 1549

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: Jx4s0C0000000000000000000000000000000wGqLsc

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


1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
# File 'lib/appwrite/services/project.rb', line 1585

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: 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: 5e07c00000000000000000000000000000198bcc

  • [] —

    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.

  • prompt (Array) (defaults to: nil) —

    Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default.

Returns:

  • (OAuth2Github)


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

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38

  • endpoint (String) (defaults to: nil) —

    Endpoint URL of self-hosted GitLab instance. For example: https://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)


1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
# File 'lib/appwrite/services/project.rb', line 1661

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: nil, enabled: nil, native_client_ids: nil, native_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: GOCSPX-2k8gsR0000000000000000VNahJj

  • prompt (Array) (defaults to: nil) —

    Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account.

  • [] —

    enabled Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.

  • native_client_ids (Array) (defaults to: nil) —

    Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.

  • [] —

    native_enabled Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code.

Returns:

  • (OAuth2Google)


1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
# File 'lib/appwrite/services/project.rb', line 1701

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        prompt: prompt,
        enabled: enabled,
        nativeClientIds: native_client_ids,
        nativeEnabled: native_enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_hugging_face(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2HuggingFace

Update the project OAuth2 Hugging Face configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt

  • [] —

    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:

  • (OAuth2HuggingFace)


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

def update_o_auth2_hugging_face(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/huggingface'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_instagram(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Instagram

Update the project OAuth2 Instagram configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Instagram OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Instagram OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Instagram)


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

def update_o_auth2_instagram(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/instagram'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_kakao(client_id: nil, client_secret: nil, enabled: nil, prompt: nil) ⇒ OAuth2Kakao

Update the project OAuth2 Kakao configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled

  • [] —

    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.

  • prompt (Array) (defaults to: nil) —

    Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default.

Returns:

  • (OAuth2Kakao)


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
# File 'lib/appwrite/services/project.rb', line 1813

def update_o_auth2_kakao(
    client_id: nil,
    client_secret: nil,
    enabled: nil,
    prompt: nil
)
    api_path = '/project/oauth2/kakao'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Kakao
    )
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: jdjrJd00000000000000000000HUsaZO

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


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
# File 'lib/appwrite/services/project.rb', line 1852

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: 34ac5600000000000000000000000000000000000000000000000000e830c8b

  • [] —

    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)


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
# File 'lib/appwrite/services/project.rb', line 1891

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_line(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Line

Update the project OAuth2 LINE configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of LINE OAuth2 app. For example: 1650000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of LINE OAuth2 app. For example: a1b2c3d4e5f600000000000000000000

  • [] —

    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:

  • (OAuth2Line)


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
# File 'lib/appwrite/services/project.rb', line 1926

def update_o_auth2_line(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/line'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_linear(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Linear

Update the project OAuth2 Linear configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Linear OAuth2 app. For example: 5e1c0000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Linear OAuth2 app. For example: 9f8e7d6c5b4a00000000000000000000

  • [] —

    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:

  • (OAuth2Linear)


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
# File 'lib/appwrite/services/project.rb', line 1961

def update_o_auth2_linear(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/linear'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Linear
    )
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: WPL_AP1.2Bf0000000000000./HtlYw==

  • [] —

    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)


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
# File 'lib/appwrite/services/project.rb', line 1996

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: 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: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u

  • 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.

  • prompt (Array) (defaults to: nil) —

    Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default.

Returns:

  • (OAuth2Microsoft)


2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
# File 'lib/appwrite/services/project.rb', line 2033

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

    api_params = {
        applicationId: application_id,
        applicationSecret: application_secret,
        tenant: tenant,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_naver(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Naver

Update the project OAuth2 Naver configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Naver OAuth2 app. For example: jK8pQ0000000000000Zv

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Naver OAuth2 app. For example: 9f42A0000000000c1dEb. Find it under Application > My Applications, on the overview of your app

  • [] —

    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:

  • (OAuth2Naver)


2072
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
# File 'lib/appwrite/services/project.rb', line 2072

def update_o_auth2_naver(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/naver'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_netlify(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Netlify

Update the project OAuth2 Netlify configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Netlify OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Netlify OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Netlify)


2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
# File 'lib/appwrite/services/project.rb', line 2107

def update_o_auth2_netlify(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/netlify'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Netlify
    )
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: secret_dLUr4b000000000000000000000000000000lFHAa9

  • [] —

    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)


2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
# File 'lib/appwrite/services/project.rb', line 2142

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: nil, max_age: 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: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV

  • 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: https://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: https://myoauth.com/oauth2/authorize

  • token_url (String) (defaults to: nil) —

    OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://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: https://myoauth.com/oauth2/userinfo

  • prompt (Array) (defaults to: nil) —

    Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account.

  • max_age (Integer) (defaults to: nil) —

    Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate.

  • [] —

    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)


2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/appwrite/services/project.rb', line 2183

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,
    prompt: nil,
    max_age: 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: ,
        prompt: prompt,
        maxAge: max_age,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: 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: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV

  • 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 https://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.

  • prompt (Array) (defaults to: nil) —

    Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default.

Returns:

  • (OAuth2Okta)


2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
# File 'lib/appwrite/services/project.rb', line 2233

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        domain: domain,
        authorizationServerId: authorization_server_id,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_patreon(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Patreon

Update the project OAuth2 Patreon configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Patreon OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Patreon OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Patreon)


2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
# File 'lib/appwrite/services/project.rb', line 2274

def update_o_auth2_patreon(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/patreon'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Patreon
    )
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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp

  • [] —

    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)


2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
# File 'lib/appwrite/services/project.rb', line 2309

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp

  • [] —

    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)


2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
# File 'lib/appwrite/services/project.rb', line 2344

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN

  • [] —

    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)


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
# File 'lib/appwrite/services/project.rb', line 2379

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_railway(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Railway

Update the project OAuth2 Railway configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Railway OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Railway OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Railway)


2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
# File 'lib/appwrite/services/project.rb', line 2414

def update_o_auth2_railway(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/railway'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_reddit(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Reddit

Update the project OAuth2 Reddit configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Reddit OAuth2 app. For example: aBcD0000000000000000aB

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Reddit OAuth2 app. For example: xYz00000000000000000000000000a

  • [] —

    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:

  • (OAuth2Reddit)


2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
# File 'lib/appwrite/services/project.rb', line 2449

def update_o_auth2_reddit(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/reddit'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_resend(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Resend

Update the project OAuth2 Resend configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4

  • [] —

    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:

  • (OAuth2Resend)


2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
# File 'lib/appwrite/services/project.rb', line 2484

def update_o_auth2_resend(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/resend'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_roblox(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Roblox

Update the project OAuth2 Roblox configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Roblox OAuth2 app. For example: 1234567890123456789

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Roblox OAuth2 app. For example: RBX-0000000000000000000000000000000000000000000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Roblox)


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
# File 'lib/appwrite/services/project.rb', line 2519

def update_o_auth2_roblox(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/roblox'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_salesforce(customer_key: nil, customer_secret: nil, enabled: nil, prompt: 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: 3w000000000000e2

  • [] —

    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.

  • prompt (Array) (defaults to: nil) —

    Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default.

Returns:

  • (OAuth2Salesforce)


2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
# File 'lib/appwrite/services/project.rb', line 2555

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

    api_params = {
        customerKey: customer_key,
        customerSecret: customer_secret,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_server(enabled:, authorization_url:, scopes: nil, authorization_details_types: nil, access_token_duration: nil, refresh_token_duration: nil, public_access_token_duration: nil, public_refresh_token_duration: nil, installation_access_token_duration: nil, confidential_pkce: nil, verification_url: nil, user_code_length: nil, user_code_format: nil, device_code_duration: nil, default_scopes: nil, installation_scopes: nil) ⇒ Project

Update the OAuth2 server (OIDC provider) configuration.

Parameters:

  • [] —

    enabled Enable or disable the OAuth2 server.

  • authorization_url (String) —

    URL to your application with consent screen.

  • scopes (Array) (defaults to: nil) —

    List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long.

  • authorization_details_types (Array) (defaults to: nil) —

    List of accepted authorization_details types. Maximum of 100 types are allowed, each up to 128 characters long.

  • access_token_duration (Integer) (defaults to: nil) —

    Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours.

  • refresh_token_duration (Integer) (defaults to: nil) —

    Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year.

  • public_access_token_duration (Integer) (defaults to: nil) —

    Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour.

  • public_refresh_token_duration (Integer) (defaults to: nil) —

    Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days.

  • installation_access_token_duration (Integer) (defaults to: nil) —

    Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour.

  • [] —

    confidential_pkce When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting.

  • verification_url (String) (defaults to: nil) —

    URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant.

  • user_code_length (Integer) (defaults to: nil) —

    Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8.

  • user_code_format (String) (defaults to: nil) —

    Character set for device flow user codes: numeric (digits only — best for numeric keypads and TV remotes), alphabetic (letters only), or alphanumeric (letters and digits — highest entropy per character). Defaults to alphanumeric.

  • device_code_duration (Integer) (defaults to: nil) —

    Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600.

  • default_scopes (Array) (defaults to: nil) —

    List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long.

  • installation_scopes (Array) (defaults to: nil) —

    List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long.

Returns:



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
# File 'lib/appwrite/services/project.rb', line 861

def update_o_auth2_server(
    enabled:,
    authorization_url:,
    scopes: nil,
    authorization_details_types: nil,
    access_token_duration: nil,
    refresh_token_duration: nil,
    public_access_token_duration: nil,
    public_refresh_token_duration: nil,
    installation_access_token_duration: nil,
    confidential_pkce: nil,
    verification_url: nil,
    user_code_length: nil,
    user_code_format: nil,
    device_code_duration: nil,
    default_scopes: nil,
    installation_scopes: nil
)
    if enabled.nil?
        raise Appwrite::Exception.new('Missing required parameter: "enabled"')
    end

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

    api_path = '/project/oauth2-server'

    api_params = {
        enabled: enabled,
        authorizationUrl: authorization_url,
        scopes: scopes,
        authorizationDetailsTypes: authorization_details_types,
        accessTokenDuration: access_token_duration,
        refreshTokenDuration: refresh_token_duration,
        publicAccessTokenDuration: public_access_token_duration,
        publicRefreshTokenDuration: public_refresh_token_duration,
        installationAccessTokenDuration: installation_access_token_duration,
        confidentialPkce: confidential_pkce,
        verificationUrl: verification_url,
        userCodeLength: user_code_length,
        userCodeFormat: user_code_format,
        deviceCodeDuration: device_code_duration,
        defaultScopes: default_scopes,
        installationScopes: installation_scopes,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Project
    )
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: 81656000000000000000000000f3d2fd

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: db068a000000000000000000008b5b9f

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_strava(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Strava

Update the project OAuth2 Strava configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Strava OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Strava OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Strava)


2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
# File 'lib/appwrite/services/project.rb', line 2662

def update_o_auth2_strava(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/strava'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Strava
    )
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: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_tik_tok(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2TikTok

Update the project OAuth2 TikTok configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0

  • client_secret (String) (defaults to: nil) —

    'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite

  • [] —

    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:

  • (OAuth2TikTok)


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

def update_o_auth2_tik_tok(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/tiktok'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2TikTok
    )
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: 7cb52700-0000-0000-0000-000000ca5b83

  • [] —

    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)


2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
# File 'lib/appwrite/services/project.rb', line 2767

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: 7cb52700-0000-0000-0000-000000ca5b83

  • [] —

    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)


2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
# File 'lib/appwrite/services/project.rb', line 2802

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: pmapue000000000000000000zylw3v

  • [] —

    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)


2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
# File 'lib/appwrite/services/project.rb', line 2837

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_vercel(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Vercel

Update the project OAuth2 Vercel configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Vercel OAuth2 app. For example: cl_0000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Vercel OAuth2 app. For example: vc_0000000000000000000000000000000000000000000000

  • [] —

    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:

  • (OAuth2Vercel)


2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
# File 'lib/appwrite/services/project.rb', line 2872

def update_o_auth2_vercel(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/vercel'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_vipps(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Vipps

Update the project OAuth2 Vipps MobilePay configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Vipps MobilePay OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Vipps MobilePay OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k

  • [] —

    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:

  • (OAuth2Vipps)


2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
# File 'lib/appwrite/services/project.rb', line 2907

def update_o_auth2_vipps(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/vipps'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_vipps_sandbox(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Vipps

Update the project OAuth2 Vipps MobilePay Sandbox configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Vipps MobilePay Sandbox OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Vipps MobilePay Sandbox OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k

  • [] —

    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:

  • (OAuth2Vipps)


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
# File 'lib/appwrite/services/project.rb', line 2942

def update_o_auth2_vipps_sandbox(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/vippsSandbox'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_vk(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2VK

Update the project OAuth2 VK configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of VK OAuth2 app. For example: 00000000000000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of VK OAuth2 app. For example: 00000000000000000000000000000000

  • [] —

    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:

  • (OAuth2VK)


2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
# File 'lib/appwrite/services/project.rb', line 2977

def update_o_auth2_vk(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/vk'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_webflow(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2Webflow

Update the project OAuth2 Webflow configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59

  • [] —

    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:

  • (OAuth2Webflow)


3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
# File 'lib/appwrite/services/project.rb', line 3012

def update_o_auth2_webflow(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/webflow'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2Webflow
    )
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: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk

  • [] —

    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)


3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
# File 'lib/appwrite/services/project.rb', line 3047

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_o_auth2_work_os(client_id: nil, client_secret: nil, enabled: nil) ⇒ OAuth2WorkOS

Update the project OAuth2 WorkOS configuration.

Parameters:

  • client_id (String) (defaults to: nil) —

    'Client ID' of WorkOS OAuth2 app. For example: client_01H0000000000000000000000

  • client_secret (String) (defaults to: nil) —

    'Client Secret' of WorkOS OAuth2 app. For example: wos0000000000000000000000000000000000000000000000000000000000000

  • [] —

    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:

  • (OAuth2WorkOS)


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

def update_o_auth2_work_os(
    client_id: nil,
    client_secret: nil,
    enabled: nil
)
    api_path = '/project/oauth2/workos'

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::OAuth2WorkOS
    )
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: tkEPkp00000000000000000000000000000000000000FTxbI9

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: cf978f0000000000000000000000000000c5e2e9

  • [] —

    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)


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

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: bbf98500000000000000000000c75a63

  • [] —

    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)


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
# File 'lib/appwrite/services/project.rb', line 3187

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, prompt: 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: fb5cac000000000000000000000000000000a68f6e

  • [] —

    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.

  • prompt (Array) (defaults to: nil) —

    Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default.

Returns:

  • (OAuth2Zoho)


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

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

    api_params = {
        clientId: client_id,
        clientSecret: client_secret,
        enabled: enabled,
        prompt: prompt,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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: GAWsG4000000000000000000007U01ON

  • [] —

    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)


3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
# File 'lib/appwrite/services/project.rb', line 3260

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_passkey_policy(rp_id:) ⇒ Project

Set the relying party ID passkeys are bound to: the domain of your application. Passkeys work on the project's web platforms on that domain or its subdomains, and on the domain itself for Apple apps. A localhost web platform enables passkeys for local development without a relying party ID. The relying party ID cannot change while users have passkeys, and any change invalidates ceremonies in progress.

Parameters:

  • rp_id (String) —

    Relying party ID: the domain of your application, such as example.com. Use localhost for local development, or an empty string to unset it.

Returns:



4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
# File 'lib/appwrite/services/project.rb', line 4628

def update_passkey_policy(
    rp_id:
)
    if rp_id.nil?
        raise Appwrite::Exception.new('Missing required parameter: "rpId"')
    end

    api_path = '/project/policies/passkey'

    api_params = {
        rpId: rp_id,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_password_dictionary_policy(enabled:, deny_list: nil) ⇒ 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.

Custom denyList entries use case-sensitive equality and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits.

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.

  • deny_list (Array) (defaults to: nil) —

    Custom blocked values using case-sensitive equality. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters.

Returns:



4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
# File 'lib/appwrite/services/project.rb', line 4672

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

    api_path = '/project/policies/password-dictionary'

    api_params = {
        enabled: enabled,
        denyList: deny_list,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 20, or null to disable the limit.

Returns:



4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
# File 'lib/appwrite/services/project.rb', line 4715

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

    api_path = '/project/policies/password-history'

    api_params = {
        total: total,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:, deny_list: nil) ⇒ 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.

Custom denyList entries use case-insensitive substring matching and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. Password recovery also checks the recovered user profile, closing the previous gap in profile-based personal-data validation.

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.

  • deny_list (Array) (defaults to: nil) —

    Custom blocked values using case-insensitive substring matching. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters.

Returns:



4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
# File 'lib/appwrite/services/project.rb', line 4762

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

    api_path = '/project/policies/password-personal-data'

    api_params = {
        enabled: enabled,
        denyList: deny_list,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_password_pwned_policy(enabled: nil, sessions: nil, users: nil) ⇒ Project

Updating this policy allows you to control if passwords are checked against the Have I Been Pwned breach database. When enabled, every password a user signs up, signs in or resets with is checked and the result is recorded on the user as passwordPwned. On its own the policy only records. Enable users to reject a breached password when a user signs up or sets a new password, and sessions to refuse a sign-in with a breached password until it is reset. Only the first five characters of the password hash are ever shared with the service. Options left out keep their current value.

Parameters:

  • [] —

    enabled Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use users and sessions to block. When changing this policy, existing passwords remain valid.

  • [] —

    sessions Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result.

  • [] —

    users Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result.

Returns:



4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
# File 'lib/appwrite/services/project.rb', line 4806

def update_password_pwned_policy(
    enabled: nil,
    sessions: nil,
    users: nil
)
    api_path = '/project/policies/password-pwned'

    api_params = {
        enabled: enabled,
        sessions: sessions,
        users: users,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_password_rotation_policy(enabled: nil, max_age: nil) ⇒ Project

Require a password reset when an email/password sign-in uses a password older than the configured maximum age. Options left out keep their current value.

Parameters:

  • [] —

    enabled Enable password rotation. Disabled by default.

  • max_age (Integer) (defaults to: nil) —

    Maximum password age in seconds. Minimum allowed value is 86400 seconds (1 day), and maximum is 10 years, which is 315360000 seconds. Defaults to 1 year, which is 31536000 seconds.

Returns:



4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
# File 'lib/appwrite/services/project.rb', line 4842

def update_password_rotation_policy(
    enabled: nil,
    max_age: nil
)
    api_path = '/project/policies/password-rotation'

    api_params = {
        enabled: enabled,
        maxAge: max_age,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_password_strength_policy(min: nil, uppercase: nil, lowercase: nil, number: nil, symbols: nil) ⇒ PolicyPasswordStrength

Update the password strength requirements for users in the project.

Parameters:

  • min (Integer) (defaults to: nil) —

    Minimum password length. Value must be between 8 and 256. Default is 8.

  • [] —

    uppercase Whether passwords must include at least one uppercase letter.

  • [] —

    lowercase Whether passwords must include at least one lowercase letter.

  • [] —

    number Whether passwords must include at least one number.

  • [] —

    symbols Whether passwords must include at least one symbol.

Returns:

  • (PolicyPasswordStrength)


4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
# File 'lib/appwrite/services/project.rb', line 4877

def update_password_strength_policy(
    min: nil,
    uppercase: nil,
    lowercase: nil,
    number: nil,
    symbols: nil
)
    api_path = '/project/policies/password-strength'

    api_params = {
        min: min,
        uppercase: uppercase,
        lowercase: lowercase,
        number: number,
        symbols: symbols,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_prefs(prefs:) ⇒ Preferences

Update the project preferences. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.

Parameters:

  • prefs (Hash) —

    Prefs key-value JSON object.

Returns:

  • (Preferences)


5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
# File 'lib/appwrite/services/project.rb', line 5252

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

    api_path = '/project/prefs'

    api_params = {
        prefs: prefs,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PUT',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::Preferences
    )
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 (ProjectProtocolId) —

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

  • [] —

    enabled Protocol status.

Returns:



5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
# File 'lib/appwrite/services/project.rb', line 5287

def update_protocol(
    protocol_id:,
    enabled:
)
    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_path = '/project/protocols/{protocolId}'
        .gsub('{protocolId}', @client.encode_path(protocol_id))

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 (ProjectServiceId) —

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

  • [] —

    enabled Service status.

Returns:



5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
# File 'lib/appwrite/services/project.rb', line 5328

def update_service(
    service_id:,
    enabled:
)
    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_path = '/project/services/{serviceId}'
        .gsub('{serviceId}', @client.encode_path(service_id))

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:



4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
# File 'lib/appwrite/services/project.rb', line 4918

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

    api_path = '/project/policies/session-alert'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 60 seconds, and maximum is 1 year, which is 31536000 seconds.

Returns:



4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
# File 'lib/appwrite/services/project.rb', line 4952

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

    api_path = '/project/policies/session-duration'

    api_params = {
        duration: duration,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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:



4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
# File 'lib/appwrite/services/project.rb', line 4987

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

    api_path = '/project/policies/session-invalidation'

    api_params = {
        enabled: enabled,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 100.

Returns:



5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
# File 'lib/appwrite/services/project.rb', line 5021

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

    api_path = '/project/policies/session-limit'

    api_params = {
        total: total,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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. Pass an empty string to clear a previously set value.

  • password (String) (defaults to: nil) —

    SMTP server password. Pass an empty string to clear a previously set value. 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. Pass an empty string to clear a previously set value.

  • sender_name (String) (defaults to: nil) —

    Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value.

  • reply_to_email (String) (defaults to: nil) —

    Email used when user replies to the email. Pass an empty string to clear a previously set value.

  • reply_to_name (String) (defaults to: nil) —

    Name used when user replies to the email. Pass an empty string to clear a previously set value.

  • secure (ProjectSMTPSecure) (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:



5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
# File 'lib/appwrite/services/project.rb', line 5404

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 = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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 0 and 10000. Use 0 or null to disable the limit.

Returns:



5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
# File 'lib/appwrite/services/project.rb', line 5056

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

    api_path = '/project/policies/user-limit'

    api_params = {
        total: total,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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, description: nil) ⇒ Variable

Update variable by its unique ID.

Parameters:

  • variable_id (String) —

    Variable unique ID.

  • key (String) (defaults to: nil) —

    Variable key. Letters, digits and underscores only, must not start with a digit. 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.

  • description (String) (defaults to: nil) —

    Optional description for the variable.

Returns:

  • (Variable)


5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
# File 'lib/appwrite/services/project.rb', line 5728

def update_variable(
    variable_id:,
    key: nil,
    value: nil,
    secret: nil,
    description: nil
)
    if variable_id.nil? || variable_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "variableId"')
    end

    api_path = '/project/variables/{variableId}'
        .gsub('{variableId}', @client.encode_path(variable_id))

    api_params = {
        key: key,
        value: value,
        secret: secret,
        description: description,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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

#update_video_profile(profile_id:, name: nil, video_bit_rate: nil, audio_bit_rate: nil, width: nil, height: nil) ⇒ VideoProfile

Update a video profile by its unique ID (PATCH /v1/project/videos/profiles/:profileId). Existing renditions are not re-encoded. Changing the profile onto the same width, height, bitrates, and codec as another profile fails with video_profile_already_exists.

Parameters:

  • profile_id (String) —

    Video profile unique ID.

  • name (String) (defaults to: nil) —

    Video profile name.

  • video_bit_rate (Integer) (defaults to: nil) —

    Target video bitrate in bits per second. Must be a multiple of 1000.

  • audio_bit_rate (Integer) (defaults to: nil) —

    Target audio bitrate in bits per second. Must be a multiple of 1000.

  • width (Integer) (defaults to: nil) —

    Target video width in pixels. Must be an even number.

  • height (Integer) (defaults to: nil) —

    Target video height in pixels. Must be an even number.

Returns:

  • (VideoProfile)


5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
# File 'lib/appwrite/services/project.rb', line 5956

def update_video_profile(
    profile_id:,
    name: nil,
    video_bit_rate: nil,
    audio_bit_rate: nil,
    width: nil,
    height: nil
)
    if profile_id.nil? || profile_id == ''
        raise Appwrite::Exception.new('Missing required parameter: "profileId"')
    end

    api_path = '/project/videos/profiles/{profileId}'
        .gsub('{profileId}', @client.encode_path(profile_id))

    api_params = {
        name: name,
        videoBitRate: video_bit_rate,
        audioBitRate: audio_bit_rate,
        width: width,
        height: height,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

    @client.call(
        method: 'PATCH',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::VideoProfile
    )
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)


4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
# File 'lib/appwrite/services/project.rb', line 4061

def update_web_platform(
    platform_id:,
    name:,
    hostname:
)
    if platform_id.nil? || platform_id == ''
        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_path = '/project/platforms/web/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {
        name: name,
        hostname: hostname,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": '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)


4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
# File 'lib/appwrite/services/project.rb', line 4158

def update_windows_platform(
    platform_id:,
    name:,
    package_identifier_name:
)
    if platform_id.nil? || platform_id == ''
        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_path = '/project/platforms/windows/{platformId}'
        .gsub('{platformId}', @client.encode_path(platform_id))

    api_params = {
        name: name,
        packageIdentifierName: package_identifier_name,
    }

    api_headers = {
        "X-Appwrite-Project": @client.get_config('project'),
        "content-type": 'application/json',
        "accept": 'application/json',
    }

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