Class: GetStream::Generated::ChatClient

Inherits:
Object
  • Object
show all
Defined in:
lib/getstream_ruby/generated/chat_client.rb

Overview

Chat API client with generated methods

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ChatClient

Returns a new instance of ChatClient.



12
13
14
# File 'lib/getstream_ruby/generated/chat_client.rb', line 12

def initialize(client)
  @client = client
end

Instance Method Details

#add_segment_targets(_id, add_segment_targets_request) ⇒ Models::Response

Add targets to a segment

Parameters:

  • _id (String)
  • add_segment_targets_request (AddSegmentTargetsRequest)

Returns:



1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1679

def add_segment_targets(_id, add_segment_targets_request)
  path = '/api/v2/chat/segments/{id}/addtargets'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = add_segment_targets_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#cast_poll_vote(message_id, poll_id, cast_poll_vote_request) ⇒ Models::PollVoteResponse

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

Parameters:

  • message_id (String)
  • poll_id (String)
  • cast_poll_vote_request (CastPollVoteRequest)

Returns:



1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1264

def cast_poll_vote(message_id, poll_id, cast_poll_vote_request)
  path = '/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build request body
  body = cast_poll_vote_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#channel_batch_update(channel_batch_update_request) ⇒ Models::ChannelBatchUpdateResponse

Update channels in batchSends events:- channel.frozen- channel.hidden- channel.unfrozen- channel.updated- channel.visible- member.added- member.removed- member.updated

Parameters:

  • channel_batch_update_request (ChannelBatchUpdateRequest)

Returns:



171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/getstream_ruby/generated/chat_client.rb', line 171

def channel_batch_update(channel_batch_update_request)
  path = '/api/v2/chat/channels/batch'
  # Build request body
  body = channel_batch_update_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#commit_message(_id, commit_message_request) ⇒ Models::MessageActionResponse

Commits a pending message, which will make it visible in the channelSends events:- message.new- message.updated

Parameters:

  • _id (String)
  • commit_message_request (CommitMessageRequest)

Returns:



1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1097

def commit_message(_id, commit_message_request)
  path = '/api/v2/chat/messages/{id}/commit'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = commit_message_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_campaign(create_campaign_request) ⇒ Models::CreateCampaignResponse

Creates a campaign

Parameters:

  • create_campaign_request (CreateCampaignRequest)

Returns:



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/getstream_ruby/generated/chat_client.rb', line 19

def create_campaign(create_campaign_request)
  path = '/api/v2/chat/campaigns'
  # Build request body
  body = create_campaign_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_channel_type(create_channel_type_request) ⇒ Models::CreateChannelTypeResponse

Creates new channel type

Parameters:

  • create_channel_type_request (CreateChannelTypeRequest)

Returns:



770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/getstream_ruby/generated/chat_client.rb', line 770

def create_channel_type(create_channel_type_request)
  path = '/api/v2/chat/channeltypes'
  # Build request body
  body = create_channel_type_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_command(create_command_request) ⇒ Models::CreateCommandResponse

Creates custom chat command

Parameters:

  • create_command_request (CreateCommandRequest)

Returns:



852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/getstream_ruby/generated/chat_client.rb', line 852

def create_command(create_command_request)
  path = '/api/v2/chat/commands'
  # Build request body
  body = create_command_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_reminder(message_id, create_reminder_request) ⇒ Models::ReminderResponseData

Creates a new reminderSends events:- reminder.created

Parameters:

  • message_id (String)
  • create_reminder_request (CreateReminderRequest)

Returns:



1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1351

def create_reminder(message_id, create_reminder_request)
  path = '/api/v2/chat/messages/{message_id}/reminders'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  # Build request body
  body = create_reminder_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_segment(create_segment_request) ⇒ Models::CreateSegmentResponse

Create a segment

Parameters:

  • create_segment_request (CreateSegmentRequest)

Returns:



1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1592

def create_segment(create_segment_request)
  path = '/api/v2/chat/segments'
  # Build request body
  body = create_segment_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#delete_campaign(_id) ⇒ Models::DeleteCampaignResponse

Delete campaign

Parameters:

  • _id (String)

Returns:



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/getstream_ruby/generated/chat_client.rb', line 53

def delete_campaign(_id)
  path = '/api/v2/chat/campaigns/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_channel(_type, _id, hard_delete = nil) ⇒ Models::DeleteChannelResponse

Deletes channelSends events:- channel.deleted

Parameters:

  • _type (String)
  • _id (String)
  • hard_delete (Boolean) (defaults to: nil)

Returns:



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/getstream_ruby/generated/chat_client.rb', line 283

def delete_channel(_type, _id, hard_delete = nil)
  path = '/api/v2/chat/channels/{type}/{id}'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['hard_delete'] = hard_delete unless hard_delete.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_channel_file(_type, _id, url = nil) ⇒ Models::Response

Deletes previously uploaded file

Parameters:

  • _type (String)
  • _id (String)
  • url (String) (defaults to: nil)

Returns:



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/getstream_ruby/generated/chat_client.rb', line 463

def delete_channel_file(_type, _id, url = nil)
  path = '/api/v2/chat/channels/{type}/{id}/file'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['url'] = url unless url.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_channel_image(_type, _id, url = nil) ⇒ Models::Response

Deletes previously uploaded image

Parameters:

  • _type (String)
  • _id (String)
  • url (String) (defaults to: nil)

