Skip to content

Commit cff6982

Browse files
authored
Merge pull request #29 from GetStream/cha-1578_openapi-refactor-codegen
[CHA-1578] refactor: code generated from openapi specs
2 parents efd2bce + 65a4563 commit cff6982

235 files changed

Lines changed: 7287 additions & 989 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/getstream_ruby/generated/feed.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ def reject_feed_member_invite(reject_feed_member_invite_request)
122122
@client.feeds.reject_feed_member_invite(@feed_group_id, @feed_id, reject_feed_member_invite_request)
123123
end
124124

125+
# Query pinned activities for a feed with filter query
126+
#
127+
# @param query_pinned_activities_request [QueryPinnedActivitiesRequest]
128+
# @return [Models::QueryPinnedActivitiesResponse]
129+
def query_pinned_activities(query_pinned_activities_request)
130+
131+
# Delegate to the FeedsClient
132+
@client.feeds.query_pinned_activities(@feed_group_id, @feed_id, query_pinned_activities_request)
133+
end
134+
125135
end
126136
end
127137
end

lib/getstream_ruby/generated/feeds_client.rb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ def upsert_activities(upsert_activities_request)
4646
)
4747
end
4848

49+
# Updates certain fields of multiple activities in a batch. Use 'set' to update specific fields and 'unset' to remove fields. Activities that fail due to not found, permission denied, or no changes detected are silently skipped and not included in the response. However, validation errors (e.g., updating reserved fields, invalid field values) will fail the entire batch request.Sends events:- feeds.activity.updated
50+
#
51+
# @param update_activities_partial_batch_request [UpdateActivitiesPartialBatchRequest]
52+
# @return [Models::UpdateActivitiesPartialBatchResponse]
53+
def update_activities_partial_batch(update_activities_partial_batch_request)
54+
path = '/api/v2/feeds/activities/batch/partial'
55+
# Build request body
56+
body = update_activities_partial_batch_request
57+
58+
# Make the API request
59+
@client.make_request(
60+
:patch,
61+
path,
62+
body: body
63+
)
64+
end
65+
4966
# Delete one or more activities by their IDs
5067
#
5168
# @param delete_activities_request [DeleteActivitiesRequest]
@@ -1036,6 +1053,28 @@ def reject_feed_member_invite(feed_group_id, feed_id, reject_feed_member_invite_
10361053
)
10371054
end
10381055

1056+
# Query pinned activities for a feed with filter query
1057+
#
1058+
# @param feed_group_id [String]
1059+
# @param feed_id [String]
1060+
# @param query_pinned_activities_request [QueryPinnedActivitiesRequest]
1061+
# @return [Models::QueryPinnedActivitiesResponse]
1062+
def query_pinned_activities(feed_group_id, feed_id, query_pinned_activities_request)
1063+
path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/pinned_activities/query'
1064+
# Replace path parameters
1065+
path = path.gsub('{feed_group_id}', feed_group_id.to_s)
1066+
path = path.gsub('{feed_id}', feed_id.to_s)
1067+
# Build request body
1068+
body = query_pinned_activities_request
1069+
1070+
# Make the API request
1071+
@client.make_request(
1072+
:post,
1073+
path,
1074+
body: body
1075+
)
1076+
end
1077+
10391078
# Get follow suggestions for a feed group
10401079
#
10411080
# @param feed_group_id [String]

lib/getstream_ruby/generated/models/activity_feedback_event_payload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ActivityFeedbackEventPayload < GetStream::BaseModel
1010

1111
# Model attributes
1212
# @!attribute action
13-
# @return [String] The type of feedback action
13+
# @return [String] The type of feedback action. One of: hide, show_more, show_less
1414
attr_accessor :action
1515
# @!attribute activity_id
1616
# @return [String] The activity that received feedback

