diff --git a/.spec-version b/.spec-version index d94e497..dd4b7f6 100644 --- a/.spec-version +++ b/.spec-version @@ -1,2 +1,2 @@ -spec: openapi-v241.37.3 -generator: chat v241.37.3 +spec: openapi-v241.37.4 +generator: chat v241.37.4 diff --git a/lib/getstream_ruby/generated/feed.rb b/lib/getstream_ruby/generated/feed.rb index 51d449b..beb4ae6 100644 --- a/lib/getstream_ruby/generated/feed.rb +++ b/lib/getstream_ruby/generated/feed.rb @@ -92,6 +92,16 @@ def pin_activity(activity_id, pin_activity_request = nil) @client.feeds.pin_activity(@feed_group_id, @feed_id, activity_id, pin_activity_request) end + # Query the current bans for one feed, newest first. Requires feed moderation permission. Active bans are returned by default. + # + # @param query_feed_bans_request [QueryFeedBansRequest] + # @return [Models::QueryFeedBansResponse] + def query_feed_bans(query_feed_bans_request = nil) + + # Delegate to the FeedsClient + @client.feeds.query_feed_bans(@feed_group_id, @feed_id, query_feed_bans_request) + end + # Changes the visibility of an existing feed. Follow reconciliation (rewriting pending follows on loosening, or removing disallowed follows/members on tightening) runs asynchronously in the background; the response returns optimistically with the intended visibility. # # @param change_feed_visibility_request [ChangeFeedVisibilityRequest] diff --git a/lib/getstream_ruby/generated/feeds_client.rb b/lib/getstream_ruby/generated/feeds_client.rb index 2aeb340..3210404 100644 --- a/lib/getstream_ruby/generated/feeds_client.rb +++ b/lib/getstream_ruby/generated/feeds_client.rb @@ -1359,6 +1359,28 @@ def pin_activity(feed_group_id, feed_id, activity_id, pin_activity_request = nil ) end + # Query the current bans for one feed, newest first. Requires feed moderation permission. Active bans are returned by default. + # + # @param feed_group_id [String] + # @param feed_id [String] + # @param query_feed_bans_request [QueryFeedBansRequest] + # @return [Models::QueryFeedBansResponse] + def query_feed_bans(feed_group_id, feed_id, query_feed_bans_request = nil) + path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/bans/query' + # Replace path parameters + path = path.gsub('{feed_group_id}', feed_group_id.to_s) + path = path.gsub('{feed_id}', feed_id.to_s) + # Build request body + body = query_feed_bans_request || {} + + # Make the API request + @client.make_request( + :post, + path, + body: body + ) + end + # Changes the visibility of an existing feed. Follow reconciliation (rewriting pending follows on loosening, or removing disallowed follows/members on tightening) runs asynchronously in the background; the response returns optimistically with the intended visibility. # # @param feed_group_id [String] diff --git a/lib/getstream_ruby/generated/models/ban_request.rb b/lib/getstream_ruby/generated/models/ban_request.rb index bedf4e3..ab8825f 100644 --- a/lib/getstream_ruby/generated/models/ban_request.rb +++ b/lib/getstream_ruby/generated/models/ban_request.rb @@ -30,6 +30,9 @@ class BanRequest < GetStream::BaseModel # @!attribute delete_reactions # @return [Boolean] Whether to delete reactions by the banned user on other users' messages attr_accessor :delete_reactions + # @!attribute feed_fid + # @return [String] Feed where the ban applies, in group:id format. Cannot be combined with channel scope, shadow, IP bans or message/reaction deletion. + attr_accessor :feed_fid # @!attribute ip_ban # @return [Boolean] Whether to ban the user's IP address attr_accessor :ip_ban @@ -56,6 +59,7 @@ def initialize(attributes = {}) @channel_type = attributes.fetch(:channel_type) { attributes.fetch('channel_type', nil) } @delete_messages = attributes.fetch(:delete_messages) { attributes.fetch('delete_messages', nil) } @delete_reactions = attributes.fetch(:delete_reactions) { attributes.fetch('delete_reactions', nil) } + @feed_fid = attributes.fetch(:feed_fid) { attributes.fetch('feed_fid', nil) } @ip_ban = attributes.fetch(:ip_ban) { attributes.fetch('ip_ban', nil) } @reason = attributes.fetch(:reason) { attributes.fetch('reason', nil) } @shadow = attributes.fetch(:shadow) { attributes.fetch('shadow', nil) } @@ -73,6 +77,7 @@ def self.json_field_mappings channel_type: 'channel_type', delete_messages: 'delete_messages', delete_reactions: 'delete_reactions', + feed_fid: 'feed_fid', ip_ban: 'ip_ban', reason: 'reason', shadow: 'shadow', diff --git a/lib/getstream_ruby/generated/models/feed_ban_response.rb b/lib/getstream_ruby/generated/models/feed_ban_response.rb new file mode 100644 index 0000000..5c66326 --- /dev/null +++ b/lib/getstream_ruby/generated/models/feed_ban_response.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT. + +module GetStream + module Generated + module Models + # + class FeedBanResponse < GetStream::BaseModel + + # Model attributes + # @!attribute created_at + # @return [DateTime] Time the ban was first created + attr_accessor :created_at + # @!attribute feed_fid + # @return [String] Feed where the ban applies, in group:id format + attr_accessor :feed_fid + # @!attribute reason + # @return [String] Explanation for the ban + attr_accessor :reason + # @!attribute target_user_id + # @return [String] ID of the banned user + attr_accessor :target_user_id + # @!attribute created_by_id + # @return [String] ID of the moderator who issued the ban, when available + attr_accessor :created_by_id + # @!attribute expires + # @return [DateTime] Ban expiry time. Absent for permanent bans. + attr_accessor :expires + # @!attribute created_by + # @return [UserResponse] User response object + attr_accessor :created_by + # @!attribute user + # @return [UserResponse] User response object + attr_accessor :user + + # Initialize with attributes + def initialize(attributes = {}) + super(attributes) + @created_at = attributes.fetch(:created_at) { attributes.fetch('created_at', nil) } + @feed_fid = attributes.fetch(:feed_fid) { attributes.fetch('feed_fid', nil) } + @reason = attributes.fetch(:reason) { attributes.fetch('reason', nil) } + @target_user_id = attributes.fetch(:target_user_id) { attributes.fetch('target_user_id', nil) } + @created_by_id = attributes.fetch(:created_by_id) { attributes.fetch('created_by_id', nil) } + @expires = attributes.fetch(:expires) { attributes.fetch('expires', nil) } + @created_by = attributes.fetch(:created_by) { attributes.fetch('created_by', nil) } + @user = attributes.fetch(:user) { attributes.fetch('user', nil) } + end + + # Override field mappings for JSON serialization + def self.json_field_mappings + { + created_at: 'created_at', + feed_fid: 'feed_fid', + reason: 'reason', + target_user_id: 'target_user_id', + created_by_id: 'created_by_id', + expires: 'expires', + created_by: 'created_by', + user: 'user' + } + end + end + end + end +end diff --git a/lib/getstream_ruby/generated/models/query_feed_bans_request.rb b/lib/getstream_ruby/generated/models/query_feed_bans_request.rb new file mode 100644 index 0000000..274414d --- /dev/null +++ b/lib/getstream_ruby/generated/models/query_feed_bans_request.rb @@ -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 + # Query a feed's current bans, ordered by creation time descending and target user ID descending. Returns active bans by default; unbanned records are not retained. + class QueryFeedBansRequest < GetStream::BaseModel + + # Model attributes + # @!attribute include_expired + # @return [Boolean] Include expired bans in addition to active bans. Defaults to false. + attr_accessor :include_expired + # @!attribute limit + # @return [Integer] Page size. Defaults to 25; maximum 100. + attr_accessor :limit + # @!attribute next + # @return [String] Cursor for the next page + attr_accessor :next + # @!attribute prev + # @return [String] Cursor for the previous page + attr_accessor :prev + # @!attribute target_user_id + # @return [String] Optionally restrict results to this exact user ID + attr_accessor :target_user_id + + # Initialize with attributes + def initialize(attributes = {}) + super(attributes) + @include_expired = attributes.fetch(:include_expired) { attributes.fetch('include_expired', nil) } + @limit = attributes.fetch(:limit) { attributes.fetch('limit', nil) } + @next = attributes.fetch(:next) { attributes.fetch('next', nil) } + @prev = attributes.fetch(:prev) { attributes.fetch('prev', nil) } + @target_user_id = attributes.fetch(:target_user_id) { attributes.fetch('target_user_id', nil) } + end + + # Override field mappings for JSON serialization + def self.json_field_mappings + { + include_expired: 'include_expired', + limit: 'limit', + next: 'next', + prev: 'prev', + target_user_id: 'target_user_id' + } + end + end + end + end +end diff --git a/lib/getstream_ruby/generated/models/query_feed_bans_response.rb b/lib/getstream_ruby/generated/models/query_feed_bans_response.rb new file mode 100644 index 0000000..ad2450c --- /dev/null +++ b/lib/getstream_ruby/generated/models/query_feed_bans_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT. + +module GetStream + module Generated + module Models + # + class QueryFeedBansResponse < GetStream::BaseModel + + # Model attributes + # @!attribute duration + # @return [String] + attr_accessor :duration + # @!attribute bans + # @return [Array] Feed bans matching the query + attr_accessor :bans + # @!attribute next + # @return [String] Cursor for the next page + attr_accessor :next + # @!attribute prev + # @return [String] Cursor for the previous page + attr_accessor :prev + + # Initialize with attributes + def initialize(attributes = {}) + super(attributes) + @duration = attributes.fetch(:duration) { attributes.fetch('duration', nil) } + @bans = attributes.fetch(:bans) { attributes.fetch('bans', nil) } + @next = attributes.fetch(:next) { attributes.fetch('next', nil) } + @prev = attributes.fetch(:prev) { attributes.fetch('prev', nil) } + end + + # Override field mappings for JSON serialization + def self.json_field_mappings + { + duration: 'duration', + bans: 'bans', + next: 'next', + prev: 'prev' + } + end + end + end + end +end diff --git a/lib/getstream_ruby/generated/moderation_client.rb b/lib/getstream_ruby/generated/moderation_client.rb index a455fda..a7e9b9e 100644 --- a/lib/getstream_ruby/generated/moderation_client.rb +++ b/lib/getstream_ruby/generated/moderation_client.rb @@ -261,7 +261,7 @@ def bulk_action_appeals(bulk_action_appeals_request) ) end - # Ban a user from a channel or the entire app + # Ban a user from a feed, channel or the entire app # # @param ban_request [BanRequest] # @return [Models::ModerationBanResponse] @@ -1107,7 +1107,7 @@ def submit_moderation_feedback(submit_moderation_feedback_request = nil) ) end - # Unban a user from a channel or globally. + # Unban a user from a feed, channel or globally. # # @param unban_request [UnbanRequest] # @param target_user_id [String] @@ -1115,8 +1115,9 @@ def submit_moderation_feedback(submit_moderation_feedback_request = nil) # @param created_by [String] # @param remove_future_channels_ban [Boolean] # @param channel_type [String] + # @param feed_fid [String] # @return [Models::UnbanResponse] - def unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, remove_future_channels_ban = nil, channel_type = nil) + def unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, remove_future_channels_ban = nil, channel_type = nil, feed_fid = nil) path = '/api/v2/moderation/unban' # Build query parameters query_params = {} @@ -1125,6 +1126,7 @@ def unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, re query_params['created_by'] = created_by unless created_by.nil? query_params['remove_future_channels_ban'] = remove_future_channels_ban unless remove_future_channels_ban.nil? query_params['channel_type'] = channel_type unless channel_type.nil? + query_params['feed_fid'] = feed_fid unless feed_fid.nil? # Build request body body = unban_request