Returns:



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/getstream_ruby/generated/chat_client.rb', line 530

def delete_channel_image(_type, _id, url = nil)
  path = '/api/v2/chat/channels/{type}/{id}/image'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['url'] = url unless url.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_channel_type(name) ⇒ Models::Response

Deletes channel type

Parameters:

  • name (String)

Returns:



787
788
789
790
791
792
793
794
795
796
797
# File 'lib/getstream_ruby/generated/chat_client.rb', line 787

def delete_channel_type(name)
  path = '/api/v2/chat/channeltypes/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_channels(delete_channels_request) ⇒ Models::DeleteChannelsResponse

Allows to delete several channels at once asynchronouslySends events:- channel.deleted

Parameters:

  • delete_channels_request (DeleteChannelsRequest)

Returns:



188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/getstream_ruby/generated/chat_client.rb', line 188

def delete_channels(delete_channels_request)
  path = '/api/v2/chat/channels/delete'
  # Build request body
  body = delete_channels_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#delete_command(name) ⇒ Models::DeleteCommandResponse

Deletes custom chat command

Parameters:

  • name (String)

Returns:



869
870
871
872
873
874
875
876
877
878
879
# File 'lib/getstream_ruby/generated/chat_client.rb', line 869

def delete_command(name)
  path = '/api/v2/chat/commands/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_draft(_type, _id, parent_id = nil, user_id = nil) ⇒ Models::Response

Deletes a draftSends events:- draft.deleted

Parameters:

  • _type (String)
  • _id (String)
  • parent_id (String) (defaults to: nil)
  • user_id (String) (defaults to: nil)

Returns:



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/getstream_ruby/generated/chat_client.rb', line 392

def delete_draft(_type, _id, parent_id = nil, user_id = nil)
  path = '/api/v2/chat/channels/{type}/{id}/draft'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['parent_id'] = parent_id unless parent_id.nil?
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_message(_id, hard = nil, deleted_by = nil, delete_for_me = nil) ⇒ Models::DeleteMessageResponse

Deletes messageSends events:- message.deleted

Parameters:

  • _id (String)
  • hard (Boolean) (defaults to: nil)
  • deleted_by (String) (defaults to: nil)
  • delete_for_me (Boolean) (defaults to: nil)

Returns:



993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
# File 'lib/getstream_ruby/generated/chat_client.rb', line 993

def delete_message(_id, hard = nil, deleted_by = nil, delete_for_me = nil)
  path = '/api/v2/chat/messages/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['hard'] = hard unless hard.nil?
  query_params['deleted_by'] = deleted_by unless deleted_by.nil?
  query_params['delete_for_me'] = delete_for_me unless delete_for_me.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_poll_vote(message_id, poll_id, vote_id, user_id = nil) ⇒ Models::PollVoteResponse

Delete a vote from a pollSends events:- feeds.poll.vote_removed- poll.vote_removed

Parameters:

  • message_id (String)
  • poll_id (String)
  • vote_id (String)
  • user_id (String) (defaults to: nil)

Returns:



1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1287