lib/getstream_ruby/generated/models/activity_request.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class ActivityRequest < GetStream::BaseModel
1515
# @!attribute feeds
1616
# @return [Array<String>] List of feeds to add the activity to with a default max limit of 25 feeds
1717
attr_accessor :feeds
18+
# @!attribute copy_custom_to_notification
19+
# @return [Boolean] Whether to copy custom data to the notification activity (only applies when create_notification_activity is true)
20+
attr_accessor :copy_custom_to_notification
1821
# @!attribute create_notification_activity
1922
# @return [Boolean] Whether to create notification activities for mentioned users
2023
attr_accessor :create_notification_activity
@@ -31,7 +34,7 @@ class ActivityRequest < GetStream::BaseModel
3134
# @return [String] ID of a poll to attach to activity
3235
attr_accessor :poll_id
3336
# @!attribute restrict_replies
34-
# @return [String] Controls who can add comments/replies to this activity. Options: 'everyone' (default - anyone can reply), 'people_i_follow' (only people the activity creator follows can reply), 'nobody' (no one can reply)
37+
# @return [String] Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody
3538
attr_accessor :restrict_replies
3639
# @!attribute skip_enrich_url
3740
# @return [Boolean] Whether to skip URL enrichment for the activity
@@ -46,7 +49,7 @@ class ActivityRequest < GetStream::BaseModel
4649
# @return [String] ID of the user creating the activity
4750
attr_accessor :user_id
4851
# @!attribute visibility
49-
# @return [String] Visibility setting for the activity
52+
# @return [String] Visibility setting for the activity. One of: public, private, tag
5053
attr_accessor :visibility
5154
# @!attribute visibility_tag
5255
# @return [String] If visibility is 'tag', this is the tag name and is required
@@ -81,6 +84,7 @@ def initialize(attributes = {})
8184
super(attributes)
8285
@type = attributes[:type] || attributes['type']
8386
@feeds = attributes[:feeds] || attributes['feeds']
87+
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
8488
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
8589
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
8690
@id = attributes[:id] || attributes['id'] || nil
@@ -108,6 +112,7 @@ def self.json_field_mappings
108112
{
109113
type: 'type',
110114
feeds: 'feeds',
115+
copy_custom_to_notification: 'copy_custom_to_notification',
111116
create_notification_activity: 'create_notification_activity',
112117
expires_at: 'expires_at',
113118
id: 'id',

lib/getstream_ruby/generated/models/activity_response.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ActivityResponse < GetStream::BaseModel
3434
# @return [Integer] Number of reactions to the activity
3535
attr_accessor :reaction_count
3636
# @!attribute restrict_replies
37-
# @return [String] Controls who can reply to this activity. Values: everyone, people_i_follow, nobody
37+
# @return [String] Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody
3838
attr_accessor :restrict_replies
3939
# @!attribute score
4040
# @return [Float] Ranking score for this activity
@@ -49,7 +49,7 @@ class ActivityResponse < GetStream::BaseModel
4949
# @return [DateTime] When the activity was last updated
5050
attr_accessor :updated_at
5151
# @!attribute visibility
52-
# @return [String] Visibility setting for the activity
52+
# @return [String] Visibility setting for the activity. One of: public, private, tag
5353
attr_accessor :visibility
5454
# @!attribute attachments
5555
# @return [Array<Attachment>] Media attachments for the activity
@@ -85,7 +85,7 @@ class ActivityResponse < GetStream::BaseModel
8585
# @return [Object] Custom data for the activity
8686
attr_accessor :custom
8787
# @!attribute reaction_groups
88-
# @return [Hash<String, ReactionGroupResponse>] Grouped reactions by type
88+
# @return [Hash<String, FeedsReactionGroupResponse>] Grouped reactions by type
8989
attr_accessor :reaction_groups
9090
# @!attribute search_data
9191
# @return [Object] Data for search indexing
@@ -102,6 +102,9 @@ class ActivityResponse < GetStream::BaseModel
102102
# @!attribute expires_at
103103
# @return [DateTime] When the activity will expire
104104
attr_accessor :expires_at
105+
# @!attribute friend_reaction_count
106+
# @return [Integer] Total count of reactions from friends on this activity
107+
attr_accessor :friend_reaction_count
105108
# @!attribute is_watched
106109
# @return [Boolean]
107110
attr_accessor :is_watched
@@ -117,6 +120,9 @@ class ActivityResponse < GetStream::BaseModel
117120
# @!attribute visibility_tag
118121
# @return [String] If visibility is 'tag', this is the tag name
119122
attr_accessor :visibility_tag
123+
# @!attribute friend_reactions
124+
# @return [Array<FeedsReactionResponse>] Reactions from users the current user follows or has mutual follows with
125+
attr_accessor :friend_reactions
120126
# @!attribute current_feed
121127
# @return [FeedResponse]
122128
attr_accessor :current_feed
@@ -170,11 +176,13 @@ def initialize(attributes = {})
170176
@deleted_at = attributes[:deleted_at] || attributes['deleted_at'] || nil
171177
@edited_at = attributes[:edited_at] || attributes['edited_at'] || nil
172178
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
179+
@friend_reaction_count = attributes[:friend_reaction_count] || attributes['friend_reaction_count'] || nil
173180
@is_watched = attributes[:is_watched] || attributes['is_watched'] || nil
174181
@moderation_action = attributes[:moderation_action] || attributes['moderation_action'] || nil
175182
@selector_source = attributes[:selector_source] || attributes['selector_source'] || nil
176183
@text = attributes[:text] || attributes['text'] || nil
177184
@visibility_tag = attributes[:visibility_tag] || attributes['visibility_tag'] || nil
185+
@friend_reactions = attributes[:friend_reactions] || attributes['friend_reactions'] || nil
178186
@current_feed = attributes[:current_feed] || attributes['current_feed'] || nil
179187
@location = attributes[:location] || attributes['location'] || nil
180188
@moderation = attributes[:moderation] || attributes['moderation'] || nil
@@ -217,11 +225,13 @@ def self.json_field_mappings
217225
deleted_at: 'deleted_at',
218226
edited_at: 'edited_at',
219227
expires_at: 'expires_at',
228+
friend_reaction_count: 'friend_reaction_count',
220229
is_watched: 'is_watched',
221230
moderation_action: 'moderation_action',
222231
selector_source: 'selector_source',
223232
text: 'text',
224233
visibility_tag: 'visibility_tag',
234+
friend_reactions: 'friend_reactions',
225235
current_feed: 'current_feed',
226236
location: 'location',
227237
moderation: 'moderation',
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# frozen_string_literal: true
2+
3+
# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
4+
5+
module GetStream
6+
module Generated
7+
module Models
8+
# Emitted when an activity is restored.
9+
class ActivityRestoredEvent < GetStream::BaseModel
10+
11+
# Model attributes
12+
# @!attribute created_at
13+
# @return [DateTime] Date/time of creation
14+
attr_accessor :created_at
15+
# @!attribute fid
16+
# @return [String]
17+
attr_accessor :fid
18+
# @!attribute activity
19+
# @return [ActivityResponse]
20+
attr_accessor :activity
21+
# @!attribute custom
22+
# @return [Object]
23+
attr_accessor :custom
24+
# @!attribute type
25+
# @return [String] The type of the event
26+
attr_accessor :type
27+
# @!attribute feed_visibility
28+
# @return [String]
29+
attr_accessor :feed_visibility
30+
# @!attribute received_at
31+
# @return [DateTime]
32+
attr_accessor :received_at
33+
# @!attribute user
34+
# @return [UserResponseCommonFields]
35+
attr_accessor :user
36+
37+
# Initialize with attributes
38+
def initialize(attributes = {})
39+
super(attributes)
40+
@created_at = attributes[:created_at] || attributes['created_at']
41+
@fid = attributes[:fid] || attributes['fid']
42+
@activity = attributes[:activity] || attributes['activity']
43+
@custom = attributes[:custom] || attributes['custom']
44+
@type = attributes[:type] || attributes['type'] || "feeds.activity.restored"
45+
@feed_visibility = attributes[:feed_visibility] || attributes['feed_visibility'] || nil
46+
@received_at = attributes[:received_at] || attributes['received_at'] || nil
47+
@user = attributes[:user] || attributes['user'] || nil
48+
end
49+
50+
# Override field mappings for JSON serialization
51+
def self.json_field_mappings
52+
{
53+
created_at: 'created_at',
54+
fid: 'fid',
55+
activity: 'activity',
56+
custom: 'custom',
57+
type: 'type',
58+
feed_visibility: 'feed_visibility',
59+
received_at: 'received_at',
60+
user: 'user'
61+
}
62+
end
63+
end
64+
end
65+
end
66+
end

lib/getstream_ruby/generated/models/activity_selector_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ActivitySelectorConfig < GetStream::BaseModel
1010

1111
# Model attributes
1212
# @!attribute type
13-
# @return [String] Type of selector
13+
# @return [String] Type of selector. One of: popular, proximity, following, current_feed, query, interest, follow_suggestion
1414
attr_accessor :type
1515
# @!attribute cutoff_time
1616
# @return [String] Time threshold for activity selection (string). Expected RFC3339 format (e.g., 2006-01-02T15:04:05Z07:00). Cannot be used together with cutoff_window

lib/getstream_ruby/generated/models/add_activity_request.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class AddActivityRequest < GetStream::BaseModel
1515
# @!attribute feeds
1616
# @return [Array<String>] List of feeds to add the activity to with a default max limit of 25 feeds
1717
attr_accessor :feeds
18+
# @!attribute copy_custom_to_notification
19+
# @return [Boolean] Whether to copy custom data to the notification activity (only applies when create_notification_activity is true)
20+
attr_accessor :copy_custom_to_notification
1821
# @!attribute create_notification_activity
1922
# @return [Boolean] Whether to create notification activities for mentioned users
2023
attr_accessor :create_notification_activity
@@ -31,7 +34,7 @@ class AddActivityRequest < GetStream::BaseModel
3134
# @return [String] ID of a poll to attach to activity
3235
attr_accessor :poll_id
3336
# @!attribute restrict_replies
34-
# @return [String] Controls who can add comments/replies to this activity. Options: 'everyone' (default - anyone can reply), 'people_i_follow' (only people the activity creator follows can reply), 'nobody' (no one can reply)
37+
# @return [String] Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody
3538
attr_accessor :restrict_replies
3639
# @!attribute skip_enrich_url
3740
# @return [Boolean] Whether to skip URL enrichment for the activity
@@ -46,7 +49,7 @@ class AddActivityRequest < GetStream::BaseModel
4649
# @return [String] ID of the user creating the activity
4750
attr_accessor :user_id
4851
# @!attribute visibility
49-
# @return [String] Visibility setting for the activity
52+
# @return [String] Visibility setting for the activity. One of: public, private, tag
5053
attr_accessor :visibility
5154
# @!attribute visibility_tag
5255
# @return [String] If visibility is 'tag', this is the tag name and is required
@@ -81,6 +84,7 @@ def initialize(attributes = {})
8184
super(attributes)
8285
@type = attributes[:type] || attributes['type']
8386
@feeds = attributes[:feeds] || attributes['feeds']
87+
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
8488
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
8589
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
8690
@id = attributes[:id] || attributes['id'] || nil
@@ -108,6 +112,7 @@ def self.json_field_mappings
108112
{
109113
type: 'type',
110114
feeds: 'feeds',
115+
copy_custom_to_notification: 'copy_custom_to_notification',
111116
create_notification_activity: 'create_notification_activity',
112117
expires_at: 'expires_at',
113118
id: 'id',

lib/getstream_ruby/generated/models/add_comment_reaction_request.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class AddCommentReactionRequest < GetStream::BaseModel
1212
# @!attribute type
1313
# @return [String] The type of reaction, eg upvote, like, ...
1414
attr_accessor :type
15+
# @!attribute copy_custom_to_notification
16+
# @return [Boolean] Whether to copy custom data to the notification activity (only applies when create_notification_activity is true)
17+
attr_accessor :copy_custom_to_notification
1518
# @!attribute create_notification_activity
1619
# @return [Boolean] Whether to create a notification activity for this reaction
1720
attr_accessor :create_notification_activity
@@ -35,6 +38,7 @@ class AddCommentReactionRequest < GetStream::BaseModel
3538
def initialize(attributes = {})
3639
super(attributes)
3740
@type = attributes[:type] || attributes['type']
41+
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
3842
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
3943
@enforce_unique = attributes[:enforce_unique] || attributes['enforce_unique'] || nil
4044
@skip_push = attributes[:skip_push] || attributes['skip_push'] || nil
@@ -47,6 +51,7 @@ def initialize(attributes = {})
4751
def self.json_field_mappings
4852
{
4953
type: 'type',
54+
copy_custom_to_notification: 'copy_custom_to_notification',
5055
create_notification_activity: 'create_notification_activity',
5156
enforce_unique: 'enforce_unique',
5257
skip_push: 'skip_push',

lib/getstream_ruby/generated/models/add_comment_request.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class AddCommentRequest < GetStream::BaseModel
1212
# @!attribute comment
1313
# @return [String] Text content of the comment
1414
attr_accessor :comment
15+
# @!attribute copy_custom_to_notification
16+
# @return [Boolean] Whether to copy custom data to the notification activity (only applies when create_notification_activity is true)
17+
attr_accessor :copy_custom_to_notification
1518
# @!attribute create_notification_activity
1619
# @return [Boolean] Whether to create a notification activity for this comment
1720
attr_accessor :create_notification_activity
@@ -53,6 +56,7 @@ class AddCommentRequest < GetStream::BaseModel
5356
def initialize(attributes = {})
5457
super(attributes)
5558
@comment = attributes[:comment] || attributes['comment'] || nil
59+
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
5660
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
5761
@id = attributes[:id] || attributes['id'] || nil
5862
@object_id = attributes[:object_id] || attributes['object_id'] || nil
@@ -71,6 +75,7 @@ def initialize(attributes = {})
7175
def self.json_field_mappings
7276
{
7377
comment: 'comment',
78+
copy_custom_to_notification: 'copy_custom_to_notification',
7479
create_notification_activity: 'create_notification_activity',
7580
id: 'id',
7681
object_id: 'object_id',

0 commit comments

Comments
 (0)