appwrite 26.0.0 → 26.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +1 -1
  3. data/lib/appwrite/enums/database_status.rb +11 -0
  4. data/lib/appwrite/enums/database_type.rb +3 -0
  5. data/lib/appwrite/enums/organization_key_scopes.rb +2 -0
  6. data/lib/appwrite/enums/project_key_scopes.rb +3 -0
  7. data/lib/appwrite/models/activity_event.rb +58 -3
  8. data/lib/appwrite/models/app.rb +152 -0
  9. data/lib/appwrite/models/app_installation.rb +72 -0
  10. data/lib/appwrite/models/app_installation_list.rb +32 -0
  11. data/lib/appwrite/models/app_key.rb +67 -0
  12. data/lib/appwrite/models/app_key_list.rb +32 -0
  13. data/lib/appwrite/models/app_scope.rb +47 -0
  14. data/lib/appwrite/models/app_scope_list.rb +32 -0
  15. data/lib/appwrite/models/app_secret.rb +67 -0
  16. data/lib/appwrite/models/app_secret_list.rb +32 -0
  17. data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
  18. data/lib/appwrite/models/apps_list.rb +32 -0
  19. data/lib/appwrite/models/billing_plan.rb +5 -0
  20. data/lib/appwrite/models/database.rb +35 -6
  21. data/lib/appwrite/models/database_status.rb +62 -0
  22. data/lib/appwrite/models/database_status_connections.rb +32 -0
  23. data/lib/appwrite/models/database_status_replica.rb +42 -0
  24. data/lib/appwrite/models/database_status_volume.rb +42 -0
  25. data/lib/appwrite/models/dedicated_database.rb +267 -0
  26. data/lib/appwrite/models/dedicated_database_member.rb +42 -0
  27. data/lib/appwrite/models/dedicated_database_replicas.rb +37 -0
  28. data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
  29. data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
  30. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +47 -0
  31. data/lib/appwrite/models/oauth2_approve.rb +27 -0
  32. data/lib/appwrite/models/oauth2_authorize.rb +32 -0
  33. data/lib/appwrite/models/oauth2_consent.rb +72 -0
  34. data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
  35. data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
  36. data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
  37. data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
  38. data/lib/appwrite/models/oauth2_grant.rb +82 -0
  39. data/lib/appwrite/models/oauth2_organization.rb +27 -0
  40. data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
  41. data/lib/appwrite/models/oauth2_par.rb +32 -0
  42. data/lib/appwrite/models/oauth2_project.rb +37 -0
  43. data/lib/appwrite/models/oauth2_project_list.rb +32 -0
  44. data/lib/appwrite/models/oauth2_reject.rb +27 -0
  45. data/lib/appwrite/models/oauth2_token.rb +57 -0
  46. data/lib/appwrite/models/project.rb +10 -0
  47. data/lib/appwrite/models/project_auth_method.rb +3 -3
  48. data/lib/appwrite/services/account.rb +209 -0
  49. data/lib/appwrite/services/apps.rb +813 -0
  50. data/lib/appwrite/services/backups.rb +25 -12
  51. data/lib/appwrite/services/oauth2.rb +525 -0
  52. data/lib/appwrite/services/organization.rb +168 -0
  53. data/lib/appwrite/services/project.rb +3 -1
  54. data/lib/appwrite/services/sites.rb +3 -1
  55. data/lib/appwrite/services/tables_db.rb +134 -2
  56. data/lib/appwrite/services/teams.rb +198 -0
  57. data/lib/appwrite.rb +38 -0
  58. metadata +40 -2
@@ -84,6 +84,215 @@ module Appwrite
84
84
 
85
85
  end
86
86
 