def delete_poll_vote(message_id, poll_id, vote_id, user_id = nil)
  path = '/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  path = path.gsub('{poll_id}', poll_id.to_s)
  path = path.gsub('{vote_id}', vote_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_reaction(_id, _type, user_id = nil) ⇒ Models::DeleteReactionResponse

Removes user reaction from the messageSends events:- reaction.deleted

Parameters:

  • _id (String)
  • _type (String)
  • user_id (String) (defaults to: nil)

Returns:



1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1158

def delete_reaction(_id, _type, user_id = nil)
  path = '/api/v2/chat/messages/{id}/reaction/{type}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  path = path.gsub('{type}', _type.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_reminder(message_id, user_id = nil) ⇒ Models::DeleteReminderResponse

Deletes a user's created reminderSends events:- reminder.deleted

Parameters:

  • message_id (String)
  • user_id (String) (defaults to: nil)

Returns:



1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1310

def delete_reminder(message_id, user_id = nil)
  path = '/api/v2/chat/messages/{message_id}/reminders'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_retention_policy(delete_retention_policy_request) ⇒ Models::DeleteRetentionPolicyResponse

Removes a retention policy for the app. Server-side only.

Parameters:

  • delete_retention_policy_request (DeleteRetentionPolicyRequest)

Returns:



1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1540

def delete_retention_policy(delete_retention_policy_request)
  path = '/api/v2/chat/retention_policy/delete'
  # Build request body
  body = delete_retention_policy_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#delete_segment(_id) ⇒ Models::Response

Delete a segment

Parameters:

  • _id (String)

Returns:



1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1626

def delete_segment(_id)
  path = '/api/v2/chat/segments/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_segment_targets(_id, delete_segment_targets_request) ⇒ Models::Response

Delete targets from a segment

Parameters:

  • _id (String)
  • delete_segment_targets_request (DeleteSegmentTargetsRequest)

Returns:



1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1699

def delete_segment_targets(_id, delete_segment_targets_request)
  path = '/api/v2/chat/segments/{id}/deletetargets'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = delete_segment_targets_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#ephemeral_message_update(_id, update_message_partial_request) ⇒ Models::UpdateMessagePartialResponse

Updates message fields without storing in database, only sends update eventSends events:- message.updated

Parameters:

  • _id (String)
  • update_message_partial_request (UpdateMessagePartialRequest)

Returns:



1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1117

def ephemeral_message_update(_id, update_message_partial_request)
  path = '/api/v2/chat/messages/{id}/ephemeral'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_message_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#export_channels(export_channels_request) ⇒ Models::ExportChannelsResponse

Exports channel data to a JSON or CSV file (CSV requires version=v2)

Parameters:

  • export_channels_request (ExportChannelsRequest)

Returns:



938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/getstream_ruby/generated/chat_client.rb', line 938

def export_channels(export_channels_request)
  path = '/api/v2/chat/export_channels'
  # Build request body
  body = export_channels_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#get_campaign(_id, prev = nil, _next = nil, limit = nil) ⇒ Models::GetCampaignResponse

Get campaign by ID.

Parameters:

  • _id (String)
  • prev (String) (defaults to: nil)
  • _next (String) (defaults to: nil)
  • limit (Integer) (defaults to: nil)

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/getstream_ruby/generated/chat_client.rb', line 72

def get_campaign(_id, prev = nil, _next = nil, limit = nil)
  path = '/api/v2/chat/campaigns/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['prev'] = prev unless prev.nil?
  query_params['next'] = _next unless _next.nil?
  query_params['limit'] = limit unless limit.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_channel(_type, _id, state = nil, messages_limit = nil, members_limit = nil, watchers_limit = nil, messages_id_lt = nil, messages_id_lte = nil, messages_id_gt = nil, messages_id_gte = nil, messages_id_around = nil, user_id = nil) ⇒ Models::ChannelStateResponse

Returns a channel by its CID without creating it. Responds with 404 when the channel does not exist, so it doubles as an existence check. Pass state=true to also load messages, read state and watchers, and the messages_id_* parameters to page those messages by message ID.

Parameters:

  • _type (String)
  • _id (String)
  • state (Boolean) (defaults to: nil)
  • messages_limit (Integer) (defaults to: nil)
  • members_limit (Integer) (defaults to: nil)
  • watchers_limit (Integer) (defaults to: nil)
  • messages_id_lt (String) (defaults to: nil)
  • messages_id_lte (String) (defaults to: nil)
  • messages_id_gt (String) (defaults to: nil)
  • messages_id_gte (String) (defaults to: nil)
  • messages_id_around (String) (defaults to: nil)
  • user_id (String) (defaults to: nil)

Returns:



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/getstream_ruby/generated/chat_client.rb', line 315

def get_channel(_type, _id, state = nil, messages_limit = nil, members_limit = nil, watchers_limit = nil, messages_id_lt = nil, messages_id_lte = nil, messages_id_gt = nil, messages_id_gte = nil, messages_id_around = nil, user_id = nil)
  path = '/api/v2/chat/channels/{type}/{id}'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['state'] = state unless state.nil?
  query_params['messages_limit'] = messages_limit unless messages_limit.nil?
  query_params['members_limit'] = members_limit unless members_limit.nil?
  query_params['watchers_limit'] = watchers_limit unless watchers_limit.nil?
  query_params['messages_id_lt'] = messages_id_lt unless messages_id_lt.nil?
  query_params['messages_id_lte'] = messages_id_lte unless messages_id_lte.nil?
  query_params['messages_id_gt'] = messages_id_gt unless messages_id_gt.nil?
  query_params['messages_id_gte'] = messages_id_gte unless messages_id_gte.nil?
  query_params['messages_id_around'] = messages_id_around unless messages_id_around.nil?
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_channel_type(name) ⇒ Models::GetChannelTypeResponse

Gets channel type

Parameters:

  • name (String)

Returns:



803
804
805
806
807
808
809
810
811
812
813
# File 'lib/getstream_ruby/generated/chat_client.rb', line 803

def get_channel_type(name)
  path = '/api/v2/chat/channeltypes/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_command(name) ⇒ Models::GetCommandResponse

Returns custom command by its name

Parameters:

  • name (String)

Returns:



885
886
887
888
889
890
891
892
893
894
895
# File 'lib/getstream_ruby/generated/chat_client.rb', line 885

def get_command(name)
  path = '/api/v2/chat/commands/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_draft(_type, _id, parent_id = nil, user_id = nil) ⇒ Models::GetDraftResponse

Get a draft

Parameters:

  • _type (String)
  • _id (String)
  • parent_id (String) (defaults to: nil)
  • user_id (String) (defaults to: nil)

Returns:



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/getstream_ruby/generated/chat_client.rb', line 417

def get_draft(_type, _id, parent_id = nil, user_id = nil)
  path = '/api/v2/chat/channels/{type}/{id}/draft'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['parent_id'] = parent_id unless parent_id.nil?
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_many_messages(_type, _id, ids, member_custom_include = nil) ⇒ Models::GetManyMessagesResponse

Returns list messages found by IDs

Parameters:

  • _type (String)
  • _id (String)
  • ids (Array<String>)
  • member_custom_include (Array<String>) (defaults to: nil)

Returns:



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/getstream_ruby/generated/chat_client.rb', line 625

def get_many_messages(_type, _id, ids, member_custom_include = nil)
  path = '/api/v2/chat/channels/{type}/{id}/messages'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['ids'] = ids unless ids.nil?
  query_params['member_custom_include'] = member_custom_include unless member_custom_include.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_message(_id, show_deleted_message = nil) ⇒ Models::GetMessageResponse

Returns message by ID

Parameters:

  • _id (String)
  • show_deleted_message (Boolean) (defaults to: nil)

Returns:



1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1016

def get_message(_id, show_deleted_message = nil)
  path = '/api/v2/chat/messages/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['show_deleted_message'] = show_deleted_message unless show_deleted_message.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_or_create_channel(_type, _id, channel_get_or_create_request) ⇒ Models::ChannelStateResponse

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

Parameters:

  • _type (String)
  • _id (String)
  • channel_get_or_create_request (ChannelGetOrCreateRequest)

Returns:



649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/getstream_ruby/generated/chat_client.rb', line 649

def get_or_create_channel(_type, _id, channel_get_or_create_request)
  path = '/api/v2/chat/channels/{type}/{id}/query'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = channel_get_or_create_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#get_or_create_distinct_channel(_type, channel_get_or_create_request) ⇒ Models::ChannelStateResponse

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

Parameters:

  • _type (String)
  • channel_get_or_create_request (ChannelGetOrCreateRequest)

Returns:



262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/getstream_ruby/generated/chat_client.rb', line 262

def get_or_create_distinct_channel(_type, channel_get_or_create_request)
  path = '/api/v2/chat/channels/{type}/query'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  # Build request body
  body = channel_get_or_create_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#get_reactions(_id, limit = nil, offset = nil) ⇒ Models::GetReactionsResponse

Returns list of reactions of specific message

Parameters:

  • _id (String)
  • limit (Integer) (defaults to: nil)
  • offset (Integer) (defaults to: nil)

Returns:



1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1181

def get_reactions(_id, limit = nil, offset = nil)
  path = '/api/v2/chat/messages/{id}/reactions'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['limit'] = limit unless limit.nil?
  query_params['offset'] = offset unless offset.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_replies(parent_id, limit = nil, id_gte = nil, id_gt = nil, id_lte = nil, id_lt = nil, id_around = nil, sort = nil, member_custom_include = nil) ⇒ Models::GetRepliesResponse

Returns replies (thread) of the message

Parameters:

  • parent_id (String)
  • limit (Integer) (defaults to: nil)
  • id_gte (String) (defaults to: nil)
  • id_gt (String) (defaults to: nil)
  • id_lte (String) (defaults to: nil)
  • id_lt (String) (defaults to: nil)
  • id_around (String) (defaults to: nil)
  • sort (Array<SortParamRequest>) (defaults to: nil)
  • member_custom_include (Array<String>) (defaults to: nil)

Returns:



1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1378

def get_replies(parent_id, limit = nil, id_gte = nil, id_gt = nil, id_lte = nil, id_lt = nil, id_around = nil, sort = nil, member_custom_include = nil)
  path = '/api/v2/chat/messages/{parent_id}/replies'
  # Replace path parameters
  path = path.gsub('{parent_id}', parent_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['limit'] = limit unless limit.nil?
  query_params['id_gte'] = id_gte unless id_gte.nil?
  query_params['id_gt'] = id_gt unless id_gt.nil?
  query_params['id_lte'] = id_lte unless id_lte.nil?
  query_params['id_lt'] = id_lt unless id_lt.nil?
  query_params['id_around'] = id_around unless id_around.nil?
  query_params['sort'] = sort unless sort.nil?
  query_params['member_custom_include'] = member_custom_include unless member_custom_include.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_retention_policyModels::GetRetentionPolicyResponse

Returns all retention policies configured for the app. Server-side only.



1509
1510
1511
1512
1513
1514
1515
1516
1517
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1509

def get_retention_policy()
  path = '/api/v2/chat/retention_policy'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_retention_policy_runs(get_retention_policy_runs_request) ⇒ Models::GetRetentionPolicyRunsResponse

Returns filtered and sorted retention cleanup run history for the app. Supports filter_conditions on 'policy' (possible values: 'old-messages', 'inactive-channels') and 'date' fields. Server-side only.

Parameters:

  • get_retention_policy_runs_request (GetRetentionPolicyRunsRequest)

Returns:



1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1557

def get_retention_policy_runs(get_retention_policy_runs_request)
  path = '/api/v2/chat/retention_policy/runs'
  # Build request body
  body = get_retention_policy_runs_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#get_segment(_id) ⇒ Models::GetSegmentResponse

Get segment

Parameters:

  • _id (String)

Returns:



1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1642

def get_segment(_id)
  path = '/api/v2/chat/segments/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_thread(message_id, reply_limit = nil, participant_limit = nil, member_limit = nil) ⇒ Models::GetThreadResponse

Return a specific thread

Parameters:

  • message_id (String)
  • reply_limit (Integer) (defaults to: nil)
  • participant_limit (Integer) (defaults to: nil)
  • member_limit (Integer) (defaults to: nil)

Returns:



1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1793

def get_thread(message_id, reply_limit = nil, participant_limit = nil, member_limit = nil)
  path = '/api/v2/chat/threads/{message_id}'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['reply_limit'] = reply_limit unless reply_limit.nil?
  query_params['participant_limit'] = participant_limit unless participant_limit.nil?
  query_params['member_limit'] = member_limit unless member_limit.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#grouped_query_channels(grouped_query_channels_request) ⇒ Models::GroupedQueryChannelsResponse

Query channels grouped into predefined buckets. Only available for enterprise apps.

Parameters:

  • grouped_query_channels_request (GroupedQueryChannelsRequest)

Returns:



227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/getstream_ruby/generated/chat_client.rb', line 227

def grouped_query_channels(grouped_query_channels_request)
  path = '/api/v2/chat/channels/grouped'
  # Build request body
  body = grouped_query_channels_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#hide_channel(_type, _id, hide_channel_request) ⇒ Models::HideChannelResponse

Marks channel as hidden for current userSends events:- channel.hidden

Parameters:

  • _type (String)
  • _id (String)
  • hide_channel_request (HideChannelRequest)

Returns:



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
# File 'lib/getstream_ruby/generated/chat_client.rb', line 508

def hide_channel(_type, _id, hide_channel_request)
  path = '/api/v2/chat/channels/{type}/{id}/hide'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = hide_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#list_channel_typesModels::ListChannelTypesResponse

Lists all available channel types



756
757
758
759
760
761
762
763
764
# File 'lib/getstream_ruby/generated/chat_client.rb', line 756

def list_channel_types()
  path = '/api/v2/chat/channeltypes'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#list_commandsModels::ListCommandsResponse

Returns all custom commands



838
839
840
841
842
843
844
845
846
# File 'lib/getstream_ruby/generated/chat_client.rb', line 838

def list_commands()
  path = '/api/v2/chat/commands'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#mark_channels_read(mark_channels_read_request) ⇒ Models::MarkReadResponse

Marks channels as read up to the specific message. If no channels is given, mark all channel as readSends events:- message.read

Parameters:

  • mark_channels_read_request (MarkChannelsReadRequest)

Returns:



244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/getstream_ruby/generated/chat_client.rb', line 244

def mark_channels_read(mark_channels_read_request)
  path = '/api/v2/chat/channels/read'
  # Build request body
  body = mark_channels_read_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#mark_delivered(mark_delivered_request, user_id = nil) ⇒ Models::MarkDeliveredResponse

Mark the status of a channel message delivered.

Parameters:

  • mark_delivered_request (MarkDeliveredRequest)
  • user_id (String) (defaults to: nil)

Returns:



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/getstream_ruby/generated/chat_client.rb', line 206

def mark_delivered(mark_delivered_request, user_id = nil)
  path = '/api/v2/chat/channels/delivered'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?
  # Build request body
  body = mark_delivered_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    query_params: query_params,
    body: body
  )
end

#mark_read(_type, _id, mark_read_request) ⇒ Models::MarkReadResponse

Marks channel as read up to the specific messageSends events:- message.read

Parameters:

  • _type (String)
  • _id (String)
  • mark_read_request (MarkReadRequest)

Returns:



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
# File 'lib/getstream_ruby/generated/chat_client.rb', line 671

def mark_read(_type, _id, mark_read_request)
  path = '/api/v2/chat/channels/{type}/{id}/read'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = mark_read_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#mark_unread(_type, _id, mark_unread_request) ⇒ Models::Response

Marks channel as unread from a specific message

Parameters:

  • _type (String)
  • _id (String)
  • mark_unread_request (MarkUnreadRequest)

Returns:



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/getstream_ruby/generated/chat_client.rb', line 737

def mark_unread(_type, _id, mark_unread_request)
  path = '/api/v2/chat/channels/{type}/{id}/unread'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = mark_unread_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#mute_channel(mute_channel_request) ⇒ Models::MuteChannelResponse

Mutes channel for userSends events:- channel.muted

Parameters:

  • mute_channel_request (MuteChannelRequest)

Returns:



1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1423

def mute_channel(mute_channel_request)
  path = '/api/v2/chat/moderation/mute/channel'
  # Build request body
  body = mute_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_banned_users(payload = nil) ⇒ Models::QueryBannedUsersResponse

Find and filter channel scoped or global user bans

Parameters:

  • payload (QueryBannedUsersPayload) (defaults to: nil)

Returns:



1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1457

def query_banned_users(payload = nil)
  path = '/api/v2/chat/query_banned_users'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#query_campaigns(query_campaigns_request) ⇒ Models::QueryCampaignsResponse

Query campaigns with filter query

Parameters:

  • query_campaigns_request (QueryCampaignsRequest)

Returns:



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/getstream_ruby/generated/chat_client.rb', line 36

def query_campaigns(query_campaigns_request)
  path = '/api/v2/chat/campaigns/query'
  # Build request body
  body = query_campaigns_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_channels(query_channels_request) ⇒ Models::QueryChannelsResponse

Query channels with filter query

Parameters:

  • query_channels_request (QueryChannelsRequest)

Returns:



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/getstream_ruby/generated/chat_client.rb', line 154

def query_channels(query_channels_request)
  path = '/api/v2/chat/channels'
  # Build request body
  body = query_channels_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_drafts(query_drafts_request) ⇒ Models::QueryDraftsResponse

Queries draft messages for a user

Parameters:

  • query_drafts_request (QueryDraftsRequest)

Returns:



921
922
923
924
925
926
927
928
929
930
931
932
# File 'lib/getstream_ruby/generated/chat_client.rb', line 921

def query_drafts(query_drafts_request)
  path = '/api/v2/chat/drafts/query'
  # Build request body
  body = query_drafts_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_future_channel_bans(payload = nil) ⇒ Models::QueryFutureChannelBansResponse

Find and filter future channel bans created by the authenticated user

Parameters:

  • payload (QueryFutureChannelBansPayload) (defaults to: nil)

Returns:



1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1475

def query_future_channel_bans(payload = nil)
  path = '/api/v2/chat/query_future_channel_bans'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#query_members(payload = nil) ⇒ Models::MembersResponse

Find and filter channel members

Parameters:

  • payload (QueryMembersPayload) (defaults to: nil)

Returns:



955
956
957
958
959
960
961
962
963
964
965
966
967
# File 'lib/getstream_ruby/generated/chat_client.rb', line 955

def query_members(payload = nil)
  path = '/api/v2/chat/members'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#query_message_flags(payload = nil) ⇒ Models::QueryMessageFlagsResponse

Find and filter message flags

Parameters:

  • payload (QueryMessageFlagsPayload) (defaults to: nil)

Returns:



1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1405

def query_message_flags(payload = nil)
  path = '/api/v2/chat/moderation/flags/message'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#query_message_history(query_message_history_request) ⇒ Models::QueryMessageHistoryResponse

Queries history for one message

Parameters:

  • query_message_history_request (QueryMessageHistoryRequest)

Returns:



973
974
975
976
977
978
979
980
981
982
983
984
# File 'lib/getstream_ruby/generated/chat_client.rb', line 973

def query_message_history(query_message_history_request)
  path = '/api/v2/chat/messages/history'
  # Build request body
  body = query_message_history_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_reactions(_id, query_reactions_request) ⇒ Models::QueryReactionsResponse

Get reactions on a message

Parameters:

  • _id (String)
  • query_reactions_request (QueryReactionsRequest)

Returns:



1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1203

def query_reactions(_id, query_reactions_request)
  path = '/api/v2/chat/messages/{id}/reactions'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = query_reactions_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_reminders(query_reminders_request) ⇒ Models::QueryRemindersResponse

Queries reminders

Parameters:

  • query_reminders_request (QueryRemindersRequest)

Returns:



1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1493

def query_reminders(query_reminders_request)
  path = '/api/v2/chat/reminders/query'
  # Build request body
  body = query_reminders_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_segment_targets(_id, query_segment_targets_request) ⇒ Models::QuerySegmentTargetsResponse

Query segment targets

Parameters:

  • _id (String)
  • query_segment_targets_request (QuerySegmentTargetsRequest)

Returns:



1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1737

def query_segment_targets(_id, query_segment_targets_request)
  path = '/api/v2/chat/segments/{id}/targets/query'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = query_segment_targets_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_segments(query_segments_request) ⇒ Models::QuerySegmentsResponse

Query segments

Parameters:

  • query_segments_request (QuerySegmentsRequest)

Returns:



1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1609

def query_segments(query_segments_request)
  path = '/api/v2/chat/segments/query'
  # Build request body
  body = query_segments_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_team_usage_stats(query_team_usage_stats_request) ⇒ Models::QueryTeamUsageStatsResponse

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.

Parameters:

  • query_team_usage_stats_request (QueryTeamUsageStatsRequest)

Returns:



1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1756

def query_team_usage_stats(query_team_usage_stats_request)
  path = '/api/v2/chat/stats/team_usage'
  # Build request body
  body = query_team_usage_stats_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#query_threads(query_threads_request) ⇒ Models::QueryThreadsResponse

Returns the list of threads for specific user

Parameters:

  • query_threads_request (QueryThreadsRequest)

Returns:



1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1773

def query_threads(query_threads_request)
  path = '/api/v2/chat/threads'
  # Build request body
  body = query_threads_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#run_message_action(_id, message_action_request) ⇒ Models::MessageActionResponse

Executes message command action with given parametersSends events:- message.new

Parameters:

  • _id (String)
  • message_action_request (MessageActionRequest)

Returns:



1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1077

def run_message_action(_id, message_action_request)
  path = '/api/v2/chat/messages/{id}/action'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = message_action_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#search(payload = nil) ⇒ Models::SearchResponse

Search messages across channels

Parameters:

  • payload (SearchPayload) (defaults to: nil)

Returns:



1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1574

def search(payload = nil)
  path = '/api/v2/chat/search'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#segment_target_exists(_id, target_id) ⇒ Models::Response

Check whether a target exists in a segment. Returns 200 if the target exists, 404 otherwise

Parameters:

  • _id (String)
  • target_id (String)

Returns:



1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1719

def segment_target_exists(_id, target_id)
  path = '/api/v2/chat/segments/{id}/target/{target_id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  path = path.gsub('{target_id}', target_id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#send_event(_type, _id, send_event_request) ⇒ Models::EventResponse

Sends event to the channel

Parameters:

  • _type (String)
  • _id (String)
  • send_event_request (SendEventRequest)

Returns:



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/getstream_ruby/generated/chat_client.rb', line 441

def send_event(_type, _id, send_event_request)
  path = '/api/v2/chat/channels/{type}/{id}/event'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = send_event_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#send_message(_type, _id, send_message_request) ⇒ Models::SendMessageResponse

Sends new message to the specified channelSends events:- channel.visible- message.new- message.updated

Parameters:

  • _type (String)
  • _id (String)
  • send_message_request (SendMessageRequest)

Returns:



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/getstream_ruby/generated/chat_client.rb', line 602

def send_message(_type, _id, send_message_request)
  path = '/api/v2/chat/channels/{type}/{id}/message'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = send_message_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#send_reaction(_id, send_reaction_request) ⇒ Models::SendReactionResponse

Sends reaction to specified messageSends events:- reaction.new- reaction.updated

Parameters:

  • _id (String)
  • send_reaction_request (SendReactionRequest)

Returns:



1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1137

def send_reaction(_id, send_reaction_request)
  path = '/api/v2/chat/messages/{id}/reaction'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = send_reaction_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#send_user_custom_event(user_id, send_user_custom_event_request) ⇒ Models::Response

Sends a custom event to a userSends events:- *

Parameters:

  • user_id (String)
  • send_user_custom_event_request (SendUserCustomEventRequest)

Returns:



1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1871

def send_user_custom_event(user_id, send_user_custom_event_request)
  path = '/api/v2/chat/users/{user_id}/event'
  # Replace path parameters
  path = path.gsub('{user_id}', user_id.to_s)
  # Build request body
  body = send_user_custom_event_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#set_retention_policy(set_retention_policy_request) ⇒ Models::SetRetentionPolicyResponse

Creates or updates a retention policy for the app. Server-side only.

Parameters:

  • set_retention_policy_request (SetRetentionPolicyRequest)

Returns:



1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1523

def set_retention_policy(set_retention_policy_request)
  path = '/api/v2/chat/retention_policy'
  # Build request body
  body = set_retention_policy_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#show_channel(_type, _id, show_channel_request) ⇒ Models::ShowChannelResponse

Shows previously hidden channelSends events:- channel.visible

Parameters:

  • _type (String)
  • _id (String)
  • show_channel_request (ShowChannelRequest)

Returns:



693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# File 'lib/getstream_ruby/generated/chat_client.rb', line 693

def show_channel(_type, _id, show_channel_request)
  path = '/api/v2/chat/channels/{type}/{id}/show'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = show_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#start_campaign(_id, start_campaign_request) ⇒ Models::StartCampaignResponse

Starts or schedules a campaign

Parameters:

  • _id (String)
  • start_campaign_request (StartCampaignRequest)

Returns:



115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/getstream_ruby/generated/chat_client.rb', line 115

def start_campaign(_id, start_campaign_request)
  path = '/api/v2/chat/campaigns/{id}/start'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = start_campaign_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#stop_campaign(_id, stop_campaign_request) ⇒ Models::CampaignResponse

Stops a campaign

Parameters:

  • _id (String)
  • stop_campaign_request (StopCampaignRequest)

Returns:



135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/getstream_ruby/generated/chat_client.rb', line 135

def stop_campaign(_id, stop_campaign_request)
  path = '/api/v2/chat/campaigns/{id}/stop'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = stop_campaign_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#translate_message(_id, translate_message_request) ⇒ Models::MessageActionResponse

Translates message to a given language using automated translation softwareSends events:- message.updated

Parameters:

  • _id (String)
  • translate_message_request (TranslateMessageRequest)

Returns:



1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1223

def translate_message(_id, translate_message_request)
  path = '/api/v2/chat/messages/{id}/translate'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = translate_message_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#truncate_channel(_type, _id, truncate_channel_request) ⇒ Models::TruncateChannelResponse

Truncates messages from a channel. Can be applied to the entire channel or scoped to specific members.Sends events:- channel.truncated

Parameters:

  • _type (String)
  • _id (String)
  • truncate_channel_request (TruncateChannelRequest)

Returns:



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/getstream_ruby/generated/chat_client.rb', line 715

def truncate_channel(_type, _id, truncate_channel_request)
  path = '/api/v2/chat/channels/{type}/{id}/truncate'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = truncate_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#undelete_message(_id, undelete_message_request) ⇒ Models::UndeleteMessageResponse

Undelete a message that was previously soft-deletedSends events:- message.undeleted

Parameters:

  • _id (String)
  • undelete_message_request (UndeleteMessageRequest)

Returns:



1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1243

def undelete_message(_id, undelete_message_request)
  path = '/api/v2/chat/messages/{id}/undelete'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = undelete_message_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#unmute_channel(unmute_channel_request) ⇒ Models::UnmuteResponse

Unmutes channel for userSends events:- channel.unmuted

Parameters:

  • unmute_channel_request (UnmuteChannelRequest)

Returns:



1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1440

def unmute_channel(unmute_channel_request)
  path = '/api/v2/chat/moderation/unmute/channel'
  # Build request body
  body = unmute_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#unread_counts(user_id = nil) ⇒ Models::WrappedUnreadCountsResponse

Fetch unread counts for a single user

Parameters:

  • user_id (String) (defaults to: nil)

Returns:



1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1835

def unread_counts(user_id = nil)
  path = '/api/v2/chat/unread'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#unread_counts_batch(unread_counts_batch_request) ⇒ Models::UnreadCountsBatchResponse

Fetch unread counts in batch for multiple users in one call

Parameters:

  • unread_counts_batch_request (UnreadCountsBatchRequest)

Returns:



1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1853

def unread_counts_batch(unread_counts_batch_request)
  path = '/api/v2/chat/unread_batch'
  # Build request body
  body = unread_counts_batch_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_campaign(_id, update_campaign_request) ⇒ Models::CampaignResponse

Updates a campaign

Parameters:

  • _id (String)
  • update_campaign_request (UpdateCampaignRequest)

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/getstream_ruby/generated/chat_client.rb', line 95

def update_campaign(_id, update_campaign_request)
  path = '/api/v2/chat/campaigns/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_campaign_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_channel(_type, _id, update_channel_request) ⇒ Models::UpdateChannelResponse

Change channel dataSends events:- channel.updated- member.added- member.removed- member.updated- message.new

Parameters:

  • _type (String)
  • _id (String)
  • update_channel_request (UpdateChannelRequest)

Returns:



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/getstream_ruby/generated/chat_client.rb', line 369

def update_channel(_type, _id, update_channel_request)
  path = '/api/v2/chat/channels/{type}/{id}'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_channel_partial(_type, _id, update_channel_partial_request) ⇒ Models::UpdateChannelPartialResponse

Updates certain fields of the channelSends events:- channel.updated

Parameters:

  • _type (String)
  • _id (String)
  • update_channel_partial_request (UpdateChannelPartialRequest)

Returns:



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/getstream_ruby/generated/chat_client.rb', line 347

def update_channel_partial(_type, _id, update_channel_partial_request)
  path = '/api/v2/chat/channels/{type}/{id}'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_channel_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#update_channel_type(name, update_channel_type_request) ⇒ Models::UpdateChannelTypeResponse

Updates channel type

Parameters:

  • name (String)
  • update_channel_type_request (UpdateChannelTypeRequest)

Returns:



820
821
822
823
824
825
826
827
828
829
830
831
832
833
# File 'lib/getstream_ruby/generated/chat_client.rb', line 820

def update_channel_type(name, update_channel_type_request)
  path = '/api/v2/chat/channeltypes/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build request body
  body = update_channel_type_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_command(name, update_command_request) ⇒ Models::UpdateCommandResponse

Updates custom chat command

Parameters:

  • name (String)
  • update_command_request (UpdateCommandRequest)

Returns:



902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/getstream_ruby/generated/chat_client.rb', line 902

def update_command(name, update_command_request)
  path = '/api/v2/chat/commands/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build request body
  body = update_command_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_member_partial(_type, _id, update_member_partial_request, user_id = nil) ⇒ Models::UpdateMemberPartialResponse

Parameters:

  • _type (String)
  • _id (String)
  • update_member_partial_request (UpdateMemberPartialRequest)
  • user_id (String) (defaults to: nil)

Returns:



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/getstream_ruby/generated/chat_client.rb', line 576

def update_member_partial(_type, _id, update_member_partial_request, user_id = nil)
  path = '/api/v2/chat/channels/{type}/{id}/member'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?
  # Build request body
  body = update_member_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    query_params: query_params,
    body: body
  )
