Skip to content

Commit d8ecda5

Browse files
feat: add bookmark for comments
1 parent cfc9763 commit d8ecda5

47 files changed

Lines changed: 632 additions & 52 deletions

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/feeds_client.rb

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,69 @@ def query_comments(query_comments_request)
676676
)
677677
end
678678

679+
# Deletes a bookmark from a comment
680+
#
681+
# @param comment_id [String]
682+
# @param folder_id [String]
683+
# @param user_id [String]
684+
# @return [Models::DeleteCommentBookmarkResponse]
685+
def delete_comment_bookmark(comment_id, folder_id = nil, user_id = nil)
686+
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
687+
# Replace path parameters
688+
path = path.gsub('{comment_id}', comment_id.to_s)
689+
# Build query parameters
690+
query_params = {}
691+
query_params['folder_id'] = folder_id unless folder_id.nil?
692+
query_params['user_id'] = user_id unless user_id.nil?
693+
694+
# Make the API request
695+
@client.make_request(
696+
:delete,
697+
path,
698+
query_params: query_params
699+
)
700+
end
701+
702+
# Updates a bookmark for a comment
703+
#
704+
# @param comment_id [String]
705+
# @param update_comment_bookmark_request [UpdateCommentBookmarkRequest]
706+
# @return [Models::UpdateCommentBookmarkResponse]
707+
def update_comment_bookmark(comment_id, update_comment_bookmark_request)
708+
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
709+
# Replace path parameters
710+
path = path.gsub('{comment_id}', comment_id.to_s)
711+
# Build request body
712+
body = update_comment_bookmark_request
713+
714+
# Make the API request
715+
@client.make_request(
716+
:patch,
717+
path,
718+
body: body
719+
)
720+
end
721+
722+
# Adds a bookmark to a comment
723+
#
724+
# @param comment_id [String]
725+
# @param add_comment_bookmark_request [AddCommentBookmarkRequest]
726+
# @return [Models::AddCommentBookmarkResponse]
727+
def add_comment_bookmark(comment_id, add_comment_bookmark_request)
728+
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
729+
# Replace path parameters
730+
path = path.gsub('{comment_id}', comment_id.to_s)
731+
# Build request body
732+
body = add_comment_bookmark_request
733+
734+
# Make the API request
735+
@client.make_request(
736+
:post,
737+
path,
738+
body: body
739+
)
740+
end
741+
679742
# Deletes a comment from an object (e.g., activity) and broadcasts appropriate events
680743
#
681744
# @param _id [String]

lib/getstream_ruby/generated/models/activity_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class ActivityRequest < GetStream::BaseModel
7474
# @return [Object] Custom data for the activity
7575
attr_accessor :custom
7676
# @!attribute location
77-
# @return [ActivityLocation]
77+
# @return [Location]
7878
attr_accessor :location
7979
# @!attribute search_data
8080
# @return [Object] Additional data for search indexing

lib/getstream_ruby/generated/models/activity_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class ActivityResponse < GetStream::BaseModel
133133
# @return [FeedResponse]
134134
attr_accessor :current_feed
135135
# @!attribute location
136-
# @return [ActivityLocation]
136+
# @return [Location]
137137
attr_accessor :location
138138
# @!attribute metrics
139139
# @return [Hash<String, Integer>]

