diff --git a/feeds-v3.go b/feeds-v3.go index 0634eda..8f9d3c2 100644 --- a/feeds-v3.go +++ b/feeds-v3.go @@ -779,7 +779,7 @@ func (c *FeedsClient) DeleteFeedUserData(ctx context.Context, userID string, req return res, err } -// Export all activities, reactions, comments, and bookmarks for a user +// Export all feed data for a user including: user profile, feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user func (c *FeedsClient) ExportFeedUserData(ctx context.Context, userID string, request *ExportFeedUserDataRequest) (*StreamResponse[ExportFeedUserDataResponse], error) { var result ExportFeedUserDataResponse pathParams := map[string]string{ diff --git a/feeds_integration_test.go b/feeds_integration_test.go index 520b6d8..116bb66 100644 --- a/feeds_integration_test.go +++ b/feeds_integration_test.go @@ -636,8 +636,8 @@ func test08AddComment(t *testing.T, ctx context.Context, feedsClient *getstream. // snippet-start: AddComment response, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{ Comment: getstream.PtrTo("This is a test comment from Go SDK"), - ObjectID: activityID, - ObjectType: "activity", + ObjectID: &activityID, + ObjectType: getstream.PtrTo("activity"), UserID: &testUserID, }) // snippet-end: AddComment @@ -673,8 +673,8 @@ func test09QueryComments(t *testing.T, ctx context.Context, feedsClient *getstre // Add a comment first commentResponse, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{ Comment: getstream.PtrTo("Comment for query test"), - ObjectID: activityID, - ObjectType: "activity", + ObjectID: &activityID, + ObjectType: getstream.PtrTo("activity"), UserID: &testUserID, }) assertResponseSuccess(t, commentResponse, err, "add comment for query test") @@ -712,8 +712,8 @@ func test10UpdateComment(t *testing.T, ctx context.Context, feedsClient *getstre // Add a comment to update commentResponse, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{ Comment: getstream.PtrTo("Comment to be updated"), - ObjectID: activityID, - ObjectType: "activity", + ObjectID: &activityID, + ObjectType: getstream.PtrTo("activity"), UserID: &testUserID, }) assertResponseSuccess(t, commentResponse, err, "add comment for update test") @@ -1075,8 +1075,8 @@ func test21DeleteComment(t *testing.T, ctx context.Context, feedsClient *getstre // Add a comment first commentResponse, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{ Comment: getstream.PtrTo("Comment to be deleted"), - ObjectID: activityID, - ObjectType: "activity", + ObjectID: &activityID, + ObjectType: getstream.PtrTo("activity"), UserID: &testUserID, }) assertResponseSuccess(t, commentResponse, err, "add comment for delete test") @@ -1591,8 +1591,8 @@ func test32RealWorldUsageDemo(t *testing.T, ctx context.Context, feedsClient *ge for _, commentText := range comments { commentResponse, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{ Comment: getstream.PtrTo(commentText), - ObjectID: postID, - ObjectType: "activity", + ObjectID: &postID, + ObjectType: getstream.PtrTo("activity"), UserID: &testUserID2, }) assertResponseSuccess(t, commentResponse, err, "add comment to post") diff --git a/models.go b/models.go index 54c4fe0..f436894 100644 --- a/models.go +++ b/models.go @@ -580,6 +580,9 @@ type ActivityRequest struct { // Controls who can add comments/replies to this activity. Options: 'everyone' (default - anyone can reply), 'people_i_follow' (only people the activity creator follows can reply), 'nobody' (no one can reply) RestrictReplies *string `json:"restrict_replies,omitempty"` + // Whether to skip URL enrichment for the activity + SkipEnrichUrl *bool `json:"skip_enrich_url,omitempty"` + // Text content of the activity Text *string `json:"text,omitempty"` @@ -3244,6 +3247,62 @@ type Channel struct { TruncatedBy *User `json:"truncated_by,omitempty"` } +type ChannelBatchUpdatedCompletedEvent struct { + BatchCreatedAt Timestamp `json:"batch_created_at"` + + CreatedAt Timestamp `json:"created_at"` + + FinishedAt Timestamp `json:"finished_at"` + + Operation string `json:"operation"` + + Status string `json:"status"` + + SuccessChannelsCount int `json:"success_channels_count"` + + TaskID string `json:"task_id"` + + FailedChannels []FailedChannelUpdates `json:"failed_channels"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} + +func (*ChannelBatchUpdatedCompletedEvent) GetEventType() string { + return "channel_batch_update.completed" +} + +type ChannelBatchUpdatedStartedEvent struct { + BatchCreatedAt Timestamp `json:"batch_created_at"` + + CreatedAt Timestamp `json:"created_at"` + + FinishedAt Timestamp `json:"finished_at"` + + Operation string `json:"operation"` + + Status string `json:"status"` + + SuccessChannelsCount int `json:"success_channels_count"` + + TaskID string `json:"task_id"` + + FailedChannels []FailedChannelUpdates `json:"failed_channels"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} + +func (*ChannelBatchUpdatedStartedEvent) GetEventType() string { + return "channel_batch_update.started" +} + type ChannelConfig struct { Automod string `json:"automod"` @@ -5581,6 +5640,12 @@ type FCM struct { Data map[string]any `json:"data,omitempty"` } +type FailedChannelUpdates struct { + Reason string `json:"reason"` + + Cids []string `json:"cids"` +} + // Emitted when a feed is created. type FeedCreatedEvent struct { // Date/time of creation @@ -6293,6 +6358,10 @@ type Flag struct { User *User `json:"user,omitempty"` } +type FlagCountRuleParameters struct { + Threshold *int `json:"threshold,omitempty"` +} + type FlagDetails struct { OriginalText string `json:"original_text"` @@ -8129,7 +8198,7 @@ type MessageNewEvent struct { } func (*MessageNewEvent) GetEventType() string { - return "notification.thread_message_new" + return "message.new" } type MessageOptions struct { @@ -9047,6 +9116,8 @@ type NotificationTrigger struct { // The type of notification (mention, reaction, comment, follow, etc.) Type string `json:"type"` + + Comment *NotificationComment `json:"comment,omitempty"` } type OCRRule struct { @@ -11285,6 +11356,8 @@ type RuleBuilderCondition struct { ContentCountRuleParams *ContentCountRuleParameters `json:"content_count_rule_params,omitempty"` + ContentFlagCountRuleParams *FlagCountRuleParameters `json:"content_flag_count_rule_params,omitempty"` + ImageContentParams *ImageContentParameters `json:"image_content_params,omitempty"` ImageRuleParams *ImageRuleParameters `json:"image_rule_params,omitempty"` @@ -11297,6 +11370,8 @@ type RuleBuilderCondition struct { UserCustomPropertyParams *UserCustomPropertyParameters `json:"user_custom_property_params,omitempty"` + UserFlagCountRuleParams *FlagCountRuleParameters `json:"user_flag_count_rule_params,omitempty"` + UserRuleParams *UserRuleParameters `json:"user_rule_params,omitempty"` VideoContentParams *VideoContentParameters `json:"video_content_params,omitempty"` diff --git a/requests.go b/requests.go index 74438a4..04b72eb 100644 --- a/requests.go +++ b/requests.go @@ -704,6 +704,7 @@ type AddActivityRequest struct { ParentID *string `json:"parent_id"` PollID *string `json:"poll_id"` RestrictReplies *string `json:"restrict_replies"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` Text *string `json:"text"` UserID *string `json:"user_id"` Visibility *string `json:"visibility"` @@ -810,6 +811,7 @@ type UpdateActivityRequest struct { ExpiresAt *Timestamp `json:"expires_at"` PollID *string `json:"poll_id"` RestrictReplies *string `json:"restrict_replies"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` Text *string `json:"text"` UserID *string `json:"user_id"` Visibility *string `json:"visibility"` @@ -886,12 +888,13 @@ type GetCommentsRequest struct { } type AddCommentRequest struct { - ObjectID string `json:"object_id"` - ObjectType string `json:"object_type"` Comment *string `json:"comment"` CreateNotificationActivity *bool `json:"create_notification_activity"` ID *string `json:"id"` + ObjectID *string `json:"object_id"` + ObjectType *string `json:"object_type"` ParentID *string `json:"parent_id"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` SkipPush *bool `json:"skip_push"` UserID *string `json:"user_id"` Attachments []Attachment `json:"attachments"` @@ -920,11 +923,12 @@ type GetCommentRequest struct { } type UpdateCommentRequest struct { - Comment *string `json:"comment"` - SkipPush *bool `json:"skip_push"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + Comment *string `json:"comment"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type AddCommentReactionRequest struct {