appwrite 30.4.0 → 30.5.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.
@@ -86,6 +86,203 @@ module Appwrite
86
86
  )
87
87
  end
88
88
 
89
+ # Get a list of your organization's escalations. Use `Query.search('search',
90
+ # term)` to search escalation IDs and names.
91
+ #
92
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, repeat, search
93
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
94
+ #
95
+ # @return [EscalationList]
96
+ def list_escalations(
97
+ queries: nil,
98
+ total: nil
99
+ )
100
+ api_path = '/organization/escalations'
101
+
102
+ api_params = {
103
+ queries: queries,
104
+ total: total,
105
+ }
106
+
107
+ api_headers = {
108
+ "X-Appwrite-Project": @client.get_config('project'),
109
+ "accept": 'application/json',
110
+ }
111
+
112
+ @client.call(
113
+ method: 'GET',
114
+ path: api_path,
115
+ headers: api_headers,
116
+ params: api_params,
117
+ response_type: Models::EscalationList
118
+ )
119
+ end
120
+
121
+ # Create an escalation for your organization. A monitor using it notifies the
122
+ # escalation's steps one after another while its alert fires, each by email,
123
+ # push and in the console, until a member acknowledges the alert or it
124
+ # resolves. Each step waits its `delay` in seconds, after the alert fires for
125
+ # the first step and after the previous step for the others, then notifies
126
+ # the members holding its `roles` and those named in `userIds`. With
127
+ # `repeat`, the steps run again from the first, a monitor's cooldown after
128
+ # the last step.
129
+ #
130
+ # @param [String] escalation_id Escalation 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.
131
+ # @param [String] name Escalation name. Max length: 128 chars.
132
+ # @param [Array] steps Steps notified in order while nobody acknowledges the alert. Each step is an object with `delay` (seconds to wait before the step, 0 to 2592000, default 0), `roles` (organization roles such as `owner` or `developer`) and `userIds` (organization members who accepted their invitation). A step names each role and member at most once and needs at least one of `roles` or `userIds`. Maximum of 100 steps.
133
+ # @param [Integer] repeat How many more times the steps run from the first while nobody acknowledges the alert, between 0 and 9. Each round starts a monitor's cooldown after the last step.
134
+ #
135
+ # @return [Escalation]
136
+ def create_escalation(
137
+ escalation_id:,
138
+ name:,
139
+ steps:,
140
+ repeat: nil
141
+ )
142
+ if escalation_id.nil?
143
+ raise Appwrite::Exception.new('Missing required parameter: "escalationId"')
144
+ end
145
+
146
+ if name.nil?
147
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
148
+ end
149
+
150
+ if steps.nil?
151
+ raise Appwrite::Exception.new('Missing required parameter: "steps"')
152
+ end
153
+
154
+ api_path = '/organization/escalations'
155
+
156
+ api_params = {
157
+ escalationId: escalation_id,
158
+ name: name,
159
+ steps: steps,
160
+ repeat: repeat,
161
+ }
162
+
163
+ api_headers = {
164
+ "X-Appwrite-Project": @client.get_config('project'),
165
+ "content-type": 'application/json',
166
+ "accept": 'application/json',
167
+ }
168
+
169
+ @client.call(
170
+ method: 'POST',
171
+ path: api_path,
172
+ headers: api_headers,
173
+ params: api_params,
174
+ response_type: Models::Escalation
175
+ )
176
+ end
177
+
178
+ # Get one of your organization's escalations by its ID.
179
+ #
180
+ # @param [String] escalation_id Escalation ID.
181
+ #
182
+ # @return [Escalation]
183
+ def get_escalation(
184
+ escalation_id:
185
+ )
186
+ if escalation_id.nil? || escalation_id == ''
187
+ raise Appwrite::Exception.new('Missing required parameter: "escalationId"')
188
+ end
189
+
190
+ api_path = '/organization/escalations/{escalationId}'
191
+ .gsub('{escalationId}', @client.encode_path(escalation_id))
192
+
193
+ api_params = {}
194
+
195
+ api_headers = {
196
+ "X-Appwrite-Project": @client.get_config('project'),
197
+ "accept": 'application/json',
198
+ }
199
+
200
+ @client.call(
201
+ method: 'GET',
202
+ path: api_path,
203
+ headers: api_headers,
204
+ params: api_params,
205
+ response_type: Models::Escalation
206
+ )
207
+ end
208
+
209
+ # Update an escalation's name, steps or repeats; what you leave out stays as
210
+ # it is. Alerts already escalating keep the steps they started with; the next
211
+ # alert uses the new ones.
212
+ #
213
+ # @param [String] escalation_id Escalation ID.
214
+ # @param [String] name Escalation name. Max length: 128 chars.
215
+ # @param [Array] steps Steps notified in order while nobody acknowledges the alert. Each step is an object with `delay` (seconds to wait before the step, 0 to 2592000, default 0), `roles` (organization roles such as `owner` or `developer`) and `userIds` (organization members who accepted their invitation). A step names each role and member at most once and needs at least one of `roles` or `userIds`. Maximum of 100 steps.
216
+ # @param [Integer] repeat How many more times the steps run from the first while nobody acknowledges the alert, between 0 and 9. Each round starts a monitor's cooldown after the last step.
217
+ #
218
+ # @return [Escalation]
219
+ def update_escalation(
220
+ escalation_id:,
221
+ name: nil,
222
+ steps: nil,
223
+ repeat: nil
224
+ )
225
+ if escalation_id.nil? || escalation_id == ''
226
+ raise Appwrite::Exception.new('Missing required parameter: "escalationId"')
227
+ end
228
+
229
+ api_path = '/organization/escalations/{escalationId}'
230
+ .gsub('{escalationId}', @client.encode_path(escalation_id))
231
+
232
+ api_params = {
233
+ name: name,
234
+ steps: steps,
235
+ repeat: repeat,
236
+ }
237
+
238
+ api_headers = {
239
+ "X-Appwrite-Project": @client.get_config('project'),
240
+ "content-type": 'application/json',
241
+ "accept": 'application/json',
242
+ }
243
+
244
+ @client.call(
245
+ method: 'PATCH',
246
+ path: api_path,
247
+ headers: api_headers,
248
+ params: api_params,
249
+ response_type: Models::Escalation
250
+ )
251
+ end
252
+
253
+ # Delete an escalation. An escalation that a monitor uses cannot be deleted:
254
+ # move the monitor to another escalation or to `notify` roles first. Open
255
+ # alerts keep the steps they started with.
256
+ #
257
+ # @param [String] escalation_id Escalation ID.
258
+ #
259
+ # @return []
260
+ def delete_escalation(
261
+ escalation_id:
262
+ )
263
+ if escalation_id.nil? || escalation_id == ''
264
+ raise Appwrite::Exception.new('Missing required parameter: "escalationId"')
265
+ end
266
+
267
+ api_path = '/organization/escalations/{escalationId}'
268
+ .gsub('{escalationId}', @client.encode_path(escalation_id))
269
+
270
+ api_params = {}
271
+
272
+ api_headers = {
273
+ "X-Appwrite-Project": @client.get_config('project'),
274
+ "content-type": 'application/json',
275
+ "accept": 'application/json',
276
+ }
277
+
278
+ @client.call(
279
+ method: 'DELETE',
280
+ path: api_path,
281
+ headers: api_headers,
282
+ params: api_params,
283
+ )
284
+ end
285
+
89
286
  # List app installations on the organization. Any organization member can
