From ad7528ed7c80eb71a777a6df2707b6a683dfcc21 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Mon, 2 Feb 2026 14:42:09 +0100 Subject: [PATCH 1/2] chore: sdk update --- lib/getstream_ruby/generated/feeds_client.rb | 45 ++++++++++++++++--- .../models/async_export_error_event.rb | 2 +- .../models/delete_activities_request.rb | 5 +++ .../generated/models/follow_request.rb | 7 ++- .../models/import_v2_task_settings.rb | 10 +++++ .../models/query_channels_response.rb | 7 ++- .../models/unfollow_batch_request.rb | 7 ++- .../models/update_activity_partial_request.rb | 5 +++ .../models/update_activity_request.rb | 5 +++ .../models/update_comment_request.rb | 10 +++++ .../generated/models/update_follow_request.rb | 7 ++- 11 files changed, 99 insertions(+), 11 deletions(-) diff --git a/lib/getstream_ruby/generated/feeds_client.rb b/lib/getstream_ruby/generated/feeds_client.rb index 1510cc4..72b935e 100644 --- a/lib/getstream_ruby/generated/feeds_client.rb +++ b/lib/getstream_ruby/generated/feeds_client.rb @@ -254,15 +254,17 @@ def query_activity_reactions(activity_id, query_activity_reactions_request) # # @param activity_id [String] # @param _type [String] + # @param delete_notification_activity [Boolean] # @param user_id [String] # @return [Models::DeleteActivityReactionResponse] - def delete_activity_reaction(activity_id, _type, user_id = nil) + def delete_activity_reaction(activity_id, _type, delete_notification_activity = nil, user_id = nil) path = '/api/v2/feeds/activities/{activity_id}/reactions/{type}' # Replace path parameters path = path.gsub('{activity_id}', activity_id.to_s) path = path.gsub('{type}', _type.to_s) # Build query parameters query_params = {} + query_params['delete_notification_activity'] = delete_notification_activity unless delete_notification_activity.nil? query_params['user_id'] = user_id unless user_id.nil? # Make the API request @@ -277,14 +279,16 @@ def delete_activity_reaction(activity_id, _type, user_id = nil) # # @param _id [String] # @param hard_delete [Boolean] + # @param delete_notification_activity [Boolean] # @return [Models::DeleteActivityResponse] - def delete_activity(_id, hard_delete = nil) + def delete_activity(_id, hard_delete = nil, delete_notification_activity = nil) path = '/api/v2/feeds/activities/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build query parameters query_params = {} query_params['hard_delete'] = hard_delete unless hard_delete.nil? + query_params['delete_notification_activity'] = delete_notification_activity unless delete_notification_activity.nil? # Make the API request @client.make_request( @@ -350,6 +354,26 @@ def update_activity(_id, update_activity_request) ) end + # Restores a soft-deleted activity by its ID. Only the activity owner can restore their own activities. + # + # @param _id [String] + # @param restore_activity_request [RestoreActivityRequest] + # @return [Models::RestoreActivityResponse] + def restore_activity(_id, restore_activity_request) + path = '/api/v2/feeds/activities/{id}/restore' + # Replace path parameters + path = path.gsub('{id}', _id.to_s) + # Build request body + body = restore_activity_request + + # Make the API request + @client.make_request( + :post, + path, + body: body + ) + end + # Query bookmark folders with filter query # # @param query_bookmark_folders_request [QueryBookmarkFoldersRequest] @@ -598,14 +622,16 @@ def query_comments(query_comments_request) # # @param _id [String] # @param hard_delete [Boolean] + # @param delete_notification_activity [Boolean] # @return [Models::DeleteCommentResponse] - def delete_comment(_id, hard_delete = nil) + def delete_comment(_id, hard_delete = nil, delete_notification_activity = nil) path = '/api/v2/feeds/comments/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build query parameters query_params = {} query_params['hard_delete'] = hard_delete unless hard_delete.nil? + query_params['delete_notification_activity'] = delete_notification_activity unless delete_notification_activity.nil? # Make the API request @client.make_request( @@ -695,15 +721,17 @@ def query_comment_reactions(_id, query_comment_reactions_request) # # @param _id [String] # @param _type [String] + # @param delete_notification_activity [Boolean] # @param user_id [String] # @return [Models::DeleteCommentReactionResponse] - def delete_comment_reaction(_id, _type, user_id = nil) + def delete_comment_reaction(_id, _type, delete_notification_activity = nil, user_id = nil) path = '/api/v2/feeds/comments/{id}/reactions/{type}' # Replace path parameters path = path.gsub('{id}', _id.to_s) path = path.gsub('{type}', _type.to_s) # Build query parameters query_params = {} + query_params['delete_notification_activity'] = delete_notification_activity unless delete_notification_activity.nil? query_params['user_id'] = user_id unless user_id.nil? # Make the API request @@ -1481,17 +1509,22 @@ def reject_follow(reject_follow_request) # # @param source [String] # @param target [String] + # @param delete_notification_activity [Boolean] # @return [Models::UnfollowResponse] - def unfollow(source, target) + def unfollow(source, target, delete_notification_activity = nil) path = '/api/v2/feeds/follows/{source}/{target}' # Replace path parameters path = path.gsub('{source}', source.to_s) path = path.gsub('{target}', target.to_s) + # Build query parameters + query_params = {} + query_params['delete_notification_activity'] = delete_notification_activity unless delete_notification_activity.nil? # Make the API request @client.make_request( :delete, - path + path, + query_params: query_params ) end diff --git a/lib/getstream_ruby/generated/models/async_export_error_event.rb b/lib/getstream_ruby/generated/models/async_export_error_event.rb index f785b8c..e297b0e 100644 --- a/lib/getstream_ruby/generated/models/async_export_error_event.rb +++ b/lib/getstream_ruby/generated/models/async_export_error_event.rb @@ -43,7 +43,7 @@ def initialize(attributes = {}) @started_at = attributes[:started_at] || attributes['started_at'] @task_id = attributes[:task_id] || attributes['task_id'] @custom = attributes[:custom] || attributes['custom'] - @type = attributes[:type] || attributes['type'] || "export.bulk_image_moderation.error" + @type = attributes[:type] || attributes['type'] || "export.channels.error" @received_at = attributes[:received_at] || attributes['received_at'] || nil end diff --git a/lib/getstream_ruby/generated/models/delete_activities_request.rb b/lib/getstream_ruby/generated/models/delete_activities_request.rb index 9b75e87..aad42c9 100644 --- a/lib/getstream_ruby/generated/models/delete_activities_request.rb +++ b/lib/getstream_ruby/generated/models/delete_activities_request.rb @@ -12,6 +12,9 @@ class DeleteActivitiesRequest < GetStream::BaseModel # @!attribute ids # @return [Array] List of activity IDs to delete attr_accessor :ids + # @!attribute delete_notification_activity + # @return [Boolean] Whether to also delete any notification activities created from mentions in these activities + attr_accessor :delete_notification_activity # @!attribute hard_delete # @return [Boolean] Whether to permanently delete the activities attr_accessor :hard_delete @@ -26,6 +29,7 @@ class DeleteActivitiesRequest < GetStream::BaseModel def initialize(attributes = {}) super(attributes) @ids = attributes[:ids] || attributes['ids'] + @delete_notification_activity = attributes[:delete_notification_activity] || attributes['delete_notification_activity'] || nil @hard_delete = attributes[:hard_delete] || attributes['hard_delete'] || nil @user_id = attributes[:user_id] || attributes['user_id'] || nil @user = attributes[:user] || attributes['user'] || nil @@ -35,6 +39,7 @@ def initialize(attributes = {}) def self.json_field_mappings { ids: 'ids', + delete_notification_activity: 'delete_notification_activity', hard_delete: 'hard_delete', user_id: 'user_id', user: 'user' diff --git a/lib/getstream_ruby/generated/models/follow_request.rb b/lib/getstream_ruby/generated/models/follow_request.rb index 3f1b904..c40a983 100644 --- a/lib/getstream_ruby/generated/models/follow_request.rb +++ b/lib/getstream_ruby/generated/models/follow_request.rb @@ -22,8 +22,11 @@ class FollowRequest < GetStream::BaseModel # @return [String] Push preference for the follow relationship attr_accessor :push_preference # @!attribute skip_push - # @return [Boolean] + # @return [Boolean] Whether to skip push for this follow attr_accessor :skip_push + # @!attribute status + # @return [String] Status of the follow relationship + attr_accessor :status # @!attribute custom # @return [Object] Custom data for the follow relationship attr_accessor :custom @@ -36,6 +39,7 @@ def initialize(attributes = {}) @create_notification_activity = attributes[:create_notification_activity] || attributes['create_notification_activity'] || nil @push_preference = attributes[:push_preference] || attributes['push_preference'] || nil @skip_push = attributes[:skip_push] || attributes['skip_push'] || nil + @status = attributes[:status] || attributes['status'] || nil @custom = attributes[:custom] || attributes['custom'] || nil end @@ -47,6 +51,7 @@ def self.json_field_mappings create_notification_activity: 'create_notification_activity', push_preference: 'push_preference', skip_push: 'skip_push', + status: 'status', custom: 'custom' } end diff --git a/lib/getstream_ruby/generated/models/import_v2_task_settings.rb b/lib/getstream_ruby/generated/models/import_v2_task_settings.rb index 9a06dbd..eccd5f0 100644 --- a/lib/getstream_ruby/generated/models/import_v2_task_settings.rb +++ b/lib/getstream_ruby/generated/models/import_v2_task_settings.rb @@ -9,6 +9,12 @@ module Models class ImportV2TaskSettings < GetStream::BaseModel # Model attributes + # @!attribute mode + # @return [String] + attr_accessor :mode + # @!attribute path + # @return [String] + attr_accessor :path # @!attribute skip_references_check # @return [Boolean] attr_accessor :skip_references_check @@ -19,6 +25,8 @@ class ImportV2TaskSettings < GetStream::BaseModel # Initialize with attributes def initialize(attributes = {}) super(attributes) + @mode = attributes[:mode] || attributes['mode'] || nil + @path = attributes[:path] || attributes['path'] || nil @skip_references_check = attributes[:skip_references_check] || attributes['skip_references_check'] || nil @s3 = attributes[:s3] || attributes['s3'] || nil end @@ -26,6 +34,8 @@ def initialize(attributes = {}) # Override field mappings for JSON serialization def self.json_field_mappings { + mode: 'mode', + path: 'path', skip_references_check: 'skip_references_check', s3: 's3' } diff --git a/lib/getstream_ruby/generated/models/query_channels_response.rb b/lib/getstream_ruby/generated/models/query_channels_response.rb index ff2557d..bc08826 100644 --- a/lib/getstream_ruby/generated/models/query_channels_response.rb +++ b/lib/getstream_ruby/generated/models/query_channels_response.rb @@ -15,19 +15,24 @@ class QueryChannelsResponse < GetStream::BaseModel # @!attribute channels # @return [Array] List of channels attr_accessor :channels + # @!attribute predefined_filter + # @return [ParsedPredefinedFilterResponse] + attr_accessor :predefined_filter # Initialize with attributes def initialize(attributes = {}) super(attributes) @duration = attributes[:duration] || attributes['duration'] @channels = attributes[:channels] || attributes['channels'] + @predefined_filter = attributes[:predefined_filter] || attributes['predefined_filter'] || nil end # Override field mappings for JSON serialization def self.json_field_mappings { duration: 'duration', - channels: 'channels' + channels: 'channels', + predefined_filter: 'predefined_filter' } end end diff --git a/lib/getstream_ruby/generated/models/unfollow_batch_request.rb b/lib/getstream_ruby/generated/models/unfollow_batch_request.rb index c41b779..157eb6b 100644 --- a/lib/getstream_ruby/generated/models/unfollow_batch_request.rb +++ b/lib/getstream_ruby/generated/models/unfollow_batch_request.rb @@ -12,17 +12,22 @@ class UnfollowBatchRequest < GetStream::BaseModel # @!attribute follows # @return [Array] List of follow relationships to remove attr_accessor :follows + # @!attribute delete_notification_activity + # @return [Boolean] Whether to delete the corresponding notification activity (default: false) + attr_accessor :delete_notification_activity # Initialize with attributes def initialize(attributes = {}) super(attributes) @follows = attributes[:follows] || attributes['follows'] + @delete_notification_activity = attributes[:delete_notification_activity] || attributes['delete_notification_activity'] || nil end # Override field mappings for JSON serialization def self.json_field_mappings { - follows: 'follows' + follows: 'follows', + delete_notification_activity: 'delete_notification_activity' } end end diff --git a/lib/getstream_ruby/generated/models/update_activity_partial_request.rb b/lib/getstream_ruby/generated/models/update_activity_partial_request.rb index 7556415..38905d4 100644 --- a/lib/getstream_ruby/generated/models/update_activity_partial_request.rb +++ b/lib/getstream_ruby/generated/models/update_activity_partial_request.rb @@ -9,6 +9,9 @@ module Models class UpdateActivityPartialRequest < GetStream::BaseModel # Model attributes + # @!attribute handle_mention_notifications + # @return [Boolean] If true, creates notification activities for newly mentioned users and deletes notifications for users no longer mentioned + attr_accessor :handle_mention_notifications # @!attribute user_id # @return [String] attr_accessor :user_id @@ -25,6 +28,7 @@ class UpdateActivityPartialRequest < GetStream::BaseModel # Initialize with attributes def initialize(attributes = {}) super(attributes) + @handle_mention_notifications = attributes[:handle_mention_notifications] || attributes['handle_mention_notifications'] || nil @user_id = attributes[:user_id] || attributes['user_id'] || nil @unset = attributes[:unset] || attributes['unset'] || nil @set = attributes[:set] || attributes['set'] || nil @@ -34,6 +38,7 @@ def initialize(attributes = {}) # Override field mappings for JSON serialization def self.json_field_mappings { + handle_mention_notifications: 'handle_mention_notifications', user_id: 'user_id', unset: 'unset', set: 'set', diff --git a/lib/getstream_ruby/generated/models/update_activity_request.rb b/lib/getstream_ruby/generated/models/update_activity_request.rb index f10b9d4..2866337 100644 --- a/lib/getstream_ruby/generated/models/update_activity_request.rb +++ b/lib/getstream_ruby/generated/models/update_activity_request.rb @@ -12,6 +12,9 @@ class UpdateActivityRequest < GetStream::BaseModel # @!attribute expires_at # @return [DateTime] Time when the activity will expire attr_accessor :expires_at + # @!attribute handle_mention_notifications + # @return [Boolean] If true, creates notification activities for newly mentioned users and deletes notifications for users no longer mentioned + attr_accessor :handle_mention_notifications # @!attribute poll_id # @return [String] Poll ID attr_accessor :poll_id @@ -65,6 +68,7 @@ class UpdateActivityRequest < GetStream::BaseModel def initialize(attributes = {}) super(attributes) @expires_at = attributes[:expires_at] || attributes['expires_at'] || nil + @handle_mention_notifications = attributes[:handle_mention_notifications] || attributes['handle_mention_notifications'] || nil @poll_id = attributes[:poll_id] || attributes['poll_id'] || nil @restrict_replies = attributes[:restrict_replies] || attributes['restrict_replies'] || nil @skip_enrich_url = attributes[:skip_enrich_url] || attributes['skip_enrich_url'] || nil @@ -87,6 +91,7 @@ def initialize(attributes = {}) def self.json_field_mappings { expires_at: 'expires_at', + handle_mention_notifications: 'handle_mention_notifications', poll_id: 'poll_id', restrict_replies: 'restrict_replies', skip_enrich_url: 'skip_enrich_url', diff --git a/lib/getstream_ruby/generated/models/update_comment_request.rb b/lib/getstream_ruby/generated/models/update_comment_request.rb index 61a5e4c..87dae9e 100644 --- a/lib/getstream_ruby/generated/models/update_comment_request.rb +++ b/lib/getstream_ruby/generated/models/update_comment_request.rb @@ -12,6 +12,9 @@ class UpdateCommentRequest < GetStream::BaseModel # @!attribute comment # @return [String] Updated text content of the comment attr_accessor :comment + # @!attribute handle_mention_notifications + # @return [Boolean] If true, creates notification activities for newly mentioned users and deletes notifications for users no longer mentioned + attr_accessor :handle_mention_notifications # @!attribute skip_enrich_url # @return [Boolean] Whether to skip URL enrichment for this comment attr_accessor :skip_enrich_url @@ -24,6 +27,9 @@ class UpdateCommentRequest < GetStream::BaseModel # @!attribute attachments # @return [Array] Updated media attachments for the comment. Providing this field will replace all existing attachments. attr_accessor :attachments + # @!attribute mentioned_user_ids + # @return [Array] List of user IDs mentioned in the comment + attr_accessor :mentioned_user_ids # @!attribute custom # @return [Object] Updated custom data for the comment attr_accessor :custom @@ -35,10 +41,12 @@ class UpdateCommentRequest < GetStream::BaseModel def initialize(attributes = {}) super(attributes) @comment = attributes[:comment] || attributes['comment'] || nil + @handle_mention_notifications = attributes[:handle_mention_notifications] || attributes['handle_mention_notifications'] || nil @skip_enrich_url = attributes[:skip_enrich_url] || attributes['skip_enrich_url'] || nil @skip_push = attributes[:skip_push] || attributes['skip_push'] || nil @user_id = attributes[:user_id] || attributes['user_id'] || nil @attachments = attributes[:attachments] || attributes['attachments'] || nil + @mentioned_user_ids = attributes[:mentioned_user_ids] || attributes['mentioned_user_ids'] || nil @custom = attributes[:custom] || attributes['custom'] || nil @user = attributes[:user] || attributes['user'] || nil end @@ -47,10 +55,12 @@ def initialize(attributes = {}) def self.json_field_mappings { comment: 'comment', + handle_mention_notifications: 'handle_mention_notifications', skip_enrich_url: 'skip_enrich_url', skip_push: 'skip_push', user_id: 'user_id', attachments: 'attachments', + mentioned_user_ids: 'mentioned_user_ids', custom: 'custom', user: 'user' } diff --git a/lib/getstream_ruby/generated/models/update_follow_request.rb b/lib/getstream_ruby/generated/models/update_follow_request.rb index eb62cd0..2b002d5 100644 --- a/lib/getstream_ruby/generated/models/update_follow_request.rb +++ b/lib/getstream_ruby/generated/models/update_follow_request.rb @@ -25,8 +25,11 @@ class UpdateFollowRequest < GetStream::BaseModel # @return [String] Push preference for the follow relationship attr_accessor :push_preference # @!attribute skip_push - # @return [Boolean] + # @return [Boolean] Whether to skip push for this follow attr_accessor :skip_push + # @!attribute status + # @return [String] Status of the follow relationship + attr_accessor :status # @!attribute custom # @return [Object] Custom data for the follow relationship attr_accessor :custom @@ -40,6 +43,7 @@ def initialize(attributes = {}) @follower_role = attributes[:follower_role] || attributes['follower_role'] || nil @push_preference = attributes[:push_preference] || attributes['push_preference'] || nil @skip_push = attributes[:skip_push] || attributes['skip_push'] || nil + @status = attributes[:status] || attributes['status'] || nil @custom = attributes[:custom] || attributes['custom'] || nil end @@ -52,6 +56,7 @@ def self.json_field_mappings follower_role: 'follower_role', push_preference: 'push_preference', skip_push: 'skip_push', + status: 'status', custom: 'custom' } end From 998d61737e8413b720f53083b09095c5927ab466 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Mon, 2 Feb 2026 16:58:17 +0100 Subject: [PATCH 2/2] chore: fix tests --- .ruby-version | 2 +- spec/integration/feed_integration_spec.rb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.ruby-version b/.ruby-version index fd2a018..15a2799 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.0 +3.3.0 diff --git a/spec/integration/feed_integration_spec.rb b/spec/integration/feed_integration_spec.rb index 703fff9..05b2ea0 100644 --- a/spec/integration/feed_integration_spec.rb +++ b/spec/integration/feed_integration_spec.rb @@ -476,7 +476,7 @@ # snippet-start: DeleteReaction # Delete reaction - delete_response = client.feeds.delete_activity_reaction(activity_id, 'like', test_user_id_1) + delete_response = client.feeds.delete_activity_reaction(activity_id, 'like', nil, test_user_id_1) expect(delete_response).to be_a(GetStreamRuby::StreamResponse) puts '✅ Deleted reaction successfully' # snippet-stop: DeleteReaction @@ -772,9 +772,10 @@ expect(get_response).to be_a(GetStreamRuby::StreamResponse) puts '✅ Retrieved feed group successfully' - # Update feed group + # Update feed group - only update allowed fields for built-in groups + # Built-in groups can only have [activity_selectors, custom_ranking] updated update_request = GetStream::Generated::Models::UpdateFeedGroupRequest.new( - aggregation: GetStream::Generated::Models::AggregationConfig.new(format: 'default'), + custom_ranking: {}, ) update_response = client.feeds.update_feed_group('foryou', update_request)