-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathactivity_response.rb
More file actions
266 lines (261 loc) · 12.8 KB
/
activity_response.rb
File metadata and controls
266 lines (261 loc) · 12.8 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
#
class ActivityResponse < GetStream::BaseModel
# Model attributes
# @!attribute bookmark_count
# @return [Integer] Number of bookmarks on the activity
attr_accessor :bookmark_count
# @!attribute comment_count
# @return [Integer] Number of comments on the activity
attr_accessor :comment_count
# @!attribute created_at
# @return [DateTime] When the activity was created
attr_accessor :created_at
# @!attribute hidden
# @return [Boolean] If this activity is hidden by this user (using activity feedback)
attr_accessor :hidden
# @!attribute id
# @return [String] Unique identifier for the activity
attr_accessor :id
# @!attribute popularity
# @return [Integer] Popularity score of the activity
attr_accessor :popularity
# @!attribute preview
# @return [Boolean] If this activity is obfuscated for this user. For premium content where you want to show a preview
attr_accessor :preview
# @!attribute reaction_count
# @return [Integer] Number of reactions to the activity
attr_accessor :reaction_count
# @!attribute restrict_replies
# @return [String] Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody
attr_accessor :restrict_replies
# @!attribute score
# @return [Float] Ranking score for this activity
attr_accessor :score
# @!attribute share_count
# @return [Integer] Number of times the activity was shared
attr_accessor :share_count
# @!attribute type
# @return [String] Type of activity
attr_accessor :type
# @!attribute updated_at
# @return [DateTime] When the activity was last updated
attr_accessor :updated_at
# @!attribute visibility
# @return [String] Visibility setting for the activity. One of: public, private, tag
attr_accessor :visibility
# @!attribute attachments
# @return [Array<Attachment>] Media attachments for the activity
attr_accessor :attachments
# @!attribute comments
# @return [Array<CommentResponse>] Latest 5 comments of this activity (comment replies excluded)
attr_accessor :comments
# @!attribute feeds
# @return [Array<String>] List of feed IDs containing this activity
attr_accessor :feeds
# @!attribute filter_tags
# @return [Array<String>] Tags for filtering
attr_accessor :filter_tags
# @!attribute interest_tags
# @return [Array<String>] Tags for user interests
attr_accessor :interest_tags
# @!attribute latest_reactions
# @return [Array<FeedsReactionResponse>] Recent reactions to the activity
attr_accessor :latest_reactions
# @!attribute mentioned_users
# @return [Array<UserResponse>] Users mentioned in the activity
attr_accessor :mentioned_users
# @!attribute own_bookmarks
# @return [Array<BookmarkResponse>] Current user's bookmarks for this activity
attr_accessor :own_bookmarks
# @!attribute own_reactions
# @return [Array<FeedsReactionResponse>] Current user's reactions to this activity
attr_accessor :own_reactions
# @!attribute collections
# @return [Hash<String, EnrichedCollectionResponse>] Enriched collection data referenced by this activity
attr_accessor :collections
# @!attribute custom
# @return [Object] Custom data for the activity
attr_accessor :custom
# @!attribute reaction_groups
# @return [Hash<String, FeedsReactionGroupResponse>] Grouped reactions by type
attr_accessor :reaction_groups
# @!attribute search_data
# @return [Object] Data for search indexing
attr_accessor :search_data
# @!attribute user
# @return [UserResponse]
attr_accessor :user
# @!attribute deleted_at
# @return [DateTime] When the activity was deleted
attr_accessor :deleted_at
# @!attribute edited_at
# @return [DateTime] When the activity was last edited
attr_accessor :edited_at
# @!attribute expires_at
# @return [DateTime] When the activity will expire
attr_accessor :expires_at
# @!attribute friend_reaction_count
# @return [Integer] Total count of reactions from friends on this activity
attr_accessor :friend_reaction_count
# @!attribute is_read
# @return [Boolean] Whether this activity has been read. Only set for feed groups with notification config (track_seen/track_read enabled).
attr_accessor :is_read
# @!attribute is_seen
# @return [Boolean] Whether this activity has been seen. Only set for feed groups with notification config (track_seen/track_read enabled).
attr_accessor :is_seen
# @!attribute is_watched
# @return [Boolean]
attr_accessor :is_watched
# @!attribute moderation_action
# @return [String]
attr_accessor :moderation_action
# @!attribute selector_source
# @return [String] Which activity selector provided this activity (e.g., 'following', 'popular', 'interest'). Only set when using multiple activity selectors with ranking.
attr_accessor :selector_source
# @!attribute text
# @return [String] Text content of the activity
attr_accessor :text
# @!attribute visibility_tag
# @return [String] If visibility is 'tag', this is the tag name
attr_accessor :visibility_tag
# @!attribute friend_reactions
# @return [Array<FeedsReactionResponse>] Reactions from users the current user follows or has mutual follows with
attr_accessor :friend_reactions
# @!attribute current_feed
# @return [FeedResponse]
attr_accessor :current_feed
# @!attribute location
# @return [Location]
attr_accessor :location
# @!attribute metrics
# @return [Hash<String, Integer>]
attr_accessor :metrics
# @!attribute moderation
# @return [ModerationV2Response]
attr_accessor :moderation
# @!attribute notification_context
# @return [NotificationContext]
attr_accessor :notification_context
# @!attribute parent
# @return [ActivityResponse]
attr_accessor :parent
# @!attribute poll
# @return [PollResponseData]
attr_accessor :poll
# @!attribute score_vars
# @return [Object] Variable values used at ranking time. Only included when include_score_vars is enabled in enrichment options.
attr_accessor :score_vars
# Initialize with attributes
def initialize(attributes = {})
super(attributes)
@bookmark_count = attributes[:bookmark_count] || attributes['bookmark_count']
@comment_count = attributes[:comment_count] || attributes['comment_count']
@created_at = attributes[:created_at] || attributes['created_at']
@hidden = attributes[:hidden] || attributes['hidden']
@id = attributes[:id] || attributes['id']
@popularity = attributes[:popularity] || attributes['popularity']
@preview = attributes[:preview] || attributes['preview']
@reaction_count = attributes[:reaction_count] || attributes['reaction_count']
@restrict_replies = attributes[:restrict_replies] || attributes['restrict_replies']
@score = attributes[:score] || attributes['score']
@share_count = attributes[:share_count] || attributes['share_count']
@type = attributes[:type] || attributes['type']
@updated_at = attributes[:updated_at] || attributes['updated_at']
@visibility = attributes[:visibility] || attributes['visibility']
@attachments = attributes[:attachments] || attributes['attachments']
@comments = attributes[:comments] || attributes['comments']
@feeds = attributes[:feeds] || attributes['feeds']
@filter_tags = attributes[:filter_tags] || attributes['filter_tags']
@interest_tags = attributes[:interest_tags] || attributes['interest_tags']
@latest_reactions = attributes[:latest_reactions] || attributes['latest_reactions']
@mentioned_users = attributes[:mentioned_users] || attributes['mentioned_users']
@own_bookmarks = attributes[:own_bookmarks] || attributes['own_bookmarks']
@own_reactions = attributes[:own_reactions] || attributes['own_reactions']
@collections = attributes[:collections] || attributes['collections']
@custom = attributes[:custom] || attributes['custom']
@reaction_groups = attributes[:reaction_groups] || attributes['reaction_groups']
@search_data = attributes[:search_data] || attributes['search_data']
@user = attributes[:user] || attributes['user']
@deleted_at = attributes[:deleted_at] || attributes['deleted_at'] || nil
@edited_at = attributes[:edited_at] || attributes['edited_at'] || nil
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
@friend_reaction_count = attributes[:friend_reaction_count] || attributes['friend_reaction_count'] || nil
@is_read = attributes[:is_read] || attributes['is_read'] || nil
@is_seen = attributes[:is_seen] || attributes['is_seen'] || nil
@is_watched = attributes[:is_watched] || attributes['is_watched'] || nil
@moderation_action = attributes[:moderation_action] || attributes['moderation_action'] || nil
@selector_source = attributes[:selector_source] || attributes['selector_source'] || nil
@text = attributes[:text] || attributes['text'] || nil
@visibility_tag = attributes[:visibility_tag] || attributes['visibility_tag'] || nil
@friend_reactions = attributes[:friend_reactions] || attributes['friend_reactions'] || nil
@current_feed = attributes[:current_feed] || attributes['current_feed'] || nil
@location = attributes[:location] || attributes['location'] || nil
@metrics = attributes[:metrics] || attributes['metrics'] || nil
@moderation = attributes[:moderation] || attributes['moderation'] || nil
@notification_context = attributes[:notification_context] || attributes['notification_context'] || nil
@parent = attributes[:parent] || attributes['parent'] || nil
@poll = attributes[:poll] || attributes['poll'] || nil
@score_vars = attributes[:score_vars] || attributes['score_vars'] || nil
end
# Override field mappings for JSON serialization
def self.json_field_mappings
{
bookmark_count: 'bookmark_count',
comment_count: 'comment_count',
created_at: 'created_at',
hidden: 'hidden',
id: 'id',
popularity: 'popularity',
preview: 'preview',
reaction_count: 'reaction_count',
restrict_replies: 'restrict_replies',
score: 'score',
share_count: 'share_count',
type: 'type',
updated_at: 'updated_at',
visibility: 'visibility',
attachments: 'attachments',
comments: 'comments',
feeds: 'feeds',
filter_tags: 'filter_tags',
interest_tags: 'interest_tags',
latest_reactions: 'latest_reactions',
mentioned_users: 'mentioned_users',
own_bookmarks: 'own_bookmarks',
own_reactions: 'own_reactions',
collections: 'collections',
custom: 'custom',
reaction_groups: 'reaction_groups',
search_data: 'search_data',
user: 'user',
deleted_at: 'deleted_at',
edited_at: 'edited_at',
expires_at: 'expires_at',
friend_reaction_count: 'friend_reaction_count',
is_read: 'is_read',
is_seen: 'is_seen',
is_watched: 'is_watched',
moderation_action: 'moderation_action',
selector_source: 'selector_source',
text: 'text',
visibility_tag: 'visibility_tag',
friend_reactions: 'friend_reactions',
current_feed: 'current_feed',
location: 'location',
metrics: 'metrics',
moderation: 'moderation',
notification_context: 'notification_context',
parent: 'parent',
poll: 'poll',
score_vars: 'score_vars'
}
end
end
end
end
end