end

#update_message(_id, update_message_request) ⇒ Models::UpdateMessageResponse

Updates message with new dataSends events:- message.updated

Parameters:

  • _id (String)
  • update_message_request (UpdateMessageRequest)

Returns:



1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1037

def update_message(_id, update_message_request)
  path = '/api/v2/chat/messages/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_message_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_message_partial(_id, update_message_partial_request) ⇒ Models::UpdateMessagePartialResponse

Updates certain fields of the messageSends events:- message.updated

Parameters:

  • _id (String)
  • update_message_partial_request (UpdateMessagePartialRequest)

Returns:



1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1057

def update_message_partial(_id, update_message_partial_request)
  path = '/api/v2/chat/messages/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_message_partial_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_reminder(message_id, update_reminder_request) ⇒ Models::UpdateReminderResponse

Updates an existing reminderSends events:- reminder.updated

Parameters:

  • message_id (String)
  • update_reminder_request (UpdateReminderRequest)

Returns:



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1331

def update_reminder(message_id, update_reminder_request)
  path = '/api/v2/chat/messages/{message_id}/reminders'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  # Build request body
  body = update_reminder_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#update_segment(_id, update_segment_request) ⇒ Models::UpdateSegmentResponse

Update an existing segment

Parameters:

  • _id (String)
  • update_segment_request (UpdateSegmentRequest)