lib/getstream_ruby/generated/models/add_activity_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class AddActivityRequest < GetStream::BaseModel
7777
# @return [Object] Custom data for the activity
7878
attr_accessor :custom
7979
# @!attribute location
80-
# @return [ActivityLocation]
80+
# @return [Location]
8181
attr_accessor :location
8282
# @!attribute search_data
8383
# @return [Object] Additional data for search indexing
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
#
9+
class AddCommentBookmarkRequest < GetStream::BaseModel
10+
11+
# Model attributes
12+
# @!attribute folder_id
13+
# @return [String] ID of the folder to add the bookmark to
14+
attr_accessor :folder_id
15+
# @!attribute user_id
16+
# @return [String]
17+
attr_accessor :user_id
18+
# @!attribute custom
19+
# @return [Object] Custom data for the bookmark
20+
attr_accessor :custom
21+
# @!attribute new_folder
22+
# @return [AddFolderRequest]
23+
attr_accessor :new_folder
24+
# @!attribute user
25+
# @return [UserRequest]
26+
attr_accessor :user
27+
28+
# Initialize with attributes
29+
def initialize(attributes = {})
30+
super(attributes)
31+
@folder_id = attributes[:folder_id] || attributes['folder_id'] || nil
32+
@user_id = attributes[:user_id] || attributes['user_id'] || nil
33+
@custom = attributes[:custom] || attributes['custom'] || nil
34+
@new_folder = attributes[:new_folder] || attributes['new_folder'] || nil
35+
@user = attributes[:user] || attributes['user'] || nil
36+
end
37+
38+
# Override field mappings for JSON serialization
39+
def self.json_field_mappings
40+
{
41+
folder_id: 'folder_id',
42+
user_id: 'user_id',
43+
custom: 'custom',
44+
new_folder: 'new_folder',
45+
user: 'user'
46+
}
47+
end
48+
end
49+
end
50+
end
51+
end
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
#
9+
class AddCommentBookmarkResponse < GetStream::BaseModel
10+
11+
# Model attributes
12+
# @!attribute duration
13+
# @return [String]
14+
attr_accessor :duration
15+
# @!attribute bookmark
16+
# @return [BookmarkResponse]
17+
attr_accessor :bookmark
18+
19+
# Initialize with attributes
20+
def initialize(attributes = {})
21+
super(attributes)
22+
@duration = attributes[:duration] || attributes['duration']
23+
@bookmark = attributes[:bookmark] || attributes['bookmark']
24+
end
25+
26+
# Override field mappings for JSON serialization
27+
def self.json_field_mappings
28+
{
29+
duration: 'duration',
30+
bookmark: 'bookmark'
31+
}
32+
end
33+
end
34+
end
35+
end
36+
end

lib/getstream_ruby/generated/models/aggregation_config.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module Models
99
class AggregationConfig < GetStream::BaseModel
1010

1111
# Model attributes
12+
# @!attribute activities_sort
13+
# @return [String] Order of member activities inside each aggregated group for non-stories feeds: created_at_desc (newest first, default) or created_at_asc (oldest first). Stories feeds ignore this and always use oldest first.
14+
attr_accessor :activities_sort
1215
# @!attribute format
1316
# @return [String] Format for activity aggregation
1417
attr_accessor :format
@@ -19,13 +22,15 @@ class AggregationConfig < GetStream::BaseModel
1922
# Initialize with attributes
2023
def initialize(attributes = {})
2124
super(attributes)
25+
@activities_sort = attributes[:activities_sort] || attributes['activities_sort'] || nil
2226
@format = attributes[:format] || attributes['format'] || nil
2327
@score_strategy = attributes[:score_strategy] || attributes['score_strategy'] || nil
2428
end
2529

2630
# Override field mappings for JSON serialization
2731
def self.json_field_mappings
2832
{
33+
activities_sort: 'activities_sort',
2934
format: 'format',
3035
score_strategy: 'score_strategy'
3136
}

lib/getstream_ruby/generated/models/ban_action_request_payload.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module Models
99
class BanActionRequestPayload < GetStream::BaseModel
1010