90
287
  # read installations.
91
288
  #
data/lib/appwrite.rb CHANGED
@@ -40,6 +40,9 @@ require_relative 'appwrite/models/deployment_list'
40
40
  require_relative 'appwrite/models/execution_list'
41
41
  require_relative 'appwrite/models/project_list'
42
42
  require_relative 'appwrite/models/webhook_list'
43
+ require_relative 'appwrite/models/monitor_list'
44
+ require_relative 'appwrite/models/alert_list'
45
+ require_relative 'appwrite/models/escalation_list'
43
46
  require_relative 'appwrite/models/key_list'
44
47
  require_relative 'appwrite/models/country_list'
45
48
  require_relative 'appwrite/models/continent_list'
@@ -148,6 +151,10 @@ require_relative 'appwrite/models/project_auth_method'
148
151
  require_relative 'appwrite/models/project_service'
149
152
  require_relative 'appwrite/models/project_protocol'
150
153
  require_relative 'appwrite/models/webhook'
154
+ require_relative 'appwrite/models/monitor'
155
+ require_relative 'appwrite/models/alert'
156
+ require_relative 'appwrite/models/escalation_step'
157
+ require_relative 'appwrite/models/escalation'
151
158
  require_relative 'appwrite/models/key'
152
159
  require_relative 'appwrite/models/ephemeral_key'
