appwrite 30.3.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +1 -1
  3. data/lib/appwrite/enums/alert_comparator.rb +10 -0
  4. data/lib/appwrite/enums/alert_metric.rb +36 -0
  5. data/lib/appwrite/enums/alert_status.rb +8 -0
  6. data/lib/appwrite/enums/monitor_method.rb +13 -0
  7. data/lib/appwrite/enums/monitor_record.rb +12 -0
  8. data/lib/appwrite/enums/monitor_resource_type.rb +13 -0
  9. data/lib/appwrite/enums/monitor_result.rb +19 -0
  10. data/lib/appwrite/enums/monitor_severity.rb +10 -0
  11. data/lib/appwrite/enums/monitor_status.rb +8 -0
  12. data/lib/appwrite/enums/monitor_tls_mode.rb +10 -0
  13. data/lib/appwrite/enums/monitor_type.rb +12 -0
  14. data/lib/appwrite/enums/o_auth_provider.rb +13 -0
  15. data/lib/appwrite/enums/project_o_auth_provider_id.rb +13 -0
  16. data/lib/appwrite/models/alert.rb +308 -0
  17. data/lib/appwrite/models/alert_list.rb +33 -0
  18. data/lib/appwrite/models/escalation.rb +53 -0
  19. data/lib/appwrite/models/escalation_list.rb +33 -0
  20. data/lib/appwrite/models/escalation_step.rb +38 -0
  21. data/lib/appwrite/models/monitor.rb +342 -0
  22. data/lib/appwrite/models/monitor_list.rb +33 -0
  23. data/lib/appwrite/models/o_auth2_atlassian.rb +43 -0
  24. data/lib/appwrite/models/o_auth2_instagram.rb +43 -0
  25. data/lib/appwrite/models/o_auth2_line.rb +43 -0
  26. data/lib/appwrite/models/o_auth2_linear.rb +43 -0
  27. data/lib/appwrite/models/o_auth2_netlify.rb +43 -0
  28. data/lib/appwrite/models/o_auth2_patreon.rb +43 -0
  29. data/lib/appwrite/models/o_auth2_railway.rb +43 -0
  30. data/lib/appwrite/models/o_auth2_reddit.rb +43 -0
  31. data/lib/appwrite/models/o_auth2_roblox.rb +43 -0
  32. data/lib/appwrite/models/o_auth2_strava.rb +43 -0
  33. data/lib/appwrite/models/o_auth2_vercel.rb +43 -0
  34. data/lib/appwrite/models/o_auth2_vk.rb +43 -0
  35. data/lib/appwrite/models/o_auth2_work_os.rb +43 -0
  36. data/lib/appwrite/services/account.rb +1 -1
  37. data/lib/appwrite/services/alerts.rb +118 -0
  38. data/lib/appwrite/services/messaging.rb +208 -0
  39. data/lib/appwrite/services/monitors.rb +862 -0
  40. data/lib/appwrite/services/organization.rb +197 -0
  41. data/lib/appwrite/services/project.rb +521 -1
  42. data/lib/appwrite.rb +33 -0
  43. metadata +35 -2
@@ -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
  #