appwrite 28.3.2 → 28.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +20 -4
  3. data/lib/appwrite/enums/billing_plan_group.rb +2 -0
  4. data/lib/appwrite/enums/build_runtime.rb +2 -0
  5. data/lib/appwrite/enums/databases_index_type.rb +1 -0
  6. data/lib/appwrite/enums/domain_registration_type.rb +10 -0
  7. data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
  8. data/lib/appwrite/enums/framework.rb +1 -0
  9. data/lib/appwrite/enums/id_token_provider.rb +8 -0
  10. data/lib/appwrite/enums/image_gravity.rb +1 -0
  11. data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
  12. data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
  13. data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
  14. data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
  15. data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
  16. data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
  17. data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
  18. data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
  19. data/lib/appwrite/enums/o_auth_provider.rb +3 -0
  20. data/lib/appwrite/enums/project_email_template_id.rb +2 -0
  21. data/lib/appwrite/enums/project_key_scopes.rb +4 -0
  22. data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
  23. data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
  24. data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
  25. data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
  26. data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
  27. data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
  28. data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
  29. data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
  30. data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
  31. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  32. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
  33. data/lib/appwrite/enums/runtime.rb +2 -0
  34. data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
  35. data/lib/appwrite/enums/waf_rule_action.rb +11 -0
  36. data/lib/appwrite/models/account.rb +143 -0
  37. data/lib/appwrite/models/billing_plan.rb +12 -0
  38. data/lib/appwrite/models/dedicated_database.rb +15 -0
  39. data/lib/appwrite/models/dedicated_database_specification.rb +20 -0
  40. data/lib/appwrite/models/dns_record.rb +83 -0
  41. data/lib/appwrite/models/dns_records_list.rb +33 -0
  42. data/lib/appwrite/models/domain.rb +109 -0
  43. data/lib/appwrite/models/domain_price.rb +63 -0
  44. data/lib/appwrite/models/domain_prices_list.rb +33 -0
  45. data/lib/appwrite/models/domain_transfer_status.rb +59 -0
  46. data/lib/appwrite/models/domains_list.rb +33 -0
  47. data/lib/appwrite/models/identity.rb +8 -3
  48. data/lib/appwrite/models/o_auth2_apple.rb +13 -3
  49. data/lib/appwrite/models/o_auth2_auth0.rb +23 -0
  50. data/lib/appwrite/models/o_auth2_discord.rb +25 -3
  51. data/lib/appwrite/models/o_auth2_github.rb +24 -3
  52. data/lib/appwrite/models/o_auth2_google.rb +17 -5
  53. data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
  54. data/lib/appwrite/models/o_auth2_microsoft.rb +24 -0
  55. data/lib/appwrite/models/o_auth2_oidc.rb +4 -2
  56. data/lib/appwrite/models/o_auth2_okta.rb +23 -0
  57. data/lib/appwrite/models/o_auth2_salesforce.rb +25 -3
  58. data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
  59. data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
  60. data/lib/appwrite/models/o_auth2_zoho.rb +24 -3
  61. data/lib/appwrite/models/oauth2_introspection.rb +83 -0
  62. data/lib/appwrite/models/platform_android.rb +8 -3
  63. data/lib/appwrite/models/policy_password_pwned.rb +43 -0
  64. data/lib/appwrite/models/policy_password_rotation.rb +38 -0
  65. data/lib/appwrite/models/project.rb +15 -0
  66. data/lib/appwrite/models/proxy_rule.rb +1 -0
  67. data/lib/appwrite/models/topic.rb +13 -3
  68. data/lib/appwrite/models/user.rb +5 -0
  69. data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
  70. data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
  71. data/lib/appwrite/models/waf_rule_deny.rb +111 -0
  72. data/lib/appwrite/models/waf_rule_list.rb +33 -0
  73. data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
  74. data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
  75. data/lib/appwrite/services/account.rb +301 -5
  76. data/lib/appwrite/services/avatars.rb +71 -0
  77. data/lib/appwrite/services/databases.rb +4 -1
  78. data/lib/appwrite/services/documents_db.rb +4 -1
  79. data/lib/appwrite/services/domains.rb +2318 -0
  80. data/lib/appwrite/services/functions.rb +11 -3
  81. data/lib/appwrite/services/locale.rb +49 -14
  82. data/lib/appwrite/services/messaging.rb +130 -6
  83. data/lib/appwrite/services/oauth2.rb +45 -0
  84. data/lib/appwrite/services/organization.rb +225 -0
  85. data/lib/appwrite/services/project.rb +439 -15
  86. data/lib/appwrite/services/sites.rb +11 -3
  87. data/lib/appwrite/services/tables_db.rb +4 -1
  88. data/lib/appwrite/services/teams.rb +4 -1
  89. data/lib/appwrite/services/vectors_db.rb +4 -1
  90. data/lib/appwrite/services/waf.rb +859 -0
  91. data/lib/appwrite.rb +42 -0
  92. metadata +44 -2
