appwrite 30.5.0 → 30.7.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +1 -1
  3. data/lib/appwrite/enums/analytics_dimension.rb +32 -0
  4. data/lib/appwrite/enums/analytics_interval.rb +10 -0
  5. data/lib/appwrite/enums/analytics_property_type.rb +9 -0
  6. data/lib/appwrite/enums/video_caption_status.rb +11 -0
  7. data/lib/appwrite/enums/video_codec_id.rb +9 -0
  8. data/lib/appwrite/enums/video_output.rb +9 -0
  9. data/lib/appwrite/enums/video_rendition_status.rb +12 -0
  10. data/lib/appwrite/enums/video_timeline_status.rb +11 -0
  11. data/lib/appwrite/models/analytics_annotation.rb +58 -0
  12. data/lib/appwrite/models/analytics_annotation_list.rb +33 -0
  13. data/lib/appwrite/models/analytics_metric.rb +88 -0
  14. data/lib/appwrite/models/analytics_metric_list.rb +33 -0
  15. data/lib/appwrite/models/analytics_property.rb +94 -0
  16. data/lib/appwrite/models/analytics_property_list.rb +33 -0
  17. data/lib/appwrite/models/video.rb +166 -0
  18. data/lib/appwrite/models/video_caption.rb +111 -0
  19. data/lib/appwrite/models/video_caption_list.rb +33 -0
  20. data/lib/appwrite/models/video_codec.rb +56 -0
  21. data/lib/appwrite/models/video_codec_list.rb +33 -0
  22. data/lib/appwrite/models/video_list.rb +33 -0
  23. data/lib/appwrite/models/video_profile.rb +84 -0
  24. data/lib/appwrite/models/video_profile_list.rb +33 -0
  25. data/lib/appwrite/models/video_rendition.rb +165 -0
  26. data/lib/appwrite/models/video_rendition_list.rb +33 -0
  27. data/lib/appwrite/services/analytics.rb +594 -0
  28. data/lib/appwrite/services/project.rb +233 -0
  29. data/lib/appwrite/services/videos.rb +966 -0
  30. data/lib/appwrite.rb +26 -0
  31. metadata +28 -2
