getstream-ruby 3.0.0.beta.1 → 3.0.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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/getstream_ruby/client.rb +12 -0
  3. data/lib/getstream_ruby/generated/chat_client.rb +1652 -0
  4. data/lib/getstream_ruby/generated/common_client.rb +14 -14
  5. data/lib/getstream_ruby/generated/feed.rb +3 -1
  6. data/lib/getstream_ruby/generated/feeds_client.rb +29 -3
  7. data/lib/getstream_ruby/generated/models/activity_response.rb +15 -0
  8. data/lib/getstream_ruby/generated/models/add_activity_request.rb +5 -0
  9. data/lib/getstream_ruby/generated/models/aggregated_activity_response.rb +10 -0
  10. data/lib/getstream_ruby/generated/models/app_response_fields.rb +5 -0
  11. data/lib/getstream_ruby/generated/models/async_export_error_event.rb +1 -1
  12. data/lib/getstream_ruby/generated/models/block_list_config.rb +5 -0
  13. data/lib/getstream_ruby/generated/models/channel_batch_member_request.rb +36 -0
  14. data/lib/getstream_ruby/generated/models/channel_batch_update_request.rb +46 -0
  15. data/lib/getstream_ruby/generated/models/channel_batch_update_response.rb +36 -0
  16. data/lib/getstream_ruby/generated/models/channel_data_update.rb +61 -0
  17. data/lib/getstream_ruby/generated/models/check_s3_access_request.rb +31 -0
  18. data/lib/getstream_ruby/generated/models/check_s3_access_response.rb +41 -0
  19. data/lib/getstream_ruby/generated/models/create_feeds_batch_request.rb +6 -1
  20. data/lib/getstream_ruby/generated/models/delete_activity_reaction_request.rb +14 -0
  21. data/lib/getstream_ruby/generated/models/delete_activity_request.rb +1 -23
  22. data/lib/getstream_ruby/generated/models/delete_block_list_request.rb +14 -0
  23. data/lib/getstream_ruby/generated/models/delete_bookmark_folder_request.rb +36 -0
  24. data/lib/getstream_ruby/generated/models/delete_bookmark_request.rb +14 -0
  25. data/lib/getstream_ruby/generated/models/delete_call_type_request.rb +14 -0
  26. data/lib/getstream_ruby/generated/models/delete_channel_request.rb +14 -0
  27. data/lib/getstream_ruby/generated/models/delete_collections_request.rb +36 -0
  28. data/lib/getstream_ruby/generated/models/delete_command_request.rb +14 -0
  29. data/lib/getstream_ruby/generated/models/delete_comment_reaction_request.rb +14 -0
  30. data/lib/getstream_ruby/generated/models/delete_comment_request.rb +1 -23
  31. data/lib/getstream_ruby/generated/models/delete_custom_role_request.rb +14 -0
  32. data/lib/getstream_ruby/generated/models/delete_device_request.rb +14 -0
  33. data/lib/getstream_ruby/generated/models/delete_draft_request.rb +14 -0
  34. data/lib/getstream_ruby/generated/models/delete_external_storage_request.rb +14 -0
  35. data/lib/getstream_ruby/generated/models/delete_feed_group_request.rb +14 -0
  36. data/lib/getstream_ruby/generated/models/delete_feed_request.rb +14 -0
  37. data/lib/getstream_ruby/generated/models/delete_feed_view_request.rb +14 -0
  38. data/lib/getstream_ruby/generated/models/delete_import_v2_task_request.rb +14 -0
  39. data/lib/getstream_ruby/generated/models/delete_membership_level_request.rb +14 -0
  40. data/lib/getstream_ruby/generated/models/delete_message_request.rb +1 -23
  41. data/lib/getstream_ruby/generated/models/delete_moderation_config_request.rb +14 -0
  42. data/lib/getstream_ruby/generated/models/delete_moderation_template_request.rb +31 -0
  43. data/lib/getstream_ruby/generated/models/delete_poll_option_request.rb +14 -0
  44. data/lib/getstream_ruby/generated/models/delete_poll_request.rb +14 -0
  45. data/lib/getstream_ruby/generated/models/delete_poll_vote_request.rb +14 -0
  46. data/lib/getstream_ruby/generated/models/delete_push_provider_request.rb +14 -0
  47. data/lib/getstream_ruby/generated/models/delete_reaction_request.rb +2 -24
  48. data/lib/getstream_ruby/generated/models/delete_recording_request.rb +14 -0
  49. data/lib/getstream_ruby/generated/models/delete_reminder_request.rb +14 -0
  50. data/lib/getstream_ruby/generated/models/delete_segment_request.rb +14 -0
  51. data/lib/getstream_ruby/generated/models/delete_sip_inbound_routing_rule_request.rb +14 -0
  52. data/lib/getstream_ruby/generated/models/delete_sip_trunk_request.rb +14 -0
  53. data/lib/getstream_ruby/generated/models/delete_transcription_request.rb +14 -0
  54. data/lib/getstream_ruby/generated/models/delete_user_group_request.rb +14 -0
  55. data/lib/getstream_ruby/generated/models/feed_own_capability.rb +1 -1
  56. data/lib/getstream_ruby/generated/models/feed_updated_event.rb +1 -1
  57. data/lib/getstream_ruby/generated/models/file_delete_request.rb +14 -0
  58. data/lib/getstream_ruby/generated/models/follow_batch_request.rb +6 -1
  59. data/lib/getstream_ruby/generated/models/follow_request.rb +5 -0
  60. data/lib/getstream_ruby/generated/models/get_channel_type_request.rb +14 -0
  61. data/lib/getstream_ruby/generated/models/notification_status_response.rb +3 -3
  62. data/lib/getstream_ruby/generated/models/pin_activity_request.rb +5 -0
  63. data/lib/getstream_ruby/generated/models/query_activities_request.rb +5 -0
  64. data/lib/getstream_ruby/generated/models/query_bookmarks_request.rb +5 -0
  65. data/lib/getstream_ruby/generated/models/query_comments_request.rb +16 -1
  66. data/lib/getstream_ruby/generated/models/query_feeds_request.rb +5 -0
  67. data/lib/getstream_ruby/generated/models/query_moderation_rules_response.rb +6 -1
  68. data/lib/getstream_ruby/generated/models/query_pinned_activities_request.rb +5 -0
  69. data/lib/getstream_ruby/generated/models/remove_user_group_members_request.rb +1 -1
  70. data/lib/getstream_ruby/generated/models/track_activity_metrics_event.rb +41 -0
  71. data/lib/getstream_ruby/generated/models/track_activity_metrics_event_result.rb +46 -0
  72. data/lib/getstream_ruby/generated/models/track_activity_metrics_request.rb +41 -0
  73. data/lib/getstream_ruby/generated/models/track_activity_metrics_response.rb +36 -0
  74. data/lib/getstream_ruby/generated/models/unfollow_batch_request.rb +6 -1
  75. data/lib/getstream_ruby/generated/models/unfollow_request.rb +14 -0
  76. data/lib/getstream_ruby/generated/models/unpin_activity_request.rb +14 -0
  77. data/lib/getstream_ruby/generated/models/update_activity_partial_request.rb +5 -0
  78. data/lib/getstream_ruby/generated/models/update_activity_request.rb +5 -0
  79. data/lib/getstream_ruby/generated/models/update_app_request.rb +5 -0
  80. data/lib/getstream_ruby/generated/models/update_feed_request.rb +5 -0
  81. data/lib/getstream_ruby/generated/models/update_follow_request.rb +5 -0
  82. data/lib/getstream_ruby/generated/models/upsert_activities_request.rb +6 -1
  83. data/lib/getstream_ruby/generated/moderation_client.rb +17 -0
  84. data/lib/getstream_ruby/generated/video_client.rb +1385 -0
  85. data/lib/getstream_ruby/version.rb +1 -1
  86. metadata +51 -4
