Class: GetStream::Generated::ChatClient
- Inherits:
-
Object
- Object
- GetStream::Generated::ChatClient
- Defined in:
- lib/getstream_ruby/generated/chat_client.rb
Overview
Chat API client with generated methods
Instance Method Summary collapse
-
#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.
-
#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.
-
#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.
-
#create_channel_type(create_channel_type_request) ⇒ Models::CreateChannelTypeResponse
Creates new channel type.
-
#create_command(create_command_request) ⇒ Models::CreateCommandResponse
Creates custom chat command.
-
#create_reminder(message_id, create_reminder_request) ⇒ Models::ReminderResponseData
Creates a new reminderSends events:- reminder.created.
-
#delete_channel(_type, _id, hard_delete = nil) ⇒ Models::DeleteChannelResponse
Deletes channelSends events:- channel.deleted.
-
#delete_channel_file(_type, _id, url = nil) ⇒ Models::Response
Deletes previously uploaded file.
-
#delete_channel_image(_type, _id, url = nil) ⇒ Models::Response
Deletes previously uploaded image.
-
#delete_channel_type(name) ⇒ Models::Response
Deletes channel type.
-
#delete_channels(delete_channels_request) ⇒ Models::DeleteChannelsResponse
Allows to delete several channels at once asynchronouslySends events:- channel.deleted.
-
#delete_command(name) ⇒ Models::DeleteCommandResponse
Deletes custom chat command.
-
#delete_draft(_type, _id, parent_id = nil, user_id = nil) ⇒ Models::Response
Deletes a draftSends events:- draft.deleted.
-
#delete_message(_id, hard = nil, deleted_by = nil, delete_for_me = nil) ⇒ Models::DeleteMessageResponse
Deletes messageSends events:- message.deleted.
-
#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.
-
#delete_reaction(_id, _type, user_id = nil) ⇒ Models::DeleteReactionResponse
Removes user reaction from the messageSends events:- reaction.deleted.
-
#delete_reminder(message_id, user_id = nil) ⇒ Models::DeleteReminderResponse
Deletes a user’s created reminderSends events:- reminder.deleted.
-
#delete_segment(_id) ⇒ Models::Response
Delete a segment.
-
#delete_segment_targets(_id, delete_segment_targets_request) ⇒ Models::Response
Delete targets from a segment.
-
#ephemeral_message_update(_id, update_message_partial_request) ⇒ Models::UpdateMessagePartialResponse
Updates message fields without storing in database, only sends update eventSends events:- message.updated.
-
#export_channels(export_channels_request) ⇒ Models::ExportChannelsResponse
Exports channel data to JSON file.
-
#get_campaign(_id, prev = nil, _next = nil, limit = nil) ⇒ Models::GetCampaignResponse
Get campaign by ID.
-
#get_channel_type(name) ⇒ Models::GetChannelTypeResponse
Gets channel type.
-
#get_command(name) ⇒ Models::GetCommandResponse
Returns custom command by its name.
-
#get_draft(_type, _id, parent_id = nil, user_id = nil) ⇒ Models::GetDraftResponse
Get a draft.
-
#get_many_messages(_type, _id, ids) ⇒ Models::GetManyMessagesResponse
Returns list messages found by IDs.
-
#get_message(_id, show_deleted_message = nil) ⇒ Models::GetMessageResponse
Returns message by ID.
-
#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.
-
#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.
-
#get_reactions(_id, limit = nil, offset = nil) ⇒ Models::GetReactionsResponse
Returns list of reactions of specific message.
-
#get_replies(parent_id, limit = nil, id_gte = nil, id_gt = nil, id_lte = nil, id_lt = nil, id_around = nil, sort = nil) ⇒ Models::GetRepliesResponse
Returns replies (thread) of the message.
-
#get_segment(_id) ⇒ Models::GetSegmentResponse
Get segment.
-
#get_thread(message_id, reply_limit = nil, participant_limit = nil, member_limit = nil) ⇒ Models::GetThreadResponse
Return a specific thread.
-
#hide_channel(_type, _id, hide_channel_request) ⇒ Models::HideChannelResponse
Marks channel as hidden for current userSends events:- channel.hidden.
-
#initialize(client) ⇒ ChatClient
constructor
A new instance of ChatClient.
-
#list_channel_types ⇒ Models::ListChannelTypesResponse
Lists all available channel types.
-
#list_commands ⇒ Models::ListCommandsResponse
Returns all custom commands.
-
#mark_channels_read(mark_channels_read_request) ⇒ Models::MarkReadResponse
Marks channels as read up to the specific message.
-
#mark_delivered(mark_delivered_request, user_id = nil) ⇒ Models::MarkDeliveredResponse
Mark the status of a channel message delivered.
-
#mark_read(_type, _id, mark_read_request) ⇒ Models::MarkReadResponse
Marks channel as read up to the specific messageSends events:- message.read.
-
#mark_unread(_type, _id, mark_unread_request) ⇒ Models::Response
Marks channel as unread from a specific message.
-
#mute_channel(mute_channel_request) ⇒ Models::MuteChannelResponse
Mutes channel for userSends events:- channel.muted.
-
#query_banned_users(payload = nil) ⇒ Models::QueryBannedUsersResponse
Find and filter channel scoped or global user bans.
-
#query_campaigns(query_campaigns_request) ⇒ Models::QueryCampaignsResponse
Query campaigns with filter query.
-
#query_channels(query_channels_request) ⇒ Models::QueryChannelsResponse
Query channels with filter query.
-
#query_drafts(query_drafts_request) ⇒ Models::QueryDraftsResponse
Queries draft messages for a user.
-
#query_future_channel_bans(payload = nil) ⇒ Models::QueryFutureChannelBansResponse
Find and filter future channel bans created by the authenticated user.
-
#query_members(payload = nil) ⇒ Models::MembersResponse
Find and filter channel members.
-
#query_message_flags(payload = nil) ⇒ Models::QueryMessageFlagsResponse
Find and filter message flags.
-
#query_message_history(query_message_history_request) ⇒ Models::QueryMessageHistoryResponse
Queries history for one message.
-
#query_reactions(_id, query_reactions_request) ⇒ Models::QueryReactionsResponse
Get reactions on a message.
-
#query_reminders(query_reminders_request) ⇒ Models::QueryRemindersResponse
Queries reminders.
-
#query_segment_targets(_id, query_segment_targets_request) ⇒ Models::QuerySegmentTargetsResponse
Query segment targets.
-
#query_segments(query_segments_request) ⇒ Models::QuerySegmentsResponse
Query segments.
-
#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.
-
#query_threads(query_threads_request) ⇒ Models::QueryThreadsResponse
Returns the list of threads for specific user.
-
#run_message_action(_id, message_action_request) ⇒ Models::MessageActionResponse
Executes message command action with given parametersSends events:- message.new.
-
#search(payload = nil) ⇒ Models::SearchResponse
Search messages across channels.
-
#segment_target_exists(_id, target_id) ⇒ Models::Response
Check whether a target exists in a segment.
-
#send_event(_type, _id, send_event_request) ⇒ Models::EventResponse
Sends event to the channel.
-
#send_message(_type, _id, send_message_request) ⇒ Models::SendMessageResponse
Sends new message to the specified channelSends events:- message.new- message.updated.
-
#send_reaction(_id, send_reaction_request) ⇒ Models::SendReactionResponse
Sends reaction to specified messageSends events:- reaction.new- reaction.updated.
-
#send_user_custom_event(user_id, send_user_custom_event_request) ⇒ Models::Response
Sends a custom event to a userSends events:- *.
-
#show_channel(_type, _id, show_channel_request) ⇒ Models::ShowChannelResponse
Shows previously hidden channelSends events:- channel.visible.
-
#start_campaign(_id, start_campaign_request) ⇒ Models::StartCampaignResponse
Starts or schedules a campaign.
-
#stop_campaign(_id, stop_campaign_request) ⇒ Models::CampaignResponse
Stops a campaign.
-
#translate_message(_id, translate_message_request) ⇒ Models::MessageActionResponse
Translates message to a given language using automated translation softwareSends events:- message.updated.
-
#truncate_channel(_type, _id, truncate_channel_request) ⇒ Models::TruncateChannelResponse
Truncates messages from a channel.
-
#undelete_message(_id, undelete_message_request) ⇒ Models::UndeleteMessageResponse
Undelete a message that was previously soft-deletedSends events:- message.undeleted.
-
#unmute_channel(unmute_channel_request) ⇒ Models::UnmuteResponse
Unmutes channel for userSends events:- channel.unmuted.
-
#unread_counts(user_id = nil) ⇒ Models::WrappedUnreadCountsResponse
Fetch unread counts for a single user.
-
#unread_counts_batch(unread_counts_batch_request) ⇒ Models::UnreadCountsBatchResponse
Fetch unread counts in batch for multiple users in one call.
-
#update_channel(_type, _id, update_channel_request) ⇒ Models::UpdateChannelResponse
Change channel dataSends events:- channel.updated- member.added- member.removed- member.updated- message.new.
-
#update_channel_partial(_type, _id, update_channel_partial_request) ⇒ Models::UpdateChannelPartialResponse
Updates certain fields of the channelSends events:- channel.updated.
-
#update_channel_type(name, update_channel_type_request) ⇒ Models::UpdateChannelTypeResponse
Updates channel type.
-
#update_command(name, update_command_request) ⇒ Models::UpdateCommandResponse
Updates custom chat command.
- #update_member_partial(_type, _id, update_member_partial_request, user_id = nil) ⇒ Models::UpdateMemberPartialResponse
-
#update_message(_id, update_message_request) ⇒ Models::UpdateMessageResponse
Updates message with new dataSends events:- message.updated.
-
#update_message_partial(_id, update_message_partial_request) ⇒ Models::UpdateMessagePartialResponse
Updates certain fields of the messageSends events:- message.updated.
-
#update_reminder(message_id, update_reminder_request) ⇒ Models::UpdateReminderResponse
Updates an existing reminderSends events:- reminder.updated.
-
#update_thread_partial(message_id, update_thread_partial_request) ⇒ Models::UpdateThreadPartialResponse
Updates certain fields of the threadSends events:- thread.updated.
-
#upload_channel_file(_type, _id, upload_channel_file_request) ⇒ Models::UploadChannelFileResponse
Uploads file.
-
#upload_channel_image(_type, _id, upload_channel_request) ⇒ Models::UploadChannelResponse
Uploads image.
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
#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
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1151 def cast_poll_vote(, 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}', .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
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 118 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
984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 984 def (_id, ) path = '/api/v2/chat/messages/{id}/commit' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # 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
657 658 659 660 661 662 663 664 665 666 667 668 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 657 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
739 740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 739 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
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1238 def create_reminder(, create_reminder_request) path = '/api/v2/chat/messages/{message_id}/reminders' # Replace path parameters path = path.gsub('{message_id}', .to_s) # Build request body body = create_reminder_request # Make the API request @client.make_request( :post, path, body: body ) end |
#delete_channel(_type, _id, hard_delete = nil) ⇒ Models::DeleteChannelResponse
Deletes channelSends events:- channel.deleted
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 213 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
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 352 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
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 419 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
674 675 676 677 678 679 680 681 682 683 684 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 674 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
135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 135 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
756 757 758 759 760 761 762 763 764 765 766 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 756 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
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 281 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
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 880 def (_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
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1174 def delete_poll_vote(, 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}', .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
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1045 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
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1197 def delete_reminder(, user_id = nil) path = '/api/v2/chat/messages/{message_id}/reminders' # Replace path parameters path = path.gsub('{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_segment(_id) ⇒ Models::Response
Delete a segment
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1430 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
1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1463 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
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1004 def (_id, ) path = '/api/v2/chat/messages/{id}/ephemeral' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # Make the API request @client.make_request( :patch, path, body: body ) end |
#export_channels(export_channels_request) ⇒ Models::ExportChannelsResponse
Exports channel data to JSON file
825 826 827 828 829 830 831 832 833 834 835 836 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 825 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.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 39 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(name) ⇒ Models::GetChannelTypeResponse
Gets channel type
690 691 692 693 694 695 696 697 698 699 700 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 690 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
772 773 774 775 776 777 778 779 780 781 782 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 772 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
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 306 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) ⇒ Models::GetManyMessagesResponse
Returns list messages found by IDs
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 513 def (_type, _id, ids) 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? # 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
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 903 def (_id, = 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'] = unless .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
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 536 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
192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 192 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
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1068 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) ⇒ Models::GetRepliesResponse
Returns replies (thread) of the message
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 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) 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? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#get_segment(_id) ⇒ Models::GetSegmentResponse
Get segment
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1446 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
1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1557 def get_thread(, reply_limit = nil, participant_limit = nil, member_limit = nil) path = '/api/v2/chat/threads/{message_id}' # Replace path parameters path = path.gsub('{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 |
#hide_channel(_type, _id, hide_channel_request) ⇒ Models::HideChannelResponse
Marks channel as hidden for current userSends events:- channel.hidden
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 397 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_types ⇒ Models::ListChannelTypesResponse
Lists all available channel types
643 644 645 646 647 648 649 650 651 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 643 def list_channel_types() path = '/api/v2/chat/channeltypes' # Make the API request @client.make_request( :get, path ) end |
#list_commands ⇒ Models::ListCommandsResponse
Returns all custom commands
725 726 727 728 729 730 731 732 733 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 725 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
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 174 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.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 153 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
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 558 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
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 624 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
1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1308 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
1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1342 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
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 19 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
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 101 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
808 809 810 811 812 813 814 815 816 817 818 819 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 808 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
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1360 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
842 843 844 845 846 847 848 849 850 851 852 853 854 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 842 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
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1290 def (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
860 861 862 863 864 865 866 867 868 869 870 871 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 860 def () path = '/api/v2/chat/messages/history' # Build request body body = # 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
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1090 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
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1378 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
1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1501 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
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1413 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.
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1520 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
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1537 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
964 965 966 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 964 def (_id, ) path = '/api/v2/chat/messages/{id}/action' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # Make the API request @client.make_request( :post, path, body: body ) end |
#search(payload = nil) ⇒ Models::SearchResponse
Search messages across channels
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1395 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
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1483 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
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 330 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:- message.new- message.updated
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 491 def (_type, _id, ) 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 = # 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
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1024 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:- *
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1635 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 |
#show_channel(_type, _id, show_channel_request) ⇒ Models::ShowChannelResponse
Shows previously hidden channelSends events:- channel.visible
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 580 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
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 62 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
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 82 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
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1110 def (_id, ) path = '/api/v2/chat/messages/{id}/translate' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # 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
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 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
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1130 def (_id, ) path = '/api/v2/chat/messages/{id}/undelete' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # 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
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1325 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
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1599 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
1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1617 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_channel(_type, _id, update_channel_request) ⇒ Models::UpdateChannelResponse
Change channel dataSends events:- channel.updated- member.added- member.removed- member.updated- message.new
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 258 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
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 236 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
707 708 709 710 711 712 713 714 715 716 717 718 719 720 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 707 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
789 790 791 792 793 794 795 796 797 798 799 800 801 802 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 789 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
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 465 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
924 925 926 927 928 929 930 931 932 933 934 935 936 937 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 924 def (_id, ) path = '/api/v2/chat/messages/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # 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
944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 944 def (_id, ) path = '/api/v2/chat/messages/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = # 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
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1218 def update_reminder(, update_reminder_request) path = '/api/v2/chat/messages/{message_id}/reminders' # Replace path parameters path = path.gsub('{message_id}', .to_s) # Build request body body = update_reminder_request # Make the API request @client.make_request( :patch, path, body: body ) end |
#update_thread_partial(message_id, update_thread_partial_request) ⇒ Models::UpdateThreadPartialResponse
Updates certain fields of the threadSends events:- thread.updated
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 1580 def update_thread_partial(, update_thread_partial_request) path = '/api/v2/chat/threads/{message_id}' # Replace path parameters path = path.gsub('{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
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 375 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
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/getstream_ruby/generated/chat_client.rb', line 442 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 |