Class: GetStream::Generated::Models::MessageResponse
- Defined in:
- lib/getstream_ruby/generated/models/message_response.rb
Overview
Represents any chat message
Instance Attribute Summary collapse
-
#attachments ⇒ Array<Attachment>
Array of message attachments.
-
#cid ⇒ String
Channel unique identifier in <type>:<id> format.
-
#command ⇒ String
Contains provided slash command.
-
#created_at ⇒ DateTime
Date/time of creation.
- #custom ⇒ Object
-
#deleted_at ⇒ DateTime
Date/time of deletion.
- #deleted_for_me ⇒ Boolean
- #deleted_reply_count ⇒ Integer
- #draft ⇒ DraftResponse
-
#html ⇒ String
Contains HTML markup of the message.
-
#i18n ⇒ Hash<String, String>
Object with translations.
-
#id ⇒ String
Message ID is unique string identifier of the message.
-
#image_labels ⇒ Hash<String, Array<String>>
Contains image moderation information.
-
#latest_reactions ⇒ Array<ReactionResponse>
List of 10 latest reactions to this message.
- #member ⇒ ChannelMemberResponse
-
#mentioned_users ⇒ Array<UserResponse>
List of mentioned users.
- #message_text_updated_at ⇒ DateTime
-
#mml ⇒ String
Should be empty if ‘text` is provided.
- #moderation ⇒ ModerationV2Response
-
#own_reactions ⇒ Array<ReactionResponse>
List of 10 latest reactions of authenticated user to this message.
-
#parent_id ⇒ String
ID of parent message (thread).
-
#pin_expires ⇒ DateTime
Date when pinned message expires.
-
#pinned ⇒ Boolean
Whether message is pinned or not.
-
#pinned_at ⇒ DateTime
Date when message got pinned.
- #pinned_by ⇒ UserResponse
- #poll ⇒ PollResponseData
-
#poll_id ⇒ String
Identifier of the poll to include in the message.
- #quoted_message ⇒ MessageResponse
- #quoted_message_id ⇒ String
-
#reaction_counts ⇒ Hash<String, Integer>
An object containing number of reactions of each type.
- #reaction_groups ⇒ Hash<String, ReactionGroupResponse>
-
#reaction_scores ⇒ Hash<String, Integer>
An object containing scores of reactions of each type.
- #reminder ⇒ ReminderResponseData
-
#reply_count ⇒ Integer
Number of replies to this message.
-
#restricted_visibility ⇒ Array<String>
A list of user ids that have restricted visibility to the message, if the list is not empty, the message is only visible to the users in the list.
-
#shadowed ⇒ Boolean
Whether the message was shadowed or not.
- #shared_location ⇒ SharedLocationResponseData
-
#show_in_channel ⇒ Boolean
Whether thread reply should be shown in the channel as well.
-
#silent ⇒ Boolean
Whether message is silent or not.
-
#text ⇒ String
Text of the message.
-
#thread_participants ⇒ Array<UserResponse>
List of users who participate in thread.
-
#type ⇒ String
Contains type of the message.
-
#updated_at ⇒ DateTime
Date/time of the last update.
- #user ⇒ UserResponse
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MessageResponse
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ MessageResponse
Initialize with attributes
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 146 def initialize(attributes = {}) super(attributes) @cid = attributes[:cid] || attributes['cid'] @created_at = attributes[:created_at] || attributes['created_at'] @deleted_reply_count = attributes[:deleted_reply_count] || attributes['deleted_reply_count'] @html = attributes[:html] || attributes['html'] @id = attributes[:id] || attributes['id'] @pinned = attributes[:pinned] || attributes['pinned'] @reply_count = attributes[:reply_count] || attributes['reply_count'] @shadowed = attributes[:shadowed] || attributes['shadowed'] @silent = attributes[:silent] || attributes['silent'] @text = attributes[:text] || attributes['text'] @type = attributes[:type] || attributes['type'] @updated_at = attributes[:updated_at] || attributes['updated_at'] @attachments = attributes[:attachments] || attributes['attachments'] @latest_reactions = attributes[:latest_reactions] || attributes['latest_reactions'] @mentioned_users = attributes[:mentioned_users] || attributes['mentioned_users'] @own_reactions = attributes[:own_reactions] || attributes['own_reactions'] @restricted_visibility = attributes[:restricted_visibility] || attributes['restricted_visibility'] @custom = attributes[:custom] || attributes['custom'] @reaction_counts = attributes[:reaction_counts] || attributes['reaction_counts'] @reaction_scores = attributes[:reaction_scores] || attributes['reaction_scores'] @user = attributes[:user] || attributes['user'] @command = attributes[:command] || attributes['command'] || nil @deleted_at = attributes[:deleted_at] || attributes['deleted_at'] || nil @deleted_for_me = attributes[:deleted_for_me] || attributes['deleted_for_me'] || nil @message_text_updated_at = attributes[:message_text_updated_at] || attributes['message_text_updated_at'] || nil @mml = attributes[:mml] || attributes['mml'] || nil @parent_id = attributes[:parent_id] || attributes['parent_id'] || nil @pin_expires = attributes[:pin_expires] || attributes['pin_expires'] || nil @pinned_at = attributes[:pinned_at] || attributes['pinned_at'] || nil @poll_id = attributes[:poll_id] || attributes['poll_id'] || nil @quoted_message_id = attributes[:quoted_message_id] || attributes['quoted_message_id'] || nil @show_in_channel = attributes[:show_in_channel] || attributes['show_in_channel'] || nil @thread_participants = attributes[:thread_participants] || attributes['thread_participants'] || nil @draft = attributes[:draft] || attributes['draft'] || nil @i18n = attributes[:i18n] || attributes['i18n'] || nil @image_labels = attributes[:image_labels] || attributes['image_labels'] || nil @member = attributes[:member] || attributes['member'] || nil @moderation = attributes[:moderation] || attributes['moderation'] || nil @pinned_by = attributes[:pinned_by] || attributes['pinned_by'] || nil @poll = attributes[:poll] || attributes['poll'] || nil @quoted_message = attributes[:quoted_message] || attributes['quoted_message'] || nil @reaction_groups = attributes[:reaction_groups] || attributes['reaction_groups'] || nil @reminder = attributes[:reminder] || attributes['reminder'] || nil @shared_location = attributes[:shared_location] || attributes['shared_location'] || nil end |
Instance Attribute Details
#attachments ⇒ Array<Attachment>
Returns Array of message attachments.
50 51 52 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 50 def @attachments end |
#cid ⇒ String
Returns Channel unique identifier in <type>:<id> format.
14 15 16 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 14 def cid @cid end |
#command ⇒ String
Returns Contains provided slash command.
77 78 79 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 77 def command @command end |
#created_at ⇒ DateTime
Returns Date/time of creation.
17 18 19 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 17 def created_at @created_at end |
#custom ⇒ Object
65 66 67 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 65 def custom @custom end |
#deleted_at ⇒ DateTime
Returns Date/time of deletion.
80 81 82 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 80 def deleted_at @deleted_at end |
#deleted_for_me ⇒ Boolean
83 84 85 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 83 def deleted_for_me @deleted_for_me end |
#deleted_reply_count ⇒ Integer
20 21 22 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 20 def deleted_reply_count @deleted_reply_count end |
#draft ⇒ DraftResponse
113 114 115 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 113 def draft @draft end |
#html ⇒ String
Returns Contains HTML markup of the message. Can only be set when using server-side API.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 23 def html @html end |
#i18n ⇒ Hash<String, String>
Returns Object with translations. Key ‘language` contains the original language key. Other keys contain translations.
116 117 118 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 116 def i18n @i18n end |
#id ⇒ String
Returns Message ID is unique string identifier of the message.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 26 def id @id end |
#image_labels ⇒ Hash<String, Array<String>>
Returns Contains image moderation information.
119 120 121 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 119 def image_labels @image_labels end |
#latest_reactions ⇒ Array<ReactionResponse>
Returns List of 10 latest reactions to this message.
53 54 55 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 53 def latest_reactions @latest_reactions end |
#member ⇒ ChannelMemberResponse
122 123 124 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 122 def member @member end |
#mentioned_users ⇒ Array<UserResponse>
Returns List of mentioned users.
56 57 58 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 56 def mentioned_users @mentioned_users end |
#message_text_updated_at ⇒ DateTime
86 87 88 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 86 def @message_text_updated_at end |
#mml ⇒ String
Returns Should be empty if ‘text` is provided. Can only be set when using server-side API.
89 90 91 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 89 def mml @mml end |
#moderation ⇒ ModerationV2Response
125 126 127 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 125 def moderation @moderation end |
#own_reactions ⇒ Array<ReactionResponse>
Returns List of 10 latest reactions of authenticated user to this message.
59 60 61 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 59 def own_reactions @own_reactions end |
#parent_id ⇒ String
Returns ID of parent message (thread).
92 93 94 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 92 def parent_id @parent_id end |
#pin_expires ⇒ DateTime
Returns Date when pinned message expires.
95 96 97 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 95 def pin_expires @pin_expires end |
#pinned ⇒ Boolean
Returns Whether message is pinned or not.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 29 def pinned @pinned end |
#pinned_at ⇒ DateTime
Returns Date when message got pinned.
98 99 100 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 98 def pinned_at @pinned_at end |
#pinned_by ⇒ UserResponse
128 129 130 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 128 def pinned_by @pinned_by end |
#poll ⇒ PollResponseData
131 132 133 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 131 def poll @poll end |
#poll_id ⇒ String
Returns Identifier of the poll to include in the message.
101 102 103 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 101 def poll_id @poll_id end |
#quoted_message ⇒ MessageResponse
134 135 136 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 134 def @quoted_message end |
#quoted_message_id ⇒ String
104 105 106 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 104 def @quoted_message_id end |
#reaction_counts ⇒ Hash<String, Integer>
Returns An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int).
68 69 70 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 68 def reaction_counts @reaction_counts end |
#reaction_groups ⇒ Hash<String, ReactionGroupResponse>
137 138 139 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 137 def reaction_groups @reaction_groups end |
#reaction_scores ⇒ Hash<String, Integer>
Returns An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int).
71 72 73 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 71 def reaction_scores @reaction_scores end |
#reminder ⇒ ReminderResponseData
140 141 142 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 140 def reminder @reminder end |
#reply_count ⇒ Integer
Returns Number of replies to this message.
32 33 34 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 32 def reply_count @reply_count end |
#restricted_visibility ⇒ Array<String>
Returns A list of user ids that have restricted visibility to the message, if the list is not empty, the message is only visible to the users in the list.
62 63 64 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 62 def restricted_visibility @restricted_visibility end |
#shadowed ⇒ Boolean
Returns Whether the message was shadowed or not.
35 36 37 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 35 def shadowed @shadowed end |
#shared_location ⇒ SharedLocationResponseData
143 144 145 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 143 def shared_location @shared_location end |
#show_in_channel ⇒ Boolean
Returns Whether thread reply should be shown in the channel as well.
107 108 109 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 107 def show_in_channel @show_in_channel end |
#silent ⇒ Boolean
Returns Whether message is silent or not.
38 39 40 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 38 def silent @silent end |
#text ⇒ String
Returns Text of the message. Should be empty if ‘mml` is provided.
41 42 43 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 41 def text @text end |
#thread_participants ⇒ Array<UserResponse>
Returns List of users who participate in thread.
110 111 112 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 110 def thread_participants @thread_participants end |
#type ⇒ String
Returns Contains type of the message.
44 45 46 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 44 def type @type end |
#updated_at ⇒ DateTime
Returns Date/time of the last update.
47 48 49 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 47 def updated_at @updated_at end |
#user ⇒ UserResponse
74 75 76 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 74 def user @user end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/getstream_ruby/generated/models/message_response.rb', line 195 def self.json_field_mappings { cid: 'cid', created_at: 'created_at', deleted_reply_count: 'deleted_reply_count', html: 'html', id: 'id', pinned: 'pinned', reply_count: 'reply_count', shadowed: 'shadowed', silent: 'silent', text: 'text', type: 'type', updated_at: 'updated_at', attachments: 'attachments', latest_reactions: 'latest_reactions', mentioned_users: 'mentioned_users', own_reactions: 'own_reactions', restricted_visibility: 'restricted_visibility', custom: 'custom', reaction_counts: 'reaction_counts', reaction_scores: 'reaction_scores', user: 'user', command: 'command', deleted_at: 'deleted_at', deleted_for_me: 'deleted_for_me', message_text_updated_at: 'message_text_updated_at', mml: 'mml', parent_id: 'parent_id', pin_expires: 'pin_expires', pinned_at: 'pinned_at', poll_id: 'poll_id', quoted_message_id: 'quoted_message_id', show_in_channel: 'show_in_channel', thread_participants: 'thread_participants', draft: 'draft', i18n: 'i18n', image_labels: 'image_labels', member: 'member', moderation: 'moderation', pinned_by: 'pinned_by', poll: 'poll', quoted_message: 'quoted_message', reaction_groups: 'reaction_groups', reminder: 'reminder', shared_location: 'shared_location' } end |