Returns:



1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1659

def update_segment(_id, update_segment_request)
  path = '/api/v2/chat/segments/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = update_segment_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_thread_partial(message_id, update_thread_partial_request) ⇒ Models::UpdateThreadPartialResponse

Updates certain fields of the threadSends events:- thread.updated

Parameters:

  • message_id (String)
  • update_thread_partial_request (UpdateThreadPartialRequest)

Returns:



1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1816

def update_thread_partial(message_id, update_thread_partial_request)
  path = '/api/v2/chat/threads/{message_id}'
  # Replace path parameters
  path = path.gsub('{message_id}', message_id.to_s)
  # Build request body
  body = update_thread_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#upload_channel_file(_type, _id, upload_channel_file_request) ⇒ Models::UploadChannelFileResponse

Uploads file

Parameters:

  • _type (String)
  • _id (String)
  • upload_channel_file_request (UploadChannelFileRequest)

Returns:



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/getstream_ruby/generated/chat_client.rb', line 486

def upload_channel_file(_type, _id, upload_channel_file_request)
  path = '/api/v2/chat/channels/{type}/{id}/file'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = upload_channel_file_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#upload_channel_image(_type, _id, upload_channel_request) ⇒ Models::UploadChannelResponse

Uploads image

Parameters:

  • _type (String)
  • _id (String)
  • upload_channel_request (UploadChannelRequest)

Returns:



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/getstream_ruby/generated/chat_client.rb', line 553

def upload_channel_image(_type, _id, upload_channel_request)
  path = '/api/v2/chat/channels/{type}/{id}/image'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{id}', _id.to_s)
  # Build request body
  body = upload_channel_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end