153
160
  require_relative 'appwrite/models/mock_number'
@@ -392,6 +399,10 @@ require_relative 'appwrite/enums/on_duplicate'
392
399
  require_relative 'appwrite/enums/firebase_migration_resource'
393
400
  require_relative 'appwrite/enums/n_host_migration_resource'
394
401
  require_relative 'appwrite/enums/supabase_migration_resource'
402
+ require_relative 'appwrite/enums/monitor_record'
403
+ require_relative 'appwrite/enums/monitor_severity'
404
+ require_relative 'appwrite/enums/monitor_method'
405
+ require_relative 'appwrite/enums/monitor_tls_mode'
395
406
  require_relative 'appwrite/enums/region'
396
407
  require_relative 'appwrite/enums/project_auth_method_id'
397
408
  require_relative 'appwrite/enums/environment_resource'
@@ -434,6 +445,13 @@ require_relative 'appwrite/enums/deployment_status'
434
445
  require_relative 'appwrite/enums/execution_resource_type'
435
446
  require_relative 'appwrite/enums/execution_trigger'
436
447
  require_relative 'appwrite/enums/execution_status'
448
+ require_relative 'appwrite/enums/monitor_type'
449
+ require_relative 'appwrite/enums/monitor_resource_type'
450
+ require_relative 'appwrite/enums/monitor_status'
451
+ require_relative 'appwrite/enums/monitor_result'
452
+ require_relative 'appwrite/enums/alert_status'
453
+ require_relative 'appwrite/enums/alert_metric'
454
+ require_relative 'appwrite/enums/alert_comparator'
437
455
  require_relative 'appwrite/enums/o_auth2_github_prompt'
438
456
  require_relative 'appwrite/enums/o_auth2_discord_prompt'
439
457
  require_relative 'appwrite/enums/o_auth2_google_prompt'
@@ -455,6 +473,7 @@ require_relative 'appwrite/enums/waf_rule_action'
455
473
 
456
474
  require_relative 'appwrite/services/account'
457
475
  require_relative 'appwrite/services/activities'
476
+ require_relative 'appwrite/services/alerts'
458
477
  require_relative 'appwrite/services/apps'
459
478
  require_relative 'appwrite/services/avatars'
460
479
  require_relative 'appwrite/services/backups'
@@ -468,6 +487,7 @@ require_relative 'appwrite/services/locale'
468
487
  require_relative 'appwrite/services/messaging'
469
488
  require_relative 'appwrite/services/migrations'
470
489
  require_relative 'appwrite/services/mongo'
490
+ require_relative 'appwrite/services/monitors'
471
491
  require_relative 'appwrite/services/mysql'
472
492
  require_relative 'appwrite/services/oauth2'
473
493
  require_relative 'appwrite/services/organization'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 30.4.0
4
+ version: 30.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-25 00:00:00.000000000 Z
11
+ date: 2026-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -33,6 +33,9 @@ files:
33
33
  - lib/appwrite.rb
34
34
  - lib/appwrite/client.rb
35
35
  - lib/appwrite/enums/adapter.rb
