From 3d610c6a98f41815d3d4a86bcc7925b6b426014f Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 15:01:27 +0100 Subject: [PATCH 1/7] sdk update --- src/FeedsV3Client.cs | 153 ++++++++- src/models.cs | 772 ++++++++++++++++++++++++++++++++++++++----- tests/FeedTests.cs | 446 ++++++++++++++++++++++++- 3 files changed, 1266 insertions(+), 105 deletions(-) diff --git a/src/FeedsV3Client.cs b/src/FeedsV3Client.cs index 3bfef35..bd0a309 100644 --- a/src/FeedsV3Client.cs +++ b/src/FeedsV3Client.cs @@ -345,6 +345,63 @@ public async Task> QueryBookmarksAsync(Qu return result; } + public async Task> DeleteCollectionsAsync(object request = null, + CancellationToken cancellationToken = default) + { + var queryParams = ExtractQueryParams(request); + + var result = await _client.MakeRequestAsync( + "DELETE", + "/api/v2/feeds/collections",queryParams,null,null, + cancellationToken); + + return result; + } + public async Task> ReadCollectionsAsync(object request = null, + CancellationToken cancellationToken = default) + { + var queryParams = ExtractQueryParams(request); + + var result = await _client.MakeRequestAsync( + "GET", + "/api/v2/feeds/collections",queryParams,null,null, + cancellationToken); + + return result; + } + public async Task> UpdateCollectionsAsync(UpdateCollectionsRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "PATCH", + "/api/v2/feeds/collections",null,request,null, + cancellationToken); + + return result; + } + public async Task> CreateCollectionsAsync(CreateCollectionsRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/collections",null,request,null, + cancellationToken); + + return result; + } + public async Task> UpsertCollectionsAsync(UpsertCollectionsRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "PUT", + "/api/v2/feeds/collections",null,request,null, + cancellationToken); + + return result; + } public async Task> GetCommentsAsync(object request = null, CancellationToken cancellationToken = default) { @@ -502,10 +559,11 @@ public async Task> GetCommentRepliesAs public async Task> ListFeedGroupsAsync(object request = null, CancellationToken cancellationToken = default) { + var queryParams = ExtractQueryParams(request); var result = await _client.MakeRequestAsync( "GET", - "/api/v2/feeds/feed_groups",null,null,null, + "/api/v2/feeds/feed_groups",queryParams,null,null, cancellationToken); return result; @@ -724,10 +782,11 @@ public async Task> GetFeedGroupAsync(string { ["id"] = id, }; + var queryParams = ExtractQueryParams(request); var result = await _client.MakeRequestAsync( "GET", - "/api/v2/feeds/feed_groups/{id}",null,null,pathParams, + "/api/v2/feeds/feed_groups/{id}",queryParams,null,pathParams, cancellationToken); return result; @@ -870,6 +929,21 @@ public async Task> GetFeedVisibilityAs return result; } + public async Task> UpdateFeedVisibilityAsync(string name,UpdateFeedVisibilityRequest request, + CancellationToken cancellationToken = default) + { + var pathParams = new Dictionary + { + ["name"] = name, + }; + + var result = await _client.MakeRequestAsync( + "PUT", + "/api/v2/feeds/feed_visibilities/{name}",null,request,pathParams, + cancellationToken); + + return result; + } public async Task> CreateFeedsBatchAsync(CreateFeedsBatchRequest request, CancellationToken cancellationToken = default) { @@ -881,6 +955,28 @@ public async Task> CreateFeedsBatchAsyn return result; } + public async Task> DeleteFeedsBatchAsync(DeleteFeedsBatchRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/feeds/delete",null,request,null, + cancellationToken); + + return result; + } + public async Task> OwnBatchAsync(OwnBatchRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/feeds/own/batch",null,request,null, + cancellationToken); + + return result; + } public async Task> QueryFeedsAsync(QueryFeedsRequest request, CancellationToken cancellationToken = default) { @@ -892,6 +988,18 @@ public async Task> QueryFeedsAsync(QueryFeeds return result; } + public async Task> GetFeedsRateLimitsAsync(object request = null, + CancellationToken cancellationToken = default) + { + var queryParams = ExtractQueryParams(request); + + var result = await _client.MakeRequestAsync( + "GET", + "/api/v2/feeds/feeds/rate_limits",queryParams,null,null, + cancellationToken); + + return result; + } public async Task> UpdateFollowAsync(UpdateFollowRequest request, CancellationToken cancellationToken = default) { @@ -936,6 +1044,17 @@ public async Task> FollowBatchAsync(FollowBa return result; } + public async Task> GetOrCreateFollowsAsync(FollowBatchRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/follows/batch/upsert",null,request,null, + cancellationToken); + + return result; + } public async Task> QueryFollowsAsync(QueryFollowsRequest request, CancellationToken cancellationToken = default) { @@ -1026,6 +1145,17 @@ public async Task> UpdateMembershi return result; } + public async Task> QueryFeedsUsageStatsAsync(QueryFeedsUsageStatsRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/stats/usage",null,request,null, + cancellationToken); + + return result; + } public async Task> UnfollowBatchAsync(UnfollowBatchRequest request, CancellationToken cancellationToken = default) { @@ -1037,7 +1167,18 @@ public async Task> UnfollowBatchAsync(Unfo return result; } - public async Task> DeleteFeedUserDataAsync(string userID,object request = null, + public async Task> GetOrCreateUnfollowsAsync(UnfollowBatchRequest request, + CancellationToken cancellationToken = default) + { + + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/unfollow/batch/upsert",null,request,null, + cancellationToken); + + return result; + } + public async Task> DeleteFeedUserDataAsync(string userID,DeleteFeedUserDataRequest request, CancellationToken cancellationToken = default) { var pathParams = new Dictionary @@ -1045,9 +1186,9 @@ public async Task> DeleteFeedUserData ["user_id"] = userID, }; - var result = await _client.MakeRequestAsync( - "DELETE", - "/api/v2/feeds/users/{user_id}/delete",null,null,pathParams, + var result = await _client.MakeRequestAsync( + "POST", + "/api/v2/feeds/users/{user_id}/delete",null,request,pathParams, cancellationToken); return result; diff --git a/src/models.cs b/src/models.cs index 54140e9..1eb9d66 100644 --- a/src/models.cs +++ b/src/models.cs @@ -267,18 +267,46 @@ public class ActivityDeletedEvent public UserResponseCommonFields? User { get; set; } } + public class ActivityFeedbackEvent + { + [JsonPropertyName("created_at")] + public DateTime CreatedAt { get; set; } + [JsonPropertyName("activity_feedback")] + public ActivityFeedbackEventPayload ActivityFeedback { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + [JsonPropertyName("type")] + public string Type { get; set; } + [JsonPropertyName("received_at")] + public DateTime? ReceivedAt { get; set; } + [JsonPropertyName("user")] + public UserResponseCommonFields? User { get; set; } + } + + public class ActivityFeedbackEventPayload + { + [JsonPropertyName("action")] + public string Action { get; set; } + [JsonPropertyName("activity_id")] + public string ActivityID { get; set; } + [JsonPropertyName("created_at")] + public DateTime CreatedAt { get; set; } + [JsonPropertyName("updated_at")] + public DateTime UpdatedAt { get; set; } + [JsonPropertyName("value")] + public string Value { get; set; } + [JsonPropertyName("user")] + public UserResponse User { get; set; } + } + public class ActivityFeedbackRequest { [JsonPropertyName("hide")] public bool? Hide { get; set; } - [JsonPropertyName("mute_user")] - public bool? MuteUser { get; set; } - [JsonPropertyName("reason")] - public string? Reason { get; set; } - [JsonPropertyName("report")] - public bool? Report { get; set; } [JsonPropertyName("show_less")] public bool? ShowLess { get; set; } + [JsonPropertyName("show_more")] + public bool? ShowMore { get; set; } [JsonPropertyName("user_id")] public string? UserID { get; set; } [JsonPropertyName("user")] @@ -469,6 +497,10 @@ public class ActivityRequest public string? ParentID { get; set; } [JsonPropertyName("poll_id")] public string? PollID { get; set; } + [JsonPropertyName("restrict_replies")] + public string? RestrictReplies { get; set; } + [JsonPropertyName("skip_enrich_url")] + public bool? SkipEnrichUrl { get; set; } [JsonPropertyName("text")] public string? Text { get; set; } [JsonPropertyName("user_id")] @@ -479,6 +511,8 @@ public class ActivityRequest public string? VisibilityTag { get; set; } [JsonPropertyName("attachments")] public List Attachments { get; set; } + [JsonPropertyName("collection_refs")] + public List CollectionRefs { get; set; } [JsonPropertyName("filter_tags")] public List FilterTags { get; set; } [JsonPropertyName("interest_tags")] @@ -501,12 +535,18 @@ public class ActivityResponse public int CommentCount { get; set; } [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } + [JsonPropertyName("hidden")] + public bool Hidden { get; set; } [JsonPropertyName("id")] public string ID { get; set; } [JsonPropertyName("popularity")] public int Popularity { get; set; } + [JsonPropertyName("preview")] + public bool Preview { get; set; } [JsonPropertyName("reaction_count")] public int ReactionCount { get; set; } + [JsonPropertyName("restrict_replies")] + public string RestrictReplies { get; set; } [JsonPropertyName("score")] public double Score { get; set; } [JsonPropertyName("share_count")] @@ -535,6 +575,8 @@ public class ActivityResponse public List OwnBookmarks { get; set; } [JsonPropertyName("own_reactions")] public List OwnReactions { get; set; } + [JsonPropertyName("collections")] + public Dictionary Collections { get; set; } [JsonPropertyName("custom")] public object Custom { get; set; } [JsonPropertyName("reaction_groups")] @@ -549,10 +591,10 @@ public class ActivityResponse public DateTime? EditedAt { get; set; } [JsonPropertyName("expires_at")] public DateTime? ExpiresAt { get; set; } - [JsonPropertyName("hidden")] - public bool? Hidden { get; set; } [JsonPropertyName("is_watched")] public bool? IsWatched { get; set; } + [JsonPropertyName("moderation_action")] + public string? ModerationAction { get; set; } [JsonPropertyName("text")] public string? Text { get; set; } [JsonPropertyName("visibility_tag")] @@ -573,28 +615,36 @@ public class ActivityResponse public class ActivitySelectorConfig { + [JsonPropertyName("type")] + public string Type { get; set; } [JsonPropertyName("cutoff_time")] public string? CutoffTime { get; set; } + [JsonPropertyName("cutoff_window")] + public string? CutoffWindow { get; set; } [JsonPropertyName("min_popularity")] public int? MinPopularity { get; set; } - [JsonPropertyName("type")] - public string? Type { get; set; } [JsonPropertyName("sort")] - public List Sort { get; set; } + public List Sort { get; set; } + [JsonPropertyName("params")] + public object @Params { get; set; } [JsonPropertyName("filter")] public object Filter { get; set; } } public class ActivitySelectorConfigResponse { + [JsonPropertyName("type")] + public string Type { get; set; } [JsonPropertyName("cutoff_time")] public DateTime? CutoffTime { get; set; } + [JsonPropertyName("cutoff_window")] + public string? CutoffWindow { get; set; } [JsonPropertyName("min_popularity")] public int? MinPopularity { get; set; } - [JsonPropertyName("type")] - public string? Type { get; set; } [JsonPropertyName("sort")] - public List Sort { get; set; } + public List Sort { get; set; } + [JsonPropertyName("params")] + public object @Params { get; set; } [JsonPropertyName("filter")] public object Filter { get; set; } } @@ -653,6 +703,10 @@ public class AddActivityRequest public string? ParentID { get; set; } [JsonPropertyName("poll_id")] public string? PollID { get; set; } + [JsonPropertyName("restrict_replies")] + public string? RestrictReplies { get; set; } + [JsonPropertyName("skip_enrich_url")] + public bool? SkipEnrichUrl { get; set; } [JsonPropertyName("text")] public string? Text { get; set; } [JsonPropertyName("user_id")] @@ -663,6 +717,8 @@ public class AddActivityRequest public string? VisibilityTag { get; set; } [JsonPropertyName("attachments")] public List Attachments { get; set; } + [JsonPropertyName("collection_refs")] + public List CollectionRefs { get; set; } [JsonPropertyName("filter_tags")] public List FilterTags { get; set; } [JsonPropertyName("interest_tags")] @@ -737,16 +793,20 @@ public class AddCommentReactionResponse public class AddCommentRequest { - [JsonPropertyName("object_id")] - public string ObjectID { get; set; } - [JsonPropertyName("object_type")] - public string ObjectType { get; set; } [JsonPropertyName("comment")] public string? Comment { get; set; } [JsonPropertyName("create_notification_activity")] public bool? CreateNotificationActivity { get; set; } + [JsonPropertyName("id")] + public string? ID { get; set; } + [JsonPropertyName("object_id")] + public string? ObjectID { get; set; } + [JsonPropertyName("object_type")] + public string? ObjectType { get; set; } [JsonPropertyName("parent_id")] public string? ParentID { get; set; } + [JsonPropertyName("skip_enrich_url")] + public bool? SkipEnrichUrl { get; set; } [JsonPropertyName("skip_push")] public bool? SkipPush { get; set; } [JsonPropertyName("user_id")] @@ -869,6 +929,8 @@ public class AppResponseFields public string EnforceUniqueUsernames { get; set; } [JsonPropertyName("guest_user_creation_disabled")] public bool GuestUserCreationDisabled { get; set; } + [JsonPropertyName("id")] + public int ID { get; set; } [JsonPropertyName("image_moderation_enabled")] public bool ImageModerationEnabled { get; set; } [JsonPropertyName("max_aggregated_activities_length")] @@ -891,12 +953,10 @@ public class AppResponseFields public string Organization { get; set; } [JsonPropertyName("permission_version")] public string PermissionVersion { get; set; } - [JsonPropertyName("region")] - public string Region { get; set; } + [JsonPropertyName("placement")] + public string Placement { get; set; } [JsonPropertyName("reminders_interval")] public int RemindersInterval { get; set; } - [JsonPropertyName("shard")] - public string Shard { get; set; } [JsonPropertyName("sns_key")] public string SnsKey { get; set; } [JsonPropertyName("sns_secret")] @@ -928,7 +988,7 @@ public class AppResponseFields [JsonPropertyName("call_types")] public Dictionary CallTypes { get; set; } [JsonPropertyName("channel_configs")] - public Dictionary ChannelConfigs { get; set; } + public Dictionary ChannelConfigs { get; set; } [JsonPropertyName("file_upload_config")] public FileUploadConfig FileUploadConfig { get; set; } [JsonPropertyName("grants")] @@ -1273,6 +1333,12 @@ public class BanResponse public string Duration { get; set; } } + public class BlockActionRequest + { + [JsonPropertyName("reason")] + public string? Reason { get; set; } + } + public class BlockListConfig { [JsonPropertyName("async")] @@ -1441,6 +1507,8 @@ public class BookmarkFolderResponse public string Name { get; set; } [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } + [JsonPropertyName("user")] + public UserResponse User { get; set; } [JsonPropertyName("custom")] public object Custom { get; set; } } @@ -1695,21 +1763,21 @@ public class CallSettingsResponse public class CallType { - [JsonPropertyName("AppPK")] - public int AppPK { get; set; } - [JsonPropertyName("CreatedAt")] + [JsonPropertyName("app")] + public int App { get; set; } + [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } - [JsonPropertyName("ExternalStorage")] - public string ExternalStorage { get; set; } - [JsonPropertyName("Name")] + [JsonPropertyName("id")] + public int ID { get; set; } + [JsonPropertyName("name")] public string Name { get; set; } - [JsonPropertyName("PK")] - public int PK { get; set; } - [JsonPropertyName("UpdatedAt")] + [JsonPropertyName("recording_external_storage")] + public string RecordingExternalStorage { get; set; } + [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } - [JsonPropertyName("NotificationSettings")] + [JsonPropertyName("notification_settings")] public NotificationSettings? NotificationSettings { get; set; } - [JsonPropertyName("Settings")] + [JsonPropertyName("settings")] public CallSettings? Settings { get; set; } } @@ -1763,6 +1831,8 @@ public class Channel public string? Team { get; set; } [JsonPropertyName("active_live_locations")] public List ActiveLiveLocations { get; set; } + [JsonPropertyName("filter_tags")] + public List FilterTags { get; set; } [JsonPropertyName("invites")] public List Invites { get; set; } [JsonPropertyName("members")] @@ -1793,6 +1863,8 @@ public class ChannelConfig public DateTime CreatedAt { get; set; } [JsonPropertyName("custom_events")] public bool CustomEvents { get; set; } + [JsonPropertyName("delivery_events")] + public bool DeliveryEvents { get; set; } [JsonPropertyName("mark_messages_pending")] public bool MarkMessagesPending { get; set; } [JsonPropertyName("max_message_length")] @@ -1840,7 +1912,7 @@ public class ChannelConfig [JsonPropertyName("partition_size")] public int? PartitionSize { get; set; } [JsonPropertyName("partition_ttl")] - public int? PartitionTtl { get; set; } + public string? PartitionTtl { get; set; } [JsonPropertyName("allowed_flag_reasons")] public List AllowedFlagReasons { get; set; } [JsonPropertyName("blocklists")] @@ -1863,6 +1935,8 @@ public class ChannelConfigWithInfo public DateTime CreatedAt { get; set; } [JsonPropertyName("custom_events")] public bool CustomEvents { get; set; } + [JsonPropertyName("delivery_events")] + public bool DeliveryEvents { get; set; } [JsonPropertyName("mark_messages_pending")] public bool MarkMessagesPending { get; set; } [JsonPropertyName("max_message_length")] @@ -1929,6 +2003,8 @@ public class ChannelMember public string ChannelRole { get; set; } [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } + [JsonPropertyName("is_global_banned")] + public bool IsGlobalBanned { get; set; } [JsonPropertyName("notifications_muted")] public bool NotificationsMuted { get; set; } [JsonPropertyName("shadow_banned")] @@ -1941,8 +2017,12 @@ public class ChannelMember public DateTime? ArchivedAt { get; set; } [JsonPropertyName("ban_expires")] public DateTime? BanExpires { get; set; } + [JsonPropertyName("blocked")] + public bool? Blocked { get; set; } [JsonPropertyName("deleted_at")] public DateTime? DeletedAt { get; set; } + [JsonPropertyName("hidden")] + public bool? Hidden { get; set; } [JsonPropertyName("invite_accepted_at")] public DateTime? InviteAcceptedAt { get; set; } [JsonPropertyName("invite_rejected_at")] @@ -1953,16 +2033,16 @@ public class ChannelMember public bool? IsModerator { get; set; } [JsonPropertyName("pinned_at")] public DateTime? PinnedAt { get; set; } - [JsonPropertyName("role")] - public string? Role { get; set; } [JsonPropertyName("status")] public string? Status { get; set; } [JsonPropertyName("user_id")] public string? UserID { get; set; } [JsonPropertyName("deleted_messages")] public List DeletedMessages { get; set; } + [JsonPropertyName("channel")] + public DenormalizedChannelFields? Channel { get; set; } [JsonPropertyName("user")] - public UserResponse? User { get; set; } + public User? User { get; set; } } public class ChannelMemberLookup @@ -1987,8 +2067,46 @@ public class ChannelMemberLookup public class ChannelMemberResponse { + [JsonPropertyName("banned")] + public bool Banned { get; set; } [JsonPropertyName("channel_role")] public string ChannelRole { get; set; } + [JsonPropertyName("created_at")] + public DateTime CreatedAt { get; set; } + [JsonPropertyName("notifications_muted")] + public bool NotificationsMuted { get; set; } + [JsonPropertyName("shadow_banned")] + public bool ShadowBanned { get; set; } + [JsonPropertyName("updated_at")] + public DateTime UpdatedAt { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + [JsonPropertyName("archived_at")] + public DateTime? ArchivedAt { get; set; } + [JsonPropertyName("ban_expires")] + public DateTime? BanExpires { get; set; } + [JsonPropertyName("deleted_at")] + public DateTime? DeletedAt { get; set; } + [JsonPropertyName("invite_accepted_at")] + public DateTime? InviteAcceptedAt { get; set; } + [JsonPropertyName("invite_rejected_at")] + public DateTime? InviteRejectedAt { get; set; } + [JsonPropertyName("invited")] + public bool? Invited { get; set; } + [JsonPropertyName("is_moderator")] + public bool? IsModerator { get; set; } + [JsonPropertyName("pinned_at")] + public DateTime? PinnedAt { get; set; } + [JsonPropertyName("role")] + public string? Role { get; set; } + [JsonPropertyName("status")] + public string? Status { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("deleted_messages")] + public List DeletedMessages { get; set; } + [JsonPropertyName("user")] + public UserResponse? User { get; set; } } public class ChannelMute @@ -2063,8 +2181,10 @@ public class ChannelResponse public string? Team { get; set; } [JsonPropertyName("truncated_at")] public DateTime? TruncatedAt { get; set; } + [JsonPropertyName("filter_tags")] + public List FilterTags { get; set; } [JsonPropertyName("members")] - public List Members { get; set; } + public List Members { get; set; } [JsonPropertyName("own_capabilities")] public List OwnCapabilities { get; set; } [JsonPropertyName("config")] @@ -2211,6 +2331,34 @@ public class CheckSQSResponse public object Data { get; set; } } + public class CollectionRequest + { + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + [JsonPropertyName("id")] + public string? ID { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + } + + public class CollectionResponse + { + [JsonPropertyName("id")] + public string ID { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("created_at")] + public DateTime? CreatedAt { get; set; } + [JsonPropertyName("updated_at")] + public DateTime? UpdatedAt { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + } + public class Command { [JsonPropertyName("args")] @@ -2509,6 +2657,24 @@ public class CreateBlockListResponse public BlockListResponse? Blocklist { get; set; } } + public class CreateCollectionsRequest + { + [JsonPropertyName("collections")] + public List Collections { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("user")] + public UserRequest? User { get; set; } + } + + public class CreateCollectionsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("collections")] + public List Collections { get; set; } + } + public class CreateDeviceRequest { [JsonPropertyName("id")] @@ -2585,8 +2751,6 @@ public class CreateFeedViewRequest { [JsonPropertyName("id")] public string ID { get; set; } - [JsonPropertyName("activity_processors")] - public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] public List ActivitySelectors { get; set; } [JsonPropertyName("aggregation")] @@ -2795,6 +2959,22 @@ public class CustomCheckResponse public ReviewQueueItemResponse? Item { get; set; } } + public class DailyMetricResponse + { + [JsonPropertyName("date")] + public string Date { get; set; } + [JsonPropertyName("value")] + public int Value { get; set; } + } + + public class DailyMetricStatsResponse + { + [JsonPropertyName("total")] + public int Total { get; set; } + [JsonPropertyName("daily")] + public List Daily { get; set; } + } + public class Data { [JsonPropertyName("id")] @@ -2897,6 +3077,8 @@ public class DeleteActivityRequest { [JsonPropertyName("hard_delete")] public bool? HardDelete { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } } public class DeleteActivityResponse @@ -2919,6 +3101,12 @@ public class DeleteBookmarkResponse public BookmarkResponse Bookmark { get; set; } } + public class DeleteCollectionsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + } + public class DeleteCommentReactionResponse { [JsonPropertyName("duration")] @@ -2929,6 +3117,14 @@ public class DeleteCommentReactionResponse public FeedsReactionResponse Reaction { get; set; } } + public class DeleteCommentRequest + { + [JsonPropertyName("hard_delete")] + public bool? HardDelete { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } + } + public class DeleteCommentResponse { [JsonPropertyName("duration")] @@ -2959,18 +3155,18 @@ public class DeleteFeedResponse public string TaskID { get; set; } } + public class DeleteFeedUserDataRequest + { + [JsonPropertyName("hard_delete")] + public bool? HardDelete { get; set; } + } + public class DeleteFeedUserDataResponse { - [JsonPropertyName("deleted_activities")] - public int DeletedActivities { get; set; } - [JsonPropertyName("deleted_bookmarks")] - public int DeletedBookmarks { get; set; } - [JsonPropertyName("deleted_comments")] - public int DeletedComments { get; set; } - [JsonPropertyName("deleted_reactions")] - public int DeletedReactions { get; set; } [JsonPropertyName("duration")] public string Duration { get; set; } + [JsonPropertyName("task_id")] + public string TaskID { get; set; } } public class DeleteFeedViewResponse @@ -2979,10 +3175,28 @@ public class DeleteFeedViewResponse public string Duration { get; set; } } + public class DeleteFeedsBatchRequest + { + [JsonPropertyName("feeds")] + public List Feeds { get; set; } + [JsonPropertyName("hard_delete")] + public bool? HardDelete { get; set; } + } + + public class DeleteFeedsBatchResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("task_id")] + public string TaskID { get; set; } + } + public class DeleteMessageRequest { [JsonPropertyName("hard_delete")] public bool? HardDelete { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } } public class DeleteModerationConfigResponse @@ -3007,6 +3221,8 @@ public class DeleteReactionRequest { [JsonPropertyName("hard_delete")] public bool? HardDelete { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } } public class DeleteUserRequest @@ -3019,6 +3235,8 @@ public class DeleteUserRequest public bool? HardDelete { get; set; } [JsonPropertyName("mark_messages_deleted")] public bool? MarkMessagesDeleted { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } } public class DeleteUsersRequest @@ -3061,6 +3279,32 @@ public class DeliveryReceiptsResponse public bool? Enabled { get; set; } } + public class DenormalizedChannelFields + { + [JsonPropertyName("created_at")] + public string? CreatedAt { get; set; } + [JsonPropertyName("created_by_id")] + public string? CreatedByID { get; set; } + [JsonPropertyName("disabled")] + public bool? Disabled { get; set; } + [JsonPropertyName("frozen")] + public bool? Frozen { get; set; } + [JsonPropertyName("id")] + public string? ID { get; set; } + [JsonPropertyName("last_message_at")] + public string? LastMessageAt { get; set; } + [JsonPropertyName("member_count")] + public int? MemberCount { get; set; } + [JsonPropertyName("team")] + public string? Team { get; set; } + [JsonPropertyName("type")] + public string? Type { get; set; } + [JsonPropertyName("updated_at")] + public string? UpdatedAt { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + } + public class Device { [JsonPropertyName("created_at")] @@ -3219,6 +3463,24 @@ public class EnrichedActivity public Data? Target { get; set; } } + public class EnrichedCollectionResponse + { + [JsonPropertyName("id")] + public string ID { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("status")] + public string Status { get; set; } + [JsonPropertyName("created_at")] + public DateTime? CreatedAt { get; set; } + [JsonPropertyName("updated_at")] + public DateTime? UpdatedAt { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + } + public class EnrichedReaction { [JsonPropertyName("activity_id")] @@ -3249,6 +3511,44 @@ public class EnrichedReaction public Data? User { get; set; } } + public class EnrichmentOptions + { + [JsonPropertyName("skip_activity")] + public bool? SkipActivity { get; set; } + [JsonPropertyName("skip_activity_collections")] + public bool? SkipActivityCollections { get; set; } + [JsonPropertyName("skip_activity_comments")] + public bool? SkipActivityComments { get; set; } + [JsonPropertyName("skip_activity_current_feed")] + public bool? SkipActivityCurrentFeed { get; set; } + [JsonPropertyName("skip_activity_mentioned_users")] + public bool? SkipActivityMentionedUsers { get; set; } + [JsonPropertyName("skip_activity_own_bookmarks")] + public bool? SkipActivityOwnBookmarks { get; set; } + [JsonPropertyName("skip_activity_parents")] + public bool? SkipActivityParents { get; set; } + [JsonPropertyName("skip_activity_poll")] + public bool? SkipActivityPoll { get; set; } + [JsonPropertyName("skip_activity_reactions")] + public bool? SkipActivityReactions { get; set; } + [JsonPropertyName("skip_activity_refresh_image_urls")] + public bool? SkipActivityRefreshImageUrls { get; set; } + [JsonPropertyName("skip_all")] + public bool? SkipAll { get; set; } + [JsonPropertyName("skip_feed_member_user")] + public bool? SkipFeedMemberUser { get; set; } + [JsonPropertyName("skip_followers")] + public bool? SkipFollowers { get; set; } + [JsonPropertyName("skip_following")] + public bool? SkipFollowing { get; set; } + [JsonPropertyName("skip_own_capabilities")] + public bool? SkipOwnCapabilities { get; set; } + [JsonPropertyName("skip_own_follows")] + public bool? SkipOwnFollows { get; set; } + [JsonPropertyName("skip_pins")] + public bool? SkipPins { get; set; } + } + public class EntityCreatorResponse { [JsonPropertyName("ban_count")] @@ -3329,6 +3629,8 @@ public class EventHook public string? ID { get; set; } [JsonPropertyName("product")] public string? Product { get; set; } + [JsonPropertyName("should_send_custom_events")] + public bool? ShouldSendCustomEvents { get; set; } [JsonPropertyName("sns_auth_type")] public string? SnsAuthType { get; set; } [JsonPropertyName("sns_key")] @@ -3473,37 +3775,37 @@ public class FeedDeletedEvent public class FeedGroup { - [JsonPropertyName("AggregationVersion")] + [JsonPropertyName("aggregation_version")] public int AggregationVersion { get; set; } - [JsonPropertyName("AppPK")] - public int AppPK { get; set; } + [JsonPropertyName("app_pk")] + public int AppPk { get; set; } [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } - [JsonPropertyName("DefaultVisibility")] + [JsonPropertyName("default_visibility")] public string DefaultVisibility { get; set; } - [JsonPropertyName("ID")] - public string ID { get; set; } + [JsonPropertyName("group_id")] + public string GroupID { get; set; } [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } - [JsonPropertyName("ActivityProcessors")] + [JsonPropertyName("activity_processors")] public List ActivityProcessors { get; set; } - [JsonPropertyName("ActivitySelectors")] + [JsonPropertyName("activity_selectors")] public List ActivitySelectors { get; set; } - [JsonPropertyName("Custom")] + [JsonPropertyName("custom")] public object Custom { get; set; } - [JsonPropertyName("DeletedAt")] + [JsonPropertyName("deleted_at")] public DateTime? DeletedAt { get; set; } - [JsonPropertyName("LastFeedGetAt")] + [JsonPropertyName("last_feed_get_at")] public DateTime? LastFeedGetAt { get; set; } - [JsonPropertyName("Aggregation")] + [JsonPropertyName("aggregation")] public AggregationConfig? Aggregation { get; set; } - [JsonPropertyName("Notification")] + [JsonPropertyName("notification")] public NotificationConfig? Notification { get; set; } - [JsonPropertyName("PushNotification")] + [JsonPropertyName("push_notification")] public PushNotificationConfig? PushNotification { get; set; } - [JsonPropertyName("Ranking")] + [JsonPropertyName("ranking")] public RankingConfig? Ranking { get; set; } - [JsonPropertyName("Stories")] + [JsonPropertyName("stories")] public StoriesConfig? Stories { get; set; } } @@ -3555,6 +3857,8 @@ public class FeedGroupResponse public DateTime UpdatedAt { get; set; } [JsonPropertyName("default_visibility")] public string? DefaultVisibility { get; set; } + [JsonPropertyName("deleted_at")] + public DateTime? DeletedAt { get; set; } [JsonPropertyName("activity_processors")] public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] @@ -3689,6 +3993,16 @@ public class FeedOwnCapability { } + public class FeedOwnData + { + [JsonPropertyName("own_capabilities")] + public List OwnCapabilities { get; set; } + [JsonPropertyName("own_follows")] + public List OwnFollows { get; set; } + [JsonPropertyName("own_membership")] + public FeedMemberResponse? OwnMembership { get; set; } + } + public class FeedRequest { [JsonPropertyName("feed_group_id")] @@ -3713,6 +4027,52 @@ public class FeedRequest public class FeedResponse { + [JsonPropertyName("activity_count")] + public int ActivityCount { get; set; } + [JsonPropertyName("created_at")] + public DateTime CreatedAt { get; set; } + [JsonPropertyName("description")] + public string Description { get; set; } + [JsonPropertyName("feed")] + public string Feed { get; set; } + [JsonPropertyName("follower_count")] + public int FollowerCount { get; set; } + [JsonPropertyName("following_count")] + public int FollowingCount { get; set; } + [JsonPropertyName("group_id")] + public string GroupID { get; set; } + [JsonPropertyName("id")] + public string ID { get; set; } + [JsonPropertyName("member_count")] + public int MemberCount { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("pin_count")] + public int PinCount { get; set; } + [JsonPropertyName("updated_at")] + public DateTime UpdatedAt { get; set; } + [JsonPropertyName("created_by")] + public UserResponse CreatedBy { get; set; } + [JsonPropertyName("deleted_at")] + public DateTime? DeletedAt { get; set; } + [JsonPropertyName("visibility")] + public string? Visibility { get; set; } + [JsonPropertyName("filter_tags")] + public List FilterTags { get; set; } + [JsonPropertyName("own_capabilities")] + public List OwnCapabilities { get; set; } + [JsonPropertyName("own_follows")] + public List OwnFollows { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + [JsonPropertyName("own_membership")] + public FeedMemberResponse? OwnMembership { get; set; } + } + + public class FeedSuggestionResponse + { + [JsonPropertyName("activity_count")] + public int ActivityCount { get; set; } [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } [JsonPropertyName("description")] @@ -3739,6 +4099,10 @@ public class FeedResponse public UserResponse CreatedBy { get; set; } [JsonPropertyName("deleted_at")] public DateTime? DeletedAt { get; set; } + [JsonPropertyName("reason")] + public string? Reason { get; set; } + [JsonPropertyName("recommendation_score")] + public double? RecommendationScore { get; set; } [JsonPropertyName("visibility")] public string? Visibility { get; set; } [JsonPropertyName("filter_tags")] @@ -3747,6 +4111,8 @@ public class FeedResponse public List OwnCapabilities { get; set; } [JsonPropertyName("own_follows")] public List OwnFollows { get; set; } + [JsonPropertyName("algorithm_scores")] + public Dictionary AlgorithmScores { get; set; } [JsonPropertyName("custom")] public object Custom { get; set; } [JsonPropertyName("own_membership")] @@ -3779,8 +4145,6 @@ public class FeedViewResponse public string ID { get; set; } [JsonPropertyName("last_used_at")] public DateTime? LastUsedAt { get; set; } - [JsonPropertyName("activity_processors")] - public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] public List ActivitySelectors { get; set; } [JsonPropertyName("aggregation")] @@ -3791,10 +4155,10 @@ public class FeedViewResponse public class FeedVisibilityResponse { - [JsonPropertyName("description")] - public string Description { get; set; } [JsonPropertyName("name")] public string Name { get; set; } + [JsonPropertyName("permissions")] + public List Permissions { get; set; } [JsonPropertyName("grants")] public Dictionary> Grants { get; set; } } @@ -3813,6 +4177,8 @@ public class FeedsPreferences public string? Comment { get; set; } [JsonPropertyName("comment_reaction")] public string? CommentReaction { get; set; } + [JsonPropertyName("comment_reply")] + public string? CommentReply { get; set; } [JsonPropertyName("follow")] public string? Follow { get; set; } [JsonPropertyName("mention")] @@ -3883,6 +4249,14 @@ public class FileUploadResponse public string? ThumbUrl { get; set; } } + public class FilterConfigResponse + { + [JsonPropertyName("llm_labels")] + public List LlmLabels { get; set; } + [JsonPropertyName("ai_text_labels")] + public List AiTextLabels { get; set; } + } + public class FirebaseConfig { [JsonPropertyName("apn_template")] @@ -3915,6 +4289,12 @@ public class FirebaseConfigFields public string? ServerKey { get; set; } } + public class FlagCountRuleParameters + { + [JsonPropertyName("threshold")] + public int? Threshold { get; set; } + } + public class FlagRequest { [JsonPropertyName("entity_id")] @@ -3959,6 +4339,8 @@ public class FollowBatchResponse { [JsonPropertyName("duration")] public string Duration { get; set; } + [JsonPropertyName("created")] + public List Created { get; set; } [JsonPropertyName("follows")] public List Follows { get; set; } } @@ -4283,12 +4665,28 @@ public class GetFeedVisibilityResponse public FeedVisibilityResponse FeedVisibility { get; set; } } + public class GetFeedsRateLimitsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("android")] + public Dictionary Android { get; set; } + [JsonPropertyName("ios")] + public Dictionary Ios { get; set; } + [JsonPropertyName("server_side")] + public Dictionary ServerSide { get; set; } + [JsonPropertyName("web")] + public Dictionary Web { get; set; } + } + public class GetFollowSuggestionsResponse { [JsonPropertyName("duration")] public string Duration { get; set; } [JsonPropertyName("suggestions")] - public List Suggestions { get; set; } + public List Suggestions { get; set; } + [JsonPropertyName("algorithm_used")] + public string? AlgorithmUsed { get; set; } } public class GetImportResponse @@ -4391,6 +4789,8 @@ public class GetOrCreateFeedGroupResponse public class GetOrCreateFeedRequest { + [JsonPropertyName("id_around")] + public string? IDAround { get; set; } [JsonPropertyName("limit")] public int? Limit { get; set; } [JsonPropertyName("next")] @@ -4403,10 +4803,10 @@ public class GetOrCreateFeedRequest public string? View { get; set; } [JsonPropertyName("watch")] public bool? Watch { get; set; } - [JsonPropertyName("activity_selector_options")] - public object ActivitySelectorOptions { get; set; } [JsonPropertyName("data")] public FeedInput? Data { get; set; } + [JsonPropertyName("enrichment_options")] + public EnrichmentOptions? EnrichmentOptions { get; set; } [JsonPropertyName("external_ranking")] public object ExternalRanking { get; set; } [JsonPropertyName("filter")] @@ -4459,8 +4859,6 @@ public class GetOrCreateFeedResponse public class GetOrCreateFeedViewRequest { - [JsonPropertyName("activity_processors")] - public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] public List ActivitySelectors { get; set; } [JsonPropertyName("aggregation")] @@ -5341,6 +5739,10 @@ public class ModerationDashboardPreferences public bool? FlagUserOnFlaggedContent { get; set; } [JsonPropertyName("media_queue_blur_enabled")] public bool? MediaQueueBlurEnabled { get; set; } + [JsonPropertyName("allowed_moderation_action_reasons")] + public List AllowedModerationActionReasons { get; set; } + [JsonPropertyName("overview_dashboard")] + public OverviewDashboardConfig? OverviewDashboard { get; set; } } public class ModerationFlagResponse @@ -5499,8 +5901,22 @@ public class NoiseCancellationSettings public string Mode { get; set; } } + public class NotificationComment + { + [JsonPropertyName("comment")] + public string Comment { get; set; } + [JsonPropertyName("id")] + public string ID { get; set; } + [JsonPropertyName("user_id")] + public string UserID { get; set; } + [JsonPropertyName("attachments")] + public List Attachments { get; set; } + } + public class NotificationConfig { + [JsonPropertyName("deduplication_window")] + public string? DeduplicationWindow { get; set; } [JsonPropertyName("track_read")] public bool? TrackRead { get; set; } [JsonPropertyName("track_seen")] @@ -5583,6 +5999,8 @@ public class NotificationTarget public string? UserID { get; set; } [JsonPropertyName("attachments")] public List Attachments { get; set; } + [JsonPropertyName("comment")] + public NotificationComment? Comment { get; set; } } public class NotificationTrigger @@ -5591,6 +6009,8 @@ public class NotificationTrigger public string Text { get; set; } [JsonPropertyName("type")] public string Type { get; set; } + [JsonPropertyName("comment")] + public NotificationComment? Comment { get; set; } } public class OCRRule @@ -5607,6 +6027,34 @@ public class OnlyUserID public string ID { get; set; } } + public class OverviewDashboardConfig + { + [JsonPropertyName("default_date_range_days")] + public int? DefaultDateRangeDays { get; set; } + [JsonPropertyName("visible_charts")] + public List VisibleCharts { get; set; } + } + + public class OwnBatchRequest + { + [JsonPropertyName("feeds")] + public List Feeds { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("fields")] + public List Fields { get; set; } + [JsonPropertyName("user")] + public UserRequest? User { get; set; } + } + + public class OwnBatchResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("data")] + public Dictionary Data { get; set; } + } + public class OwnUser { [JsonPropertyName("banned")] @@ -6107,6 +6555,8 @@ public class PushProvider public string? HuaweiAppID { get; set; } [JsonPropertyName("huawei_app_secret")] public string? HuaweiAppSecret { get; set; } + [JsonPropertyName("huawei_host")] + public string? HuaweiHost { get; set; } [JsonPropertyName("xiaomi_app_secret")] public string? XiaomiAppSecret { get; set; } [JsonPropertyName("xiaomi_package_name")] @@ -6191,16 +6641,22 @@ public class PushTemplate public class QueryActivitiesRequest { + [JsonPropertyName("include_private_activities")] + public bool? IncludePrivateActivities { get; set; } [JsonPropertyName("limit")] public int? Limit { get; set; } [JsonPropertyName("next")] public string? Next { get; set; } [JsonPropertyName("prev")] public string? Prev { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } [JsonPropertyName("sort")] public List Sort { get; set; } [JsonPropertyName("filter")] public object Filter { get; set; } + [JsonPropertyName("user")] + public UserRequest? User { get; set; } } public class QueryActivitiesResponse @@ -6419,6 +6875,28 @@ public class QueryFeedsResponse public string? Prev { get; set; } } + public class QueryFeedsUsageStatsRequest + { + [JsonPropertyName("from")] + public string? From { get; set; } + [JsonPropertyName("to")] + public string? To { get; set; } + } + + public class QueryFeedsUsageStatsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("api_requests")] + public DailyMetricStatsResponse APIRequests { get; set; } + [JsonPropertyName("activities")] + public DailyMetricStatsResponse Activities { get; set; } + [JsonPropertyName("follows")] + public DailyMetricStatsResponse Follows { get; set; } + [JsonPropertyName("openai_requests")] + public DailyMetricStatsResponse OpenaiRequests { get; set; } + } + public class QueryFollowsRequest { [JsonPropertyName("limit")] @@ -6669,6 +7147,8 @@ public class QueryReviewQueueResponse public string? Next { get; set; } [JsonPropertyName("prev")] public string? Prev { get; set; } + [JsonPropertyName("filter_config")] + public FilterConfigResponse? FilterConfig { get; set; } } public class QueryUsersPayload @@ -6751,20 +7231,38 @@ public class RankingConfig public class Reaction { + [JsonPropertyName("activity_id")] + public string ActivityID { get; set; } [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } - [JsonPropertyName("message_id")] - public string MessageID { get; set; } - [JsonPropertyName("score")] - public int Score { get; set; } - [JsonPropertyName("type")] - public string Type { get; set; } + [JsonPropertyName("kind")] + public string Kind { get; set; } [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } - [JsonPropertyName("custom")] - public object Custom { get; set; } [JsonPropertyName("user_id")] - public string? UserID { get; set; } + public string UserID { get; set; } + [JsonPropertyName("deleted_at")] + public DateTime? DeletedAt { get; set; } + [JsonPropertyName("id")] + public string? ID { get; set; } + [JsonPropertyName("parent")] + public string? Parent { get; set; } + [JsonPropertyName("score")] + public double? Score { get; set; } + [JsonPropertyName("target_feeds")] + public List TargetFeeds { get; set; } + [JsonPropertyName("children_counts")] + public object ChildrenCounts { get; set; } + [JsonPropertyName("data")] + public object Data { get; set; } + [JsonPropertyName("latest_children")] + public Dictionary> LatestChildren { get; set; } + [JsonPropertyName("moderation")] + public object Moderation { get; set; } + [JsonPropertyName("own_children")] + public Dictionary> OwnChildren { get; set; } + [JsonPropertyName("target_feeds_extra_data")] + public object TargetFeedsExtraData { get; set; } [JsonPropertyName("user")] public User? User { get; set; } } @@ -6839,6 +7337,14 @@ public class ReactivateUsersResponse public string TaskID { get; set; } } + public class ReadCollectionsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("collections")] + public List Collections { get; set; } + } + public class ReadReceipts { [JsonPropertyName("enabled")] @@ -6924,9 +7430,9 @@ public class ReminderResponseData [JsonPropertyName("channel")] public ChannelResponse? Channel { get; set; } [JsonPropertyName("message")] - public Message? Message { get; set; } + public MessageResponse? Message { get; set; } [JsonPropertyName("user")] - public User? User { get; set; } + public UserResponse? User { get; set; } } public class RepliesMeta @@ -6989,6 +7495,8 @@ public class ReviewQueueItemResponse public int FlagsCount { get; set; } [JsonPropertyName("id")] public string ID { get; set; } + [JsonPropertyName("latest_moderator_action")] + public string LatestModeratorAction { get; set; } [JsonPropertyName("recommended_action")] public string RecommendedAction { get; set; } [JsonPropertyName("reviewed_by")] @@ -7029,6 +7537,10 @@ public class ReviewQueueItemResponse public EnrichedActivity? FeedsV2Activity { get; set; } [JsonPropertyName("feeds_v2_reaction")] public Reaction? FeedsV2Reaction { get; set; } + [JsonPropertyName("feeds_v3_activity")] + public ActivityResponse? FeedsV3Activity { get; set; } + [JsonPropertyName("feeds_v3_comment")] + public CommentResponse? FeedsV3Comment { get; set; } [JsonPropertyName("message")] public MessageResponse? Message { get; set; } [JsonPropertyName("moderation_payload")] @@ -7107,6 +7619,8 @@ public class RuleBuilderCondition public string? Type { get; set; } [JsonPropertyName("content_count_rule_params")] public ContentCountRuleParameters? ContentCountRuleParams { get; set; } + [JsonPropertyName("content_flag_count_rule_params")] + public FlagCountRuleParameters? ContentFlagCountRuleParams { get; set; } [JsonPropertyName("image_content_params")] public ImageContentParameters? ImageContentParams { get; set; } [JsonPropertyName("image_rule_params")] @@ -7119,6 +7633,8 @@ public class RuleBuilderCondition public UserCreatedWithinParameters? UserCreatedWithinParams { get; set; } [JsonPropertyName("user_custom_property_params")] public UserCustomPropertyParameters? UserCustomPropertyParams { get; set; } + [JsonPropertyName("user_flag_count_rule_params")] + public FlagCountRuleParameters? UserFlagCountRuleParams { get; set; } [JsonPropertyName("user_rule_params")] public UserRuleParameters? UserRuleParams { get; set; } [JsonPropertyName("video_content_params")] @@ -7213,6 +7729,8 @@ public class SessionSettingsResponse public class ShadowBlockActionRequest { + [JsonPropertyName("reason")] + public string? Reason { get; set; } } public class SharedLocation @@ -7317,6 +7835,8 @@ public class SortParam public int? Direction { get; set; } [JsonPropertyName("field")] public string? Field { get; set; } + [JsonPropertyName("type")] + public string? Type { get; set; } } public class SortParamRequest @@ -7325,6 +7845,8 @@ public class SortParamRequest public int? Direction { get; set; } [JsonPropertyName("field")] public string? Field { get; set; } + [JsonPropertyName("type")] + public string? Type { get; set; } } public class SpeechSegmentConfig @@ -7357,6 +7879,8 @@ public class StoriesFeedUpdatedEvent public string? FeedVisibility { get; set; } [JsonPropertyName("received_at")] public DateTime? ReceivedAt { get; set; } + [JsonPropertyName("activities")] + public List Activities { get; set; } [JsonPropertyName("aggregated_activities")] public List AggregatedActivities { get; set; } [JsonPropertyName("user")] @@ -7373,10 +7897,14 @@ public class SubmitActionRequest public string? UserID { get; set; } [JsonPropertyName("ban")] public BanActionRequest? Ban { get; set; } + [JsonPropertyName("block")] + public BlockActionRequest? Block { get; set; } [JsonPropertyName("custom")] public CustomActionRequest? Custom { get; set; } [JsonPropertyName("delete_activity")] public DeleteActivityRequest? DeleteActivity { get; set; } + [JsonPropertyName("delete_comment")] + public DeleteCommentRequest? DeleteComment { get; set; } [JsonPropertyName("delete_message")] public DeleteMessageRequest? DeleteMessage { get; set; } [JsonPropertyName("delete_reaction")] @@ -7385,6 +7913,8 @@ public class SubmitActionRequest public DeleteUserRequest? DeleteUser { get; set; } [JsonPropertyName("mark_reviewed")] public MarkReviewedRequest? MarkReviewed { get; set; } + [JsonPropertyName("shadow_block")] + public ShadowBlockActionRequest? ShadowBlock { get; set; } [JsonPropertyName("unban")] public UnbanActionRequest? Unban { get; set; } [JsonPropertyName("user")] @@ -7693,6 +8223,10 @@ public class UpdateActivityRequest public DateTime? ExpiresAt { get; set; } [JsonPropertyName("poll_id")] public string? PollID { get; set; } + [JsonPropertyName("restrict_replies")] + public string? RestrictReplies { get; set; } + [JsonPropertyName("skip_enrich_url")] + public bool? SkipEnrichUrl { get; set; } [JsonPropertyName("text")] public string? Text { get; set; } [JsonPropertyName("user_id")] @@ -7701,6 +8235,8 @@ public class UpdateActivityRequest public string? Visibility { get; set; } [JsonPropertyName("attachments")] public List Attachments { get; set; } + [JsonPropertyName("collection_refs")] + public List CollectionRefs { get; set; } [JsonPropertyName("feeds")] public List Feeds { get; set; } [JsonPropertyName("filter_tags")] @@ -7885,14 +8421,48 @@ public class UpdateBookmarkResponse public BookmarkResponse Bookmark { get; set; } } + public class UpdateCollectionRequest + { + [JsonPropertyName("id")] + public string ID { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("custom")] + public object Custom { get; set; } + } + + public class UpdateCollectionsRequest + { + [JsonPropertyName("collections")] + public List Collections { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } + [JsonPropertyName("user")] + public UserRequest? User { get; set; } + } + + public class UpdateCollectionsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("collections")] + public List Collections { get; set; } + } + public class UpdateCommentRequest { [JsonPropertyName("comment")] public string? Comment { get; set; } + [JsonPropertyName("skip_enrich_url")] + public bool? SkipEnrichUrl { get; set; } [JsonPropertyName("skip_push")] public bool? SkipPush { get; set; } + [JsonPropertyName("user_id")] + public string? UserID { get; set; } [JsonPropertyName("custom")] public object Custom { get; set; } + [JsonPropertyName("user")] + public UserRequest? User { get; set; } } public class UpdateCommentResponse @@ -7935,6 +8505,8 @@ public class UpdateExternalStorageResponse public class UpdateFeedGroupRequest { + [JsonPropertyName("default_visibility")] + public string? DefaultVisibility { get; set; } [JsonPropertyName("activity_processors")] public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] @@ -8005,8 +8577,6 @@ public class UpdateFeedResponse public class UpdateFeedViewRequest { - [JsonPropertyName("activity_processors")] - public List ActivityProcessors { get; set; } [JsonPropertyName("activity_selectors")] public List ActivitySelectors { get; set; } [JsonPropertyName("aggregation")] @@ -8023,6 +8593,20 @@ public class UpdateFeedViewResponse public FeedViewResponse FeedView { get; set; } } + public class UpdateFeedVisibilityRequest + { + [JsonPropertyName("grants")] + public Dictionary> Grants { get; set; } + } + + public class UpdateFeedVisibilityResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("feed_visibility")] + public FeedVisibilityResponse FeedVisibility { get; set; } + } + public class UpdateFollowRequest { [JsonPropertyName("source")] @@ -8185,6 +8769,20 @@ public class UpsertActivitiesResponse public List Activities { get; set; } } + public class UpsertCollectionsRequest + { + [JsonPropertyName("collections")] + public List Collections { get; set; } + } + + public class UpsertCollectionsResponse + { + [JsonPropertyName("duration")] + public string Duration { get; set; } + [JsonPropertyName("collections")] + public List Collections { get; set; } + } + public class UpsertConfigRequest { [JsonPropertyName("key")] diff --git a/tests/FeedTests.cs b/tests/FeedTests.cs index bc8c173..120acec 100644 --- a/tests/FeedTests.cs +++ b/tests/FeedTests.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using System.Collections.Generic; using Moq; +using GetStream.Requests; using GetStream.Models; using System.Threading; using NUnit.Framework; @@ -383,7 +384,7 @@ public async Task DeletePollVoteAsync_ShouldCallCorrectEndpoint() public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() { // Arrange - var request = new AddReactionRequest(); + var request = new AddActivityReactionRequest(); var activityID = "test-activityID"; var expectedResponse = new StreamResponse @@ -391,11 +392,11 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() Data = new AddReactionResponse() }; - _mockClient.Setup(x => x.MakeRequestAsync( + _mockClient.Setup(x => x.MakeRequestAsync( It.IsAny(), It.IsAny(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny())) .ReturnsAsync(expectedResponse); @@ -407,11 +408,11 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() Assert.That(result, Is.Not.Null); Assert.That(result, Is.EqualTo(expectedResponse)); - _mockClient.Verify(x => x.MakeRequestAsync( + _mockClient.Verify(x => x.MakeRequestAsync( "POST", "/api/v2/feeds/activities/{activity_id}/reactions", It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny()), Times.Once); } @@ -775,6 +776,181 @@ public async Task QueryBookmarksAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task DeleteCollectionsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + object request = null!; + + var expectedResponse = new StreamResponse + { + Data = new DeleteCollectionsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.DeleteCollectionsAsync(null!); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "DELETE", + "/api/v2/feeds/collections", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] + public async Task ReadCollectionsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + object request = null!; + + var expectedResponse = new StreamResponse + { + Data = new ReadCollectionsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.ReadCollectionsAsync(null!); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "GET", + "/api/v2/feeds/collections", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] + public async Task UpdateCollectionsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new UpdateCollectionsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new UpdateCollectionsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.UpdateCollectionsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "PATCH", + "/api/v2/feeds/collections", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] + public async Task CreateCollectionsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new CreateCollectionsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new CreateCollectionsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.CreateCollectionsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/collections", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] + public async Task UpsertCollectionsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new UpsertCollectionsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new UpsertCollectionsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.UpsertCollectionsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "PUT", + "/api/v2/feeds/collections", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task GetCommentsAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2075,6 +2251,42 @@ public async Task GetFeedVisibilityAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task UpdateFeedVisibilityAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new UpdateFeedVisibilityRequest(); + var name = "test-name"; + + var expectedResponse = new StreamResponse + { + Data = new UpdateFeedVisibilityResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.UpdateFeedVisibilityAsync(name,request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "PUT", + "/api/v2/feeds/feed_visibilities/{name}", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task CreateFeedsBatchAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2110,6 +2322,76 @@ public async Task CreateFeedsBatchAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task DeleteFeedsBatchAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new DeleteFeedsBatchRequest(); + + var expectedResponse = new StreamResponse + { + Data = new DeleteFeedsBatchResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.DeleteFeedsBatchAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/feeds/delete", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] + public async Task OwnBatchAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new OwnBatchRequest(); + + var expectedResponse = new StreamResponse + { + Data = new OwnBatchResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.OwnBatchAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/feeds/own/batch", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task QueryFeedsAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2145,6 +2427,41 @@ public async Task QueryFeedsAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task GetFeedsRateLimitsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + object request = null!; + + var expectedResponse = new StreamResponse + { + Data = new GetFeedsRateLimitsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.GetFeedsRateLimitsAsync(null!); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "GET", + "/api/v2/feeds/feeds/rate_limits", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task UpdateFollowAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2285,6 +2602,41 @@ public async Task FollowBatchAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new GetOrCreateFollowsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new FollowBatchResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.GetOrCreateFollowsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/follows/batch/upsert", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task QueryFollowsAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2534,6 +2886,41 @@ public async Task UpdateMembershipLevelAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task QueryFeedsUsageStatsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new QueryFeedsUsageStatsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new QueryFeedsUsageStatsResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.QueryFeedsUsageStatsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/stats/usage", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task UnfollowBatchAsync_ShouldCallCorrectEndpoint() { // Arrange @@ -2569,10 +2956,45 @@ public async Task UnfollowBatchAsync_ShouldCallCorrectEndpoint() It.IsAny()), Times.Once); } [Test] + public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() + { + // Arrange + var request = new GetOrCreateUnfollowsRequest(); + + var expectedResponse = new StreamResponse + { + Data = new UnfollowBatchResponse() + }; + + _mockClient.Setup(x => x.MakeRequestAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny())) + .ReturnsAsync(expectedResponse); + + // Act + var result = await _client.GetOrCreateUnfollowsAsync(request); + + // Assert + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.EqualTo(expectedResponse)); + + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", + "/api/v2/feeds/unfollow/batch/upsert", + It.IsAny>(), + It.IsAny(), + It.IsAny>(), + It.IsAny()), Times.Once); + } + [Test] public async Task DeleteFeedUserDataAsync_ShouldCallCorrectEndpoint() { // Arrange - object request = null!; + var request = new DeleteFeedUserDataRequest(); var userID = "test-userID"; var expectedResponse = new StreamResponse @@ -2580,27 +3002,27 @@ public async Task DeleteFeedUserDataAsync_ShouldCallCorrectEndpoint() Data = new DeleteFeedUserDataResponse() }; - _mockClient.Setup(x => x.MakeRequestAsync( + _mockClient.Setup(x => x.MakeRequestAsync( It.IsAny(), It.IsAny(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny())) .ReturnsAsync(expectedResponse); // Act - var result = await _client.DeleteFeedUserDataAsync(userID,null!); + var result = await _client.DeleteFeedUserDataAsync(userID,request); // Assert Assert.That(result, Is.Not.Null); Assert.That(result, Is.EqualTo(expectedResponse)); - _mockClient.Verify(x => x.MakeRequestAsync( - "DELETE", + _mockClient.Verify(x => x.MakeRequestAsync( + "POST", "/api/v2/feeds/users/{user_id}/delete", It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny()), Times.Once); } From eb1252edb442e7303690bd08da433c30434b2d6d Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 15:07:28 +0100 Subject: [PATCH 2/7] rem usused import --- tests/FeedTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/FeedTests.cs b/tests/FeedTests.cs index 120acec..d204e04 100644 --- a/tests/FeedTests.cs +++ b/tests/FeedTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using System.Collections.Generic; using Moq; -using GetStream.Requests; using GetStream.Models; using System.Threading; using NUnit.Framework; From 94df0ae89da72be7a8da52f07b979e2fa7859738 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 16:02:30 +0100 Subject: [PATCH 3/7] fix tests --- tests/FeedTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/FeedTests.cs b/tests/FeedTests.cs index d204e04..aaf9fd5 100644 --- a/tests/FeedTests.cs +++ b/tests/FeedTests.cs @@ -391,7 +391,7 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() Data = new AddReactionResponse() }; - _mockClient.Setup(x => x.MakeRequestAsync( + _mockClient.Setup(x => x.MakeRequestAsync( It.IsAny(), It.IsAny(), It.IsAny>(), @@ -407,7 +407,7 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() Assert.That(result, Is.Not.Null); Assert.That(result, Is.EqualTo(expectedResponse)); - _mockClient.Verify(x => x.MakeRequestAsync( + _mockClient.Verify(x => x.MakeRequestAsync( "POST", "/api/v2/feeds/activities/{activity_id}/reactions", It.IsAny>(), @@ -2611,7 +2611,7 @@ public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() Data = new FollowBatchResponse() }; - _mockClient.Setup(x => x.MakeRequestAsync( + _mockClient.Setup(x => x.MakeRequestAsync( It.IsAny(), It.IsAny(), It.IsAny>(), @@ -2627,7 +2627,7 @@ public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() Assert.That(result, Is.Not.Null); Assert.That(result, Is.EqualTo(expectedResponse)); - _mockClient.Verify(x => x.MakeRequestAsync( + _mockClient.Verify(x => x.MakeRequestAsync( "POST", "/api/v2/feeds/follows/batch/upsert", It.IsAny>(), @@ -2965,7 +2965,7 @@ public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() Data = new UnfollowBatchResponse() }; - _mockClient.Setup(x => x.MakeRequestAsync( + _mockClient.Setup(x => x.MakeRequestAsync( It.IsAny(), It.IsAny(), It.IsAny>(), @@ -2981,7 +2981,7 @@ public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() Assert.That(result, Is.Not.Null); Assert.That(result, Is.EqualTo(expectedResponse)); - _mockClient.Verify(x => x.MakeRequestAsync( + _mockClient.Verify(x => x.MakeRequestAsync( "POST", "/api/v2/feeds/unfollow/batch/upsert", It.IsAny>(), From 347f2d673e7da04a88e9fe69051e30747cdfdd00 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 16:07:31 +0100 Subject: [PATCH 4/7] fix tests --- tests/FeedTests.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/FeedTests.cs b/tests/FeedTests.cs index aaf9fd5..64b945a 100644 --- a/tests/FeedTests.cs +++ b/tests/FeedTests.cs @@ -383,7 +383,7 @@ public async Task DeletePollVoteAsync_ShouldCallCorrectEndpoint() public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() { // Arrange - var request = new AddActivityReactionRequest(); + var request = new AddReactionRequest(); var activityID = "test-activityID"; var expectedResponse = new StreamResponse @@ -395,7 +395,7 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() It.IsAny(), It.IsAny(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny())) .ReturnsAsync(expectedResponse); @@ -411,7 +411,7 @@ public async Task AddActivityReactionAsync_ShouldCallCorrectEndpoint() "POST", "/api/v2/feeds/activities/{activity_id}/reactions", It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny()), Times.Once); } @@ -2604,7 +2604,7 @@ public async Task FollowBatchAsync_ShouldCallCorrectEndpoint() public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() { // Arrange - var request = new GetOrCreateFollowsRequest(); + var request = new FollowBatchRequest(); var expectedResponse = new StreamResponse { @@ -2615,7 +2615,7 @@ public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() It.IsAny(), It.IsAny(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny())) .ReturnsAsync(expectedResponse); @@ -2631,7 +2631,7 @@ public async Task GetOrCreateFollowsAsync_ShouldCallCorrectEndpoint() "POST", "/api/v2/feeds/follows/batch/upsert", It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny()), Times.Once); } @@ -2958,7 +2958,7 @@ public async Task UnfollowBatchAsync_ShouldCallCorrectEndpoint() public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() { // Arrange - var request = new GetOrCreateUnfollowsRequest(); + var request = new UnfollowBatchRequest(); var expectedResponse = new StreamResponse { @@ -2969,7 +2969,7 @@ public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() It.IsAny(), It.IsAny(), It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny())) .ReturnsAsync(expectedResponse); @@ -2985,7 +2985,7 @@ public async Task GetOrCreateUnfollowsAsync_ShouldCallCorrectEndpoint() "POST", "/api/v2/feeds/unfollow/batch/upsert", It.IsAny>(), - It.IsAny(), + It.IsAny(), It.IsAny>(), It.IsAny()), Times.Once); } From c350c14240671298305c9761b0a2db0e302b5308 Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 16:21:08 +0100 Subject: [PATCH 5/7] add version header in requests --- .github/workflows/create-release-pr.yml | 8 +++++++- .github/workflows/release.yml | 8 +++++++- src/Client.cs | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 9dfade0..3d64f23 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -82,6 +82,12 @@ jobs: NEW_VERSION="${{ steps.new_version.outputs.new_version }}" sed -i "s/.*<\/Version>/$NEW_VERSION<\/Version>/" src/stream-feed-net.csproj echo "Updated version to $NEW_VERSION" + + - name: Update version in Client.cs + run: | + NEW_VERSION="${{ steps.new_version.outputs.new_version }}" + sed -i "s/private const string VersionName = \".*\";/private const string VersionName = \"$NEW_VERSION\";/" src/Client.cs + echo "Updated version constant in Client.cs to $NEW_VERSION" - name: Run tests env: @@ -98,7 +104,7 @@ jobs: VERSION_TYPE="${{ github.event.inputs.version_type }}" RELEASE_NOTES="${{ github.event.inputs.release_notes }}" - git add src/stream-feed-net.csproj + git add src/stream-feed-net.csproj src/Client.cs git commit -m "Bump version to $NEW_VERSION Version type: $VERSION_TYPE diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01a7473..d72f22f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -155,6 +155,12 @@ jobs: sed -i "s/.*<\/Version>/$NEW_VERSION<\/Version>/" src/stream-feed-net.csproj echo "Updated version to $NEW_VERSION" + - name: Update version in Client.cs + run: | + NEW_VERSION="${{ steps.new_version.outputs.new_version }}" + sed -i "s/private const string VersionName = \".*\";/private const string VersionName = \"$NEW_VERSION\";/" src/Client.cs + echo "Updated version constant in Client.cs to $NEW_VERSION" + - name: Create NuGet package run: | dotnet pack src/stream-feed-net.csproj --configuration Release --no-build --output ./packages @@ -194,7 +200,7 @@ jobs: NEW_VERSION="${{ steps.new_version.outputs.new_version }}" git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git add src/stream-feed-net.csproj + git add src/stream-feed-net.csproj src/Client.cs git commit -m "chore: bump version to $NEW_VERSION [skip ci]" || exit 0 git push diff --git a/src/Client.cs b/src/Client.cs index ed8589e..9933c41 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -7,6 +7,9 @@ namespace GetStream { public class BaseClient :IClient { + private const string VersionName = "2.1.0"; + private static readonly string VersionHeader = $"getstream-net-{VersionName}"; + private readonly HttpClient _httpClient; protected string ApiKey; protected string ApiSecret; @@ -51,6 +54,7 @@ public async Task> MakeRequestAsync> MakeRequestAsyncDebug Date: Wed, 10 Dec 2025 16:23:21 +0100 Subject: [PATCH 6/7] fix tests --- tests/FeedIntegrationTests.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/FeedIntegrationTests.cs b/tests/FeedIntegrationTests.cs index 9ebff0b..87e405c 100644 --- a/tests/FeedIntegrationTests.cs +++ b/tests/FeedIntegrationTests.cs @@ -1748,10 +1748,6 @@ public async Task Test34_FeedViewCRUD() { new() { Type = "popular" } }, - ActivityProcessors = new List - { - new() { Type = "proximity" } - }, Aggregation = new AggregationConfig { Format = "time_based" From 638898a9990b254d061452444bca0ab5966107ad Mon Sep 17 00:00:00 2001 From: Aditya Agarwal Date: Wed, 10 Dec 2025 16:27:16 +0100 Subject: [PATCH 7/7] fix tests --- tests/FeedIntegrationTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/FeedIntegrationTests.cs b/tests/FeedIntegrationTests.cs index 87e405c..0941a39 100644 --- a/tests/FeedIntegrationTests.cs +++ b/tests/FeedIntegrationTests.cs @@ -668,7 +668,8 @@ public async Task Test10_UpdateComment() commentId, new UpdateCommentRequest { - Comment = "Updated comment text from .NET SDK" + Comment = "Updated comment text from .NET SDK", + UserID = _testUserId } ); // snippet-end: UpdateComment