1111
# Model attributes
12+
# @!attribute ban_from_future_channels
13+
# @return [Boolean] Also ban user from all channels this moderator creates in the future
14+
attr_accessor :ban_from_future_channels
1215
# @!attribute channel_ban_only
1316
# @return [Boolean] Ban only from specific channel
1417
attr_accessor :channel_ban_only
@@ -37,6 +40,7 @@ class BanActionRequestPayload < GetStream::BaseModel
3740
# Initialize with attributes
3841
def initialize(attributes = {})
3942
super(attributes)
43+
@ban_from_future_channels = attributes[:ban_from_future_channels] || attributes['ban_from_future_channels'] || nil
4044
@channel_ban_only = attributes[:channel_ban_only] || attributes['channel_ban_only'] || nil
4145
@channel_cid = attributes[:channel_cid] || attributes['channel_cid'] || nil
4246
@delete_messages = attributes[:delete_messages] || attributes['delete_messages'] || nil
@@ -50,6 +54,7 @@ def initialize(attributes = {})
5054
# Override field mappings for JSON serialization
5155
def self.json_field_mappings
5256
{
57+
ban_from_future_channels: 'ban_from_future_channels',
5358
channel_ban_only: 'channel_ban_only',
5459
channel_cid: 'channel_cid',
5560
delete_messages: 'delete_messages',

lib/getstream_ruby/generated/models/bookmark_response.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ module Models
99
class BookmarkResponse < GetStream::BaseModel
1010

1111
# Model attributes
12+
# @!attribute _object_id
13+
# @return [String] ID of the bookmarked object
14+
attr_accessor :_object_id
1215
# @!attribute created_at
1316
# @return [DateTime] When the bookmark was created
1417
attr_accessor :created_at
18+
# @!attribute object_type
19+
# @return [String] Type of the bookmarked object (activity or comment)
20+
attr_accessor :object_type
1521
# @!attribute updated_at
1622
# @return [DateTime] When the bookmark was last updated
1723
attr_accessor :updated_at
@@ -21,6 +27,12 @@ class BookmarkResponse < GetStream::BaseModel
2127
# @!attribute user
2228
# @return [UserResponse]
2329
attr_accessor :user
30+
# @!attribute activity_id
31+
# @return [String]
32+
attr_accessor :activity_id
33+
# @!attribute comment
34+
# @return [CommentResponse]
35+
attr_accessor :comment
2436
# @!attribute custom
2537
# @return [Object] Custom data for the bookmark
2638
attr_accessor :custom
@@ -31,21 +43,29 @@ class BookmarkResponse < GetStream::BaseModel
3143
# Initialize with attributes
3244
def initialize(attributes = {})
3345
super(attributes)
46+
@_object_id = attributes[:_object_id] || attributes['object_id']
3447
@created_at = attributes[:created_at] || attributes['created_at']
48+
@object_type = attributes[:object_type] || attributes['object_type']
3549
@updated_at = attributes[:updated_at] || attributes['updated_at']
3650
@activity = attributes[:activity] || attributes['activity']
3751
@user = attributes[:user] || attributes['user']
52+
@activity_id = attributes[:activity_id] || attributes['activity_id'] || nil
53+
@comment = attributes[:comment] || attributes['comment'] || nil
3854
@custom = attributes[:custom] || attributes['custom'] || nil
3955
@folder = attributes[:folder] || attributes['folder'] || nil
4056
end
4157

4258
# Override field mappings for JSON serialization
4359
def self.json_field_mappings
4460
{
61+
_object_id: 'object_id',
4562
created_at: 'created_at',
63+
object_type: 'object_type',
4664
updated_at: 'updated_at',
4765
activity: 'activity',
4866
user: 'user',
67+
activity_id: 'activity_id',
68+
comment: 'comment',
4969
custom: 'custom',
5070
folder: 'folder'
5171
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
#
9+
class BypassActionRequest < GetStream::BaseModel
10+
11+
# Model attributes
12+
# @!attribute enabled
13+
# @return [Boolean]
14+
attr_accessor :enabled
15+
16+
# Initialize with attributes
17+
def initialize(attributes = {})
18+
super(attributes)
19+
@enabled = attributes[:enabled] || attributes['enabled'] || nil
20+
end
21+
22+
# Override field mappings for JSON serialization
23+
def self.json_field_mappings
24+
{
25+
enabled: 'enabled'
26+
}
27+
end
28+
end
29+
end
30+
end
31+
end

0 commit comments

Comments
 (0)