@@ -0,0 +1,1652 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
4
+
5
+ # Load all models at once
6
+ Dir[File.join(__dir__, "models", "*.rb")].sort.each { |file| require_relative file }
7
+
8
+ module GetStream
9
+ module Generated
10
+ # Chat API client with generated methods
11
+ class ChatClient
12
+ def initialize(client)
13
+ @client = client
14
+ end
15
+ # Query campaigns with filter query
16
+ #
17
+ # @param query_campaigns_request [QueryCampaignsRequest]
18
+ # @return [Models::QueryCampaignsResponse]
19
+ def query_campaigns(query_campaigns_request)
20
+ path = '/api/v2/chat/campaigns/query'
21
+ # Build request body
22
+ body = query_campaigns_request
23
+
24
+ # Make the API request
25
+ @client.make_request(
26
+ :post,
27
+ path,
28
+ body: body
29
+ )
30
+ end
31
+
32
+ # Get campaign by ID.
33
+ #
34
+ # @param _id [String]
35
+ # @param prev [String]
36
+ # @param _next [String]
37
+ # @param limit [Integer]
38
+ # @return [Models::GetCampaignResponse]
39
+ def get_campaign(_id, prev = nil, _next = nil, limit = nil)
40
+ path = '/api/v2/chat/campaigns/{id}'
41
+ # Replace path parameters
42
+ path = path.gsub('{id}', _id.to_s)
43
+ # Build query parameters
44
+ query_params = {}
45
+ query_params['prev'] = prev unless prev.nil?
46
+ query_params['next'] = _next unless _next.nil?
47
+ query_params['limit'] = limit unless limit.nil?
48
+
49
+ # Make the API request
50
+ @client.make_request(
51
+ :get,
52
+ path,
53
+ query_params: query_params
54
+ )
55
+ end
56
+
57
+ # Starts or schedules a campaign
58
+ #
59
+ # @param _id [String]
60
+ # @param start_campaign_request [StartCampaignRequest]
61
+ # @return [Models::StartCampaignResponse]
62
+ def start_campaign(_id, start_campaign_request)
63
+ path = '/api/v2/chat/campaigns/{id}/start'
64
+ # Replace path parameters
65
+ path = path.gsub('{id}', _id.to_s)
66
+ # Build request body
67
+ body = start_campaign_request
68
+
69
+ # Make the API request
70
+ @client.make_request(
71
+ :post,
72
+ path,
73
+ body: body
74
+ )
75
+ end
76
+
77
+ # Stops a campaign
78
+ #
79
+ # @param _id [String]
80
+ # @param stop_campaign_request [StopCampaignRequest]
81
+ # @return [Models::CampaignResponse]
82
+ def stop_campaign(_id, stop_campaign_request)
83
+ path = '/api/v2/chat/campaigns/{id}/stop'
84
+ # Replace path parameters
85
+ path = path.gsub('{id}', _id.to_s)
86
+ # Build request body
87
+ body = stop_campaign_request
88
+
89
+ # Make the API request
90
+ @client.make_request(
91
+ :post,
92
+ path,
93
+ body: body
94
+ )
95
+ end
96
+
97
+ # Query channels with filter query
98
+ #
99
+ # @param query_channels_request [QueryChannelsRequest]
100
+ # @return [Models::QueryChannelsResponse]
101
+ def query_channels(query_channels_request)
102
+ path = '/api/v2/chat/channels'
103
+ # Build request body
104
+ body = query_channels_request
105
+
106
+ # Make the API request
107
+ @client.make_request(
108
+ :post,
109
+ path,
110
+ body: body
111
+ )
112
+ end
113
+
114
+ # Update channels in batchSends events:- channel.frozen- channel.hidden- channel.unfrozen- channel.updated- channel.visible- member.added- member.removed- member.updated
115
+ #
116
+ # @param channel_batch_update_request [ChannelBatchUpdateRequest]
117
+ # @return [Models::ChannelBatchUpdateResponse]
118
+ def channel_batch_update(channel_batch_update_request)
119
+ path = '/api/v2/chat/channels/batch'
120
+ # Build request body
121
+ body = channel_batch_update_request
122
+
123
+ # Make the API request
124
+ @client.make_request(
125
+ :put,
126
+ path,
127
+ body: body
128
+ )
129
+ end
130
+
131
+ # Allows to delete several channels at once asynchronouslySends events:- channel.deleted
132
+ #
133
+ # @param delete_channels_request [DeleteChannelsRequest]
134
+ # @return [Models::DeleteChannelsResponse]
135
+ def delete_channels(delete_channels_request)
136
+ path = '/api/v2/chat/channels/delete'
137
+ # Build request body
138
+ body = delete_channels_request
139
+
140
+ # Make the API request
141
+ @client.make_request(
142
+ :post,
143
+ path,
144
+ body: body
145
+ )
146
+ end
147
+
148
+ # Mark the status of a channel message delivered.
149
+ #
150
+ # @param mark_delivered_request [MarkDeliveredRequest]
151
+ # @param user_id [String]
152
+ # @return [Models::MarkDeliveredResponse]
153
+ def mark_delivered(mark_delivered_request, user_id = nil)
154
+ path = '/api/v2/chat/channels/delivered'
155
+ # Build query parameters
156
+ query_params = {}
157
+ query_params['user_id'] = user_id unless user_id.nil?
158
+ # Build request body
159
+ body = mark_delivered_request
160
+
161
+ # Make the API request
162
+ @client.make_request(
163
+ :post,
164
+ path,
165
+ query_params: query_params,
166
+ body: body
167
+ )
168
+ end
169
+
170
+ # Marks channels as read up to the specific message. If no channels is given, mark all channel as readSends events:- message.read
171
+ #
172
+ # @param mark_channels_read_request [MarkChannelsReadRequest]
173
+ # @return [Models::MarkReadResponse]
174
+ def mark_channels_read(mark_channels_read_request)
175
+ path = '/api/v2/chat/channels/read'
176
+ # Build request body
177
+ body = mark_channels_read_request
178
+
179
+ # Make the API request
180
+ @client.make_request(
181
+ :post,
182
+ path,
183
+ body: body
184
+ )
185
+ end
186
+
187
+ # This Method creates a channel or returns an existing one with matching attributesSends events:- channel.created- member.added- member.removed- member.updated- user.watching.start
188
+ #
189
+ # @param _type [String]
190
+ # @param channel_get_or_create_request [ChannelGetOrCreateRequest]
191
+ # @return [Models::ChannelStateResponse]
192
+ def get_or_create_distinct_channel(_type, channel_get_or_create_request)
193
+ path = '/api/v2/chat/channels/{type}/query'
194
+ # Replace path parameters
195
+ path = path.gsub('{type}', _type.to_s)
196
+ # Build request body
197
+ body = channel_get_or_create_request
198
+
199
+ # Make the API request
200
+ @client.make_request(
201
+ :post,
202
+ path,
203
+ body: body
204
+ )
205
+ end
206
+
207
+ # Deletes channelSends events:- channel.deleted
208
+ #
209
+ # @param _type [String]
210
+ # @param _id [String]
211
+ # @param hard_delete [Boolean]
212
+ # @return [Models::DeleteChannelResponse]
213
+ def delete_channel(_type, _id, hard_delete = nil)
214
+ path = '/api/v2/chat/channels/{type}/{id}'
215
+ # Replace path parameters
216
+ path = path.gsub('{type}', _type.to_s)
217
+ path = path.gsub('{id}', _id.to_s)
218
+ # Build query parameters
219
+ query_params = {}
220
+ query_params['hard_delete'] = hard_delete unless hard_delete.nil?
221
+
222
+ # Make the API request
223
+ @client.make_request(
224
+ :delete,
225
+ path,
226
+ query_params: query_params
227
+ )
228
+ end
229
+
230
+ # Updates certain fields of the channelSends events:- channel.updated
231
+ #
232
+ # @param _type [String]
233
+ # @param _id [String]
234
+ # @param update_channel_partial_request [UpdateChannelPartialRequest]
235
+ # @return [Models::UpdateChannelPartialResponse]
236
+ def update_channel_partial(_type, _id, update_channel_partial_request)
237
+ path = '/api/v2/chat/channels/{type}/{id}'
238
+ # Replace path parameters
239
+ path = path.gsub('{type}', _type.to_s)
240
+ path = path.gsub('{id}', _id.to_s)
241
+ # Build request body
242
+ body = update_channel_partial_request
243
+
244
+ # Make the API request
245
+ @client.make_request(
246
+ :patch,
247
+ path,
248
+ body: body
249
+ )
250
+ end
251
+
252
+ # Change channel dataSends events:- channel.updated- member.added- member.removed- member.updated- message.new
253
+ #
254
+ # @param _type [String]
255
+ # @param _id [String]
256
+ # @param update_channel_request [UpdateChannelRequest]
257
+ # @return [Models::UpdateChannelResponse]
258
+ def update_channel(_type, _id, update_channel_request)
259
+ path = '/api/v2/chat/channels/{type}/{id}'
260
+ # Replace path parameters
261
+ path = path.gsub('{type}', _type.to_s)
262
+ path = path.gsub('{id}', _id.to_s)
263
+ # Build request body
264
+ body = update_channel_request
265
+
266
+ # Make the API request
267
+ @client.make_request(
268
+ :post,
269
+ path,
270
+ body: body
271
+ )
272
+ end
273
+
274
+ # Deletes a draftSends events:- draft.deleted
275
+ #
276
+ # @param _type [String]
277
+ # @param _id [String]
278
+ # @param parent_id [String]
279
+ # @param user_id [String]
280
+ # @return [Models::Response]
281
+ def delete_draft(_type, _id, parent_id = nil, user_id = nil)
282
+ path = '/api/v2/chat/channels/{type}/{id}/draft'
283
+ # Replace path parameters
284
+ path = path.gsub('{type}', _type.to_s)
285
+ path = path.gsub('{id}', _id.to_s)
286
+ # Build query parameters
287
+ query_params = {}
288
+ query_params['parent_id'] = parent_id unless parent_id.nil?
289
+ query_params['user_id'] = user_id unless user_id.nil?
290
+
291
+ # Make the API request
292
+ @client.make_request(
293
+ :delete,
294
+ path,
295
+ query_params: query_params
296
+ )
297
+ end
298
+
299
+ # Get a draft
300
+ #
301
+ # @param _type [String]
302
+ # @param _id [String]
303
+ # @param parent_id [String]
304
+ # @param user_id [String]
305
+ # @return [Models::GetDraftResponse]
306
+ def get_draft(_type, _id, parent_id = nil, user_id = nil)
307
+ path = '/api/v2/chat/channels/{type}/{id}/draft'
308
+ # Replace path parameters
309
+ path = path.gsub('{type}', _type.to_s)
310
+ path = path.gsub('{id}', _id.to_s)
311
+ # Build query parameters
312
+ query_params = {}
313
+ query_params['parent_id'] = parent_id unless parent_id.nil?
314
+ query_params['user_id'] = user_id unless user_id.nil?
315
+
316
+ # Make the API request
317
+ @client.make_request(
318
+ :get,
319
+ path,
320
+ query_params: query_params
321
+ )
322
+ end
323
+
324
+ # Sends event to the channel
325
+ #
326
+ # @param _type [String]
327
+ # @param _id [String]
328
+ # @param send_event_request [SendEventRequest]
329
+ # @return [Models::EventResponse]
330
+ def send_event(_type, _id, send_event_request)
331
+ path = '/api/v2/chat/channels/{type}/{id}/event'
332
+ # Replace path parameters
333
+ path = path.gsub('{type}', _type.to_s)
334
+ path = path.gsub('{id}', _id.to_s)
335
+ # Build request body
336
+ body = send_event_request
337
+
338
+ # Make the API request
339
+ @client.make_request(
340
+ :post,
341
+ path,
342
+ body: body
343
+ )
344
+ end
345
+
346
+ # Deletes previously uploaded file
347
+ #
348
+ # @param _type [String]
349
+ # @param _id [String]
350
+ # @param url [String]
351
+ # @return [Models::Response]
352
+ def delete_channel_file(_type, _id, url = nil)
353
+ path = '/api/v2/chat/channels/{type}/{id}/file'
354
+ # Replace path parameters
355
+ path = path.gsub('{type}', _type.to_s)
356
+ path = path.gsub('{id}', _id.to_s)
357
+ # Build query parameters
358
+ query_params = {}
359
+ query_params['url'] = url unless url.nil?
360
+
361
+ # Make the API request
362
+ @client.make_request(
363
+ :delete,
364
+ path,
365
+ query_params: query_params
366
+ )
367
+ end
368
+
369
+ # Uploads file
370
+ #
371
+ # @param _type [String]
372
+ # @param _id [String]
373
+ # @param upload_channel_file_request [UploadChannelFileRequest]
374
+ # @return [Models::UploadChannelFileResponse]
375
+ def upload_channel_file(_type, _id, upload_channel_file_request)
376
+ path = '/api/v2/chat/channels/{type}/{id}/file'
377
+ # Replace path parameters
378
+ path = path.gsub('{type}', _type.to_s)
379
+ path = path.gsub('{id}', _id.to_s)
380
+ # Build request body
381
+ body = upload_channel_file_request
382
+
383
+ # Make the API request
384
+ @client.make_request(
385
+ :post,
386
+ path,
387
+ body: body
388
+ )
389
+ end
390
+
391
+ # Marks channel as hidden for current userSends events:- channel.hidden
392
+ #
393
+ # @param _type [String]
394
+ # @param _id [String]
395
+ # @param hide_channel_request [HideChannelRequest]
396
+ # @return [Models::HideChannelResponse]
397
+ def hide_channel(_type, _id, hide_channel_request)
398
+ path = '/api/v2/chat/channels/{type}/{id}/hide'
399
+ # Replace path parameters
400
+ path = path.gsub('{type}', _type.to_s)
401
+ path = path.gsub('{id}', _id.to_s)
402
+ # Build request body
403
+ body = hide_channel_request
404
+
405
+ # Make the API request
406
+ @client.make_request(
407
+ :post,
408
+ path,
409
+ body: body
410
+ )
411
+ end
412
+
413
+ # Deletes previously uploaded image
414
+ #
415
+ # @param _type [String]
416
+ # @param _id [String]
417
+ # @param url [String]
418
+ # @return [Models::Response]
419
+ def delete_channel_image(_type, _id, url = nil)
420
+ path = '/api/v2/chat/channels/{type}/{id}/image'
421
+ # Replace path parameters
422
+ path = path.gsub('{type}', _type.to_s)
423
+ path = path.gsub('{id}', _id.to_s)
424
+ # Build query parameters
425
+ query_params = {}
426
+ query_params['url'] = url unless url.nil?
427
+
428
+ # Make the API request
429
+ @client.make_request(
430
+ :delete,
431
+ path,
432
+ query_params: query_params
433
+ )
434
+ end
435
+
436
+ # Uploads image
437
+ #
438
+ # @param _type [String]
439
+ # @param _id [String]
440
+ # @param upload_channel_request [UploadChannelRequest]
441
+ # @return [Models::UploadChannelResponse]
442
+ def upload_channel_image(_type, _id, upload_channel_request)
443
+ path = '/api/v2/chat/channels/{type}/{id}/image'
444
+ # Replace path parameters
445
+ path = path.gsub('{type}', _type.to_s)
446
+ path = path.gsub('{id}', _id.to_s)
447
+ # Build request body
448
+ body = upload_channel_request
449
+
450
+ # Make the API request
451
+ @client.make_request(
452
+ :post,
453
+ path,
454
+ body: body
455
+ )
456
+ end
457
+
458
+ #
459
+ #
460
+ # @param _type [String]
461
+ # @param _id [String]
462
+ # @param update_member_partial_request [UpdateMemberPartialRequest]
463
+ # @param user_id [String]
464
+ # @return [Models::UpdateMemberPartialResponse]
465
+ def update_member_partial(_type, _id, update_member_partial_request, user_id = nil)
466
+ path = '/api/v2/chat/channels/{type}/{id}/member'
467
+ # Replace path parameters
468
+ path = path.gsub('{type}', _type.to_s)
469
+ path = path.gsub('{id}', _id.to_s)
470
+ # Build query parameters
471
+ query_params = {}
472
+ query_params['user_id'] = user_id unless user_id.nil?
473
+ # Build request body
474
+ body = update_member_partial_request
475
+
476
+ # Make the API request
477
+ @client.make_request(
478
+ :patch,
479
+ path,
480
+ query_params: query_params,
481
+ body: body
482
+ )
483
+ end
484
+
485
+ # Sends new message to the specified channelSends events:- message.new- message.updated
486
+ #
487
+ # @param _type [String]
488
+ # @param _id [String]
489
+ # @param send_message_request [SendMessageRequest]
490
+ # @return [Models::SendMessageResponse]
491
+ def send_message(_type, _id, send_message_request)
492
+ path = '/api/v2/chat/channels/{type}/{id}/message'
493
+ # Replace path parameters
494
+ path = path.gsub('{type}', _type.to_s)
495
+ path = path.gsub('{id}', _id.to_s)
496
+ # Build request body
497
+ body = send_message_request
498
+
499
+ # Make the API request
500
+ @client.make_request(
501
+ :post,
502
+ path,
503
+ body: body
504
+ )
505
+ end
506
+
507
+ # Returns list messages found by IDs
508
+ #
509
+ # @param _type [String]
510
+ # @param _id [String]
511
+ # @param ids [Array<String>]
512
+ # @return [Models::GetManyMessagesResponse]
513
+ def get_many_messages(_type, _id, ids)
514
+ path = '/api/v2/chat/channels/{type}/{id}/messages'
515
+ # Replace path parameters
516
+ path = path.gsub('{type}', _type.to_s)
517
+ path = path.gsub('{id}', _id.to_s)
518
+ # Build query parameters
519
+ query_params = {}
520
+ query_params['ids'] = ids unless ids.nil?
521
+
522
+ # Make the API request
523
+ @client.make_request(
524
+ :get,
525
+ path,
526
+ query_params: query_params
527
+ )
528
+ end
529
+
530
+ # This Method creates a channel or returns an existing one with matching attributesSends events:- channel.created- member.added- member.removed- member.updated- user.watching.start
531
+ #
532
+ # @param _type [String]
533
+ # @param _id [String]
534
+ # @param channel_get_or_create_request [ChannelGetOrCreateRequest]
535
+ # @return [Models::ChannelStateResponse]
536
+ def get_or_create_channel(_type, _id, channel_get_or_create_request)
537
+ path = '/api/v2/chat/channels/{type}/{id}/query'
538
+ # Replace path parameters
539
+ path = path.gsub('{type}', _type.to_s)
540
+ path = path.gsub('{id}', _id.to_s)
541
+ # Build request body
542
+ body = channel_get_or_create_request
543
+
544
+ # Make the API request
545
+ @client.make_request(
546
+ :post,
547
+ path,
548
+ body: body
549
+ )
550
+ end
551
+
552
+ # Marks channel as read up to the specific messageSends events:- message.read
553
+ #
554
+ # @param _type [String]
555
+ # @param _id [String]
556
+ # @param mark_read_request [MarkReadRequest]
557
+ # @return [Models::MarkReadResponse]
558
+ def mark_read(_type, _id, mark_read_request)
559
+ path = '/api/v2/chat/channels/{type}/{id}/read'
560
+ # Replace path parameters
561
+ path = path.gsub('{type}', _type.to_s)
562
+ path = path.gsub('{id}', _id.to_s)
563
+ # Build request body
564
+ body = mark_read_request
565
+
566
+ # Make the API request
567
+ @client.make_request(
568
+ :post,
569
+ path,
570
+ body: body
571
+ )
572
+ end
573
+
574
+ # Shows previously hidden channelSends events:- channel.visible
575
+ #
576
+ # @param _type [String]
577
+ # @param _id [String]
578
+ # @param show_channel_request [ShowChannelRequest]
579
+ # @return [Models::ShowChannelResponse]
580
+ def show_channel(_type, _id, show_channel_request)
581
+ path = '/api/v2/chat/channels/{type}/{id}/show'
582
+ # Replace path parameters
583
+ path = path.gsub('{type}', _type.to_s)
584
+ path = path.gsub('{id}', _id.to_s)
585
+ # Build request body
586
+ body = show_channel_request
587
+
588
+ # Make the API request
589
+ @client.make_request(
590
+ :post,
591
+ path,
592
+ body: body
593
+ )
594
+ end
595
+
596
+ # Truncates messages from a channel. Can be applied to the entire channel or scoped to specific members.Sends events:- channel.truncated
597
+ #
598
+ # @param _type [String]
599
+ # @param _id [String]
600
+ # @param truncate_channel_request [TruncateChannelRequest]
601
+ # @return [Models::TruncateChannelResponse]
602
+ def truncate_channel(_type, _id, truncate_channel_request)
603
+ path = '/api/v2/chat/channels/{type}/{id}/truncate'
604
+ # Replace path parameters
605
+ path = path.gsub('{type}', _type.to_s)
606
+ path = path.gsub('{id}', _id.to_s)
607
+ # Build request body
608
+ body = truncate_channel_request
609
+
610
+ # Make the API request
611
+ @client.make_request(
612
+ :post,
613
+ path,
614
+ body: body
615
+ )
616
+ end
617
+
618
+ # Marks channel as unread from a specific message
619
+ #
620
+ # @param _type [String]
621
+ # @param _id [String]
622
+ # @param mark_unread_request [MarkUnreadRequest]
623
+ # @return [Models::Response]
624
+ def mark_unread(_type, _id, mark_unread_request)
625
+ path = '/api/v2/chat/channels/{type}/{id}/unread'
626
+ # Replace path parameters
627
+ path = path.gsub('{type}', _type.to_s)
628
+ path = path.gsub('{id}', _id.to_s)
629
+ # Build request body
630
+ body = mark_unread_request
631
+
632
+ # Make the API request
633
+ @client.make_request(
634
+ :post,
635
+ path,
636
+ body: body
637
+ )
638
+ end
639
+
640
+ # Lists all available channel types
641
+ #
642
+ # @return [Models::ListChannelTypesResponse]
643
+ def list_channel_types()
644
+ path = '/api/v2/chat/channeltypes'
645
+
646
+ # Make the API request
647
+ @client.make_request(
648
+ :get,
649
+ path
650
+ )
651
+ end
652
+
653
+ # Creates new channel type
654
+ #
655
+ # @param create_channel_type_request [CreateChannelTypeRequest]
656
+ # @return [Models::CreateChannelTypeResponse]
657
+ def create_channel_type(create_channel_type_request)
658
+ path = '/api/v2/chat/channeltypes'
659
+ # Build request body
660
+ body = create_channel_type_request
661
+
662
+ # Make the API request
663
+ @client.make_request(
664
+ :post,
665
+ path,
666
+ body: body
667
+ )
668
+ end
669
+
670
+ # Deletes channel type
671
+ #
672
+ # @param name [String]
673
+ # @return [Models::Response]
674
+ def delete_channel_type(name)
675
+ path = '/api/v2/chat/channeltypes/{name}'
676
+ # Replace path parameters
677
+ path = path.gsub('{name}', name.to_s)
678
+
679
+ # Make the API request
680
+ @client.make_request(
681
+ :delete,
682
+ path
683
+ )
684
+ end
685
+
686
+ # Gets channel type
687
+ #
688
+ # @param name [String]
689
+ # @return [Models::GetChannelTypeResponse]
690
+ def get_channel_type(name)
691
+ path = '/api/v2/chat/channeltypes/{name}'
692
+ # Replace path parameters
693
+ path = path.gsub('{name}', name.to_s)
694
+
695
+ # Make the API request
696
+ @client.make_request(
697
+ :get,
698
+ path
699
+ )
700
+ end
701
+
702
+ # Updates channel type
703
+ #
704
+ # @param name [String]
705
+ # @param update_channel_type_request [UpdateChannelTypeRequest]
706
+ # @return [Models::UpdateChannelTypeResponse]
707
+ def update_channel_type(name, update_channel_type_request)
708
+ path = '/api/v2/chat/channeltypes/{name}'
709
+ # Replace path parameters
710
+ path = path.gsub('{name}', name.to_s)
711
+ # Build request body
712
+ body = update_channel_type_request
713
+
714
+ # Make the API request
715
+ @client.make_request(
716
+ :put,
717
+ path,
718
+ body: body
719
+ )
720
+ end
721
+
722
+ # Returns all custom commands
723
+ #
724
+ # @return [Models::ListCommandsResponse]
725
+ def list_commands()
726
+ path = '/api/v2/chat/commands'
727
+
728
+ # Make the API request
729
+ @client.make_request(
730
+ :get,
731
+ path
732
+ )
733
+ end
734
+
735
+ # Creates custom chat command
736
+ #
737
+ # @param create_command_request [CreateCommandRequest]
738
+ # @return [Models::CreateCommandResponse]
739
+ def create_command(create_command_request)
740
+ path = '/api/v2/chat/commands'
741
+ # Build request body
742
+ body = create_command_request
743
+
744
+ # Make the API request
745
+ @client.make_request(
746
+ :post,
747
+ path,
748
+ body: body
749
+ )
750
+ end
751
+
752
+ # Deletes custom chat command
753
+ #
754
+ # @param name [String]
755
+ # @return [Models::DeleteCommandResponse]
756
+ def delete_command(name)
757
+ path = '/api/v2/chat/commands/{name}'
758
+ # Replace path parameters
759
+ path = path.gsub('{name}', name.to_s)
760
+
761
+ # Make the API request
762
+ @client.make_request(
763
+ :delete,
764
+ path
765
+ )
766
+ end
767
+
768
+ # Returns custom command by its name
769
+ #
770
+ # @param name [String]
771
+ # @return [Models::GetCommandResponse]
772
+ def get_command(name)
773
+ path = '/api/v2/chat/commands/{name}'
774
+ # Replace path parameters
775
+ path = path.gsub('{name}', name.to_s)
776
+
777
+ # Make the API request
778
+ @client.make_request(
779
+ :get,
780
+ path
781
+ )
782
+ end
783
+
784
+ # Updates custom chat command
785
+ #
786
+ # @param name [String]
787
+ # @param update_command_request [UpdateCommandRequest]
788
+ # @return [Models::UpdateCommandResponse]
789
+ def update_command(name, update_command_request)
790
+ path = '/api/v2/chat/commands/{name}'
791
+ # Replace path parameters
792
+ path = path.gsub('{name}', name.to_s)
793
+ # Build request body
794
+ body = update_command_request
795
+
796
+ # Make the API request
797
+ @client.make_request(
798
+ :put,
799
+ path,
800
+ body: body
801
+ )
802
+ end
803
+
804
+ # Queries draft messages for a user
805
+ #
806
+ # @param query_drafts_request [QueryDraftsRequest]
807
+ # @return [Models::QueryDraftsResponse]
808
+ def query_drafts(query_drafts_request)
809
+ path = '/api/v2/chat/drafts/query'
810
+ # Build request body
811
+ body = query_drafts_request
812
+
813
+ # Make the API request
814
+ @client.make_request(
815
+ :post,
816
+ path,
817
+ body: body
818
+ )
819
+ end
820
+
821
+ # Exports channel data to JSON file
822
+ #
823
+ # @param export_channels_request [ExportChannelsRequest]
824
+ # @return [Models::ExportChannelsResponse]
825
+ def export_channels(export_channels_request)
826
+ path = '/api/v2/chat/export_channels'
827
+ # Build request body
828
+ body = export_channels_request
829
+
830
+ # Make the API request
831
+ @client.make_request(
832
+ :post,
833
+ path,
834
+ body: body
835
+ )
836
+ end
837
+
838
+ # Find and filter channel members
839
+ #
840
+ # @param payload [QueryMembersPayload]
841
+ # @return [Models::MembersResponse]
842
+ def query_members(payload = nil)
843
+ path = '/api/v2/chat/members'
844
+ # Build query parameters
845
+ query_params = {}
846
+ query_params['payload'] = payload unless payload.nil?
847
+
848
+ # Make the API request
849
+ @client.make_request(
850
+ :get,
851
+ path,
852
+ query_params: query_params
853
+ )
854
+ end
855
+
856
+ # Queries history for one message
857
+ #
858
+ # @param query_message_history_request [QueryMessageHistoryRequest]
859
+ # @return [Models::QueryMessageHistoryResponse]
860
+ def query_message_history(query_message_history_request)
861
+ path = '/api/v2/chat/messages/history'
862
+ # Build request body
863
+ body = query_message_history_request
864
+
865
+ # Make the API request
866
+ @client.make_request(
867
+ :post,
868
+ path,
869
+ body: body
870
+ )
871
+ end
872
+
873
+ # Deletes messageSends events:- message.deleted
874
+ #
875
+ # @param _id [String]
876
+ # @param hard [Boolean]
877
+ # @param deleted_by [String]
878
+ # @param delete_for_me [Boolean]
879
+ # @return [Models::DeleteMessageResponse]
880
+ def delete_message(_id, hard = nil, deleted_by = nil, delete_for_me = nil)
881
+ path = '/api/v2/chat/messages/{id}'
882
+ # Replace path parameters
883
+ path = path.gsub('{id}', _id.to_s)
884
+ # Build query parameters
885
+ query_params = {}
886
+ query_params['hard'] = hard unless hard.nil?
887
+ query_params['deleted_by'] = deleted_by unless deleted_by.nil?
888
+ query_params['delete_for_me'] = delete_for_me unless delete_for_me.nil?
889
+
890
+ # Make the API request
891
+ @client.make_request(
892
+ :delete,
893
+ path,
894
+ query_params: query_params
895
+ )
896
+ end
897
+
898
+ # Returns message by ID
899
+ #
900
+ # @param _id [String]
901
+ # @param show_deleted_message [Boolean]
902
+ # @return [Models::GetMessageResponse]
903
+ def get_message(_id, show_deleted_message = nil)
904
+ path = '/api/v2/chat/messages/{id}'
905
+ # Replace path parameters
906
+ path = path.gsub('{id}', _id.to_s)
907
+ # Build query parameters
908
+ query_params = {}
909
+ query_params['show_deleted_message'] = show_deleted_message unless show_deleted_message.nil?
910
+
911
+ # Make the API request
912
+ @client.make_request(
913
+ :get,
914
+ path,
915
+ query_params: query_params
916
+ )
917
+ end
918
+
919
+ # Updates message with new dataSends events:- message.updated
920
+ #
921
+ # @param _id [String]
922
+ # @param update_message_request [UpdateMessageRequest]
923
+ # @return [Models::UpdateMessageResponse]
924
+ def update_message(_id, update_message_request)
925
+ path = '/api/v2/chat/messages/{id}'
926
+ # Replace path parameters
927
+ path = path.gsub('{id}', _id.to_s)
928
+ # Build request body
929
+ body = update_message_request
930
+
931
+ # Make the API request
932
+ @client.make_request(
933
+ :post,
934
+ path,
935
+ body: body
936
+ )
937
+ end
938
+
939
+ # Updates certain fields of the messageSends events:- message.updated
940
+ #
941
+ # @param _id [String]
942
+ # @param update_message_partial_request [UpdateMessagePartialRequest]
943
+ # @return [Models::UpdateMessagePartialResponse]
944
+ def update_message_partial(_id, update_message_partial_request)
945
+ path = '/api/v2/chat/messages/{id}'
946
+ # Replace path parameters
947
+ path = path.gsub('{id}', _id.to_s)
948
+ # Build request body
949
+ body = update_message_partial_request
950
+
951
+ # Make the API request
952
+ @client.make_request(
953
+ :put,
954
+ path,
955
+ body: body
956
+ )
957
+ end
958
+
959
+ # Executes message command action with given parametersSends events:- message.new
960
+ #
961
+ # @param _id [String]
962
+ # @param message_action_request [MessageActionRequest]
963
+ # @return [Models::MessageActionResponse]
964
+ def run_message_action(_id, message_action_request)
965
+ path = '/api/v2/chat/messages/{id}/action'
966
+ # Replace path parameters
967
+ path = path.gsub('{id}', _id.to_s)
968
+ # Build request body
969
+ body = message_action_request
970
+
971
+ # Make the API request
972
+ @client.make_request(
973
+ :post,
974
+ path,
975
+ body: body
976
+ )
977
+ end
978
+
979
+ # Commits a pending message, which will make it visible in the channelSends events:- message.new- message.updated
980
+ #
981
+ # @param _id [String]
982
+ # @param commit_message_request [CommitMessageRequest]
983
+ # @return [Models::MessageActionResponse]
984
+ def commit_message(_id, commit_message_request)
985
+ path = '/api/v2/chat/messages/{id}/commit'
986
+ # Replace path parameters
987
+ path = path.gsub('{id}', _id.to_s)
988
+ # Build request body
989
+ body = commit_message_request
990
+
991
+ # Make the API request
992
+ @client.make_request(
993
+ :post,
994
+ path,
995
+ body: body
996
+ )
997
+ end
998
+
999
+ # Updates message fields without storing in database, only sends update eventSends events:- message.updated
1000
+ #
1001
+ # @param _id [String]
1002
+ # @param update_message_partial_request [UpdateMessagePartialRequest]
1003
+ # @return [Models::UpdateMessagePartialResponse]
1004
+ def ephemeral_message_update(_id, update_message_partial_request)
1005
+ path = '/api/v2/chat/messages/{id}/ephemeral'
1006
+ # Replace path parameters
1007
+ path = path.gsub('{id}', _id.to_s)
1008
+ # Build request body
1009
+ body = update_message_partial_request
1010
+
1011
+ # Make the API request
1012
+ @client.make_request(
1013
+ :patch,
1014
+ path,
1015
+ body: body
1016
+ )
1017
+ end
1018
+
1019
+ # Sends reaction to specified messageSends events:- reaction.new- reaction.updated
1020
+ #
1021
+ # @param _id [String]
1022
+ # @param send_reaction_request [SendReactionRequest]
1023
+ # @return [Models::SendReactionResponse]
1024
+ def send_reaction(_id, send_reaction_request)
1025
+ path = '/api/v2/chat/messages/{id}/reaction'
1026
+ # Replace path parameters
1027
+ path = path.gsub('{id}', _id.to_s)
1028
+ # Build request body
1029
+ body = send_reaction_request
1030
+
1031
+ # Make the API request
1032
+ @client.make_request(
1033
+ :post,
1034
+ path,
1035
+ body: body
1036
+ )
1037
+ end
1038
+
1039
+ # Removes user reaction from the messageSends events:- reaction.deleted
1040
+ #
1041
+ # @param _id [String]
1042
+ # @param _type [String]
1043
+ # @param user_id [String]
1044
+ # @return [Models::DeleteReactionResponse]
1045
+ def delete_reaction(_id, _type, user_id = nil)
1046
+ path = '/api/v2/chat/messages/{id}/reaction/{type}'
1047
+ # Replace path parameters
1048
+ path = path.gsub('{id}', _id.to_s)
1049
+ path = path.gsub('{type}', _type.to_s)
1050
+ # Build query parameters
1051
+ query_params = {}
1052
+ query_params['user_id'] = user_id unless user_id.nil?
1053
+
1054
+ # Make the API request
1055
+ @client.make_request(
1056
+ :delete,
1057
+ path,
1058
+ query_params: query_params
1059
+ )
1060
+ end
1061
+
1062
+ # Returns list of reactions of specific message
1063
+ #
1064
+ # @param _id [String]
1065
+ # @param limit [Integer]
1066
+ # @param offset [Integer]
1067
+ # @return [Models::GetReactionsResponse]
1068
+ def get_reactions(_id, limit = nil, offset = nil)
1069
+ path = '/api/v2/chat/messages/{id}/reactions'
1070
+ # Replace path parameters
1071
+ path = path.gsub('{id}', _id.to_s)
1072
+ # Build query parameters
1073
+ query_params = {}
1074
+ query_params['limit'] = limit unless limit.nil?
1075
+ query_params['offset'] = offset unless offset.nil?
1076
+
1077
+ # Make the API request
1078
+ @client.make_request(
1079
+ :get,
1080
+ path,
1081
+ query_params: query_params
1082
+ )
1083
+ end
1084
+
1085
+ # Get reactions on a message
1086
+ #
1087
+ # @param _id [String]
1088
+ # @param query_reactions_request [QueryReactionsRequest]
1089
+ # @return [Models::QueryReactionsResponse]
1090
+ def query_reactions(_id, query_reactions_request)
1091
+ path = '/api/v2/chat/messages/{id}/reactions'
1092
+ # Replace path parameters
1093
+ path = path.gsub('{id}', _id.to_s)
1094
+ # Build request body
1095
+ body = query_reactions_request
1096
+
1097
+ # Make the API request
1098
+ @client.make_request(
1099
+ :post,
1100
+ path,
1101
+ body: body
1102
+ )
1103
+ end
1104
+
1105
+ # Translates message to a given language using automated translation softwareSends events:- message.updated
1106
+ #
1107
+ # @param _id [String]
1108
+ # @param translate_message_request [TranslateMessageRequest]
1109
+ # @return [Models::MessageActionResponse]
1110
+ def translate_message(_id, translate_message_request)
1111
+ path = '/api/v2/chat/messages/{id}/translate'
1112
+ # Replace path parameters
1113
+ path = path.gsub('{id}', _id.to_s)
1114
+ # Build request body
1115
+ body = translate_message_request
1116
+
1117
+ # Make the API request
1118
+ @client.make_request(
1119
+ :post,
1120
+ path,
1121
+ body: body
1122
+ )
1123
+ end
1124
+
1125
+ # Undelete a message that was previously soft-deletedSends events:- message.undeleted
1126
+ #
1127
+ # @param _id [String]
1128
+ # @param undelete_message_request [UndeleteMessageRequest]
1129
+ # @return [Models::UndeleteMessageResponse]
1130
+ def undelete_message(_id, undelete_message_request)
1131
+ path = '/api/v2/chat/messages/{id}/undelete'
1132
+ # Replace path parameters
1133
+ path = path.gsub('{id}', _id.to_s)
1134
+ # Build request body
1135
+ body = undelete_message_request
1136
+
1137
+ # Make the API request
1138
+ @client.make_request(
1139
+ :post,
1140
+ path,
1141
+ body: body
1142
+ )
1143
+ end
1144
+
1145
+ # Cast a vote on a pollSends events:- feeds.poll.vote_casted- feeds.poll.vote_changed- feeds.poll.vote_removed- poll.vote_casted- poll.vote_changed- poll.vote_removed
1146
+ #
1147
+ # @param message_id [String]
1148
+ # @param poll_id [String]
1149
+ # @param cast_poll_vote_request [CastPollVoteRequest]
1150
+ # @return [Models::PollVoteResponse]
1151
+ def cast_poll_vote(message_id, poll_id, cast_poll_vote_request)
1152
+ path = '/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote'
1153
+ # Replace path parameters
1154
+ path = path.gsub('{message_id}', message_id.to_s)
1155
+ path = path.gsub('{poll_id}', poll_id.to_s)
1156
+ # Build request body
1157
+ body = cast_poll_vote_request
1158
+
1159
+ # Make the API request
1160
+ @client.make_request(
1161
+ :post,
1162
+ path,
1163
+ body: body
1164
+ )
1165
+ end
1166
+
1167
+ # Delete a vote from a pollSends events:- feeds.poll.vote_removed- poll.vote_removed
1168
+ #
1169
+ # @param message_id [String]
1170
+ # @param poll_id [String]
1171
+ # @param vote_id [String]
1172
+ # @param user_id [String]
1173
+ # @return [Models::PollVoteResponse]
1174
+ def delete_poll_vote(message_id, poll_id, vote_id, user_id = nil)
1175
+ path = '/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}'
1176
+ # Replace path parameters
1177
+ path = path.gsub('{message_id}', message_id.to_s)
1178
+ path = path.gsub('{poll_id}', poll_id.to_s)
1179
+ path = path.gsub('{vote_id}', vote_id.to_s)
1180
+ # Build query parameters
1181
+ query_params = {}
1182
+ query_params['user_id'] = user_id unless user_id.nil?
1183
+
1184
+ # Make the API request
1185
+ @client.make_request(
1186
+ :delete,
1187
+ path,
1188
+ query_params: query_params
1189
+ )
1190
+ end
1191
+
1192
+ # Deletes a user's created reminderSends events:- reminder.deleted
1193
+ #
1194
+ # @param message_id [String]
1195
+ # @param user_id [String]
1196
+ # @return [Models::DeleteReminderResponse]
1197
+ def delete_reminder(message_id, user_id = nil)
1198
+ path = '/api/v2/chat/messages/{message_id}/reminders'
1199
+ # Replace path parameters
1200
+ path = path.gsub('{message_id}', message_id.to_s)
1201
+ # Build query parameters
1202
+ query_params = {}
1203
+ query_params['user_id'] = user_id unless user_id.nil?
1204
+
1205
+ # Make the API request
1206
+ @client.make_request(
1207
+ :delete,
1208
+ path,
1209
+ query_params: query_params
1210
+ )
1211
+ end
1212
+
1213
+ # Updates an existing reminderSends events:- reminder.updated
1214
+ #
1215
+ # @param message_id [String]
1216
+ # @param update_reminder_request [UpdateReminderRequest]
1217
+ # @return [Models::UpdateReminderResponse]
1218
+ def update_reminder(message_id, update_reminder_request)
1219
+ path = '/api/v2/chat/messages/{message_id}/reminders'
1220
+ # Replace path parameters
1221
+ path = path.gsub('{message_id}', message_id.to_s)
1222
+ # Build request body
1223
+ body = update_reminder_request
1224
+
1225
+ # Make the API request
1226
+ @client.make_request(
1227
+ :patch,
1228
+ path,
1229
+ body: body
1230
+ )
1231
+ end
1232
+
1233
+ # Creates a new reminderSends events:- reminder.created
1234
+ #
1235
+ # @param message_id [String]
1236
+ # @param create_reminder_request [CreateReminderRequest]
1237
+ # @return [Models::ReminderResponseData]
1238
+ def create_reminder(message_id, create_reminder_request)
1239
+ path = '/api/v2/chat/messages/{message_id}/reminders'
1240
+ # Replace path parameters
1241
+ path = path.gsub('{message_id}', message_id.to_s)
1242
+ # Build request body
1243
+ body = create_reminder_request
1244
+
1245
+ # Make the API request
1246
+ @client.make_request(
1247
+ :post,
1248
+ path,
1249
+ body: body
1250
+ )
1251
+ end
1252
+
1253
+ # Returns replies (thread) of the message
1254
+ #
1255
+ # @param parent_id [String]
1256
+ # @param limit [Integer]
1257
+ # @param id_gte [String]
1258
+ # @param id_gt [String]
1259
+ # @param id_lte [String]
1260
+ # @param id_lt [String]
1261
+ # @param id_around [String]
1262
+ # @param sort [Array<SortParamRequest>]
1263
+ # @return [Models::GetRepliesResponse]
1264
+ def get_replies(parent_id, limit = nil, id_gte = nil, id_gt = nil, id_lte = nil, id_lt = nil, id_around = nil, sort = nil)
1265
+ path = '/api/v2/chat/messages/{parent_id}/replies'
1266
+ # Replace path parameters
1267
+ path = path.gsub('{parent_id}', parent_id.to_s)
1268
+ # Build query parameters
1269
+ query_params = {}
1270
+ query_params['limit'] = limit unless limit.nil?
1271
+ query_params['id_gte'] = id_gte unless id_gte.nil?
1272
+ query_params['id_gt'] = id_gt unless id_gt.nil?
1273
+ query_params['id_lte'] = id_lte unless id_lte.nil?
1274
+ query_params['id_lt'] = id_lt unless id_lt.nil?
1275
+ query_params['id_around'] = id_around unless id_around.nil?
1276
+ query_params['sort'] = sort unless sort.nil?
1277
+
1278
+ # Make the API request
1279
+ @client.make_request(
1280
+ :get,
1281
+ path,
1282
+ query_params: query_params
1283
+ )
1284
+ end
1285
+
1286
+ # Find and filter message flags
1287
+ #
1288
+ # @param payload [QueryMessageFlagsPayload]
1289
+ # @return [Models::QueryMessageFlagsResponse]
1290
+ def query_message_flags(payload = nil)
1291
+ path = '/api/v2/chat/moderation/flags/message'
1292
+ # Build query parameters
1293
+ query_params = {}
1294
+ query_params['payload'] = payload unless payload.nil?
1295
+
1296
+ # Make the API request
1297
+ @client.make_request(
1298
+ :get,
1299
+ path,
1300
+ query_params: query_params
1301
+ )
1302
+ end
1303
+
1304
+ # Mutes channel for userSends events:- channel.muted
1305
+ #
1306
+ # @param mute_channel_request [MuteChannelRequest]
1307
+ # @return [Models::MuteChannelResponse]
1308
+ def mute_channel(mute_channel_request)
1309
+ path = '/api/v2/chat/moderation/mute/channel'
1310
+ # Build request body
1311
+ body = mute_channel_request
1312
+
1313
+ # Make the API request
1314
+ @client.make_request(
1315
+ :post,
1316
+ path,
1317
+ body: body
1318
+ )
1319
+ end
1320
+
1321
+ # Unmutes channel for userSends events:- channel.unmuted
1322
+ #
1323
+ # @param unmute_channel_request [UnmuteChannelRequest]
1324
+ # @return [Models::UnmuteResponse]
1325
+ def unmute_channel(unmute_channel_request)
1326
+ path = '/api/v2/chat/moderation/unmute/channel'
1327
+ # Build request body
1328
+ body = unmute_channel_request
1329
+
1330
+ # Make the API request
1331
+ @client.make_request(
1332
+ :post,
1333
+ path,
1334
+ body: body
1335
+ )
1336
+ end
1337
+
1338
+ # Find and filter channel scoped or global user bans
1339
+ #
1340
+ # @param payload [QueryBannedUsersPayload]
1341
+ # @return [Models::QueryBannedUsersResponse]
1342
+ def query_banned_users(payload = nil)
1343
+ path = '/api/v2/chat/query_banned_users'
1344
+ # Build query parameters
1345
+ query_params = {}
1346
+ query_params['payload'] = payload unless payload.nil?
1347
+
1348
+ # Make the API request
1349
+ @client.make_request(
1350
+ :get,
1351
+ path,
1352
+ query_params: query_params
1353
+ )
1354
+ end
1355
+
1356
+ # Find and filter future channel bans created by the authenticated user
1357
+ #
1358
+ # @param payload [QueryFutureChannelBansPayload]
1359
+ # @return [Models::QueryFutureChannelBansResponse]
1360
+ def query_future_channel_bans(payload = nil)
1361
+ path = '/api/v2/chat/query_future_channel_bans'
1362
+ # Build query parameters
1363
+ query_params = {}
1364
+ query_params['payload'] = payload unless payload.nil?
1365
+
1366
+ # Make the API request
1367
+ @client.make_request(
1368
+ :get,
1369
+ path,
1370
+ query_params: query_params
1371
+ )
1372
+ end
1373
+
1374
+ # Queries reminders
1375
+ #
1376
+ # @param query_reminders_request [QueryRemindersRequest]
1377
+ # @return [Models::QueryRemindersResponse]
1378
+ def query_reminders(query_reminders_request)
1379
+ path = '/api/v2/chat/reminders/query'
1380
+ # Build request body
1381
+ body = query_reminders_request
1382
+
1383
+ # Make the API request
1384
+ @client.make_request(
1385
+ :post,
1386
+ path,
1387
+ body: body
1388
+ )
1389
+ end
1390
+
1391
+ # Search messages across channels
1392
+ #
1393
+ # @param payload [SearchPayload]
1394
+ # @return [Models::SearchResponse]
1395
+ def search(payload = nil)
1396
+ path = '/api/v2/chat/search'
1397
+ # Build query parameters
1398
+ query_params = {}
1399
+ query_params['payload'] = payload unless payload.nil?
1400
+
1401
+ # Make the API request
1402
+ @client.make_request(
1403
+ :get,
1404
+ path,
1405
+ query_params: query_params
1406
+ )
1407
+ end
1408
+
1409
+ # Query segments
1410
+ #
1411
+ # @param query_segments_request [QuerySegmentsRequest]
1412
+ # @return [Models::QuerySegmentsResponse]
1413
+ def query_segments(query_segments_request)
1414
+ path = '/api/v2/chat/segments/query'
1415
+ # Build request body
1416
+ body = query_segments_request
1417
+
1418
+ # Make the API request
1419
+ @client.make_request(
1420
+ :post,
1421
+ path,
1422
+ body: body
1423
+ )
1424
+ end
1425
+
1426
+ # Delete a segment
1427
+ #
1428
+ # @param _id [String]
1429
+ # @return [Models::Response]
1430
+ def delete_segment(_id)
1431
+ path = '/api/v2/chat/segments/{id}'
1432
+ # Replace path parameters
1433
+ path = path.gsub('{id}', _id.to_s)
1434
+
1435
+ # Make the API request
1436
+ @client.make_request(
1437
+ :delete,
1438
+ path
1439
+ )
1440
+ end
1441
+
1442
+ # Get segment
1443
+ #
1444
+ # @param _id [String]
1445
+ # @return [Models::GetSegmentResponse]
1446
+ def get_segment(_id)
1447
+ path = '/api/v2/chat/segments/{id}'
1448
+ # Replace path parameters
1449
+ path = path.gsub('{id}', _id.to_s)
1450
+
1451
+ # Make the API request
1452
+ @client.make_request(
1453
+ :get,
1454
+ path
1455
+ )
1456
+ end
1457
+
1458
+ # Delete targets from a segment
1459
+ #
1460
+ # @param _id [String]
1461
+ # @param delete_segment_targets_request [DeleteSegmentTargetsRequest]
1462
+ # @return [Models::Response]
1463
+ def delete_segment_targets(_id, delete_segment_targets_request)
1464
+ path = '/api/v2/chat/segments/{id}/deletetargets'
1465
+ # Replace path parameters
1466
+ path = path.gsub('{id}', _id.to_s)
1467
+ # Build request body
1468
+ body = delete_segment_targets_request
1469
+
1470
+ # Make the API request
1471
+ @client.make_request(
1472
+ :post,
1473
+ path,
1474
+ body: body
1475
+ )
1476
+ end
1477
+
1478
+ # Check whether a target exists in a segment. Returns 200 if the target exists, 404 otherwise
1479
+ #
1480
+ # @param _id [String]
1481
+ # @param target_id [String]
1482
+ # @return [Models::Response]
1483
+ def segment_target_exists(_id, target_id)
1484
+ path = '/api/v2/chat/segments/{id}/target/{target_id}'
1485
+ # Replace path parameters
1486
+ path = path.gsub('{id}', _id.to_s)
1487
+ path = path.gsub('{target_id}', target_id.to_s)
1488
+
1489
+ # Make the API request
1490
+ @client.make_request(
1491
+ :get,
1492
+ path
1493
+ )
1494
+ end
1495
+
1496
+ # Query segment targets
1497
+ #
1498
+ # @param _id [String]
1499
+ # @param query_segment_targets_request [QuerySegmentTargetsRequest]
1500
+ # @return [Models::QuerySegmentTargetsResponse]
1501
+ def query_segment_targets(_id, query_segment_targets_request)
1502
+ path = '/api/v2/chat/segments/{id}/targets/query'
1503
+ # Replace path parameters
1504
+ path = path.gsub('{id}', _id.to_s)
1505
+ # Build request body
1506
+ body = query_segment_targets_request
1507
+
1508
+ # Make the API request
1509
+ @client.make_request(
1510
+ :post,
1511
+ path,
1512
+ body: body
1513
+ )
1514
+ end
1515
+
1516
+ # Retrieve team-level usage statistics from the warehouse database.Returns all 16 metrics grouped by team with cursor-based pagination.**Date Range Options (mutually exclusive):**- Use 'month' parameter (YYYY-MM format) for monthly aggregated values- Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown- If neither provided, defaults to current month (monthly mode)This endpoint is server-side only.
1517
+ #
1518
+ # @param query_team_usage_stats_request [QueryTeamUsageStatsRequest]
1519
+ # @return [Models::QueryTeamUsageStatsResponse]
1520
+ def query_team_usage_stats(query_team_usage_stats_request)
1521
+ path = '/api/v2/chat/stats/team_usage'
1522
+ # Build request body
1523
+ body = query_team_usage_stats_request
1524
+
1525
+ # Make the API request
1526
+ @client.make_request(
1527
+ :post,
1528
+ path,
1529
+ body: body
1530
+ )
1531
+ end
1532
+
1533
+ # Returns the list of threads for specific user
1534
+ #
1535
+ # @param query_threads_request [QueryThreadsRequest]
1536
+ # @return [Models::QueryThreadsResponse]
1537
+ def query_threads(query_threads_request)
1538
+ path = '/api/v2/chat/threads'
1539
+ # Build request body
1540
+ body = query_threads_request
1541
+
1542
+ # Make the API request
1543
+ @client.make_request(
1544
+ :post,
1545
+ path,
1546
+ body: body
1547
+ )
1548
+ end
1549
+
1550
+ # Return a specific thread
1551
+ #
1552
+ # @param message_id [String]
1553
+ # @param reply_limit [Integer]
1554
+ # @param participant_limit [Integer]
1555
+ # @param member_limit [Integer]
1556
+ # @return [Models::GetThreadResponse]
1557
+ def get_thread(message_id, reply_limit = nil, participant_limit = nil, member_limit = nil)
1558
+ path = '/api/v2/chat/threads/{message_id}'
1559
+ # Replace path parameters
1560
+ path = path.gsub('{message_id}', message_id.to_s)
1561
+ # Build query parameters
1562
+ query_params = {}
1563
+ query_params['reply_limit'] = reply_limit unless reply_limit.nil?
1564
+ query_params['participant_limit'] = participant_limit unless participant_limit.nil?
1565
+ query_params['member_limit'] = member_limit unless member_limit.nil?
1566
+
1567
+ # Make the API request
1568
+ @client.make_request(
1569
+ :get,
1570
+ path,
1571
+ query_params: query_params
1572
+ )
1573
+ end
1574
+
1575
+ # Updates certain fields of the threadSends events:- thread.updated
1576
+ #
1577
+ # @param message_id [String]
1578
+ # @param update_thread_partial_request [UpdateThreadPartialRequest]
1579
+ # @return [Models::UpdateThreadPartialResponse]
1580
+ def update_thread_partial(message_id, update_thread_partial_request)
1581
+ path = '/api/v2/chat/threads/{message_id}'
1582
+ # Replace path parameters
1583
+ path = path.gsub('{message_id}', message_id.to_s)
1584
+ # Build request body
1585
+ body = update_thread_partial_request
1586
+
1587
+ # Make the API request
1588
+ @client.make_request(
1589
+ :patch,
1590
+ path,
1591
+ body: body
1592
+ )
1593
+ end
1594
+
1595
+ # Fetch unread counts for a single user
1596
+ #
1597
+ # @param user_id [String]
1598
+ # @return [Models::WrappedUnreadCountsResponse]
1599
+ def unread_counts(user_id = nil)
1600
+ path = '/api/v2/chat/unread'
1601
+ # Build query parameters
1602
+ query_params = {}
1603
+ query_params['user_id'] = user_id unless user_id.nil?
1604
+
1605
+ # Make the API request
1606
+ @client.make_request(
1607
+ :get,
1608
+ path,
1609
+ query_params: query_params
1610
+ )
1611
+ end
1612
+
1613
+ # Fetch unread counts in batch for multiple users in one call
1614
+ #
1615
+ # @param unread_counts_batch_request [UnreadCountsBatchRequest]
1616
+ # @return [Models::UnreadCountsBatchResponse]
1617
+ def unread_counts_batch(unread_counts_batch_request)
1618
+ path = '/api/v2/chat/unread_batch'
1619
+ # Build request body
1620
+ body = unread_counts_batch_request
1621
+
1622
+ # Make the API request
1623
+ @client.make_request(
1624
+ :post,
1625
+ path,
1626
+ body: body
1627
+ )
1628
+ end
1629
+
1630
+ # Sends a custom event to a userSends events:- *
1631
+ #
1632
+ # @param user_id [String]
1633
+ # @param send_user_custom_event_request [SendUserCustomEventRequest]
1634
+ # @return [Models::Response]
1635
+ def send_user_custom_event(user_id, send_user_custom_event_request)
1636
+ path = '/api/v2/chat/users/{user_id}/event'
1637
+ # Replace path parameters
1638
+ path = path.gsub('{user_id}', user_id.to_s)
1639
+ # Build request body
1640
+ body = send_user_custom_event_request
1641
+
1642
+ # Make the API request
1643
+ @client.make_request(
1644
+ :post,
1645
+ path,
1646
+ body: body
1647
+ )
1648
+ end
1649
+
1650
+ end
1651
+ end
1652
+ end