-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmessage_with_channel_response.rb
More file actions
266 lines (261 loc) · 12.9 KB
/
message_with_channel_response.rb
File metadata and controls
266 lines (261 loc) · 12.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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
193
194
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# frozen_string_literal: true
# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
module GetStream
module Generated
module Models
# Represents any chat message
class MessageWithChannelResponse < GetStream::BaseModel
# Model attributes
# @!attribute cid
# @return [String] Channel unique identifier in <type>:<id> format
attr_accessor :cid
# @!attribute created_at
# @return [DateTime] Date/time of creation
attr_accessor :created_at
# @!attribute deleted_reply_count
# @return [Integer]
attr_accessor :deleted_reply_count
# @!attribute html
# @return [String] Contains HTML markup of the message. Can only be set when using server-side API
attr_accessor :html
# @!attribute id
# @return [String] Message ID is unique string identifier of the message
attr_accessor :id
# @!attribute mentioned_channel
# @return [Boolean] Whether the message mentioned the channel tag
attr_accessor :mentioned_channel
# @!attribute mentioned_here
# @return [Boolean] Whether the message mentioned online users with @here tag
attr_accessor :mentioned_here
# @!attribute pinned
# @return [Boolean] Whether message is pinned or not
attr_accessor :pinned
# @!attribute reply_count
# @return [Integer] Number of replies to this message
attr_accessor :reply_count
# @!attribute shadowed
# @return [Boolean] Whether the message was shadowed or not
attr_accessor :shadowed
# @!attribute silent
# @return [Boolean] Whether message is silent or not
attr_accessor :silent
# @!attribute text
# @return [String] Text of the message. Should be empty if `mml` is provided
attr_accessor :text
# @!attribute type
# @return [String] Contains type of the message. One of: regular, ephemeral, error, reply, system, deleted
attr_accessor :type
# @!attribute updated_at
# @return [DateTime] Date/time of the last update
attr_accessor :updated_at
# @!attribute attachments
# @return [Array<Attachment>] Array of message attachments
attr_accessor :attachments
# @!attribute latest_reactions
# @return [Array<ReactionResponse>] List of 10 latest reactions to this message
attr_accessor :latest_reactions
# @!attribute mentioned_users
# @return [Array<UserResponse>] List of mentioned users
attr_accessor :mentioned_users
# @!attribute own_reactions
# @return [Array<ReactionResponse>] List of 10 latest reactions of authenticated user to this message
attr_accessor :own_reactions
# @!attribute restricted_visibility
# @return [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
attr_accessor :restricted_visibility
# @!attribute channel
# @return [ChannelResponse]
attr_accessor :channel
# @!attribute custom
# @return [Object]
attr_accessor :custom
# @!attribute reaction_counts
# @return [Hash<String, Integer>] An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int)
attr_accessor :reaction_counts
# @!attribute reaction_scores
# @return [Hash<String, Integer>] An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int)
attr_accessor :reaction_scores
# @!attribute user
# @return [UserResponse]
attr_accessor :user
# @!attribute command
# @return [String] Contains provided slash command
attr_accessor :command
# @!attribute deleted_at
# @return [DateTime] Date/time of deletion
attr_accessor :deleted_at
# @!attribute deleted_for_me
# @return [Boolean]
attr_accessor :deleted_for_me
# @!attribute message_text_updated_at
# @return [DateTime]
attr_accessor :message_text_updated_at
# @!attribute mml
# @return [String] Should be empty if `text` is provided. Can only be set when using server-side API
attr_accessor :mml
# @!attribute parent_id
# @return [String] ID of parent message (thread)
attr_accessor :parent_id
# @!attribute pin_expires
# @return [DateTime] Date when pinned message expires
attr_accessor :pin_expires
# @!attribute pinned_at
# @return [DateTime] Date when message got pinned
attr_accessor :pinned_at
# @!attribute poll_id
# @return [String] Identifier of the poll to include in the message
attr_accessor :poll_id
# @!attribute quoted_message_id
# @return [String]
attr_accessor :quoted_message_id
# @!attribute show_in_channel
# @return [Boolean] Whether thread reply should be shown in the channel as well
attr_accessor :show_in_channel
# @!attribute mentioned_roles
# @return [Array<String>] List of roles mentioned in the message (e.g. admin, channel_moderator, custom roles). Members with matching roles will receive push notifications based on their push preferences. Max 10 roles
attr_accessor :mentioned_roles
# @!attribute thread_participants
# @return [Array<UserResponse>] List of users who participate in thread
attr_accessor :thread_participants
# @!attribute draft
# @return [DraftResponse]
attr_accessor :draft
# @!attribute i18n
# @return [Hash<String, String>] Object with translations. Key `language` contains the original language key. Other keys contain translations
attr_accessor :i18n
# @!attribute image_labels
# @return [Hash<String, Array<String>>] Contains image moderation information
attr_accessor :image_labels
# @!attribute member
# @return [ChannelMemberResponse]
attr_accessor :member
# @!attribute moderation
# @return [ModerationV2Response]
attr_accessor :moderation
# @!attribute pinned_by
# @return [UserResponse]
attr_accessor :pinned_by
# @!attribute poll
# @return [PollResponseData]
attr_accessor :poll
# @!attribute quoted_message
# @return [MessageResponse]
attr_accessor :quoted_message
# @!attribute reaction_groups
# @return [Hash<String, ReactionGroupResponse>]
attr_accessor :reaction_groups
# @!attribute reminder
# @return [ReminderResponseData]
attr_accessor :reminder
# @!attribute shared_location
# @return [SharedLocationResponseData]
attr_accessor :shared_location
# Initialize with attributes
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']
@mentioned_channel = attributes[:mentioned_channel] || attributes['mentioned_channel']
@mentioned_here = attributes[:mentioned_here] || attributes['mentioned_here']
@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']
@channel = attributes[:channel] || attributes['channel']
@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
@mentioned_roles = attributes[:mentioned_roles] || attributes['mentioned_roles'] || 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
# Override field mappings for JSON serialization
def self.json_field_mappings
{
cid: 'cid',
created_at: 'created_at',
deleted_reply_count: 'deleted_reply_count',
html: 'html',
id: 'id',
mentioned_channel: 'mentioned_channel',
mentioned_here: 'mentioned_here',
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',
channel: 'channel',
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',
mentioned_roles: 'mentioned_roles',
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
end
end
end
end