@@ -153,12 +153,17 @@ module Appwrite
153
153
 
154
154
  # Get a list of all runtimes that are currently active on your instance.
155
155
  #
156
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
156
157
  #
157
158
  # @return [RuntimeList]
158
- def list_runtimes()
159
+ def list_runtimes(
160
+ total: nil
161
+ )
159
162
  api_path = '/functions/runtimes'
160
163
 
161
- api_params = {}
164
+ api_params = {
165
+ total: total,
166
+ }
162
167
 
163
168
  api_headers = {
164
169
  "X-Appwrite-Project": @client.get_config('project'),
@@ -177,15 +182,18 @@ module Appwrite
177
182
  # List allowed function specifications for this instance.
178
183
  #
179
184
  # @param [String] type Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.
185
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
180
186
  #
181
187
  # @return [SpecificationList]
182
188
  def list_specifications(
183
- type: nil
189
+ type: nil,
190
+ total: nil
184
191
  )
185
192
  api_path = '/functions/specifications'
186
193
 
187
194
  api_params = {
188
195
  type: type,
196
+ total: total,
189
197
  }
190
198
 
191
199
  api_headers = {
@@ -37,12 +37,17 @@ module Appwrite
37
37
  # List of all locale codes in [ISO
38
38
  # 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
39
39
  #
40
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
40
41
  #
41
42
  # @return [LocaleCodeList]
42
- def list_codes()
43
+ def list_codes(
44
+ total: nil
45
+ )
43
46
  api_path = '/locale/codes'
44
47
 
45
- api_params = {}
48
+ api_params = {
49
+ total: total,
50
+ }
46
51
 
47
52
  api_headers = {
48
53
  "X-Appwrite-Project": @client.get_config('project'),
@@ -61,12 +66,17 @@ module Appwrite
61
66
  # List of all continents. You can use the locale header to get the data in a
62
67
  # supported language.
63
68
  #
69
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
64
70
  #
65
71
  # @return [ContinentList]
66
- def list_continents()
72
+ def list_continents(
73
+ total: nil
74
+ )
67
75
  api_path = '/locale/continents'
68
76
 
69
- api_params = {}
77
+ api_params = {
78
+ total: total,
79
+ }
70
80
 
71
81
  api_headers = {
72
82
  "X-Appwrite-Project": @client.get_config('project'),
@@ -85,12 +95,17 @@ module Appwrite
85
95
  # List of all countries. You can use the locale header to get the data in a
86
96
  # supported language.
87
97
  #
98
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
88
99
  #
89
100
  # @return [CountryList]
90
- def list_countries()
101
+ def list_countries(
102
+ total: nil
103
+ )
91
104
  api_path = '/locale/countries'
92
105
 
93
- api_params = {}
106
+ api_params = {
107
+ total: total,
108
+ }
94
109
 
95
110
  api_headers = {
96
111
  "X-Appwrite-Project": @client.get_config('project'),
@@ -109,12 +124,17 @@ module Appwrite
109
124
  # List of all countries that are currently members of the EU. You can use the
110
125
  # locale header to get the data in a supported language.
111
126
  #
127
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
112
128
  #
113
129
  # @return [CountryList]
114
- def list_countries_eu()
130
+ def list_countries_eu(
131
+ total: nil
132
+ )
115
133
  api_path = '/locale/countries/eu'
116
134
 
117
- api_params = {}
135
+ api_params = {
136
+ total: total,
137
+ }
118
138
 
119
139
  api_headers = {
120
140
  "X-Appwrite-Project": @client.get_config('project'),
@@ -133,12 +153,17 @@ module Appwrite
133
153
  # List of all countries phone codes. You can use the locale header to get the
134
154
  # data in a supported language.
135
155
  #
156
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
136
157
  #
137
158
  # @return [PhoneList]
138
- def list_countries_phones()
159
+ def list_countries_phones(
160
+ total: nil
161
+ )
139
162
  api_path = '/locale/countries/phones'
140
163
 
141
- api_params = {}
164
+ api_params = {
165
+ total: total,
166
+ }
142
167
 
143
168
  api_headers = {
144
169
  "X-Appwrite-Project": @client.get_config('project'),
@@ -158,12 +183,17 @@ module Appwrite
158
183
  # decimal digits for all major and minor currencies. You can use the locale
159
184
  # header to get the data in a supported language.
160
185
  #
186
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
161
187
  #
162
188
  # @return [CurrencyList]
163
- def list_currencies()
189
+ def list_currencies(
190
+ total: nil
191
+ )
164
192
  api_path = '/locale/currencies'
165
193
 
166
- api_params = {}
194
+ api_params = {
195
+ total: total,
196
+ }
167
197
 
168
198
  api_headers = {
169
199
  "X-Appwrite-Project": @client.get_config('project'),
@@ -182,12 +212,17 @@ module Appwrite
182
212
  # List of all languages classified by ISO 639-1 including 2-letter code, name
183
213
  # in English, and name in the respective language.
184
214
  #
215
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
185
216
  #
186
217
  # @return [LanguageList]
187
- def list_languages()
218
+ def list_languages(
219
+ total: nil
220
+ )
188
221
  api_path = '/locale/languages'
189
222
 
190
- api_params = {}
223
+ api_params = {
224
+ total: total,
225
+ }
191
226
 
192
227
  api_headers = {
193
228
  "X-Appwrite-Project": @client.get_config('project'),
@@ -54,6 +54,8 @@ module Appwrite
54
54
  # @param [] draft Is message a draft
55
55
  # @param [] html Is content of type HTML
56
56
  # @param [String] scheduled_at Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
57
+ # @param [String] reply_to_email Email address to reply to. If not set, defaults to the sender email address.
58
+ # @param [String] reply_to_name Name of the reply to recipient. If not set, defaults to the sender name.
57
59
  #
58
60
  # @return [Message]
59
61
  def create_email(
@@ -68,7 +70,9 @@ module Appwrite
68
70
  attachments: nil,
69
71
  draft: nil,
70
72
  html: nil,
71
- scheduled_at: nil
73
+ scheduled_at: nil,
74
+ reply_to_email: nil,
75
+ reply_to_name: nil
72
76
  )
73
77
  api_path = '/messaging/messages/email'
74
78
 
@@ -97,6 +101,8 @@ module Appwrite
97
101
  draft: draft,
98
102
  html: html,
99
103
  scheduledAt: scheduled_at,
104
+ replyToEmail: reply_to_email,
105
+ replyToName: reply_to_name,
100
106
  }
101
107
 
102
108
  api_headers = {
@@ -131,6 +137,8 @@ module Appwrite
131
137
  # @param [Array] bcc Array of target IDs to be added as BCC.
132
138
  # @param [String] scheduled_at Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
133
139
  # @param [Array] attachments Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
140
+ # @param [String] reply_to_email Email address to reply to. Pass an empty string to restore the provider or sender default.
141
+ # @param [String] reply_to_name Name of the reply to recipient. Pass an empty string to restore the provider or sender default.
134
142
  #
135
143
  # @return [Message]
136
144
  def update_email(
@@ -145,7 +153,9 @@ module Appwrite
145
153
  cc: nil,
146
154
  bcc: nil,
147
155
  scheduled_at: nil,
148
- attachments: nil
156
+ attachments: nil,
157
+ reply_to_email: nil,
158
+ reply_to_name: nil
149
159
  )
150
160
  api_path = '/messaging/messages/email/{messageId}'
151
161
  .gsub('{messageId}', message_id)
@@ -166,6 +176,8 @@ module Appwrite
166
176
  bcc: bcc,
167
177
  scheduledAt: scheduled_at,
168
178
  attachments: attachments,
179
+ replyToEmail: reply_to_email,
180
+ replyToName: reply_to_name,
169
181
  }
170
182
 
171
183
  api_headers = {
@@ -204,6 +216,7 @@ module Appwrite
204
216
  # @param [] content_available If set to true, the notification will be delivered in the background. Available only for iOS Platform.
205
217
  # @param [] critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
206
218
  # @param [MessagePriority] priority Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
219
+ # @param [String] channel_id ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Available only for Android Platform.
207
220
  #
208
221
  # @return [Message]
209
222
  def create_push(
@@ -225,7 +238,8 @@ module Appwrite
225
238
  scheduled_at: nil,
226
239
  content_available: nil,
227
240
  critical: nil,
228
- priority: nil
241
+ priority: nil,
242
+ channel_id: nil
229
243
  )
230
244
  api_path = '/messaging/messages/push'
231
245
 
@@ -253,6 +267,7 @@ module Appwrite
253
267
  contentAvailable: content_available,
254
268
  critical: critical,
255
269
  priority: priority,
270
+ channelId: channel_id,
256
271
  }
257
272
 
258
273
  api_headers = {
@@ -294,6 +309,7 @@ module Appwrite
294
309
  # @param [] content_available If set to true, the notification will be delivered in the background. Available only for iOS Platform.
295
310
  # @param [] critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
296
311
  # @param [MessagePriority] priority Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
312
+ # @param [String] channel_id ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Pass an empty string to clear it. Available only for Android platforms.
297
313
  #
298
314
  # @return [Message]
299
315
  def update_push(
@@ -315,7 +331,8 @@ module Appwrite
315
331
  scheduled_at: nil,
316
332
  content_available: nil,
317
333
  critical: nil,
318
- priority: nil
334
+ priority: nil,
335
+ channel_id: nil
319
336
  )
320
337
  api_path = '/messaging/messages/push/{messageId}'
321
338
  .gsub('{messageId}', message_id)
@@ -343,6 +360,7 @@ module Appwrite
343
360
  contentAvailable: content_available,
344
361
  critical: critical,
345
362
  priority: priority,
363
+ channelId: channel_id,
346
364
  }
347
365
 
348
366
  api_headers = {
@@ -716,6 +734,100 @@ module Appwrite
716
734
  )
717
735
  end
718
736
 
737
+ # Create a new Appwrite push provider.
738
+ #
739
+ # @param [String] provider_id Provider 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.
740
+ # @param [String] name Provider name.
741
+ # @param [] enabled Set as enabled.
742
+ # @param [Integer] qos Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
743
+ # @param [Integer] expiry Default message retention in seconds for offline delivery. Max 7 days (604800).
744
+ #
745
+ # @return [Provider]
746
+ def create_appwrite_provider(
747
+ provider_id:,
748
+ name:,
749
+ enabled: nil,
750
+ qos: nil,
751
+ expiry: nil
752
+ )
753
+ if provider_id.nil?
754
+ raise Appwrite::Exception.new('Missing required parameter: "providerId"')
755
+ end
756
+
757
+ if name.nil?
758
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
759
+ end
760
+
761
+ api_path = '/messaging/providers/appwrite'
762
+
763
+ api_params = {
764
+ providerId: provider_id,
765
+ name: name,
766
+ enabled: enabled,
767
+ qos: qos,
768
+ expiry: expiry,
769
+ }
770
+
771
+ api_headers = {
772
+ "X-Appwrite-Project": @client.get_config('project'),
773
+ "content-type": 'application/json',
774
+ "accept": 'application/json',
775
+ }
776
+
777
+ @client.call(
778
+ method: 'POST',
779
+ path: api_path,
780
+ headers: api_headers,
781
+ params: api_params,
782
+ response_type: Models::Provider
783
+ )
784
+ end
785
+
786
+ # Update an Appwrite push provider by its unique ID.
787
+ #
788
+ # @param [String] provider_id Provider ID.
789
+ # @param [String] name Provider name.
790
+ # @param [] enabled Set as enabled.
791
+ # @param [Integer] qos Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
792
+ # @param [Integer] expiry Default message retention in seconds for offline delivery. Max 7 days (604800).
793
+ #
794
+ # @return [Provider]
795
+ def update_appwrite_provider(
796
+ provider_id:,
797
+ name: nil,
798
+ enabled: nil,
799
+ qos: nil,
800
+ expiry: nil
801
+ )
802
+ if provider_id.nil?
803
+ raise Appwrite::Exception.new('Missing required parameter: "providerId"')
804
+ end
805
+
806
+ api_path = '/messaging/providers/appwrite/{providerId}'
807
+ .gsub('{providerId}', provider_id)
808
+
809
+ api_params = {
810
+ name: name,
811
+ enabled: enabled,
812
+ qos: qos,
813
+ expiry: expiry,
814
+ }
815
+
816
+ api_headers = {
817
+ "X-Appwrite-Project": @client.get_config('project'),
818
+ "content-type": 'application/json',
819
+ "accept": 'application/json',
820
+ }
821
+
822
+ @client.call(
823
+ method: 'PATCH',
824
+ path: api_path,
825
+ headers: api_headers,
826
+ params: api_params,
827
+ response_type: Models::Provider
828
+ )
829
+ end
830
+
719
831
  # Create a new Firebase Cloud Messaging provider.
720
832
  #
721
833
  # @param [String] provider_id Provider 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.
@@ -2029,12 +2141,16 @@ module Appwrite
2029
2141
  # @param [String] topic_id Topic ID. Choose a custom Topic ID or a new Topic ID.
2030
2142
  # @param [String] name Topic Name.
2031
2143
  # @param [Array] subscribe An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2144
+ # @param [Integer] qos MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose.
2145
+ # @param [Integer] expiry Message retention in seconds for offline delivery. Max 7 days (604800).
2032
2146
  #
2033
2147
  # @return [Topic]
2034
2148
  def create_topic(
2035
2149
  topic_id:,
2036
2150
  name:,
2037
- subscribe: nil
2151
+ subscribe: nil,
2152
+ qos: nil,
2153
+ expiry: nil
2038
2154
  )
2039
2155
  api_path = '/messaging/topics'
2040
2156
 
@@ -2050,6 +2166,8 @@ module Appwrite
2050
2166
  topicId: topic_id,
2051
2167
  name: name,
2052
2168
  subscribe: subscribe,
2169
+ qos: qos,
2170
+ expiry: expiry,
2053
2171
  }
2054
2172
 
2055
2173
  api_headers = {
@@ -2105,12 +2223,16 @@ module Appwrite
2105
2223
  # @param [String] topic_id Topic ID.
2106
2224
  # @param [String] name Topic Name.
2107
2225
  # @param [Array] subscribe An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2226
+ # @param [Integer] qos MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose.
2227
+ # @param [Integer] expiry Message retention in seconds for offline delivery. Max 7 days (604800).
2108
2228
  #
2109
2229
  # @return [Topic]
2110
2230
  def update_topic(
2111
2231
  topic_id:,
2112
2232
  name: nil,
2113
- subscribe: nil
2233
+ subscribe: nil,
2234
+ qos: nil,
2235
+ expiry: nil
2114
2236
  )
2115
2237
  api_path = '/messaging/topics/{topicId}'
2116
2238
  .gsub('{topicId}', topic_id)
@@ -2122,6 +2244,8 @@ module Appwrite
2122
2244
  api_params = {
2123
2245
  name: name,
2124
2246
  subscribe: subscribe,
2247
+ qos: qos,
2248
+ expiry: expiry,
2125
2249
  }
2126
2250
 
2127
2251
  api_headers = {
@@ -303,6 +303,51 @@ module Appwrite
303
303
  )
304
304
  end
305
305
 
306
+ # Introspect an OAuth2 access token or refresh token. Authenticate with an
307
+ # API key holding the `oauth2.introspect` scope to introspect any token in
308
+ # the project, or with the client credentials of the app the token was issued
309
+ # to.
310
+ #
311
+ # @param [String] token The access token or refresh token to introspect.
312
+ # @param [String] token_type_hint Type of token to introspect. Can be one of: `access_token` or `refresh_token`.
313
+ # @param [String] client_id OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
314
+ # @param [String] client_secret OAuth2 client secret.
315
+ #
316
+ # @return [Oauth2Introspection]
317
+ def introspect(
318
+ token:,
319
+ token_type_hint: nil,
320
+ client_id: nil,
321
+ client_secret: nil
322
+ )
323
+ if token.nil?
324
+ raise Appwrite::Exception.new('Missing required parameter: "token"')
325
+ end
326
+
327
+ api_path = '/oauth2/{project_id}/introspect'
328
+ .gsub('{project_id}', @client.get_config('project'))
329
+
330
+ api_params = {
331
+ token: token,
332
+ token_type_hint: token_type_hint,
333
+ client_id: client_id,
334
+ client_secret: client_secret,
335
+ }
336
+
337
+ api_headers = {
338
+ "content-type": 'application/json',
339
+ "accept": 'application/json',
340
+ }
341
+
342
+ @client.call(
343
+ method: 'POST',
344
+ path: api_path,
345
+ headers: api_headers,
346
+ params: api_params,
347
+ response_type: Models::Oauth2Introspection
348
+ )
349
+ end
350
+
306
351
  # List the organizations the OAuth2 access token can access. Resolves the
307
352
  # token's `organization` authorization details, expanding the `*` wildcard
308
353
  # into the concrete set of organizations the user can see.