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
@@ -0,0 +1,862 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Monitors < Service
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # Get a list of the project&#039;s monitors of every type. Use queries to filter
10
+ # by type, resource, severity or status, and `Query.search(&#039;search&#039;, term)`
11
+ # to search monitor IDs, names, metrics and resources.
12
+ #
13
+ # @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, type, resourceType, resourceId, enabled, severity, escalationId, status, evaluatedAt, triggeredAt, search
14
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
15
+ #
16
+ # @return [MonitorList]
17
+ def list(
18
+ queries: nil,
19
+ total: nil
20
+ )
21
+ api_path = '/monitors'
22
+
23
+ api_params = {
24
+ queries: queries,
25
+ total: total,
26
+ }
27
+
28
+ api_headers = {
29
+ "X-Appwrite-Project": @client.get_config('project'),
30
+ "accept": 'application/json',
31
+ }
32
+
33
+ @client.call(
34
+ method: 'GET',
35
+ path: api_path,
36
+ headers: api_headers,
37
+ params: api_params,
38
+ response_type: Models::MonitorList
39
+ )
40
+ end
41
+
42
+ # Create a DNS monitor. It asks a resolver for a domain&#039;s records of one type
43
+ # on its own interval, and opens an alert when the resolver fails, or when
44
+ # its rules match the answers, by default when there is no such record. Each
45
+ # alert fires the `monitors.[monitorId].alerts.[alertId].create` event when
46
+ # it opens and `.update` when a check passes again, for project webhooks,
47
+ # functions and realtime, and notifies the organization&#039;s members by email
48
+ # and in the console.
49
+ #
50
+ # @param [String] monitor_id Monitor 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&#039;t start with a special char. Max length is 36 chars.
51
+ # @param [String] name Monitor name. Max length: 128 chars.
52
+ # @param [String] domain Domain to query, such as `example.com`.
53
+ # @param [MonitorRecord] record Record type to query: `A`, `AAAA`, `CNAME`, `MX`, `TXT` or `NS`. Defaults to `A`.
54
+ # @param [String] resolver Resolver to query, as an IP address with an optional port, such as `1.1.1.1` or `[2606:4700:4700::1111]:53`. Defaults to the server&#039;s DNS resolver.
55
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `answer` (the first record returned, compared lowercased without the trailing dot), `answers` (number of records returned), `latency` (milliseconds the check took). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. `answer` takes `equal` and `notEqual` only. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires when the resolver returns no answers.
56
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Defaults to 60, or to the shortest interval your plan allows when that is longer. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
57
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
58
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
59
+ # @param [] enabled Set to false to create the monitor without checking it.
60
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Defaults to owners; pass an empty list to rely on the alert events alone.
61
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
62
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Leave empty to notify the `notify` roles once.
63
+ #
64
+ # @return [Monitor]
65
+ def create_dns_monitor(
66
+ monitor_id:,
67
+ name:,
68
+ domain:,
69
+ record: nil,
70
+ resolver: nil,
71
+ rules: nil,
72
+ interval: nil,
73
+ timeout: nil,
74
+ cooldown: nil,
75
+ enabled: nil,
76
+ notify: nil,
77
+ severity: nil,
78
+ escalation_id: nil
79
+ )
80
+ if monitor_id.nil?
81
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
82
+ end
83
+
84
+ if name.nil?
85
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
86
+ end
87
+
88
+ if domain.nil?
89
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
90
+ end
91
+
92
+ api_path = '/monitors/dns'
93
+
94
+ api_params = {
95
+ monitorId: monitor_id,
96
+ name: name,
97
+ domain: domain,
98
+ record: record,
99
+ resolver: resolver,
100
+ rules: rules,
101
+ interval: interval,
102
+ timeout: timeout,
103
+ cooldown: cooldown,
104
+ enabled: enabled,
105
+ notify: notify,
106
+ severity: severity,
107
+ escalationId: escalation_id,
108
+ }
109
+
110
+ api_headers = {
111
+ "X-Appwrite-Project": @client.get_config('project'),
112
+ "content-type": 'application/json',
113
+ "accept": 'application/json',
114
+ }
115
+
116
+ @client.call(
117
+ method: 'POST',
118
+ path: api_path,
119
+ headers: api_headers,
120
+ params: api_params,
121
+ response_type: Models::Monitor
122
+ )
123
+ end
124
+
125
+ # Update a DNS monitor by its unique ID. Only the parameters passed change;
126
+ # the monitor&#039;s state, its last check and its open alert are kept. Passing
127
+ # `rules` replaces all of them.
128
+ #
129
+ # @param [String] monitor_id Monitor ID.
130
+ # @param [String] name Monitor name. Max length: 128 chars.
131
+ # @param [String] domain Domain to query, such as `example.com`.
132
+ # @param [MonitorRecord] record Record type to query: `A`, `AAAA`, `CNAME`, `MX`, `TXT` or `NS`.
133
+ # @param [String] resolver Resolver to query, as an IP address with an optional port, such as `1.1.1.1` or `[2606:4700:4700::1111]:53`. Pass an empty string to use the server&#039;s DNS resolver.
134
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `answer` (the first record returned, compared lowercased without the trailing dot), `answers` (number of records returned), `latency` (milliseconds the check took). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. `answer` takes `equal` and `notEqual` only. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires when the resolver returns no answers. Replaces the current rules; an empty list restores the defaults.
135
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
136
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
137
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
138
+ # @param [] enabled Whether the monitor is checked.
139
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Pass an empty list to rely on the alert events alone.
140
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
141
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Pass an empty string to go back to the `notify` roles.
142
+ #
143
+ # @return [Monitor]
144
+ def update_dns_monitor(
145
+ monitor_id:,
146
+ name: nil,
147
+ domain: nil,
148
+ record: nil,
149
+ resolver: nil,
150
+ rules: nil,
151
+ interval: nil,
152
+ timeout: nil,
153
+ cooldown: nil,
154
+ enabled: nil,
155
+ notify: nil,
156
+ severity: nil,
157
+ escalation_id: nil
158
+ )
159
+ if monitor_id.nil? || monitor_id == ''
160
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
161
+ end
162
+
163
+ api_path = '/monitors/dns/{monitorId}'
164
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
165
+
166
+ api_params = {
167
+ name: name,
168
+ domain: domain,
169
+ record: record,
170
+ resolver: resolver,
171
+ rules: rules,
172
+ interval: interval,
173
+ timeout: timeout,
174
+ cooldown: cooldown,
175
+ enabled: enabled,
176
+ notify: notify,
177
+ severity: severity,
178
+ escalationId: escalation_id,
179
+ }
180
+
181
+ api_headers = {
182
+ "X-Appwrite-Project": @client.get_config('project'),
183
+ "content-type": 'application/json',
184
+ "accept": 'application/json',
185
+ }
186
+
187
+ @client.call(
188
+ method: 'PATCH',
189
+ path: api_path,
190
+ headers: api_headers,
191
+ params: api_params,
192
+ response_type: Models::Monitor
193
+ )
194
+ end
195
+
196
+ # Create an HTTP monitor. It requests a URL on its own interval, following
197
+ # redirects, and opens an alert when the request fails or when its rules
198
+ # match the response, by default a status outside 2xx or the certificate of
199
+ # an HTTPS URL about to expire. The response body is discarded as it arrives.
200
+ # Each alert fires the `monitors.[monitorId].alerts.[alertId].create` event
201
+ # when it opens and `.update` when a check passes again, for project
202
+ # webhooks, functions and realtime, and notifies the organization&#039;s members
203
+ # by email and in the console.
204
+ #
205
+ # @param [String] monitor_id Monitor 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&#039;t start with a special char. Max length is 36 chars.
206
+ # @param [String] name Monitor name. Max length: 128 chars.
207
+ # @param [String] url URL to request, with an `http` or `https` scheme.
208
+ # @param [MonitorMethod] method HTTP method to request the URL with: `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`. Defaults to `GET`.
209
+ # @param [Hash] headers HTTP headers to send, as an object of header names and values. Each name must be a valid HTTP header name.
210
+ # @param [String] body Request body to send. Max length: 16384 chars.
211
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `statusCode` (HTTP status), `latency` (milliseconds the check took), `certificateDays` (whole days until the certificate expires), `certificateLifetime` (percent of the certificate&#039;s lifetime left). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on a status code outside 200 to 299, or on a certificate with fewer than 14 days and less than 25% of its lifetime left.
212
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Defaults to 60, or to the shortest interval your plan allows when that is longer. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
213
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
214
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
215
+ # @param [] enabled Set to false to create the monitor without checking it.
216
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Defaults to owners; pass an empty list to rely on the alert events alone.
217
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
218
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Leave empty to notify the `notify` roles once.
219
+ #
220
+ # @return [Monitor]
221
+ def create_http_monitor(
222
+ monitor_id:,
223
+ name:,
224
+ url:,
225
+ method: nil,
226
+ headers: nil,
227
+ body: nil,
228
+ rules: nil,
229
+ interval: nil,
230
+ timeout: nil,
231
+ cooldown: nil,
232
+ enabled: nil,
233
+ notify: nil,
234
+ severity: nil,
235
+ escalation_id: nil
236
+ )
237
+ if monitor_id.nil?
238
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
239
+ end
240
+
241
+ if name.nil?
242
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
243
+ end
244
+
245
+ if url.nil?
246
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
247
+ end
248
+
249
+ api_path = '/monitors/http'
250
+
251
+ api_params = {
252
+ monitorId: monitor_id,
253
+ name: name,
254
+ url: url,
255
+ method: method,
256
+ headers: headers,
257
+ body: body,
258
+ rules: rules,
259
+ interval: interval,
260
+ timeout: timeout,
261
+ cooldown: cooldown,
262
+ enabled: enabled,
263
+ notify: notify,
264
+ severity: severity,
265
+ escalationId: escalation_id,
266
+ }
267
+
268
+ api_headers = {
269
+ "X-Appwrite-Project": @client.get_config('project'),
270
+ "content-type": 'application/json',
271
+ "accept": 'application/json',
272
+ }
273
+
274
+ @client.call(
275
+ method: 'POST',
276
+ path: api_path,
277
+ headers: api_headers,
278
+ params: api_params,
279
+ response_type: Models::Monitor
280
+ )
281
+ end
282
+
283
+ # Update an HTTP monitor by its unique ID. Only the parameters passed change;
284
+ # the monitor&#039;s state, its last check and its open alert are kept. Passing
285
+ # `rules` replaces all of them.
286
+ #
287
+ # @param [String] monitor_id Monitor ID.
288
+ # @param [String] name Monitor name. Max length: 128 chars.
289
+ # @param [String] url URL to request, with an `http` or `https` scheme.
290
+ # @param [MonitorMethod] method HTTP method to request the URL with: `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`.
291
+ # @param [Hash] headers HTTP headers to send, as an object of header names and values. Each name must be a valid HTTP header name.
292
+ # @param [String] body Request body to send. Max length: 16384 chars.
293
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `statusCode` (HTTP status), `latency` (milliseconds the check took), `certificateDays` (whole days until the certificate expires), `certificateLifetime` (percent of the certificate&#039;s lifetime left). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on a status code outside 200 to 299, or on a certificate with fewer than 14 days and less than 25% of its lifetime left. Replaces the current rules; an empty list restores the defaults.
294
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
295
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
296
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
297
+ # @param [] enabled Whether the monitor is checked.
298
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Pass an empty list to rely on the alert events alone.
299
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
300
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Pass an empty string to go back to the `notify` roles.
301
+ #
302
+ # @return [Monitor]
303
+ def update_http_monitor(
304
+ monitor_id:,
305
+ name: nil,
306
+ url: nil,
307
+ method: nil,
308
+ headers: nil,
309
+ body: nil,
310
+ rules: nil,
311
+ interval: nil,
312
+ timeout: nil,
313
+ cooldown: nil,
314
+ enabled: nil,
315
+ notify: nil,
316
+ severity: nil,
317
+ escalation_id: nil
318
+ )
319
+ if monitor_id.nil? || monitor_id == ''
320
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
321
+ end
322
+
323
+ api_path = '/monitors/http/{monitorId}'
324
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
325
+
326
+ api_params = {
327
+ name: name,
328
+ url: url,
329
+ method: method,
330
+ headers: headers,
331
+ body: body,
332
+ rules: rules,
333
+ interval: interval,
334
+ timeout: timeout,
335
+ cooldown: cooldown,
336
+ enabled: enabled,
337
+ notify: notify,
338
+ severity: severity,
339
+ escalationId: escalation_id,
340
+ }
341
+
342
+ api_headers = {
343
+ "X-Appwrite-Project": @client.get_config('project'),
344
+ "content-type": 'application/json',
345
+ "accept": 'application/json',
346
+ }
347
+
348
+ @client.call(
349
+ method: 'PATCH',
350
+ path: api_path,
351
+ headers: api_headers,
352
+ params: api_params,
353
+ response_type: Models::Monitor
354
+ )
355
+ end
356
+
357
+ # Create an SMTP monitor. It reads a mail server&#039;s greeting, sends `EHLO`
358
+ # and, as its TLS mode asks, upgrades with `STARTTLS` or speaks TLS from the
359
+ # start, on its own interval. It opens an alert when the server cannot be
360
+ # reached, refuses the session or fails the TLS handshake, or when its rules
361
+ # match. It never authenticates or sends mail. Each alert fires the
362
+ # `monitors.[monitorId].alerts.[alertId].create` event when it opens and
363
+ # `.update` when a check passes again, for project webhooks, functions and
364
+ # realtime, and notifies the organization&#039;s members by email and in the
365
+ # console.
366
+ #
367
+ # @param [String] monitor_id Monitor 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&#039;t start with a special char. Max length is 36 chars.
368
+ # @param [String] name Monitor name. Max length: 128 chars.
369
+ # @param [String] host Hostname or IP address of the mail server.
370
+ # @param [Integer] port Port to connect to, such as 25, 465 or 587.
371
+ # @param [MonitorTlsMode] tls_mode TLS mode: `auto` (`implicit` on port 465, `starttls` on 587 and `none` otherwise), `none`, `starttls` (upgrade after the greeting, and fail when the server does not offer it) or `implicit` (TLS from the first byte). Defaults to `auto`.
372
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `code` (SMTP reply code), `latency` (milliseconds the check took), `certificateDays` (whole days until the certificate expires), `certificateLifetime` (percent of the certificate&#039;s lifetime left). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on transport failures only.
373
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Defaults to 60, or to the shortest interval your plan allows when that is longer. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
374
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
375
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
376
+ # @param [] enabled Set to false to create the monitor without checking it.
377
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Defaults to owners; pass an empty list to rely on the alert events alone.
378
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
379
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Leave empty to notify the `notify` roles once.
380
+ #
381
+ # @return [Monitor]
382
+ def create_smtp_monitor(
383
+ monitor_id:,
384
+ name:,
385
+ host:,
386
+ port:,
387
+ tls_mode: nil,
388
+ rules: nil,
389
+ interval: nil,
390
+ timeout: nil,
391
+ cooldown: nil,
392
+ enabled: nil,
393
+ notify: nil,
394
+ severity: nil,
395
+ escalation_id: nil
396
+ )
397
+ if monitor_id.nil?
398
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
399
+ end
400
+
401
+ if name.nil?
402
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
403
+ end
404
+
405
+ if host.nil?
406
+ raise Appwrite::Exception.new('Missing required parameter: "host"')
407
+ end
408
+
409
+ if port.nil?
410
+ raise Appwrite::Exception.new('Missing required parameter: "port"')
411
+ end
412
+
413
+ api_path = '/monitors/smtp'
414
+
415
+ api_params = {
416
+ monitorId: monitor_id,
417
+ name: name,
418
+ host: host,
419
+ port: port,
420
+ tlsMode: tls_mode,
421
+ rules: rules,
422
+ interval: interval,
423
+ timeout: timeout,
424
+ cooldown: cooldown,
425
+ enabled: enabled,
426
+ notify: notify,
427
+ severity: severity,
428
+ escalationId: escalation_id,
429
+ }
430
+
431
+ api_headers = {
432
+ "X-Appwrite-Project": @client.get_config('project'),
433
+ "content-type": 'application/json',
434
+ "accept": 'application/json',
435
+ }
436
+
437
+ @client.call(
438
+ method: 'POST',
439
+ path: api_path,
440
+ headers: api_headers,
441
+ params: api_params,
442
+ response_type: Models::Monitor
443
+ )
444
+ end
445
+
446
+ # Update an SMTP monitor by its unique ID. Only the parameters passed change;
447
+ # the monitor&#039;s state, its last check and its open alert are kept. Passing
448
+ # `rules` replaces all of them.
449
+ #
450
+ # @param [String] monitor_id Monitor ID.
451
+ # @param [String] name Monitor name. Max length: 128 chars.
452
+ # @param [String] host Hostname or IP address of the mail server.
453
+ # @param [Integer] port Port to connect to, such as 25, 465 or 587.
454
+ # @param [MonitorTlsMode] tls_mode TLS mode: `auto` (`implicit` on port 465, `starttls` on 587 and `none` otherwise), `none`, `starttls` (upgrade after the greeting, and fail when the server does not offer it) or `implicit` (TLS from the first byte).
455
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `code` (SMTP reply code), `latency` (milliseconds the check took), `certificateDays` (whole days until the certificate expires), `certificateLifetime` (percent of the certificate&#039;s lifetime left). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on transport failures only. Replaces the current rules; an empty list removes them.
456
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
457
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
458
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
459
+ # @param [] enabled Whether the monitor is checked.
460
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Pass an empty list to rely on the alert events alone.
461
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
462
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Pass an empty string to go back to the `notify` roles.
463
+ #
464
+ # @return [Monitor]
465
+ def update_smtp_monitor(
466
+ monitor_id:,
467
+ name: nil,
468
+ host: nil,
469
+ port: nil,
470
+ tls_mode: nil,
471
+ rules: nil,
472
+ interval: nil,
473
+ timeout: nil,
474
+ cooldown: nil,
475
+ enabled: nil,
476
+ notify: nil,
477
+ severity: nil,
478
+ escalation_id: nil
479
+ )
480
+ if monitor_id.nil? || monitor_id == ''
481
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
482
+ end
483
+
484
+ api_path = '/monitors/smtp/{monitorId}'
485
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
486
+
487
+ api_params = {
488
+ name: name,
489
+ host: host,
490
+ port: port,
491
+ tlsMode: tls_mode,
492
+ rules: rules,
493
+ interval: interval,
494
+ timeout: timeout,
495
+ cooldown: cooldown,
496
+ enabled: enabled,
497
+ notify: notify,
498
+ severity: severity,
499
+ escalationId: escalation_id,
500
+ }
501
+
502
+ api_headers = {
503
+ "X-Appwrite-Project": @client.get_config('project'),
504
+ "content-type": 'application/json',
505
+ "accept": 'application/json',
506
+ }
507
+
508
+ @client.call(
509
+ method: 'PATCH',
510
+ path: api_path,
511
+ headers: api_headers,
512
+ params: api_params,
513
+ response_type: Models::Monitor
514
+ )
515
+ end
516
+
517
+ # Create a TCP monitor. It opens a connection to a host and port on its own
518
+ # interval and closes it at once, and opens an alert when the connection
519
+ # cannot be made, or when its rules match. Each alert fires the
520
+ # `monitors.[monitorId].alerts.[alertId].create` event when it opens and
521
+ # `.update` when a check passes again, for project webhooks, functions and
522
+ # realtime, and notifies the organization&#039;s members by email and in the
523
+ # console.
524
+ #
525
+ # @param [String] monitor_id Monitor 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&#039;t start with a special char. Max length is 36 chars.
526
+ # @param [String] name Monitor name. Max length: 128 chars.
527
+ # @param [String] host Hostname or IP address to connect to.
528
+ # @param [Integer] port Port to connect to.
529
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `latency` (milliseconds the check took). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on transport failures only.
530
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Defaults to 60, or to the shortest interval your plan allows when that is longer. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
531
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
532
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
533
+ # @param [] enabled Set to false to create the monitor without checking it.
534
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Defaults to owners; pass an empty list to rely on the alert events alone.
535
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
536
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Leave empty to notify the `notify` roles once.
537
+ #
538
+ # @return [Monitor]
539
+ def create_tcp_monitor(
540
+ monitor_id:,
541
+ name:,
542
+ host:,
543
+ port:,
544
+ rules: nil,
545
+ interval: nil,
546
+ timeout: nil,
547
+ cooldown: nil,
548
+ enabled: nil,
549
+ notify: nil,
550
+ severity: nil,
551
+ escalation_id: nil
552
+ )
553
+ if monitor_id.nil?
554
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
555
+ end
556
+
557
+ if name.nil?
558
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
559
+ end
560
+
561
+ if host.nil?
562
+ raise Appwrite::Exception.new('Missing required parameter: "host"')
563
+ end
564
+
565
+ if port.nil?
566
+ raise Appwrite::Exception.new('Missing required parameter: "port"')
567
+ end
568
+
569
+ api_path = '/monitors/tcp'
570
+
571
+ api_params = {
572
+ monitorId: monitor_id,
573
+ name: name,
574
+ host: host,
575
+ port: port,
576
+ rules: rules,
577
+ interval: interval,
578
+ timeout: timeout,
579
+ cooldown: cooldown,
580
+ enabled: enabled,
581
+ notify: notify,
582
+ severity: severity,
583
+ escalationId: escalation_id,
584
+ }
585
+
586
+ api_headers = {
587
+ "X-Appwrite-Project": @client.get_config('project'),
588
+ "content-type": 'application/json',
589
+ "accept": 'application/json',
590
+ }
591
+
592
+ @client.call(
593
+ method: 'POST',
594
+ path: api_path,
595
+ headers: api_headers,
596
+ params: api_params,
597
+ response_type: Models::Monitor
598
+ )
599
+ end
600
+
601
+ # Update a TCP monitor by its unique ID. Only the parameters passed change;
602
+ # the monitor&#039;s state, its last check and its open alert are kept. Passing
603
+ # `rules` replaces all of them.
604
+ #
605
+ # @param [String] monitor_id Monitor ID.
606
+ # @param [String] name Monitor name. Max length: 128 chars.
607
+ # @param [String] host Hostname or IP address to connect to.
608
+ # @param [Integer] port Port to connect to.
609
+ # @param [Array] rules Rules that describe the failing state, as query strings generated with the Query class. The monitor fires when they match. Transport failures, such as timeouts, DNS failures, refused connections and denied targets, always fire. Variables: `latency` (milliseconds the check took). Operators: `equal`, `notEqual`, `lessThan`, `lessThanEqual`, `greaterThan`, `greaterThanEqual`, `between`, `notBetween`. Combine rules with `or` and `and`; top-level rules must all match. Without rules it fires on transport failures only. Replaces the current rules; an empty list removes them.
610
+ # @param [Integer] interval Seconds between two checks, between 1 and 2592000. The scheduler runs on a one second tick, so one second is the shortest interval. Reads back raised to your plan&#039;s minimum interval when the plan no longer allows it.
611
+ # @param [Integer] timeout Seconds a check may take before it fails, between 1 and 60, and no longer than the interval.
612
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
613
+ # @param [] enabled Whether the monitor is checked.
614
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Pass an empty list to rely on the alert events alone.
615
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
616
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Pass an empty string to go back to the `notify` roles.
617
+ #
618
+ # @return [Monitor]
619
+ def update_tcp_monitor(
620
+ monitor_id:,
621
+ name: nil,
622
+ host: nil,
623
+ port: nil,
624
+ rules: nil,
625
+ interval: nil,
626
+ timeout: nil,
627
+ cooldown: nil,
628
+ enabled: nil,
629
+ notify: nil,
630
+ severity: nil,
631
+ escalation_id: nil
632
+ )
633
+ if monitor_id.nil? || monitor_id == ''
634
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
635
+ end
636
+
637
+ api_path = '/monitors/tcp/{monitorId}'
638
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
639
+
640
+ api_params = {
641
+ name: name,
642
+ host: host,
643
+ port: port,
644
+ rules: rules,
645
+ interval: interval,
646
+ timeout: timeout,
647
+ cooldown: cooldown,
648
+ enabled: enabled,
649
+ notify: notify,
650
+ severity: severity,
651
+ escalationId: escalation_id,
652
+ }
653
+
654
+ api_headers = {
655
+ "X-Appwrite-Project": @client.get_config('project'),
656
+ "content-type": 'application/json',
657
+ "accept": 'application/json',
658
+ }
659
+
660
+ @client.call(
661
+ method: 'PATCH',
662
+ path: api_path,
663
+ headers: api_headers,
664
+ params: api_params,
665
+ response_type: Models::Monitor
666
+ )
667
+ end
668
+
669
+ # Create a usage monitor. It reads a usage metric of the project, or of one
670
+ # of its databases, buckets, functions or sites, on a schedule, and opens an
671
+ # alert when all its rules hold. Each alert fires the
672
+ # `monitors.[monitorId].alerts.[alertId].create` event when it opens and
673
+ # `.update` when usage recovers, for project webhooks, functions and
674
+ # realtime, and notifies the confirmed members of the `notify` roles by email
675
+ # and in the console, or the steps of the escalation set by `escalationId`.
676
+ #
677
+ # @param [String] monitor_id Monitor 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&#039;t start with a special char. Max length is 36 chars.
678
+ # @param [String] name Monitor name. Max length: 128 chars.
679
+ # @param [Array] rules Rules that must all hold for the monitor to fire, as query strings generated with the Query class: one comparing a usage metric, named as the usage endpoints name it (such as `network.outbound` or `databases.operations.reads`), with a threshold in the metric&#039;s unit (bytes for storage and bandwidth, MB-seconds for GB-hours, a count otherwise), and optionally `equal` rules on `resourceType` and `resourceId` to watch one database, bucket, function or site instead of the whole project.
680
+ # @param [Integer] window Seconds a counter metric is summed over, between 60 and 2592000. Gauges compare their latest value.
681
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
682
+ # @param [] enabled Set to false to create the monitor without evaluating it.
683
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Defaults to owners; pass an empty list to rely on the alert events alone.
684
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode.
685
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Leave empty to notify the `notify` roles once.
686
+ #
687
+ # @return [Monitor]
688
+ def create_usage_monitor(
689
+ monitor_id:,
690
+ name:,
691
+ rules:,
692
+ window: nil,
693
+ cooldown: nil,
694
+ enabled: nil,
695
+ notify: nil,
696
+ severity: nil,
697
+ escalation_id: nil
698
+ )
699
+ if monitor_id.nil?
700
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
701
+ end
702
+
703
+ if name.nil?
704
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
705
+ end
706
+
707
+ if rules.nil?
708
+ raise Appwrite::Exception.new('Missing required parameter: "rules"')
709
+ end
710
+
711
+ api_path = '/monitors/usage'
712
+
713
+ api_params = {
714
+ monitorId: monitor_id,
715
+ name: name,
716
+ rules: rules,
717
+ window: window,
718
+ cooldown: cooldown,
719
+ enabled: enabled,
720
+ notify: notify,
721
+ severity: severity,
722
+ escalationId: escalation_id,
723
+ }
724
+
725
+ api_headers = {
726
+ "X-Appwrite-Project": @client.get_config('project'),
727
+ "content-type": 'application/json',
728
+ "accept": 'application/json',
729
+ }
730
+
731
+ @client.call(
732
+ method: 'POST',
733
+ path: api_path,
734
+ headers: api_headers,
735
+ params: api_params,
736
+ response_type: Models::Monitor
737
+ )
738
+ end
739
+
740
+ # Update a usage monitor by its unique ID. Only the parameters passed change;
741
+ # the monitor&#039;s state and its open alert are kept. Passing `rules` replaces
742
+ # all of them.
743
+ #
744
+ # @param [String] monitor_id Monitor ID.
745
+ # @param [String] name Monitor name. Max length: 128 chars.
746
+ # @param [Array] rules Rules that must all hold for the monitor to fire, as query strings generated with the Query class: one comparing a usage metric, named as the usage endpoints name it (such as `network.outbound` or `databases.operations.reads`), with a threshold in the metric&#039;s unit (bytes for storage and bandwidth, MB-seconds for GB-hours, a count otherwise), and optionally `equal` rules on `resourceType` and `resourceId` to watch one database, bucket, function or site instead of the whole project. Replaces the current rules.
747
+ # @param [Integer] window Seconds a counter metric is summed over, between 60 and 2592000. Gauges compare their latest value.
748
+ # @param [Integer] cooldown Minimum seconds between two team notifications of this monitor firing, between 300 and 2592000. Events fire on every change between firing and resolved regardless.
749
+ # @param [] enabled Whether the monitor is evaluated.
750
+ # @param [Array] notify Organization roles whose confirmed members get an email and a console notification when the monitor fires and resolves. Each must be an organization role, such as `owner` or `developer`. Pass an empty list to rely on the alert events alone; pass null or omit to keep the current roles.
751
+ # @param [MonitorSeverity] severity How urgent the monitor&#039;s alerts are: `info`, `warning`, `error` or `critical`. Critical alerts may be delivered with higher urgency by the notification channels that support it, such as a push that rings through silent mode. Omit to keep the current one.
752
+ # @param [String] escalation_id ID of an escalation of the organization that notifies the team of this monitor&#039;s alerts step by step, until a member acknowledges the alert or it resolves. When set, `notify` is not used. Pass an empty string to go back to the `notify` roles; pass null or omit to keep the current one.
753
+ #
754
+ # @return [Monitor]
755
+ def update_usage_monitor(
756
+ monitor_id:,
757
+ name: nil,
758
+ rules: nil,
759
+ window: nil,
760
+ cooldown: nil,
761
+ enabled: nil,
762
+ notify: nil,
763
+ severity: nil,
764
+ escalation_id: nil
765
+ )
766
+ if monitor_id.nil? || monitor_id == ''
767
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
768
+ end
769
+
770
+ api_path = '/monitors/usage/{monitorId}'
771
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
772
+
773
+ api_params = {
774
+ name: name,
775
+ rules: rules,
776
+ window: window,
777
+ cooldown: cooldown,
778
+ enabled: enabled,
779
+ notify: notify,
780
+ severity: severity,
781
+ escalationId: escalation_id,
782
+ }
783
+
784
+ api_headers = {
785
+ "X-Appwrite-Project": @client.get_config('project'),
786
+ "content-type": 'application/json',
787
+ "accept": 'application/json',
788
+ }
789
+
790
+ @client.call(
791
+ method: 'PATCH',
792
+ path: api_path,
793
+ headers: api_headers,
794
+ params: api_params,
795
+ response_type: Models::Monitor
796
+ )
797
+ end
798
+
799
+ # Get a monitor by its unique ID, with its state as of its last evaluation.
800
+ #
801
+ # @param [String] monitor_id Monitor ID.
802
+ #
803
+ # @return [Monitor]
804
+ def get(
805
+ monitor_id:
806
+ )
807
+ if monitor_id.nil? || monitor_id == ''
808
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
809
+ end
810
+
811
+ api_path = '/monitors/{monitorId}'
812
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
813
+
814
+ api_params = {}
815
+
816
+ api_headers = {
817
+ "X-Appwrite-Project": @client.get_config('project'),
818
+ "accept": 'application/json',
819
+ }
820
+
821
+ @client.call(
822
+ method: 'GET',
823
+ path: api_path,
824
+ headers: api_headers,
825
+ params: api_params,
826
+ response_type: Models::Monitor
827
+ )
828
+ end
829
+
830
+ # Delete a monitor by its unique ID. It stops being evaluated; an alert it is
831
+ # firing is resolved and kept with the rest of its alert history.
832
+ #
833
+ # @param [String] monitor_id Monitor ID.
834
+ #
835
+ # @return []
836
+ def delete(
837
+ monitor_id:
838
+ )
839
+ if monitor_id.nil? || monitor_id == ''
840
+ raise Appwrite::Exception.new('Missing required parameter: "monitorId"')
841
+ end
842
+
843
+ api_path = '/monitors/{monitorId}'
844
+ .gsub('{monitorId}', @client.encode_path(monitor_id))
845
+
846
+ api_params = {}
847
+
848
+ api_headers = {
849
+ "X-Appwrite-Project": @client.get_config('project'),
850
+ "content-type": 'application/json',
851
+ "accept": 'application/json',
852
+ }
853
+
854
+ @client.call(
855
+ method: 'DELETE',
856
+ path: api_path,
857
+ headers: api_headers,
858
+ params: api_params,
859
+ )
860
+ end
861
+ end
862
+ end