@@ -0,0 +1,594 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Analytics < Service
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # List analytics properties for the current project.
10
+ #
11
+ # @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, domain, enabled, type
12
+ # @param [String] search Search term to filter your list results. Matches the property ID, name and domain. Max length: 256 chars.
13
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
14
+ #
15
+ # @return [AnalyticsPropertyList]
16
+ def list_properties(
17
+ queries: nil,
18
+ search: nil,
19
+ total: nil
20
+ )
21
+ api_path = '/analytics/properties'
22
+
23
+ api_params = {
24
+ queries: queries,
25
+ search: search,
26
+ total: total,
27
+ }
28
+
29
+ api_headers = {
30
+ "X-Appwrite-Project": @client.get_config('project'),
31
+ "accept": 'application/json',
32
+ }
33
+
34
+ @client.call(
35
+ method: 'GET',
36
+ path: api_path,
37
+ headers: api_headers,
38
+ params: api_params,
39
+ response_type: Models::AnalyticsPropertyList
40
+ )
41
+ end
42
+
43
+ # Create a new analytics property to track a website or application.
44
+ #
45
+ # @param [String] property_id Unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Max length is 36 chars.
46
+ # @param [String] name Human-readable name for this property.
47
+ # @param [String] domain Primary domain to track (e.g. example.com). May be empty for mobile and agent properties.
48
+ # @param [] enabled Whether the property accepts events. Events sent to a disabled property are rejected as not found.
49
+ # @param [Array] allowed_origins Allowed origins for tracking. Use [&quot;*&quot;] to allow all.
50
+ # @param [] identify_users Record the signed-in user&#039;s ID on events sent from a client session, so traffic can be broken down and counted by user. Off by default.
51
+ # @param [AnalyticsPropertyType] type Kind of product this property tracks. Only changes which panels the dashboard shows; ingestion accepts the same events for every type.
52
+ #
53
+ # @return [AnalyticsProperty]
54
+ def create_property(
55
+ property_id:,
56
+ name:,
57
+ domain: nil,
58
+ enabled: nil,
59
+ allowed_origins: nil,
60
+ identify_users: nil,
61
+ type: nil
62
+ )
63
+ if property_id.nil?
64
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
65
+ end
66
+
67
+ if name.nil?
68
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
69
+ end
70
+
71
+ api_path = '/analytics/properties'
72
+
73
+ api_params = {
74
+ propertyId: property_id,
75
+ name: name,
76
+ domain: domain,
77
+ enabled: enabled,
78
+ allowedOrigins: allowed_origins,
79
+ identifyUsers: identify_users,
80
+ type: type,
81
+ }
82
+
83
+ api_headers = {
84
+ "X-Appwrite-Project": @client.get_config('project'),
85
+ "content-type": 'application/json',
86
+ "accept": 'application/json',
87
+ }
88
+
89
+ @client.call(
90
+ method: 'POST',
91
+ path: api_path,
92
+ headers: api_headers,
93
+ params: api_params,
94
+ response_type: Models::AnalyticsProperty
95
+ )
96
+ end
97
+
98
+ # Get an analytics property by ID.
99
+ #
100
+ # @param [String] property_id Analytics property unique ID.
101
+ #
102
+ # @return [AnalyticsProperty]
103
+ def get_property(
104
+ property_id:
105
+ )
106
+ if property_id.nil? || property_id == ''
107
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
108
+ end
109
+
110
+ api_path = '/analytics/properties/{propertyId}'
111
+ .gsub('{propertyId}', @client.encode_path(property_id))
112
+
113
+ api_params = {}
114
+
115
+ api_headers = {
116
+ "X-Appwrite-Project": @client.get_config('project'),
117
+ "accept": 'application/json',
118
+ }
119
+
120
+ @client.call(
121
+ method: 'GET',
122
+ path: api_path,
123
+ headers: api_headers,
124
+ params: api_params,
125
+ response_type: Models::AnalyticsProperty
126
+ )
127
+ end
128
+
129
+ # Update an analytics property. Only the attributes you pass are changed;
130
+ # omitted attributes keep their current value.
131
+ #
132
+ # @param [String] property_id Analytics property unique ID.
133
+ # @param [String] name Human-readable name for this property.
134
+ # @param [String] domain Primary domain to track (e.g. example.com). Pass an empty string to clear it.
135
+ # @param [] enabled Whether the property accepts events. Events sent to a disabled property are rejected as not found.
136
+ # @param [Array] allowed_origins Allowed origins for tracking. Use [&quot;*&quot;] to allow all. On a property linked to a site, Appwrite manages this list: it is rewritten from the site&#039;s production domains whenever they change.
137
+ # @param [] identify_users Record the signed-in user&#039;s ID on events sent from a client session, so traffic can be broken down and counted by user.
138
+ # @param [AnalyticsPropertyType] type Kind of product this property tracks. Only changes which panels the dashboard shows; stored events are kept.
139
+ #
140
+ # @return [AnalyticsProperty]
141
+ def update_property(
142
+ property_id:,
143
+ name: nil,
144
+ domain: nil,
145
+ enabled: nil,
146
+ allowed_origins: nil,
147
+ identify_users: nil,
148
+ type: nil
149
+ )
150
+ if property_id.nil? || property_id == ''
151
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
152
+ end
153
+
154
+ api_path = '/analytics/properties/{propertyId}'
155
+ .gsub('{propertyId}', @client.encode_path(property_id))
156
+
157
+ api_params = {
158
+ name: name,
159
+ domain: domain,
160
+ enabled: enabled,
161
+ allowedOrigins: allowed_origins,
162
+ identifyUsers: identify_users,
163
+ type: type,
164
+ }
165
+
166
+ api_headers = {
167
+ "X-Appwrite-Project": @client.get_config('project'),
168
+ "content-type": 'application/json',
169
+ "accept": 'application/json',
170
+ }
171
+
172
+ @client.call(
173
+ method: 'PATCH',
174
+ path: api_path,
175
+ headers: api_headers,
176
+ params: api_params,
177
+ response_type: Models::AnalyticsProperty
178
+ )
179
+ end
180
+
181
+ # Delete an analytics property along with every event and session collected
182
+ # for it. This cannot be undone.
183
+ #
184
+ # @param [String] property_id Analytics property unique ID.
185
+ #
186
+ # @return []
187
+ def delete_property(
188
+ property_id:
189
+ )
190
+ if property_id.nil? || property_id == ''
191
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
192
+ end
193
+
194
+ api_path = '/analytics/properties/{propertyId}'
195
+ .gsub('{propertyId}', @client.encode_path(property_id))
196
+
197
+ api_params = {}
198
+
199
+ api_headers = {
200
+ "X-Appwrite-Project": @client.get_config('project'),
201
+ "content-type": 'application/json',
202
+ "accept": 'application/json',
203
+ }
204
+
205
+ @client.call(
206
+ method: 'DELETE',
207
+ path: api_path,
208
+ headers: api_headers,
209
+ params: api_params,
210
+ )
211
+ end
212
+
213
+ # List the annotations of an analytics property. Filter on `date` to fetch
214
+ # the annotations inside a chart&#039;s time range.
215
+ #
216
+ # @param [String] property_id Analytics property unique ID.
217
+ # @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: date
218
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
219
+ #
220
+ # @return [AnalyticsAnnotationList]
221
+ def list_annotations(
222
+ property_id:,
223
+ queries: nil,
224
+ total: nil
225
+ )
226
+ if property_id.nil? || property_id == ''
227
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
228
+ end
229
+
230
+ api_path = '/analytics/properties/{propertyId}/annotations'
231
+ .gsub('{propertyId}', @client.encode_path(property_id))
232
+
233
+ api_params = {
234
+ queries: queries,
235
+ total: total,
236
+ }
237
+
238
+ api_headers = {
239
+ "X-Appwrite-Project": @client.get_config('project'),
240
+ "accept": 'application/json',
241
+ }
242
+
243
+ @client.call(
244
+ method: 'GET',
245
+ path: api_path,
246
+ headers: api_headers,
247
+ params: api_params,
248
+ response_type: Models::AnalyticsAnnotationList
249
+ )
250
+ end
251
+
252
+ # Create an annotation that marks a point in time on an analytics property&#039;s
253
+ # charts.
254
+ #
255
+ # @param [String] property_id Analytics property unique ID.
256
+ # @param [String] annotation_id Unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Max length is 36 chars.
257
+ # @param [String] date Point in time the annotation marks, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
258
+ # @param [String] content Annotation text. Max length: 512 chars.
259
+ #
260
+ # @return [AnalyticsAnnotation]
261
+ def create_annotation(
262
+ property_id:,
263
+ annotation_id:,
264
+ date:,
265
+ content:
266
+ )
267
+ if property_id.nil? || property_id == ''
268
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
269
+ end
270
+
271
+ if annotation_id.nil?
272
+ raise Appwrite::Exception.new('Missing required parameter: "annotationId"')
273
+ end
274
+
275
+ if date.nil?
276
+ raise Appwrite::Exception.new('Missing required parameter: "date"')
277
+ end
278
+
279
+ if content.nil?
280
+ raise Appwrite::Exception.new('Missing required parameter: "content"')
281
+ end
282
+
283
+ api_path = '/analytics/properties/{propertyId}/annotations'
284
+ .gsub('{propertyId}', @client.encode_path(property_id))
285
+
286
+ api_params = {
287
+ annotationId: annotation_id,
288
+ date: date,
289
+ content: content,
290
+ }
291
+
292
+ api_headers = {
293
+ "X-Appwrite-Project": @client.get_config('project'),
294
+ "content-type": 'application/json',
295
+ "accept": 'application/json',
296
+ }
297
+
298
+ @client.call(
299
+ method: 'POST',
300
+ path: api_path,
301
+ headers: api_headers,
302
+ params: api_params,
303
+ response_type: Models::AnalyticsAnnotation
304
+ )
305
+ end
306
+
307
+ # Get an analytics annotation by ID.
308
+ #
309
+ # @param [String] property_id Analytics property unique ID.
310
+ # @param [String] annotation_id Annotation unique ID.
311
+ #
312
+ # @return [AnalyticsAnnotation]
313
+ def get_annotation(
314
+ property_id:,
315
+ annotation_id:
316
+ )
317
+ if property_id.nil? || property_id == ''
318
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
319
+ end
320
+
321
+ if annotation_id.nil? || annotation_id == ''
322
+ raise Appwrite::Exception.new('Missing required parameter: "annotationId"')
323
+ end
324
+
325
+ api_path = '/analytics/properties/{propertyId}/annotations/{annotationId}'
326
+ .gsub('{propertyId}', @client.encode_path(property_id))
327
+ .gsub('{annotationId}', @client.encode_path(annotation_id))
328
+
329
+ api_params = {}
330
+
331
+ api_headers = {
332
+ "X-Appwrite-Project": @client.get_config('project'),
333
+ "accept": 'application/json',
334
+ }
335
+
336
+ @client.call(
337
+ method: 'GET',
338
+ path: api_path,
339
+ headers: api_headers,
340
+ params: api_params,
341
+ response_type: Models::AnalyticsAnnotation
342
+ )
343
+ end
344
+
345
+ # Update an analytics annotation. Only the attributes you pass are changed;
346
+ # omitted attributes keep their current value.
347
+ #
348
+ # @param [String] property_id Analytics property unique ID.
349
+ # @param [String] annotation_id Annotation unique ID.
350
+ # @param [String] date Point in time the annotation marks, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
351
+ # @param [String] content Annotation text. Max length: 512 chars.
352
+ #
353
+ # @return [AnalyticsAnnotation]
354
+ def update_annotation(
355
+ property_id:,
356
+ annotation_id:,
357
+ date: nil,
358
+ content: nil
359
+ )
360
+ if property_id.nil? || property_id == ''
361
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
362
+ end
363
+
364
+ if annotation_id.nil? || annotation_id == ''
365
+ raise Appwrite::Exception.new('Missing required parameter: "annotationId"')
366
+ end
367
+
368
+ api_path = '/analytics/properties/{propertyId}/annotations/{annotationId}'
369
+ .gsub('{propertyId}', @client.encode_path(property_id))
370
+ .gsub('{annotationId}', @client.encode_path(annotation_id))
371
+
372
+ api_params = {
373
+ date: date,
374
+ content: content,
375
+ }
376
+
377
+ api_headers = {
378
+ "X-Appwrite-Project": @client.get_config('project'),
379
+ "content-type": 'application/json',
380
+ "accept": 'application/json',
381
+ }
382
+
383
+ @client.call(
384
+ method: 'PATCH',
385
+ path: api_path,
386
+ headers: api_headers,
387
+ params: api_params,
388
+ response_type: Models::AnalyticsAnnotation
389
+ )
390
+ end
391
+
392
+ # Delete an analytics annotation.
393
+ #
394
+ # @param [String] property_id Analytics property unique ID.
395
+ # @param [String] annotation_id Annotation unique ID.
396
+ #
397
+ # @return []
398
+ def delete_annotation(
399
+ property_id:,
400
+ annotation_id:
401
+ )
402
+ if property_id.nil? || property_id == ''
403
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
404
+ end
405
+
406
+ if annotation_id.nil? || annotation_id == ''
407
+ raise Appwrite::Exception.new('Missing required parameter: "annotationId"')
408
+ end
409
+
410
+ api_path = '/analytics/properties/{propertyId}/annotations/{annotationId}'
411
+ .gsub('{propertyId}', @client.encode_path(property_id))
412
+ .gsub('{annotationId}', @client.encode_path(annotation_id))
413
+
414
+ api_params = {}
415
+
416
+ api_headers = {
417
+ "X-Appwrite-Project": @client.get_config('project'),
418
+ "content-type": 'application/json',
419
+ "accept": 'application/json',
420
+ }
421
+
422
+ @client.call(
423
+ method: 'DELETE',
424
+ path: api_path,
425
+ headers: api_headers,
426
+ params: api_params,
427
+ )
428
+ end
429
+
430
+ # Send a tracking event from a browser, native app, or server-side SDK.
431
+ #
432
+ # @param [String] property_id Analytics property ID.
433
+ # @param [String] name Event name. &quot;pageview&quot; and &quot;screen_view&quot; are counted as views, every other name is a custom event.
434
+ # @param [String] url Full page URL or screen identifier.
435
+ # @param [String] domain Hostname (e.g. example.com).
436
+ # @param [String] referrer Referrer URL.
437
+ # @param [Integer] screen_width Viewport width in CSS pixels.
438
+ # @param [String] session_hash Optional session hash (provided by SDK).
439
+ # @param [Integer] scroll_depth Scroll depth percentage 0-100.
440
+ # @param [Integer] engagement_time Engagement time in seconds, 0-4294967295.
441
+ # @param [Array] props Custom string properties as a flat key=value list (max 32 entries, alternating key,value).
442
+ # @param [String] user_id Override user ID. Pass an opaque ID, not personal data such as an email. Requires API-key auth with analytics.write scope.
443
+ # @param [String] ip Override IP address. Requires API-key auth with analytics.write scope.
444
+ # @param [String] user_agent Override user agent. Requires API-key auth with analytics.write scope.
445
+ # @param [] interactive Whether this event is a visitor interaction that ends a bounce. Set false for telemetry such as heartbeats or background syncs. Defaults to true for custom events and false for the automatic engagement, scroll and app lifecycle events. Ignored for views.
446
+ #
447
+ # @return []
448
+ def create_event(
449
+ property_id:,
450
+ name:,
451
+ url:,
452
+ domain: nil,
453
+ referrer: nil,
454
+ screen_width: nil,
455
+ session_hash: nil,
456
+ scroll_depth: nil,
457
+ engagement_time: nil,
458
+ props: nil,
459
+ user_id: nil,
460
+ ip: nil,
461
+ user_agent: nil,
462
+ interactive: nil
463
+ )
464
+ if property_id.nil? || property_id == ''
465
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
466
+ end
467
+
468
+ if name.nil?
469
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
470
+ end
471
+
472
+ if url.nil?
473
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
474
+ end
475
+
476
+ api_path = '/analytics/properties/{propertyId}/events'
477
+ .gsub('{propertyId}', @client.encode_path(property_id))
478
+
479
+ api_params = {
480
+ name: name,
481
+ url: url,
482
+ domain: domain,
483
+ referrer: referrer,
484
+ screenWidth: screen_width,
485
+ sessionHash: session_hash,
486
+ scrollDepth: scroll_depth,
487
+ engagementTime: engagement_time,
488
+ props: props,
489
+ userId: user_id,
490
+ ip: ip,
491
+ userAgent: user_agent,
492
+ interactive: interactive,
493
+ }
494
+
495
+ api_headers = {
496
+ "X-Appwrite-Project": @client.get_config('project'),
497
+ "content-type": 'application/json',
498
+ "accept": 'application/json',
499
+ }
500
+
501
+ @client.call(
502
+ method: 'POST',
503
+ path: api_path,
504
+ headers: api_headers,
505
+ params: api_params,
506
+ )
507
+ end
508
+
509
+ # Read analytics metrics (visitors, sessions, pageviews, events, bounceRate,
510
+ # …) for a property over a date range.
511
+ #
512
+ # **Three response shapes**, chosen by `dimensions[]` and `interval`:
513
+ # - Neither: one row aggregating the whole window, with `value` and `date`
514
+ # null. Only this shape carries `visits`, `bounceRate`, `visitDuration`,
515
+ # `viewsPerVisit`, `scrollDepth` and `engagementTime`.
516
+ # - `dimensions[]`: one row per dimension value, ranked by visitors, with
517
+ # `value` set and `date` null.
518
+ # - `interval`: one row per time bucket in chronological order, with `date`
519
+ # set and `value` null.
520
+ #
521
+ # `pageviews` is carried by the flat aggregate and by `interval`, but not by
522
+ # a breakdown.
523
+ #
524
+ # `userId` and `users` cover identified traffic only: events sent with an API
525
+ # key&#039;s `userId`, or from a signed-in session on a property with
526
+ # `identifyUsers` on. A `userId` breakdown leaves out anonymous events;
527
+ # returned values are the project&#039;s user IDs.
528
+ #
529
+ # Custom event props: `dimensions[]=props` ranks the prop keys seen in the
530
+ # window, and adding `propKey` ranks the values of that one key. `queries[]`
531
+ # filters on a prop&#039;s value with the `props.&lt;key&gt;` attribute, e.g.
532
+ # `equal(&quot;props.plan&quot;, [&quot;pro&quot;])`.
533
+ #
534
+ # Combining `dimensions[]` with `interval` is not supported yet. `queries[]`
535
+ # filters the underlying events using standard Utopia query syntax.
536
+ #
537
+ # @param [String] property_id Analytics property unique ID.
538
+ # @param [Array] queries Up to 10 filter queries in Utopia syntax. Allowed attributes: country, region, city, browser, browserVersion, operatingSystem, operatingSystemVersion, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, trafficType, botName, botCategory, userId, eventName, and `props.&lt;key&gt;` for a custom prop. page, userId, eventName and `props.&lt;key&gt;` are only accepted alongside `interval`, or with a breakdown on a dimension other than entryPage, exitPage. Allowed methods: equal, notEqual, contains, startsWith, endsWith. Example: `queries[]=equal(&quot;country&quot;, [&quot;US&quot;])`.
539
+ # @param [AnalyticsInterval] interval Time bucket size. Omit (null) for a flat aggregate over the whole window. Allowed: 1h, 1d, 1w, 1m.
540
+ # @param [Array] dimensions Dimension to break the metrics down by. One at most for now; the parameter is a list so that cap can be raised without a breaking change. Allowed: country, region, city, browser, browserVersion, operatingSystem, operatingSystemVersion, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, entryPage, exitPage, trafficType, botName, botCategory, userId, eventName, props.
541
+ # @param [String] prop_key Custom prop key whose values to rank, with `dimensions[]=props`. Omit to rank the prop keys themselves.
542
+ # @param [String] date_range Date range shorthand (e.g. 7d, 30d). Ignored for any bound you supply explicitly via startAt/endAt.
543
+ # @param [String] start_at Explicit window start in ISO 8601. Defaults to endAt minus dateRange.
544
+ # @param [String] end_at Explicit window end in ISO 8601. Defaults to the current time.
545
+ # @param [Integer] limit Maximum number of ranked values to return.
546
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
547
+ #
548
+ # @return [AnalyticsMetricList]
549
+ def list_metrics(
550
+ property_id:,
551
+ queries: nil,
552
+ interval: nil,
553
+ dimensions: nil,
554
+ prop_key: nil,
555
+ date_range: nil,
556
+ start_at: nil,
557
+ end_at: nil,
558
+ limit: nil,
559
+ total: nil
560
+ )
561
+ if property_id.nil? || property_id == ''
562
+ raise Appwrite::Exception.new('Missing required parameter: "propertyId"')
563
+ end
564
+
565
+ api_path = '/analytics/properties/{propertyId}/metrics'
566
+ .gsub('{propertyId}', @client.encode_path(property_id))
567
+
568
+ api_params = {
569
+ queries: queries,
570
+ interval: interval,
571
+ dimensions: dimensions,
572
+ propKey: prop_key,
573
+ dateRange: date_range,
574
+ startAt: start_at,
575
+ endAt: end_at,
576
+ limit: limit,
577
+ total: total,
578
+ }
579
+
580
+ api_headers = {
581
+ "X-Appwrite-Project": @client.get_config('project'),
582
+ "accept": 'application/json',
583
+ }
584
+
585
+ @client.call(
586
+ method: 'GET',
587
+ path: api_path,
588
+ headers: api_headers,
589
+ params: api_params,
590
+ response_type: Models::AnalyticsMetricList
591
+ )
592
+ end
593
+ end
594
+ end