Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 81 additions & 4 deletions lib/getstream_ruby/generated/feeds_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,25 @@ def delete_activity(_id, hard_delete = nil, delete_notification_activity = nil)
# Returns activity by ID
#
# @param _id [String]
# @param comment_sort [String]
# @param comment_limit [Integer]
# @param user_id [String]
# @return [Models::GetActivityResponse]
def get_activity(_id)
def get_activity(_id, comment_sort = nil, comment_limit = nil, user_id = nil)
path = '/api/v2/feeds/activities/{id}'
# Replace path parameters
path = path.gsub('{id}', _id.to_s)
# Build query parameters
query_params = {}
query_params['comment_sort'] = comment_sort unless comment_sort.nil?
query_params['comment_limit'] = comment_limit unless comment_limit.nil?
query_params['user_id'] = user_id unless user_id.nil?

# Make the API request
@client.make_request(
:get,
path
path,
query_params: query_params
)
end

Expand Down Expand Up @@ -676,6 +685,69 @@ def query_comments(query_comments_request)
)
end

# Deletes a bookmark from a comment
#
# @param comment_id [String]
# @param folder_id [String]
# @param user_id [String]
# @return [Models::DeleteCommentBookmarkResponse]
def delete_comment_bookmark(comment_id, folder_id = nil, user_id = nil)
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
# Replace path parameters
path = path.gsub('{comment_id}', comment_id.to_s)
# Build query parameters
query_params = {}
query_params['folder_id'] = folder_id unless folder_id.nil?
query_params['user_id'] = user_id unless user_id.nil?

# Make the API request
@client.make_request(
:delete,
path,
query_params: query_params
)
end

# Updates a bookmark for a comment
#
# @param comment_id [String]
# @param update_comment_bookmark_request [UpdateCommentBookmarkRequest]
# @return [Models::UpdateCommentBookmarkResponse]
def update_comment_bookmark(comment_id, update_comment_bookmark_request)
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
# Replace path parameters
path = path.gsub('{comment_id}', comment_id.to_s)
# Build request body
body = update_comment_bookmark_request

# Make the API request
@client.make_request(
:patch,
path,
body: body
)
end

# Adds a bookmark to a comment
#
# @param comment_id [String]
# @param add_comment_bookmark_request [AddCommentBookmarkRequest]
# @return [Models::AddCommentBookmarkResponse]
def add_comment_bookmark(comment_id, add_comment_bookmark_request)
path = '/api/v2/feeds/comments/{comment_id}/bookmarks'
# Replace path parameters
path = path.gsub('{comment_id}', comment_id.to_s)
# Build request body
body = add_comment_bookmark_request

# Make the API request
@client.make_request(
:post,
path,
body: body
)
end

# Deletes a comment from an object (e.g., activity) and broadcasts appropriate events
#
# @param _id [String]
Expand All @@ -702,16 +774,21 @@ def delete_comment(_id, hard_delete = nil, delete_notification_activity = nil)
# Get a comment by ID
#
# @param _id [String]
# @param user_id [String]
# @return [Models::GetCommentResponse]
def get_comment(_id)
def get_comment(_id, user_id = nil)
path = '/api/v2/feeds/comments/{id}'
# Replace path parameters
path = path.gsub('{id}', _id.to_s)
# Build query parameters
query_params = {}
query_params['user_id'] = user_id unless user_id.nil?

# Make the API request
@client.make_request(
:get,
path
path,
query_params: query_params
)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/getstream_ruby/generated/models/activity_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ActivityRequest < GetStream::BaseModel
# @return [Object] Custom data for the activity
attr_accessor :custom
# @!attribute location
# @return [ActivityLocation]
# @return [Location]
attr_accessor :location
# @!attribute search_data
# @return [Object] Additional data for search indexing
Expand Down
2 changes: 1 addition & 1 deletion lib/getstream_ruby/generated/models/activity_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ActivityResponse < GetStream::BaseModel
# @return [FeedResponse]
attr_accessor :current_feed
# @!attribute location
# @return [ActivityLocation]
# @return [Location]
attr_accessor :location
# @!attribute metrics
# @return [Hash<String, Integer>]
Expand Down
7 changes: 6 additions & 1 deletion lib/getstream_ruby/generated/models/add_activity_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class AddActivityRequest < GetStream::BaseModel
# @!attribute expires_at
# @return [String] Expiration time for the activity
attr_accessor :expires_at
# @!attribute force_moderation
# @return [Boolean]
attr_accessor :force_moderation
# @!attribute id
# @return [String] Optional ID for the activity
attr_accessor :id
Expand Down Expand Up @@ -77,7 +80,7 @@ class AddActivityRequest < GetStream::BaseModel
# @return [Object] Custom data for the activity
attr_accessor :custom
# @!attribute location
# @return [ActivityLocation]
# @return [Location]
attr_accessor :location
# @!attribute search_data
# @return [Object] Additional data for search indexing
Expand All @@ -92,6 +95,7 @@ def initialize(attributes = {})
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
@enrich_own_fields = attributes[:enrich_own_fields] || attributes['enrich_own_fields'] || nil
@expires_at = attributes[:expires_at] || attributes['expires_at'] || nil
@force_moderation = attributes[:force_moderation] || attributes['force_moderation'] || nil
@id = attributes[:id] || attributes['id'] || nil
@parent_id = attributes[:parent_id] || attributes['parent_id'] || nil
@poll_id = attributes[:poll_id] || attributes['poll_id'] || nil
Expand Down Expand Up @@ -121,6 +125,7 @@ def self.json_field_mappings
create_notification_activity: 'create_notification_activity',
enrich_own_fields: 'enrich_own_fields',
expires_at: 'expires_at',
force_moderation: 'force_moderation',
id: 'id',
parent_id: 'parent_id',
poll_id: 'poll_id',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# frozen_string_literal: true

# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.

module GetStream
module Generated
module Models
#
class AddCommentBookmarkRequest < GetStream::BaseModel

# Model attributes
# @!attribute folder_id
# @return [String] ID of the folder to add the bookmark to
attr_accessor :folder_id
# @!attribute user_id
# @return [String]
attr_accessor :user_id
# @!attribute custom
# @return [Object] Custom data for the bookmark
attr_accessor :custom
# @!attribute new_folder
# @return [AddFolderRequest]
attr_accessor :new_folder
# @!attribute user
# @return [UserRequest]
attr_accessor :user

# Initialize with attributes
def initialize(attributes = {})
super(attributes)
@folder_id = attributes[:folder_id] || attributes['folder_id'] || nil
@user_id = attributes[:user_id] || attributes['user_id'] || nil
@custom = attributes[:custom] || attributes['custom'] || nil
@new_folder = attributes[:new_folder] || attributes['new_folder'] || nil
@user = attributes[:user] || attributes['user'] || nil
end

# Override field mappings for JSON serialization
def self.json_field_mappings
{
folder_id: 'folder_id',
user_id: 'user_id',
custom: 'custom',
new_folder: 'new_folder',
user: 'user'
}
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.

module GetStream
module Generated
module Models
#
class AddCommentBookmarkResponse < GetStream::BaseModel

# Model attributes
# @!attribute duration
# @return [String]
attr_accessor :duration
# @!attribute bookmark
# @return [BookmarkResponse]
attr_accessor :bookmark

# Initialize with attributes
def initialize(attributes = {})
super(attributes)
@duration = attributes[:duration] || attributes['duration']
@bookmark = attributes[:bookmark] || attributes['bookmark']
end

# Override field mappings for JSON serialization
def self.json_field_mappings
{
duration: 'duration',
bookmark: 'bookmark'
}
end
end
end
end
end
5 changes: 5 additions & 0 deletions lib/getstream_ruby/generated/models/add_comment_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class AddCommentRequest < GetStream::BaseModel
# @!attribute create_notification_activity
# @return [Boolean] Whether to create a notification activity for this comment
attr_accessor :create_notification_activity
# @!attribute force_moderation
# @return [Boolean] If true, forces moderation to run for server-side requests. By default, server-side requests skip moderation. Client-side requests always run moderation regardless of this field.
attr_accessor :force_moderation
# @!attribute id
# @return [String] Optional custom ID for the comment (max 255 characters). If not provided, a UUID will be generated.
attr_accessor :id
Expand Down Expand Up @@ -60,6 +63,7 @@ def initialize(attributes = {})
@comment = attributes[:comment] || attributes['comment'] || nil
@copy_custom_to_notification = attributes[:copy_custom_to_notification] || attributes['copy_custom_to_notification'] || nil
@create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil
@force_moderation = attributes[:force_moderation] || attributes['force_moderation'] || nil
@id = attributes[:id] || attributes['id'] || nil
@object_type = attributes[:object_type] || attributes['object_type'] || nil
@parent_id = attributes[:parent_id] || attributes['parent_id'] || nil
Expand All @@ -79,6 +83,7 @@ def self.json_field_mappings
comment: 'comment',
copy_custom_to_notification: 'copy_custom_to_notification',
create_notification_activity: 'create_notification_activity',
force_moderation: 'force_moderation',
id: 'id',
object_type: 'object_type',
parent_id: 'parent_id',
Expand Down
5 changes: 5 additions & 0 deletions lib/getstream_ruby/generated/models/aggregation_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module Models
class AggregationConfig < GetStream::BaseModel

# Model attributes
# @!attribute activities_sort
# @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.
attr_accessor :activities_sort
# @!attribute format
# @return [String] Format for activity aggregation
attr_accessor :format
Expand All @@ -19,13 +22,15 @@ class AggregationConfig < GetStream::BaseModel
# Initialize with attributes
def initialize(attributes = {})
super(attributes)
@activities_sort = attributes[:activities_sort] || attributes['activities_sort'] || nil
@format = attributes[:format] || attributes['format'] || nil
@score_strategy = attributes[:score_strategy] || attributes['score_strategy'] || nil
end

# Override field mappings for JSON serialization
def self.json_field_mappings
{
activities_sort: 'activities_sort',
format: 'format',
score_strategy: 'score_strategy'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module Models
class BanActionRequestPayload < GetStream::BaseModel

# Model attributes
# @!attribute ban_from_future_channels
# @return [Boolean] Also ban user from all channels this moderator creates in the future
attr_accessor :ban_from_future_channels
# @!attribute channel_ban_only
# @return [Boolean] Ban only from specific channel
attr_accessor :channel_ban_only
Expand Down Expand Up @@ -37,6 +40,7 @@ class BanActionRequestPayload < GetStream::BaseModel
# Initialize with attributes
def initialize(attributes = {})
super(attributes)
@ban_from_future_channels = attributes[:ban_from_future_channels] || attributes['ban_from_future_channels'] || nil
@channel_ban_only = attributes[:channel_ban_only] || attributes['channel_ban_only'] || nil
@channel_cid = attributes[:channel_cid] || attributes['channel_cid'] || nil
@delete_messages = attributes[:delete_messages] || attributes['delete_messages'] || nil
Expand All @@ -50,6 +54,7 @@ def initialize(attributes = {})
# Override field mappings for JSON serialization
def self.json_field_mappings
{
ban_from_future_channels: 'ban_from_future_channels',
channel_ban_only: 'channel_ban_only',
channel_cid: 'channel_cid',
delete_messages: 'delete_messages',
Expand Down
Loading
Loading