87
+ # Get a list of the OAuth2 consents the current user has given to third-party
88
+ # apps.
89
+ #
90
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
91
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
92
+ #
93
+ # @return [Oauth2ConsentList]
94
+ def list_consents(queries: nil, total: nil)
95
+ api_path = '/account/consents'
96
+
97
+ api_params = {
98
+ queries: queries,
99
+ total: total,
100
+ }
101
+
102
+ api_headers = {
103
+ "X-Appwrite-Project": @client.get_config('project'),
104
+ "accept": 'application/json',
105
+ }
106
+
107
+ @client.call(
108
+ method: 'GET',
109
+ path: api_path,
110
+ headers: api_headers,
111
+ params: api_params,
112
+ response_type: Models::Oauth2ConsentList
113
+ )
114
+
115
+ end
116
+
117
+ # Get an OAuth2 consent the current user has given to a third-party app by
118
+ # its unique ID.
119
+ #
120
+ # @param [String] consent_id Consent unique ID.
121
+ #
122
+ # @return [Oauth2Consent]
123
+ def get_consent(consent_id:)
124
+ api_path = '/account/consents/{consentId}'
125
+ .gsub('{consentId}', consent_id)
126
+
127
+ if consent_id.nil?
128
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
129
+ end
130
+
131
+ api_params = {
132
+ }
133
+
134
+ api_headers = {
135
+ "X-Appwrite-Project": @client.get_config('project'),
136
+ "accept": 'application/json',
137
+ }
138
+
139
+ @client.call(
140
+ method: 'GET',
141
+ path: api_path,
142
+ headers: api_headers,
143
+ params: api_params,
144
+ response_type: Models::Oauth2Consent
145
+ )
146
+
147
+ end
148
+
149
+ # Delete an OAuth2 consent by its unique ID. All token families issued under
150
+ # the consent are revoked, and the app must ask for consent again to regain
151
+ # access.
152
+ #
153
+ # @param [String] consent_id Consent unique ID.
154
+ #
155
+ # @return []
156
+ def delete_consent(consent_id:)
157
+ api_path = '/account/consents/{consentId}'
158
+ .gsub('{consentId}', consent_id)
159
+
160
+ if consent_id.nil?
161
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
162
+ end
163
+
164
+ api_params = {
165
+ }
166
+
167
+ api_headers = {
168
+ "X-Appwrite-Project": @client.get_config('project'),
169
+ "content-type": 'application/json',
170
+ "accept": 'application/json',
171
+ }
172
+
173
+ @client.call(
174
+ method: 'DELETE',
175
+ path: api_path,
176
+ headers: api_headers,
177
+ params: api_params,
178
+ )
179
+
180
+ end
181
+
182
+ # Get a list of the token families issued under an OAuth2 consent. Each entry
183
+ # represents one authorized device or session; the token secrets themselves
184
+ # are never returned.
185
+ #
186
+ # @param [String] consent_id Consent unique ID.
187
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
188
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
189
+ #
190
+ # @return [Oauth2ConsentTokenList]
191
+ def list_consent_tokens(consent_id:, queries: nil, total: nil)
192
+ api_path = '/account/consents/{consentId}/tokens'
193
+ .gsub('{consentId}', consent_id)
194
+
195
+ if consent_id.nil?
196
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
197
+ end
198
+
199
+ api_params = {
200
+ queries: queries,
201
+ total: total,
202
+ }
203
+
204
+ api_headers = {
205
+ "X-Appwrite-Project": @client.get_config('project'),
206
+ "accept": 'application/json',
207
+ }
208
+
209
+ @client.call(
210
+ method: 'GET',
211
+ path: api_path,
212
+ headers: api_headers,
213
+ params: api_params,
214
+ response_type: Models::Oauth2ConsentTokenList
215
+ )
216
+
217
+ end
218
+
219
+ # Get a token family issued under an OAuth2 consent by its unique ID. The
220
+ # token secrets themselves are never returned.
221
+ #
222
+ # @param [String] consent_id Consent unique ID.
223
+ # @param [String] token_id Token unique ID.
224
+ #
225
+ # @return [Oauth2ConsentToken]
226
+ def get_consent_token(consent_id:, token_id:)
227
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
228
+ .gsub('{consentId}', consent_id)
229
+ .gsub('{tokenId}', token_id)
230
+
231
+ if consent_id.nil?
232
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
233
+ end
234
+
235
+ if token_id.nil?
236
+ raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
237
+ end
238
+
239
+ api_params = {
240
+ }
241
+
242
+ api_headers = {
243
+ "X-Appwrite-Project": @client.get_config('project'),
244
+ "accept": 'application/json',
245
+ }
246
+
247
+ @client.call(
248
+ method: 'GET',
249
+ path: api_path,
250
+ headers: api_headers,
251
+ params: api_params,
252
+ response_type: Models::Oauth2ConsentToken
253
+ )
254
+
255
+ end
256
+
257
+ # Delete a token family issued under an OAuth2 consent by its unique ID. The
258
+ # access and refresh tokens of the family stop working immediately; other
259
+ # token families and the consent itself are unaffected.
260
+ #
261
+ # @param [String] consent_id Consent unique ID.
262
+ # @param [String] token_id Token unique ID.
263
+ #
264
+ # @return []
265
+ def delete_consent_token(consent_id:, token_id:)
266
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
267
+ .gsub('{consentId}', consent_id)
268
+ .gsub('{tokenId}', token_id)
269
+
270
+ if consent_id.nil?
271
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
272
+ end
273
+
274
+ if token_id.nil?
275
+ raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
276
+ end
277
+
278
+ api_params = {
279
+ }
280
+
281
+ api_headers = {
282
+ "X-Appwrite-Project": @client.get_config('project'),
283
+ "content-type": 'application/json',
284
+ "accept": 'application/json',
285
+ }
286
+
287
+ @client.call(
288
+ method: 'DELETE',
289
+ path: api_path,
290
+ headers: api_headers,
291
+ params: api_params,
292
+ )
293
+
294
+ end
295
+
87
296
  # Update currently logged in user account email address. After changing user
88
297
  # address, the user confirmation status will get reset. A new confirmation
89
298
  # email is not sent automatically however you can use the send confirmation