36
+ - lib/appwrite/enums/alert_comparator.rb
37
+ - lib/appwrite/enums/alert_metric.rb
38
+ - lib/appwrite/enums/alert_status.rb
36
39
  - lib/appwrite/enums/appwrite_migration_resource.rb
37
40
  - lib/appwrite/enums/attribute_status.rb
38
41
  - lib/appwrite/enums/authentication_factor.rb
@@ -71,6 +74,14 @@ files:
71
74
  - lib/appwrite/enums/message_priority.rb
72
75
  - lib/appwrite/enums/message_status.rb
73
76
  - lib/appwrite/enums/messaging_provider_type.rb
77
+ - lib/appwrite/enums/monitor_method.rb
78
+ - lib/appwrite/enums/monitor_record.rb
79
+ - lib/appwrite/enums/monitor_resource_type.rb
80
+ - lib/appwrite/enums/monitor_result.rb
81
+ - lib/appwrite/enums/monitor_severity.rb
82
+ - lib/appwrite/enums/monitor_status.rb
83
+ - lib/appwrite/enums/monitor_tls_mode.rb
84
+ - lib/appwrite/enums/monitor_type.rb
74
85
  - lib/appwrite/enums/n_host_migration_resource.rb
75
86
  - lib/appwrite/enums/o_auth2_auth0_prompt.rb
76
87
  - lib/appwrite/enums/o_auth2_discord_prompt.rb
@@ -131,6 +142,8 @@ files:
131
142
  - lib/appwrite/models/activity_event.rb
132
143
  - lib/appwrite/models/activity_event_list.rb
133
144
  - lib/appwrite/models/additional_resource.rb
145
+ - lib/appwrite/models/alert.rb
146
+ - lib/appwrite/models/alert_list.rb
134
147
  - lib/appwrite/models/algo_argon2.rb
135
148
  - lib/appwrite/models/algo_bcrypt.rb
136
149
  - lib/appwrite/models/algo_md5.rb
@@ -262,6 +275,9 @@ files:
262
275
  - lib/appwrite/models/environment.rb
263
276
  - lib/appwrite/models/environment_list.rb
264
277
  - lib/appwrite/models/ephemeral_key.rb
278
+ - lib/appwrite/models/escalation.rb
279
+ - lib/appwrite/models/escalation_list.rb
280
+ - lib/appwrite/models/escalation_step.rb
265
281
  - lib/appwrite/models/execution.rb
266
282
  - lib/appwrite/models/execution_list.rb
267
283
  - lib/appwrite/models/file.rb
@@ -300,6 +316,8 @@ files:
300
316
  - lib/appwrite/models/migration_list.rb
301
317
  - lib/appwrite/models/mock_number.rb
302
318
  - lib/appwrite/models/mock_number_list.rb
319
+ - lib/appwrite/models/monitor.rb
320
+ - lib/appwrite/models/monitor_list.rb
303
321
  - lib/appwrite/models/o_auth2_amazon.rb
304
322
  - lib/appwrite/models/o_auth2_apple.rb
305
323
  - lib/appwrite/models/o_auth2_appwrite.rb
@@ -479,6 +497,7 @@ files:
479
497
  - lib/appwrite/services/account.rb
480
498
  - lib/appwrite/services/activities.rb
481
499
  - lib/appwrite/services/advisor.rb
500
+ - lib/appwrite/services/alerts.rb
482
501
  - lib/appwrite/services/apps.rb
483
502
  - lib/appwrite/services/avatars.rb
484
503
  - lib/appwrite/services/backups.rb
@@ -492,6 +511,7 @@ files:
492
511
  - lib/appwrite/services/messaging.rb
493
512
  - lib/appwrite/services/migrations.rb
494
513
  - lib/appwrite/services/mongo.rb
514
+ - lib/appwrite/services/monitors.rb
495
515
  - lib/appwrite/services/mysql.rb
496
516
  - lib/appwrite/services/oauth2.rb
497
517
  - lib/appwrite/services/organization.rb