diff --git a/call.go b/call.go index 66c7bb0..f908d55 100644 --- a/call.go +++ b/call.go @@ -163,6 +163,24 @@ func (c *Call) ListRecordings(ctx context.Context, request *ListRecordingsReques return response, nil } +func (c *Call) StartRecording(ctx context.Context, recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { + response, err := c.client.StartRecording(ctx, c.callType, c.callID, recordingType, request) + if err != nil { + return nil, err + } + c.syncFromResponse(response.Data) + return response, nil +} + +func (c *Call) StopRecording(ctx context.Context, recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { + response, err := c.client.StopRecording(ctx, c.callType, c.callID, recordingType, request) + if err != nil { + return nil, err + } + c.syncFromResponse(response.Data) + return response, nil +} + func (c *Call) GetCallReport(ctx context.Context, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse], error) { response, err := c.client.GetCallReport(ctx, c.callType, c.callID, request) if err != nil { @@ -208,8 +226,8 @@ func (c *Call) StopRTMPBroadcast(ctx context.Context, name string, request *Stop return response, nil } -func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { - response, err := c.client.StartHLSBroadcasting(ctx, c.callType, c.callID, request) +func (c *Call) QueryCallParticipantSessions(ctx context.Context, session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse], error) { + response, err := c.client.QueryCallParticipantSessions(ctx, c.callType, c.callID, session, request) if err != nil { return nil, err } @@ -217,8 +235,8 @@ func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadc return response, nil } -func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse], error) { - response, err := c.client.StartClosedCaptions(ctx, c.callType, c.callID, request) +func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { + response, err := c.client.StartHLSBroadcasting(ctx, c.callType, c.callID, request) if err != nil { return nil, err } @@ -226,8 +244,8 @@ func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCapt return response, nil } -func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse], error) { - response, err := c.client.StartFrameRecording(ctx, c.callType, c.callID, request) +func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse], error) { + response, err := c.client.StartClosedCaptions(ctx, c.callType, c.callID, request) if err != nil { return nil, err } @@ -235,8 +253,8 @@ func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecor return response, nil } -func (c *Call) StartRecording(ctx context.Context, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { - response, err := c.client.StartRecording(ctx, c.callType, c.callID, request) +func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse], error) { + response, err := c.client.StartFrameRecording(ctx, c.callType, c.callID, request) if err != nil { return nil, err } @@ -289,15 +307,6 @@ func (c *Call) StopLive(ctx context.Context, request *StopLiveRequest) (*StreamR return response, nil } -func (c *Call) StopRecording(ctx context.Context, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { - response, err := c.client.StopRecording(ctx, c.callType, c.callID, request) - if err != nil { - return nil, err - } - c.syncFromResponse(response.Data) - return response, nil -} - func (c *Call) StopTranscription(ctx context.Context, request *StopTranscriptionRequest) (*StreamResponse[StopTranscriptionResponse], error) { response, err := c.client.StopTranscription(ctx, c.callType, c.callID, request) if err != nil { diff --git a/chat.go b/chat.go index ba1626b..67c8b4e 100644 --- a/chat.go +++ b/chat.go @@ -793,6 +793,14 @@ func (c *ChatClient) QueryBannedUsers(ctx context.Context, request *QueryBannedU return res, err } +// Find and filter future channel bans created by the authenticated user +func (c *ChatClient) QueryFutureChannelBans(ctx context.Context, request *QueryFutureChannelBansRequest) (*StreamResponse[QueryFutureChannelBansResponse], error) { + var result QueryFutureChannelBansResponse + params := extractQueryParams(request) + res, err := MakeRequest[any, QueryFutureChannelBansResponse](c.client, ctx, "GET", "/api/v2/chat/query_future_channel_bans", params, nil, &result, nil) + return res, err +} + // Queries reminders func (c *ChatClient) QueryReminders(ctx context.Context, request *QueryRemindersRequest) (*StreamResponse[QueryRemindersResponse], error) { var result QueryRemindersResponse diff --git a/chat_test.go b/chat_test.go index d7d419f..5c76570 100644 --- a/chat_test.go +++ b/chat_test.go @@ -466,6 +466,13 @@ func TestChatQueryBannedUsers(t *testing.T) { _, err = client.Chat().QueryBannedUsers(context.Background(), &getstream.QueryBannedUsersRequest{}) require.NoError(t, err) } +func TestChatQueryFutureChannelBans(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryFutureChannelBans(context.Background(), &getstream.QueryFutureChannelBansRequest{}) + require.NoError(t, err) +} func TestChatQueryReminders(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) diff --git a/common.go b/common.go index 655c741..4201499 100644 --- a/common.go +++ b/common.go @@ -186,6 +186,41 @@ func (c *Client) CreateImport(ctx context.Context, request *CreateImportRequest) return res, err } +// Lists all import v2 tasks for the app +func (c *Client) ListImportV2Tasks(ctx context.Context, request *ListImportV2TasksRequest) (*StreamResponse[ListImportV2TasksResponse], error) { + var result ListImportV2TasksResponse + params := extractQueryParams(request) + res, err := MakeRequest[any, ListImportV2TasksResponse](c, ctx, "GET", "/api/v2/imports/v2", params, nil, &result, nil) + return res, err +} + +// Creates a new import v2 task +func (c *Client) CreateImportV2Task(ctx context.Context, request *CreateImportV2TaskRequest) (*StreamResponse[CreateImportV2TaskResponse], error) { + var result CreateImportV2TaskResponse + res, err := MakeRequest[CreateImportV2TaskRequest, CreateImportV2TaskResponse](c, ctx, "POST", "/api/v2/imports/v2", nil, request, &result, nil) + return res, err +} + +// Deletes an import v2 task. Can only delete tasks in queued state. +func (c *Client) DeleteImportV2Task(ctx context.Context, id string, request *DeleteImportV2TaskRequest) (*StreamResponse[DeleteImportV2TaskResponse], error) { + var result DeleteImportV2TaskResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[any, DeleteImportV2TaskResponse](c, ctx, "DELETE", "/api/v2/imports/v2/{id}", nil, nil, &result, pathParams) + return res, err +} + +// Gets a single import v2 task by ID +func (c *Client) GetImportV2Task(ctx context.Context, id string, request *GetImportV2TaskRequest) (*StreamResponse[GetImportV2TaskResponse], error) { + var result GetImportV2TaskResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[any, GetImportV2TaskResponse](c, ctx, "GET", "/api/v2/imports/v2/{id}", nil, nil, &result, pathParams) + return res, err +} + // Gets an import func (c *Client) GetImport(ctx context.Context, id string, request *GetImportRequest) (*StreamResponse[GetImportResponse], error) { var result GetImportResponse diff --git a/common_test.go b/common_test.go index 5984509..cc32059 100644 --- a/common_test.go +++ b/common_test.go @@ -170,6 +170,34 @@ func TestCommonCreateImport(t *testing.T) { _, err = client.CreateImport(context.Background(), &getstream.CreateImportRequest{}) require.NoError(t, err) } +func TestCommonListImportV2Tasks(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListImportV2Tasks(context.Background(), &getstream.ListImportV2TasksRequest{}) + require.NoError(t, err) +} +func TestCommonCreateImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateImportV2Task(context.Background(), &getstream.CreateImportV2TaskRequest{}) + require.NoError(t, err) +} +func TestCommonDeleteImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteImportV2Task(context.Background(), "", &getstream.DeleteImportV2TaskRequest{}) + require.NoError(t, err) +} +func TestCommonGetImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetImportV2Task(context.Background(), "", &getstream.GetImportV2TaskRequest{}) + require.NoError(t, err) +} func TestCommonGetImport(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) diff --git a/feeds-v3.go b/feeds-v3.go index d0be51f..26e039c 100644 --- a/feeds-v3.go +++ b/feeds-v3.go @@ -643,10 +643,17 @@ func (c *FeedsClient) CreateFeedsBatch(ctx context.Context, request *CreateFeeds return res, err } -// Retrieves capabilities for multiple feeds in a single request. Useful for batch processing when activities are added to feeds. -func (c *FeedsClient) OwnCapabilitiesBatch(ctx context.Context, request *OwnCapabilitiesBatchRequest) (*StreamResponse[OwnCapabilitiesBatchResponse], error) { - var result OwnCapabilitiesBatchResponse - res, err := MakeRequest[OwnCapabilitiesBatchRequest, OwnCapabilitiesBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/own_capabilities/batch", nil, request, &result, nil) +// Delete multiple feeds by their IDs. All feeds must exist. This endpoint is server-side only. +func (c *FeedsClient) DeleteFeedsBatch(ctx context.Context, request *DeleteFeedsBatchRequest) (*StreamResponse[DeleteFeedsBatchResponse], error) { + var result DeleteFeedsBatchResponse + res, err := MakeRequest[DeleteFeedsBatchRequest, DeleteFeedsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/delete", nil, request, &result, nil) + return res, err +} + +// Retrieves own_follows, own_capabilities, and/or own_membership for multiple feeds in a single request. If fields are not specified, all three fields are returned. +func (c *FeedsClient) OwnBatch(ctx context.Context, request *OwnBatchRequest) (*StreamResponse[OwnBatchResponse], error) { + var result OwnBatchResponse + res, err := MakeRequest[OwnBatchRequest, OwnBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/own/batch", nil, request, &result, nil) return res, err } @@ -722,7 +729,8 @@ func (c *FeedsClient) Unfollow(ctx context.Context, source string, target string "source": source, "target": target, } - res, err := MakeRequest[any, UnfollowResponse](c.client, ctx, "DELETE", "/api/v2/feeds/follows/{source}/{target}", nil, nil, &result, pathParams) + params := extractQueryParams(request) + res, err := MakeRequest[any, UnfollowResponse](c.client, ctx, "DELETE", "/api/v2/feeds/follows/{source}/{target}", params, nil, &result, pathParams) return res, err } @@ -783,13 +791,13 @@ func (c *FeedsClient) GetOrCreateUnfollows(ctx context.Context, request *GetOrCr return res, err } -// Delete all activities, reactions, comments, and bookmarks for a user +// Delete all feed data for a user including: feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user func (c *FeedsClient) DeleteFeedUserData(ctx context.Context, userID string, request *DeleteFeedUserDataRequest) (*StreamResponse[DeleteFeedUserDataResponse], error) { var result DeleteFeedUserDataResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[any, DeleteFeedUserDataResponse](c.client, ctx, "DELETE", "/api/v2/feeds/users/{user_id}/delete", nil, nil, &result, pathParams) + res, err := MakeRequest[DeleteFeedUserDataRequest, DeleteFeedUserDataResponse](c.client, ctx, "POST", "/api/v2/feeds/users/{user_id}/delete", nil, request, &result, pathParams) return res, err } diff --git a/feeds.go b/feeds.go index aa4eb59..141f238 100644 --- a/feeds.go +++ b/feeds.go @@ -17,6 +17,7 @@ func NewFeed(feedType string, feedID string, client *FeedsClient) *Feeds { } } +// 1 func (c *Feeds) Delete(ctx context.Context, request *DeleteFeedRequest) (*StreamResponse[DeleteFeedResponse], error) { return c.client.DeleteFeed(ctx, c.feedType, c.feedID, request) } diff --git a/feeds_test.go b/feeds_test.go index e54f986..60434dc 100644 --- a/feeds_test.go +++ b/feeds_test.go @@ -457,11 +457,18 @@ func TestFeedsCreateFeedsBatch(t *testing.T) { _, err = client.Feeds().CreateFeedsBatch(context.Background(), &getstream.CreateFeedsBatchRequest{}) require.NoError(t, err) } -func TestFeedsOwnCapabilitiesBatch(t *testing.T) { +func TestFeedsDeleteFeedsBatch(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.Feeds().OwnCapabilitiesBatch(context.Background(), &getstream.OwnCapabilitiesBatchRequest{}) + _, err = client.Feeds().DeleteFeedsBatch(context.Background(), &getstream.DeleteFeedsBatchRequest{}) + require.NoError(t, err) +} +func TestFeedsOwnBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().OwnBatch(context.Background(), &getstream.OwnBatchRequest{}) require.NoError(t, err) } func TestFeedsQueryFeeds(t *testing.T) { diff --git a/models.go b/models.go index e303156..47c49cd 100644 --- a/models.go +++ b/models.go @@ -562,9 +562,12 @@ type ActivityRequest struct { // Type of activity Type string `json:"type"` - // List of feed IDs to add the activity to + // List of feeds to add the activity to with a default max limit of 25 feeds Feeds []string `json:"feeds"` + // Whether to create notification activities for mentioned users + CreateNotificationActivity *bool `json:"create_notification_activity,omitempty"` + // Expiration time for the activity ExpiresAt *string `json:"expires_at,omitempty"` @@ -583,6 +586,9 @@ type ActivityRequest struct { // Whether to skip URL enrichment for the activity SkipEnrichUrl *bool `json:"skip_enrich_url,omitempty"` + // Whether to skip push notifications + SkipPush *bool `json:"skip_push,omitempty"` + // Text content of the activity Text *string `json:"text,omitempty"` @@ -665,7 +671,7 @@ type ActivityResponse struct { // Media attachments for the activity Attachments []Attachment `json:"attachments"` - // Comments on this activity + // Latest 5 comments of this activity (comment replies excluded) Comments []CommentResponse `json:"comments"` // List of feed IDs containing this activity @@ -716,6 +722,9 @@ type ActivityResponse struct { ModerationAction *string `json:"moderation_action,omitempty"` + // Which activity selector provided this activity (e.g., 'following', 'popular', 'interest'). Only set when using multiple activity selectors with ranking. + SelectorSource *string `json:"selector_source,omitempty"` + // Text content of the activity Text *string `json:"text,omitempty"` @@ -753,6 +762,8 @@ type ActivitySelectorConfig struct { // Filter for activity selection Filter map[string]any `json:"filter,omitempty"` + + Params map[string]any `json:"params,omitempty"` } type ActivitySelectorConfigResponse struct { @@ -773,6 +784,9 @@ type ActivitySelectorConfigResponse struct { // Filter for activity selection Filter map[string]any `json:"filter,omitempty"` + + // Generic params for selector-specific configuration + Params map[string]any `json:"params,omitempty"` } // Emitted when an activity is unpinned. @@ -830,6 +844,9 @@ type AddActivityResponse struct { Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` + + // Number of mention notification activities created for mentioned users + MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` } type AddBookmarkResponse struct { @@ -845,12 +862,21 @@ type AddCommentReactionResponse struct { Comment CommentResponse `json:"comment"` Reaction FeedsReactionResponse `json:"reaction"` + + // Whether a notification activity was successfully created + NotificationCreated *bool `json:"notification_created,omitempty"` } type AddCommentResponse struct { Duration string `json:"duration"` Comment CommentResponse `json:"comment"` + + // Number of mention notification activities created for mentioned users + MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` + + // Whether a notification activity was successfully created + NotificationCreated *bool `json:"notification_created,omitempty"` } type AddCommentsBatchResponse struct { @@ -894,6 +920,9 @@ type AddReactionResponse struct { Activity ActivityResponse `json:"activity"` Reaction FeedsReactionResponse `json:"reaction"` + + // Whether a notification activity was successfully created + NotificationCreated *bool `json:"notification_created,omitempty"` } type AggregatedActivityResponse struct { @@ -1045,6 +1074,96 @@ type AppResponseFields struct { ModerationDashboardPreferences *ModerationDashboardPreferences `json:"moderation_dashboard_preferences,omitempty"` } +// This event is sent when an appeal is accepted +type AppealAcceptedEvent struct { + CreatedAt Timestamp `json:"created_at"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + Appeal *AppealItemResponse `json:"appeal,omitempty"` +} + +func (*AppealAcceptedEvent) GetEventType() string { + return "appeal.accepted" +} + +// This event is sent when an appeal is created +type AppealCreatedEvent struct { + CreatedAt Timestamp `json:"created_at"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + Appeal *AppealItemResponse `json:"appeal,omitempty"` +} + +func (*AppealCreatedEvent) GetEventType() string { + return "appeal.created" +} + +type AppealItemResponse struct { + // Reason Text of the Appeal Item + AppealReason string `json:"appeal_reason"` + + // When the flag was created + CreatedAt Timestamp `json:"created_at"` + + // ID of the entity + EntityID string `json:"entity_id"` + + // Type of entity + EntityType string `json:"entity_type"` + + ID string `json:"id"` + + // Status of the Appeal Item + Status string `json:"status"` + + // When the flag was last updated + UpdatedAt Timestamp `json:"updated_at"` + + // Decision Reason of the Appeal Item + DecisionReason *string `json:"decision_reason,omitempty"` + + // Attachments(e.g. Images) of the Appeal Item + Attachments []string `json:"attachments,omitempty"` + + EntityContent *ModerationPayload `json:"entity_content,omitempty"` + + User *UserResponse `json:"user,omitempty"` +} + +// This event is sent when an appeal is rejected +type AppealRejectedEvent struct { + CreatedAt Timestamp `json:"created_at"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + Appeal *AppealItemResponse `json:"appeal,omitempty"` +} + +func (*AppealRejectedEvent) GetEventType() string { + return "appeal.rejected" +} + +type AppealResponse struct { + // Unique identifier of the created Appeal item + AppealID string `json:"appeal_id"` + + Duration string `json:"duration"` +} + type AsyncBulkImageModerationEvent struct { CreatedAt Timestamp `json:"created_at"` @@ -2263,6 +2382,9 @@ type CallRecordingFailedEvent struct { EgressID string `json:"egress_id"` + // The type of recording + RecordingType string `json:"recording_type"` + // The type of event: "call.recording_failed" in this case Type string `json:"type"` } @@ -2279,6 +2401,9 @@ type CallRecordingReadyEvent struct { EgressID string `json:"egress_id"` + // The type of recording + RecordingType string `json:"recording_type"` + CallRecording CallRecording `json:"call_recording"` // The type of event: "call.recording_ready" in this case @@ -2297,6 +2422,9 @@ type CallRecordingStartedEvent struct { EgressID string `json:"egress_id"` + // The type of recording + RecordingType string `json:"recording_type"` + // The type of event: "call.recording_started" in this case Type string `json:"type"` } @@ -2313,6 +2441,9 @@ type CallRecordingStoppedEvent struct { EgressID string `json:"egress_id"` + // The type of recording + RecordingType string `json:"recording_type"` + // The type of event: "call.recording_stopped" in this case Type string `json:"type"` } @@ -2420,6 +2551,9 @@ type CallResponse struct { JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` + // 10-digit routing number for SIP routing + RoutingNumber *string `json:"routing_number,omitempty"` + // Date/time when the call will start StartsAt *Timestamp `json:"starts_at,omitempty"` @@ -2653,10 +2787,14 @@ type CallSettings struct { Geofencing *GeofenceSettings `json:"geofencing,omitempty"` + IndividualRecording *IndividualRecordSettings `json:"individual_recording,omitempty"` + Ingress *IngressSettings `json:"ingress,omitempty"` Limits *LimitsSettings `json:"limits,omitempty"` + RawRecording *RawRecordSettings `json:"raw_recording,omitempty"` + Recording *RecordSettings `json:"recording,omitempty"` Ring *RingSettings `json:"ring,omitempty"` @@ -2683,10 +2821,14 @@ type CallSettingsRequest struct { Geofencing *GeofenceSettingsRequest `json:"geofencing,omitempty"` + IndividualRecording *IndividualRecordingSettingsRequest `json:"individual_recording,omitempty"` + Ingress *IngressSettingsRequest `json:"ingress,omitempty"` Limits *LimitsSettingsRequest `json:"limits,omitempty"` + RawRecording *RawRecordingSettingsRequest `json:"raw_recording,omitempty"` + Recording *RecordSettingsRequest `json:"recording,omitempty"` Ring *RingSettingsRequest `json:"ring,omitempty"` @@ -2713,8 +2855,12 @@ type CallSettingsResponse struct { Geofencing GeofenceSettingsResponse `json:"geofencing"` + IndividualRecording IndividualRecordingSettingsResponse `json:"individual_recording"` + Limits LimitsSettingsResponse `json:"limits"` + RawRecording RawRecordingSettingsResponse `json:"raw_recording"` + Recording RecordSettingsResponse `json:"recording"` Ring RingSettingsResponse `json:"ring"` @@ -2834,6 +2980,8 @@ type CallStatsParticipantCounts struct { Publishers int `json:"publishers"` Sessions int `json:"sessions"` + + TotalParticipantDuration *int `json:"total_participant_duration,omitempty"` } type CallStatsParticipantSession struct { @@ -3297,7 +3445,7 @@ type Channel struct { TruncatedBy *User `json:"truncated_by,omitempty"` } -type ChannelBatchUpdatedCompletedEvent struct { +type ChannelBatchCompletedEvent struct { BatchCreatedAt Timestamp `json:"batch_created_at"` CreatedAt Timestamp `json:"created_at"` @@ -3321,11 +3469,11 @@ type ChannelBatchUpdatedCompletedEvent struct { ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*ChannelBatchUpdatedCompletedEvent) GetEventType() string { +func (*ChannelBatchCompletedEvent) GetEventType() string { return "channel_batch_update.completed" } -type ChannelBatchUpdatedStartedEvent struct { +type ChannelBatchStartedEvent struct { BatchCreatedAt Timestamp `json:"batch_created_at"` CreatedAt Timestamp `json:"created_at"` @@ -3349,7 +3497,7 @@ type ChannelBatchUpdatedStartedEvent struct { ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*ChannelBatchUpdatedStartedEvent) GetEventType() string { +func (*ChannelBatchStartedEvent) GetEventType() string { return "channel_batch_update.started" } @@ -4544,6 +4692,9 @@ type CommentResponse struct { // When the comment was deleted DeletedAt *Timestamp `json:"deleted_at,omitempty"` + // When the comment was last edited + EditedAt *Timestamp `json:"edited_at,omitempty"` + // ID of parent comment for nested replies ParentID *string `json:"parent_id,omitempty"` @@ -4589,6 +4740,10 @@ func (*CommentUpdatedEvent) GetEventType() string { return "feeds.comment.updated" } +type CompositeRecordingResponse struct { + Status string `json:"status"` +} + type ConfigOverrides struct { Blocklist *string `json:"blocklist,omitempty"` @@ -4850,6 +5005,26 @@ type CreateImportURLResponse struct { UploadUrl string `json:"upload_url"` } +// Basic response information +type CreateImportV2TaskResponse struct { + AppPk int `json:"app_pk"` + + CreatedAt Timestamp `json:"created_at"` + + // Duration of the request in milliseconds + Duration string `json:"duration"` + + ID string `json:"id"` + + Product string `json:"product"` + + State int `json:"state"` + + UpdatedAt Timestamp `json:"updated_at"` + + Settings ImportV2TaskSettings `json:"settings"` +} + type CreateMembershipLevelResponse struct { Duration string `json:"duration"` @@ -5131,22 +5306,26 @@ type DeleteFeedResponse struct { // Response for deleting feed user data type DeleteFeedUserDataResponse struct { - // Number of activities that were deleted - DeletedActivities int `json:"deleted_activities"` - - // Number of bookmarks that were deleted - DeletedBookmarks int `json:"deleted_bookmarks"` + Duration string `json:"duration"` - // Number of comments that were deleted - DeletedComments int `json:"deleted_comments"` + // The task ID for the deletion task + TaskID string `json:"task_id"` +} - // Number of reactions that were deleted - DeletedReactions int `json:"deleted_reactions"` +type DeleteFeedViewResponse struct { + Duration string `json:"duration"` +} +type DeleteFeedsBatchResponse struct { Duration string `json:"duration"` + + // The ID of the async task that will handle feed cleanup and hard deletion + TaskID string `json:"task_id"` } -type DeleteFeedViewResponse struct { +// Basic response information +type DeleteImportV2TaskResponse struct { + // Duration of the request in milliseconds Duration string `json:"duration"` } @@ -5414,9 +5593,15 @@ type EgressResponse struct { Rtmps []EgressRTMPResponse `json:"rtmps"` + CompositeRecording *CompositeRecordingResponse `json:"composite_recording,omitempty"` + FrameRecording *FrameRecordingResponse `json:"frame_recording,omitempty"` HLS *EgressHLSResponse `json:"hls,omitempty"` + + IndividualRecording *IndividualRecordingResponse `json:"individual_recording,omitempty"` + + RawRecording *RawRecordingResponse `json:"raw_recording,omitempty"` } // Response for ending a call @@ -5502,39 +5687,60 @@ type EnrichedReaction struct { User *Data `json:"user,omitempty"` } +// Options to skip specific enrichments to improve performance. Default is false (enrichments are included). Setting a field to true skips that enrichment. type EnrichmentOptions struct { + // Default: false. When true, includes fetching and enriching own_followings (follows where activity author's feeds follow current user's feeds). + EnrichOwnFollowings *bool `json:"enrich_own_followings,omitempty"` + + // Default: false. When true, skips all activity enrichments. SkipActivity *bool `json:"skip_activity,omitempty"` + // Default: false. When true, skips enriching collections on activities. SkipActivityCollections *bool `json:"skip_activity_collections,omitempty"` + // Default: false. When true, skips enriching comments on activities. SkipActivityComments *bool `json:"skip_activity_comments,omitempty"` + // Default: false. When true, skips enriching current_feed on activities. Note: CurrentFeed is still computed for permission checks, but enrichment is skipped. SkipActivityCurrentFeed *bool `json:"skip_activity_current_feed,omitempty"` + // Default: false. When true, skips enriching mentioned users on activities. SkipActivityMentionedUsers *bool `json:"skip_activity_mentioned_users,omitempty"` + // Default: false. When true, skips enriching own bookmarks on activities. SkipActivityOwnBookmarks *bool `json:"skip_activity_own_bookmarks,omitempty"` + // Default: false. When true, skips enriching parent activities. SkipActivityParents *bool `json:"skip_activity_parents,omitempty"` + // Default: false. When true, skips enriching poll data on activities. SkipActivityPoll *bool `json:"skip_activity_poll,omitempty"` + // Default: false. When true, skips fetching and enriching latest and own reactions on activities. Note: If reactions are already denormalized in the database, they will still be included. SkipActivityReactions *bool `json:"skip_activity_reactions,omitempty"` + // Default: false. When true, skips refreshing image URLs on activities. SkipActivityRefreshImageUrls *bool `json:"skip_activity_refresh_image_urls,omitempty"` + // Default: false. When true, skips all enrichments. SkipAll *bool `json:"skip_all,omitempty"` + // Default: false. When true, skips enriching user data on feed members. SkipFeedMemberUser *bool `json:"skip_feed_member_user,omitempty"` + // Default: false. When true, skips fetching and enriching followers. Note: If followers_pagination is explicitly provided, followers will be fetched regardless of this setting. SkipFollowers *bool `json:"skip_followers,omitempty"` + // Default: false. When true, skips fetching and enriching following. Note: If following_pagination is explicitly provided, following will be fetched regardless of this setting. SkipFollowing *bool `json:"skip_following,omitempty"` + // Default: false. When true, skips computing and including capabilities for feeds. SkipOwnCapabilities *bool `json:"skip_own_capabilities,omitempty"` + // Default: false. When true, skips fetching and enriching own_follows (follows where user's feeds follow target feeds). SkipOwnFollows *bool `json:"skip_own_follows,omitempty"` + // Default: false. When true, skips enriching pinned activities. SkipPins *bool `json:"skip_pins,omitempty"` } @@ -5620,6 +5826,8 @@ type EventHook struct { SnsAuthType *string `json:"sns_auth_type,omitempty"` + SnsEventBasedMessageGroupIDEnabled *bool `json:"sns_event_based_message_group_id_enabled,omitempty"` + SnsKey *string `json:"sns_key,omitempty"` SnsRegion *string `json:"sns_region,omitempty"` @@ -6077,6 +6285,19 @@ func (c FeedOwnCapability) String() string { return string(c) } +type FeedOwnData struct { + // Capabilities the current user has for this feed + OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` + + // Follow relationships where the feed owner's feeds are following the current user's feeds (up to 5 total) + OwnFollowings []FollowResponse `json:"own_followings,omitempty"` + + // Follow relationships where the current user's feeds are following this feed + OwnFollows []FollowResponse `json:"own_follows,omitempty"` + + OwnMembership *FeedMemberResponse `json:"own_membership,omitempty"` +} + type FeedRequest struct { // ID of the feed group FeedGroupID string `json:"feed_group_id"` @@ -6107,6 +6328,8 @@ type FeedRequest struct { } type FeedResponse struct { + ActivityCount int `json:"activity_count"` + // When the feed was created CreatedAt Timestamp `json:"created_at"` @@ -6154,6 +6377,9 @@ type FeedResponse struct { // Capabilities the current user has for this feed OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` + // Follow relationships where the feed owner’s feeds are following the current user's feeds + OwnFollowings []FollowResponse `json:"own_followings,omitempty"` + // Follow relationships where the current user's feeds are following this feed OwnFollows []FollowResponse `json:"own_follows,omitempty"` @@ -6164,6 +6390,8 @@ type FeedResponse struct { } type FeedSuggestionResponse struct { + ActivityCount int `json:"activity_count"` + // When the feed was created CreatedAt Timestamp `json:"created_at"` @@ -6215,6 +6443,9 @@ type FeedSuggestionResponse struct { // Capabilities the current user has for this feed OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` + // Follow relationships where the feed owner’s feeds are following the current user's feeds + OwnFollowings []FollowResponse `json:"own_followings,omitempty"` + // Follow relationships where the current user's feeds are following this feed OwnFollows []FollowResponse `json:"own_follows,omitempty"` @@ -6514,7 +6745,10 @@ type FlagUserOptions struct { type FollowBatchResponse struct { Duration string `json:"duration"` - // List of created follow relationships + // List of newly created follow relationships + Created []FollowResponse `json:"created"` + + // List of current follow relationships Follows []FollowResponse `json:"follows"` } @@ -6715,6 +6949,20 @@ type FullUserResponse struct { TeamsRole map[string]string `json:"teams_role,omitempty"` } +type FutureChannelBanResponse struct { + CreatedAt Timestamp `json:"created_at"` + + Expires *Timestamp `json:"expires,omitempty"` + + Reason *string `json:"reason,omitempty"` + + Shadow *bool `json:"shadow,omitempty"` + + BannedBy *UserResponse `json:"banned_by,omitempty"` + + User *UserResponse `json:"user,omitempty"` +} + type GeofenceResponse struct { Name string `json:"name"` @@ -6758,6 +7006,12 @@ type GetActivityResponse struct { Activity ActivityResponse `json:"activity"` } +type GetAppealResponse struct { + Duration string `json:"duration"` + + Item *AppealItemResponse `json:"item,omitempty"` +} + // Basic response information type GetApplicationResponse struct { // Duration of the request in milliseconds @@ -7062,6 +7316,26 @@ type GetImportResponse struct { ImportTask *ImportTask `json:"import_task,omitempty"` } +// Basic response information +type GetImportV2TaskResponse struct { + AppPk int `json:"app_pk"` + + CreatedAt Timestamp `json:"created_at"` + + // Duration of the request in milliseconds + Duration string `json:"duration"` + + ID string `json:"id"` + + Product string `json:"product"` + + State int `json:"state"` + + UpdatedAt Timestamp `json:"updated_at"` + + Settings ImportV2TaskSettings `json:"settings"` +} + type GetManyMessagesResponse struct { Duration string `json:"duration"` @@ -7470,6 +7744,52 @@ type ImportTaskHistory struct { PrevState string `json:"prev_state"` } +type ImportV2TaskItem struct { + AppPk int `json:"app_pk"` + + CreatedAt Timestamp `json:"created_at"` + + ID string `json:"id"` + + Product string `json:"product"` + + State int `json:"state"` + + UpdatedAt Timestamp `json:"updated_at"` + + Settings ImportV2TaskSettings `json:"settings"` +} + +type ImportV2TaskSettings struct { + SkipReferencesCheck *bool `json:"skip_references_check,omitempty"` + + S3 *ImportV2TaskSettingsS3 `json:"s3,omitempty"` +} + +type ImportV2TaskSettingsS3 struct { + Bucket *string `json:"bucket,omitempty"` + + Dir *string `json:"dir,omitempty"` + + Region *string `json:"region,omitempty"` +} + +type IndividualRecordSettings struct { + Mode string `json:"mode"` +} + +type IndividualRecordingResponse struct { + Status string `json:"status"` +} + +type IndividualRecordingSettingsRequest struct { + Mode string `json:"mode"` +} + +type IndividualRecordingSettingsResponse struct { + Mode string `json:"mode"` +} + type IngressAudioEncodingOptions struct { Bitrate int `json:"bitrate"` @@ -7494,6 +7814,32 @@ type IngressAudioEncodingResponse struct { EnableDtx bool `json:"enable_dtx"` } +// This event is sent when a critical error occurs that breaks the streaming pipeline +type IngressErrorEvent struct { + CallCid string `json:"call_cid"` + + CreatedAt Timestamp `json:"created_at"` + + // Human-readable error message + Error string `json:"error"` + + // Unique identifier for the stream + IngressStreamID string `json:"ingress_stream_id"` + + // User who was streaming + UserID string `json:"user_id"` + + // The type of event: "ingress.error" in this case + Type string `json:"type"` + + // Error code + Code *string `json:"code,omitempty"` +} + +func (*IngressErrorEvent) GetEventType() string { + return "ingress.error" +} + type IngressSettings struct { Enabled bool `json:"enabled"` @@ -7542,6 +7888,58 @@ type IngressSourceResponse struct { Width int `json:"width"` } +// This event is sent when a user begins streaming into a call +type IngressStartedEvent struct { + CallCid string `json:"call_cid"` + + CreatedAt Timestamp `json:"created_at"` + + // Unique identifier for this stream + IngressStreamID string `json:"ingress_stream_id"` + + // Streaming protocol (e.g., 'rtmps', 'srt', 'rtmp', 'rtsp') + PublisherType string `json:"publisher_type"` + + // User who started the stream + UserID string `json:"user_id"` + + // The type of event: "ingress.started" in this case + Type string `json:"type"` + + // Client IP address + ClientIp *string `json:"client_ip,omitempty"` + + // Streaming client software name (e.g., 'OBS Studio') + ClientName *string `json:"client_name,omitempty"` + + // Client software version + Version *string `json:"version,omitempty"` +} + +func (*IngressStartedEvent) GetEventType() string { + return "ingress.started" +} + +// This event is sent when streaming stops due to user action or call ended +type IngressStoppedEvent struct { + CallCid string `json:"call_cid"` + + CreatedAt Timestamp `json:"created_at"` + + // Unique identifier for the stream + IngressStreamID string `json:"ingress_stream_id"` + + // User who was streaming + UserID string `json:"user_id"` + + // The type of event: "ingress.stopped" in this case + Type string `json:"type"` +} + +func (*IngressStoppedEvent) GetEventType() string { + return "ingress.stopped" +} + type IngressVideoEncodingOptions struct { Layers []IngressVideoLayer `json:"layers"` @@ -7810,6 +8208,18 @@ type ListFeedVisibilitiesResponse struct { FeedVisibilities map[string]FeedVisibilityResponse `json:"feed_visibilities"` } +// Basic response information +type ListImportV2TasksResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + + ImportTasks []ImportV2TaskItem `json:"import_tasks"` + + Next *string `json:"next,omitempty"` + + Prev *string `json:"prev,omitempty"` +} + // Basic response information type ListImportsResponse struct { // Duration of the request in milliseconds @@ -7896,6 +8306,8 @@ type MarkReadResponse struct { type MarkReviewedRequest struct { ContentToMarkAsReviewedLimit *int `json:"content_to_mark_as_reviewed_limit,omitempty"` + DecisionReason *string `json:"decision_reason,omitempty"` + DisableMarkingContentAsReviewed *bool `json:"disable_marking_content_as_reviewed,omitempty"` } @@ -8298,7 +8710,7 @@ type MessageNewEvent struct { } func (*MessageNewEvent) GetEventType() string { - return "message.new" + return "notification.thread_message_new" } type MessageOptions struct { @@ -9236,48 +9648,52 @@ type OverviewDashboardConfig struct { VisibleCharts []string `json:"visible_charts,omitempty"` } -type OwnCapabilitiesBatchResponse struct { +type OwnBatchResponse struct { Duration string `json:"duration"` - // Map of feed ID to capabilities array - Capabilities map[string][]FeedOwnCapability `json:"capabilities"` + // Map of feed ID to own fields data + Data map[string]FeedOwnData `json:"data"` } type OwnCapability string const ( - BLOCK_USERS OwnCapability = "block-users" - CHANGE_MAX_DURATION OwnCapability = "change-max-duration" - CREATE_CALL OwnCapability = "create-call" - CREATE_REACTION OwnCapability = "create-reaction" - ENABLE_NOISE_CANCELLATION OwnCapability = "enable-noise-cancellation" - END_CALL OwnCapability = "end-call" - JOIN_BACKSTAGE OwnCapability = "join-backstage" - JOIN_CALL OwnCapability = "join-call" - JOIN_ENDED_CALL OwnCapability = "join-ended-call" - KICK_USER OwnCapability = "kick-user" - MUTE_USERS OwnCapability = "mute-users" - PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" - READ_CALL OwnCapability = "read-call" - REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" - SCREENSHARE OwnCapability = "screenshare" - SEND_AUDIO OwnCapability = "send-audio" - SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" - SEND_VIDEO OwnCapability = "send-video" - START_BROADCAST_CALL OwnCapability = "start-broadcast-call" - START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" - START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" - START_RECORD_CALL OwnCapability = "start-record-call" - START_TRANSCRIPTION_CALL OwnCapability = "start-transcription-call" - STOP_BROADCAST_CALL OwnCapability = "stop-broadcast-call" - STOP_CLOSED_CAPTIONS_CALL OwnCapability = "stop-closed-captions-call" - STOP_FRAME_RECORD_CALL OwnCapability = "stop-frame-record-call" - STOP_RECORD_CALL OwnCapability = "stop-record-call" - STOP_TRANSCRIPTION_CALL OwnCapability = "stop-transcription-call" - UPDATE_CALL OwnCapability = "update-call" - UPDATE_CALL_MEMBER OwnCapability = "update-call-member" - UPDATE_CALL_PERMISSIONS OwnCapability = "update-call-permissions" - UPDATE_CALL_SETTINGS OwnCapability = "update-call-settings" + BLOCK_USERS OwnCapability = "block-users" + CHANGE_MAX_DURATION OwnCapability = "change-max-duration" + CREATE_CALL OwnCapability = "create-call" + CREATE_REACTION OwnCapability = "create-reaction" + ENABLE_NOISE_CANCELLATION OwnCapability = "enable-noise-cancellation" + END_CALL OwnCapability = "end-call" + JOIN_BACKSTAGE OwnCapability = "join-backstage" + JOIN_CALL OwnCapability = "join-call" + JOIN_ENDED_CALL OwnCapability = "join-ended-call" + KICK_USER OwnCapability = "kick-user" + MUTE_USERS OwnCapability = "mute-users" + PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" + READ_CALL OwnCapability = "read-call" + REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" + SCREENSHARE OwnCapability = "screenshare" + SEND_AUDIO OwnCapability = "send-audio" + SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" + SEND_VIDEO OwnCapability = "send-video" + START_BROADCAST_CALL OwnCapability = "start-broadcast-call" + START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" + START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" + START_INDIVIDUAL_RECORD_CALL OwnCapability = "start-individual-record-call" + START_RAW_RECORD_CALL OwnCapability = "start-raw-record-call" + START_RECORD_CALL OwnCapability = "start-record-call" + START_TRANSCRIPTION_CALL OwnCapability = "start-transcription-call" + STOP_BROADCAST_CALL OwnCapability = "stop-broadcast-call" + STOP_CLOSED_CAPTIONS_CALL OwnCapability = "stop-closed-captions-call" + STOP_FRAME_RECORD_CALL OwnCapability = "stop-frame-record-call" + STOP_INDIVIDUAL_RECORD_CALL OwnCapability = "stop-individual-record-call" + STOP_RAW_RECORD_CALL OwnCapability = "stop-raw-record-call" + STOP_RECORD_CALL OwnCapability = "stop-record-call" + STOP_TRANSCRIPTION_CALL OwnCapability = "stop-transcription-call" + UPDATE_CALL OwnCapability = "update-call" + UPDATE_CALL_MEMBER OwnCapability = "update-call-member" + UPDATE_CALL_PERMISSIONS OwnCapability = "update-call-permissions" + UPDATE_CALL_SETTINGS OwnCapability = "update-call-settings" ) func (c OwnCapability) String() string { @@ -9536,6 +9952,22 @@ type ParticipantSeriesUserStats struct { Thresholds map[string][]MetricThreshold `json:"thresholds,omitempty"` } +type ParticipantSessionDetails struct { + PublisherType string `json:"publisher_type"` + + UserID string `json:"user_id"` + + UserSessionID string `json:"user_session_id"` + + Roles []string `json:"roles"` + + DurationInSeconds *int `json:"duration_in_seconds,omitempty"` + + JoinedAt *Timestamp `json:"joined_at,omitempty"` + + LeftAt *Timestamp `json:"left_at,omitempty"` +} + // Pending message event for async moderation type PendingMessageEvent struct { // Date/time of creation @@ -9864,6 +10296,8 @@ type PollVoteResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` + Poll *PollResponseData `json:"poll,omitempty"` + Vote *PollVoteResponseData `json:"vote,omitempty"` } @@ -10227,6 +10661,17 @@ type QueryAggregateCallStatsResponse struct { UserFeedbackReport *UserFeedbackReportResponse `json:"user_feedback_report,omitempty"` } +type QueryAppealsResponse struct { + Duration string `json:"duration"` + + // List of Appeal Items + Items []AppealItemResponse `json:"items"` + + Next *string `json:"next,omitempty"` + + Prev *string `json:"prev,omitempty"` +} + type QueryBannedUsersPayload struct { FilterConditions map[string]any `json:"filter_conditions"` @@ -10293,6 +10738,30 @@ type QueryCallMembersResponse struct { Prev *string `json:"prev,omitempty"` } +// Basic response information +type QueryCallParticipantSessionsResponse struct { + CallID string `json:"call_id"` + + CallSessionID string `json:"call_session_id"` + + CallType string `json:"call_type"` + + // Duration of the request in milliseconds + Duration int `json:"duration"` + + TotalParticipantDuration int `json:"total_participant_duration"` + + TotalParticipantSessions int `json:"total_participant_sessions"` + + ParticipantsSessions []ParticipantSessionDetails `json:"participants_sessions"` + + Next *string `json:"next,omitempty"` + + Prev *string `json:"prev,omitempty"` + + Session *CallSessionResponse `json:"session,omitempty"` +} + type QueryCallParticipantsResponse struct { Duration string `json:"duration"` @@ -10535,6 +11004,32 @@ type QueryFollowsResponse struct { Prev *string `json:"prev,omitempty"` } +type QueryFutureChannelBansPayload struct { + // Whether to exclude expired bans or not + ExcludeExpiredBans *bool `json:"exclude_expired_bans,omitempty"` + + // Number of records to return + Limit *int `json:"limit,omitempty"` + + // Number of records to offset + Offset *int `json:"offset,omitempty"` + + // Filter by the target user ID. For server-side requests only. + TargetUserID *string `json:"target_user_id,omitempty"` + + UserID *string `json:"user_id,omitempty"` + + User *UserRequest `json:"user,omitempty"` +} + +type QueryFutureChannelBansResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + + // List of found future channel bans + Bans []FutureChannelBanResponse `json:"bans"` +} + // Client request type QueryMembersPayload struct { Type string `json:"type"` @@ -10842,7 +11337,7 @@ type RTMPSettingsResponse struct { } type RankingConfig struct { - // Type of ranking algorithm. Required. Must be one of: recency, expression, interest + // Type of ranking algorithm. Required. Must be one of: expression, interest Type string `json:"type"` // Scoring formula. Required when type is 'expression' or 'interest' @@ -10855,6 +11350,22 @@ type RankingConfig struct { Functions map[string]DecayFunctionConfig `json:"functions,omitempty"` } +type RawRecordSettings struct { + Mode string `json:"mode"` +} + +type RawRecordingResponse struct { + Status string `json:"status"` +} + +type RawRecordingSettingsRequest struct { + Mode string `json:"mode"` +} + +type RawRecordingSettingsResponse struct { + Mode string `json:"mode"` +} + type Reaction struct { CreatedAt Timestamp `json:"created_at"` @@ -11085,6 +11596,10 @@ type RecordSettingsResponse struct { Layout LayoutSettingsResponse `json:"layout"` } +type RejectAppealRequest struct { + DecisionReason string `json:"decision_reason"` +} + type RejectFeedMemberInviteResponse struct { Duration string `json:"duration"` @@ -11292,7 +11807,9 @@ type Response struct { Duration string `json:"duration"` } -type RestoreActionRequest struct{} +type RestoreActionRequest struct { + DecisionReason *string `json:"decision_reason,omitempty"` +} // This event is sent when a new moderation review queue item is created type ReviewQueueItemNewEvent struct { @@ -11379,6 +11896,8 @@ type ReviewQueueItemResponse struct { Activity *EnrichedActivity `json:"activity,omitempty"` + Appeal *AppealItemResponse `json:"appeal,omitempty"` + AssignedTo *UserResponse `json:"assigned_to,omitempty"` Call *CallResponse `json:"call,omitempty"` @@ -11504,6 +12023,10 @@ type RuleBuilderCondition struct { UserFlagCountRuleParams *FlagCountRuleParameters `json:"user_flag_count_rule_params,omitempty"` + UserIdenticalContentCountParams *UserIdenticalContentCountParameters `json:"user_identical_content_count_params,omitempty"` + + UserRoleParams *UserRoleParameters `json:"user_role_params,omitempty"` + UserRuleParams *UserRuleParameters `json:"user_rule_params,omitempty"` VideoContentParams *VideoContentParameters `json:"video_content_params,omitempty"` @@ -11842,6 +12365,10 @@ type SearchPayload struct { // Channel filter conditions FilterConditions map[string]any `json:"filter_conditions"` + ForceDefaultSearch *bool `json:"force_default_search,omitempty"` + + ForceSqlV2Backend *bool `json:"force_sql_v2_backend,omitempty"` + // Number of messages to return Limit *int `json:"limit,omitempty"` @@ -12179,6 +12706,9 @@ type SingleFollowResponse struct { Duration string `json:"duration"` Follow FollowResponse `json:"follow"` + + // Whether a notification activity was successfully created + NotificationCreated *bool `json:"notification_created,omitempty"` } // Credentials for SIP inbound call authentication @@ -12206,6 +12736,8 @@ type SortParam struct { Direction *int `json:"direction,omitempty"` Field *string `json:"field,omitempty"` + + Type *string `json:"type,omitempty"` } type SortParamRequest struct { @@ -12214,6 +12746,9 @@ type SortParamRequest struct { // Name of field to sort by Field *string `json:"field,omitempty"` + + // Type of field to sort by (default is string) + Type *string `json:"type,omitempty"` } type SpeechSegmentConfig struct { @@ -12360,6 +12895,8 @@ func (*StoriesFeedUpdatedEvent) GetEventType() string { type SubmitActionResponse struct { Duration string `json:"duration"` + AppealItem *AppealItemResponse `json:"appeal_item,omitempty"` + Item *ReviewQueueItemResponse `json:"item,omitempty"` } @@ -12422,6 +12959,8 @@ type TextContentParameters struct { type TextRuleParameters struct { ContainsUrl *bool `json:"contains_url,omitempty"` + SemanticFilterMinThreshold *float64 `json:"semantic_filter_min_threshold,omitempty"` + Severity *string `json:"severity,omitempty"` Threshold *int `json:"threshold,omitempty"` @@ -12432,6 +12971,8 @@ type TextRuleParameters struct { HarmLabels []string `json:"harm_labels,omitempty"` + SemanticFilterNames []string `json:"semantic_filter_names,omitempty"` + LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` } @@ -12618,6 +13159,8 @@ type ThreadedCommentResponse struct { DeletedAt *Timestamp `json:"deleted_at,omitempty"` + EditedAt *Timestamp `json:"edited_at,omitempty"` + ParentID *string `json:"parent_id,omitempty"` Text *string `json:"text,omitempty"` @@ -12731,13 +13274,17 @@ type TypingIndicatorsResponse struct { Enabled *bool `json:"enabled,omitempty"` } -type UnbanActionRequest struct{} +type UnbanActionRequest struct { + DecisionReason *string `json:"decision_reason,omitempty"` +} type UnbanResponse struct { Duration string `json:"duration"` } -type UnblockActionRequest struct{} +type UnblockActionRequest struct { + DecisionReason *string `json:"decision_reason,omitempty"` +} // UnblockUserResponse is the payload for unblocking a user. type UnblockUserResponse struct { @@ -13269,6 +13816,9 @@ type UpsertActivitiesResponse struct { // List of created or updated activities Activities []ActivityResponse `json:"activities"` + + // Total number of mention notification activities created for mentioned users across all activities + MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` } type UpsertCollectionsResponse struct { @@ -13492,6 +14042,12 @@ func (*UserFlaggedEvent) GetEventType() string { return "user.flagged" } +type UserIdenticalContentCountParameters struct { + Threshold *int `json:"threshold,omitempty"` + + TimeWindow *string `json:"time_window,omitempty"` +} + // This event is sent when a user's message get deleted. The event contains information about the user whose messages got deleted. type UserMessagesDeletedEvent struct { // Date/time of creation @@ -13771,6 +14327,12 @@ type UserResponsePrivacyFields struct { TeamsRole map[string]string `json:"teams_role,omitempty"` } +type UserRoleParameters struct { + Operator *string `json:"operator,omitempty"` + + Role *string `json:"role,omitempty"` +} + type UserRuleParameters struct { MaxAge *string `json:"max_age,omitempty"` } diff --git a/moderation.go b/moderation.go index 3e1d7c4..16b9617 100644 --- a/moderation.go +++ b/moderation.go @@ -15,6 +15,30 @@ func NewModerationClient(client *Client) *ModerationClient { } } +// Appeal against the moderation decision +func (c *ModerationClient) Appeal(ctx context.Context, request *AppealRequest) (*StreamResponse[AppealResponse], error) { + var result AppealResponse + res, err := MakeRequest[AppealRequest, AppealResponse](c.client, ctx, "POST", "/api/v2/moderation/appeal", nil, request, &result, nil) + return res, err +} + +// Retrieve a specific appeal item by its ID +func (c *ModerationClient) GetAppeal(ctx context.Context, id string, request *GetAppealRequest) (*StreamResponse[GetAppealResponse], error) { + var result GetAppealResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[any, GetAppealResponse](c.client, ctx, "GET", "/api/v2/moderation/appeal/{id}", nil, nil, &result, pathParams) + return res, err +} + +// Query Appeals +func (c *ModerationClient) QueryAppeals(ctx context.Context, request *QueryAppealsRequest) (*StreamResponse[QueryAppealsResponse], error) { + var result QueryAppealsResponse + res, err := MakeRequest[QueryAppealsRequest, QueryAppealsResponse](c.client, ctx, "POST", "/api/v2/moderation/appeals", nil, request, &result, nil) + return res, err +} + // Ban a user from a channel or the entire app func (c *ModerationClient) Ban(ctx context.Context, request *BanRequest) (*StreamResponse[BanResponse], error) { var result BanResponse diff --git a/moderation_integration_test.go b/moderation_integration_test.go index 407836d..8fd9231 100644 --- a/moderation_integration_test.go +++ b/moderation_integration_test.go @@ -120,7 +120,7 @@ func TestModerationSubmitModerationAction(t *testing.T) { // snippet-start: SubmitModerationAction request := &getstream.SubmitActionRequest{ - ItemID: "review_item_123", + ItemID: getstream.PtrTo("review_item_123"), ActionType: "mark_reviewed", UserID: getstream.PtrTo("moderator456"), } diff --git a/requests.go b/requests.go index 674a764..da268c4 100644 --- a/requests.go +++ b/requests.go @@ -110,10 +110,13 @@ type QueryChannelsRequest struct { MemberLimit *int `json:"member_limit"` MessageLimit *int `json:"message_limit"` Offset *int `json:"offset"` + PredefinedFilter *string `json:"predefined_filter"` State *bool `json:"state"` UserID *string `json:"user_id"` Sort []SortParamRequest `json:"sort"` FilterConditions map[string]any `json:"filter_conditions"` + FilterValues map[string]any `json:"filter_values"` + SortValues map[string]any `json:"sort_values"` User *UserRequest `json:"user"` } @@ -540,6 +543,10 @@ type QueryBannedUsersRequest struct { Payload *QueryBannedUsersPayload `json:"-" query:"payload"` } +type QueryFutureChannelBansRequest struct { + Payload *QueryFutureChannelBansPayload `json:"-" query:"payload"` +} + type QueryRemindersRequest struct { Limit *int `json:"limit"` Next *string `json:"next"` @@ -697,26 +704,28 @@ type CheckExternalStorageRequest struct { } type AddActivityRequest struct { - Type string `json:"type"` - Feeds []string `json:"feeds"` - ExpiresAt *string `json:"expires_at"` - ID *string `json:"id"` - 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"` - VisibilityTag *string `json:"visibility_tag"` - Attachments []Attachment `json:"attachments"` - CollectionRefs []string `json:"collection_refs"` - FilterTags []string `json:"filter_tags"` - InterestTags []string `json:"interest_tags"` - MentionedUserIds []string `json:"mentioned_user_ids"` - Custom map[string]any `json:"custom"` - Location *ActivityLocation `json:"location"` - SearchData map[string]any `json:"search_data"` + Type string `json:"type"` + Feeds []string `json:"feeds"` + CreateNotificationActivity *bool `json:"create_notification_activity"` + ExpiresAt *string `json:"expires_at"` + ID *string `json:"id"` + ParentID *string `json:"parent_id"` + PollID *string `json:"poll_id"` + RestrictReplies *string `json:"restrict_replies"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` + Text *string `json:"text"` + UserID *string `json:"user_id"` + Visibility *string `json:"visibility"` + VisibilityTag *string `json:"visibility_tag"` + Attachments []Attachment `json:"attachments"` + CollectionRefs []string `json:"collection_refs"` + FilterTags []string `json:"filter_tags"` + InterestTags []string `json:"interest_tags"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + Location *ActivityLocation `json:"location"` + SearchData map[string]any `json:"search_data"` } type UpsertActivitiesRequest struct { @@ -724,10 +733,11 @@ type UpsertActivitiesRequest struct { } type DeleteActivitiesRequest struct { - Ids []string `json:"ids"` - HardDelete *bool `json:"hard_delete"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + Ids []string `json:"ids"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` + HardDelete *bool `json:"hard_delete"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type QueryActivitiesRequest struct { @@ -790,39 +800,45 @@ type QueryActivityReactionsRequest struct { } type DeleteActivityReactionRequest struct { - UserID *string `json:"-" query:"user_id"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` + UserID *string `json:"-" query:"user_id"` } type DeleteActivityRequest struct { - HardDelete *bool `json:"-" query:"hard_delete"` + HardDelete *bool `json:"-" query:"hard_delete"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type GetActivityRequest struct { } type UpdateActivityPartialRequest struct { - UserID *string `json:"user_id"` - Unset []string `json:"unset"` - Set map[string]any `json:"set"` - User *UserRequest `json:"user"` + HandleMentionNotifications *bool `json:"handle_mention_notifications"` + UserID *string `json:"user_id"` + Unset []string `json:"unset"` + Set map[string]any `json:"set"` + User *UserRequest `json:"user"` } 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"` - Attachments []Attachment `json:"attachments"` - CollectionRefs []string `json:"collection_refs"` - Feeds []string `json:"feeds"` - FilterTags []string `json:"filter_tags"` - InterestTags []string `json:"interest_tags"` - Custom map[string]any `json:"custom"` - Location *ActivityLocation `json:"location"` - User *UserRequest `json:"user"` + ExpiresAt *Timestamp `json:"expires_at"` + HandleMentionNotifications *bool `json:"handle_mention_notifications"` + 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"` + VisibilityTag *string `json:"visibility_tag"` + Attachments []Attachment `json:"attachments"` + CollectionRefs []string `json:"collection_refs"` + Feeds []string `json:"feeds"` + FilterTags []string `json:"filter_tags"` + InterestTags []string `json:"interest_tags"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + Location *ActivityLocation `json:"location"` + User *UserRequest `json:"user"` } type QueryBookmarkFoldersRequest struct { @@ -882,6 +898,7 @@ type GetCommentsRequest struct { Depth *int `json:"-" query:"depth"` Sort *string `json:"-" query:"sort"` RepliesLimit *int `json:"-" query:"replies_limit"` + UserID *string `json:"-" query:"user_id"` Limit *int `json:"-" query:"limit"` Prev *string `json:"-" query:"prev"` Next *string `json:"-" query:"next"` @@ -916,19 +933,23 @@ type QueryCommentsRequest struct { } type DeleteCommentRequest struct { - HardDelete *bool `json:"-" query:"hard_delete"` + HardDelete *bool `json:"-" query:"hard_delete"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type GetCommentRequest struct { } type UpdateCommentRequest struct { - 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"` + Comment *string `json:"comment"` + HandleMentionNotifications *bool `json:"handle_mention_notifications"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` + UserID *string `json:"user_id"` + Attachments []Attachment `json:"attachments"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type AddCommentReactionRequest struct { @@ -950,13 +971,15 @@ type QueryCommentReactionsRequest struct { } type DeleteCommentReactionRequest struct { - UserID *string `json:"-" query:"user_id"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` + UserID *string `json:"-" query:"user_id"` } type GetCommentRepliesRequest struct { Depth *int `json:"-" query:"depth"` Sort *string `json:"-" query:"sort"` RepliesLimit *int `json:"-" query:"replies_limit"` + UserID *string `json:"-" query:"user_id"` Limit *int `json:"-" query:"limit"` Prev *string `json:"-" query:"prev"` Next *string `json:"-" query:"next"` @@ -1004,6 +1027,9 @@ type GetOrCreateFeedRequest struct { type UpdateFeedRequest struct { CreatedByID *string `json:"created_by_id"` + Description *string `json:"description"` + Name *string `json:"name"` + FilterTags []string `json:"filter_tags"` Custom map[string]any `json:"custom"` } @@ -1131,9 +1157,15 @@ type CreateFeedsBatchRequest struct { Feeds []FeedRequest `json:"feeds"` } -type OwnCapabilitiesBatchRequest struct { +type DeleteFeedsBatchRequest struct { + Feeds []string `json:"feeds"` + HardDelete *bool `json:"hard_delete"` +} + +type OwnBatchRequest struct { Feeds []string `json:"feeds"` UserID *string `json:"user_id"` + Fields []string `json:"fields"` User *UserRequest `json:"user"` } @@ -1161,6 +1193,7 @@ type UpdateFollowRequest struct { FollowerRole *string `json:"follower_role"` PushPreference *string `json:"push_preference"` SkipPush *bool `json:"skip_push"` + Status *string `json:"status"` Custom map[string]any `json:"custom"` } @@ -1170,6 +1203,7 @@ type FollowRequest struct { CreateNotificationActivity *bool `json:"create_notification_activity"` PushPreference *string `json:"push_preference"` SkipPush *bool `json:"skip_push"` + Status *string `json:"status"` Custom map[string]any `json:"custom"` } @@ -1201,6 +1235,7 @@ type RejectFollowRequest struct { } type UnfollowRequest struct { + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type CreateMembershipLevelRequest struct { @@ -1237,14 +1272,17 @@ type QueryFeedsUsageStatsRequest struct { } type UnfollowBatchRequest struct { - Follows []FollowPair `json:"follows"` + Follows []FollowPair `json:"follows"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` } type GetOrCreateUnfollowsRequest struct { - Follows []FollowPair `json:"follows"` + Follows []FollowPair `json:"follows"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` } type DeleteFeedUserDataRequest struct { + HardDelete *bool `json:"hard_delete"` } type ExportFeedUserDataRequest struct { @@ -1266,9 +1304,48 @@ type CreateImportRequest struct { Path string `json:"path"` } +type ListImportV2TasksRequest struct { + State *int `json:"-" query:"state"` +} + +type CreateImportV2TaskRequest struct { + Product string `json:"product"` + Settings ImportV2TaskSettings `json:"settings"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` +} + +type DeleteImportV2TaskRequest struct { +} + +type GetImportV2TaskRequest struct { +} + type GetImportRequest struct { } +type AppealRequest struct { + AppealReason string `json:"appeal_reason"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + UserID *string `json:"user_id"` + Attachments []string `json:"attachments"` + User *UserRequest `json:"user"` +} + +type GetAppealRequest struct { +} + +type QueryAppealsRequest struct { + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` +} + type BanRequest struct { TargetUserID string `json:"target_user_id"` BannedByID *string `json:"banned_by_id"` @@ -1445,7 +1522,8 @@ type GetReviewQueueItemRequest struct { type SubmitActionRequest struct { ActionType string `json:"action_type"` - ItemID string `json:"item_id"` + AppealID *string `json:"appeal_id"` + ItemID *string `json:"item_id"` UserID *string `json:"user_id"` Ban *BanActionRequest `json:"ban"` Block *BlockActionRequest `json:"block"` @@ -1456,8 +1534,11 @@ type SubmitActionRequest struct { DeleteReaction *DeleteReactionRequest `json:"delete_reaction"` DeleteUser *DeleteUserRequest `json:"delete_user"` MarkReviewed *MarkReviewedRequest `json:"mark_reviewed"` + RejectAppeal *RejectAppealRequest `json:"reject_appeal"` + Restore *RestoreActionRequest `json:"restore"` ShadowBlock *ShadowBlockActionRequest `json:"shadow_block"` Unban *UnbanActionRequest `json:"unban"` + Unblock *UnblockActionRequest `json:"unblock"` User *UserRequest `json:"user"` } @@ -1812,7 +1893,10 @@ type CollectUserFeedbackRequest struct { type GoLiveRequest struct { RecordingStorageName *string `json:"recording_storage_name"` StartClosedCaption *bool `json:"start_closed_caption"` + StartCompositeRecording *bool `json:"start_composite_recording"` StartHLS *bool `json:"start_hls"` + StartIndividualRecording *bool `json:"start_individual_recording"` + StartRawRecording *bool `json:"start_raw_recording"` StartRecording *bool `json:"start_recording"` StartTranscription *bool `json:"start_transcription"` TranscriptionStorageName *string `json:"transcription_storage_name"` @@ -1857,6 +1941,13 @@ type VideoPinRequest struct { type ListRecordingsRequest struct { } +type StartRecordingRequest struct { + RecordingExternalStorage *string `json:"recording_external_storage"` +} + +type StopRecordingRequest struct { +} + type GetCallReportRequest struct { SessionID *string `json:"-" query:"session_id"` } @@ -1876,6 +1967,13 @@ type StopAllRTMPBroadcastsRequest struct { type StopRTMPBroadcastRequest struct { } +type QueryCallParticipantSessionsRequest struct { + Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` + FilterConditions map[string]any `json:"-" query:"filter_conditions"` +} + type StartHLSBroadcastingRequest struct { } @@ -1890,10 +1988,6 @@ type StartFrameRecordingRequest struct { RecordingExternalStorage *string `json:"recording_external_storage"` } -type StartRecordingRequest struct { - RecordingExternalStorage *string `json:"recording_external_storage"` -} - type StartTranscriptionRequest struct { EnableClosedCaptions *bool `json:"enable_closed_captions"` Language *string `json:"language"` @@ -1911,14 +2005,14 @@ type StopFrameRecordingRequest struct { } type StopLiveRequest struct { - ContinueClosedCaption *bool `json:"continue_closed_caption"` - ContinueHLS *bool `json:"continue_hls"` - ContinueRTMPBroadcasts *bool `json:"continue_rtmp_broadcasts"` - ContinueRecording *bool `json:"continue_recording"` - ContinueTranscription *bool `json:"continue_transcription"` -} - -type StopRecordingRequest struct { + ContinueClosedCaption *bool `json:"continue_closed_caption"` + ContinueCompositeRecording *bool `json:"continue_composite_recording"` + ContinueHLS *bool `json:"continue_hls"` + ContinueIndividualRecording *bool `json:"continue_individual_recording"` + ContinueRTMPBroadcasts *bool `json:"continue_rtmp_broadcasts"` + ContinueRawRecording *bool `json:"continue_raw_recording"` + ContinueRecording *bool `json:"continue_recording"` + ContinueTranscription *bool `json:"continue_transcription"` } type StopTranscriptionRequest struct { @@ -2012,13 +2106,6 @@ type UpdateCallTypeRequest struct { type GetEdgesRequest struct { } -type ResolveSipInboundRequest struct { - SipCallerNumber string `json:"sip_caller_number"` - SipTrunkNumber string `json:"sip_trunk_number"` - Challenge SIPChallenge `json:"challenge"` - SipHeaders map[string]string `json:"sip_headers"` -} - type ListSIPInboundRoutingRuleRequest struct { } @@ -2065,6 +2152,14 @@ type UpdateSIPTrunkRequest struct { Numbers []string `json:"numbers"` } +type ResolveSipInboundRequest struct { + SipCallerNumber string `json:"sip_caller_number"` + SipTrunkNumber string `json:"sip_trunk_number"` + Challenge SIPChallenge `json:"challenge"` + RoutingNumber *string `json:"routing_number"` + SipHeaders map[string]string `json:"sip_headers"` +} + type QueryAggregateCallStatsRequest struct { From *string `json:"from"` To *string `json:"to"` diff --git a/video.go b/video.go index f76098a..876cfde 100644 --- a/video.go +++ b/video.go @@ -245,6 +245,36 @@ func (c *VideoClient) ListRecordings(ctx context.Context, _type string, id strin return res, err } +// Starts recording +// +// Sends events: +// - call.recording_started +func (c *VideoClient) StartRecording(ctx context.Context, _type string, id string, recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { + var result StartRecordingResponse + pathParams := map[string]string{ + "type": _type, + "id": id, + "recording_type": recordingType, + } + res, err := MakeRequest[StartRecordingRequest, StartRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/start", nil, request, &result, pathParams) + return res, err +} + +// Stops recording +// +// Sends events: +// - call.recording_stopped +func (c *VideoClient) StopRecording(ctx context.Context, _type string, id string, recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { + var result StopRecordingResponse + pathParams := map[string]string{ + "type": _type, + "id": id, + "recording_type": recordingType, + } + res, err := MakeRequest[StopRecordingRequest, StopRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/stop", nil, request, &result, pathParams) + return res, err +} + func (c *VideoClient) GetCallReport(ctx context.Context, _type string, id string, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse], error) { var result GetCallReportResponse pathParams := map[string]string{ @@ -304,6 +334,18 @@ func (c *VideoClient) StopRTMPBroadcast(ctx context.Context, _type string, id st return res, err } +func (c *VideoClient) QueryCallParticipantSessions(ctx context.Context, _type string, id string, session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse], error) { + var result QueryCallParticipantSessionsResponse + pathParams := map[string]string{ + "type": _type, + "id": id, + "session": session, + } + params := extractQueryParams(request) + res, err := MakeRequest[any, QueryCallParticipantSessionsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/session/{session}/participant_sessions", params, nil, &result, pathParams) + return res, err +} + // Starts HLS broadcasting func (c *VideoClient) StartHLSBroadcasting(ctx context.Context, _type string, id string, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { var result StartHLSBroadcastingResponse @@ -340,20 +382,6 @@ func (c *VideoClient) StartFrameRecording(ctx context.Context, _type string, id return res, err } -// Starts recording -// -// Sends events: -// - call.recording_started -func (c *VideoClient) StartRecording(ctx context.Context, _type string, id string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { - var result StartRecordingResponse - pathParams := map[string]string{ - "type": _type, - "id": id, - } - res, err := MakeRequest[StartRecordingRequest, StartRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_recording", nil, request, &result, pathParams) - return res, err -} - // Starts transcription func (c *VideoClient) StartTranscription(ctx context.Context, _type string, id string, request *StartTranscriptionRequest) (*StreamResponse[StartTranscriptionResponse], error) { var result StartTranscriptionResponse @@ -416,20 +444,6 @@ func (c *VideoClient) StopLive(ctx context.Context, _type string, id string, req return res, err } -// Stops recording -// -// Sends events: -// - call.recording_stopped -func (c *VideoClient) StopRecording(ctx context.Context, _type string, id string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { - var result StopRecordingResponse - pathParams := map[string]string{ - "type": _type, - "id": id, - } - res, err := MakeRequest[any, StopRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_recording", nil, nil, &result, pathParams) - return res, err -} - // Stops transcription // // Sends events: @@ -625,24 +639,17 @@ func (c *VideoClient) GetEdges(ctx context.Context, request *GetEdgesRequest) (* return res, err } -// Resolve SIP inbound routing based on trunk number, caller number, and challenge authentication -func (c *VideoClient) ResolveSipInbound(ctx context.Context, request *ResolveSipInboundRequest) (*StreamResponse[ResolveSipInboundResponse], error) { - var result ResolveSipInboundResponse - res, err := MakeRequest[ResolveSipInboundRequest, ResolveSipInboundResponse](c.client, ctx, "POST", "/api/v2/video/sip/resolve", nil, request, &result, nil) - return res, err -} - // List all SIP Inbound Routing Rules for the application func (c *VideoClient) ListSIPInboundRoutingRule(ctx context.Context, request *ListSIPInboundRoutingRuleRequest) (*StreamResponse[ListSIPInboundRoutingRuleResponse], error) { var result ListSIPInboundRoutingRuleResponse - res, err := MakeRequest[any, ListSIPInboundRoutingRuleResponse](c.client, ctx, "GET", "/api/v2/video/sip/routing_rules", nil, nil, &result, nil) + res, err := MakeRequest[any, ListSIPInboundRoutingRuleResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_routing_rules", nil, nil, &result, nil) return res, err } // Create a new SIP Inbound Routing Rule with either direct routing or PIN routing configuration func (c *VideoClient) CreateSIPInboundRoutingRule(ctx context.Context, request *CreateSIPInboundRoutingRuleRequest) (*StreamResponse[SIPInboundRoutingRuleResponse], error) { var result SIPInboundRoutingRuleResponse - res, err := MakeRequest[CreateSIPInboundRoutingRuleRequest, SIPInboundRoutingRuleResponse](c.client, ctx, "POST", "/api/v2/video/sip/routing_rules", nil, request, &result, nil) + res, err := MakeRequest[CreateSIPInboundRoutingRuleRequest, SIPInboundRoutingRuleResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_routing_rules", nil, request, &result, nil) return res, err } @@ -652,7 +659,7 @@ func (c *VideoClient) DeleteSIPInboundRoutingRule(ctx context.Context, id string pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteSIPInboundRoutingRuleResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/routing_rules/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteSIPInboundRoutingRuleResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_routing_rules/{id}", nil, nil, &result, pathParams) return res, err } @@ -662,21 +669,21 @@ func (c *VideoClient) UpdateSIPInboundRoutingRule(ctx context.Context, id string pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateSIPInboundRoutingRuleRequest, UpdateSIPInboundRoutingRuleResponse](c.client, ctx, "PUT", "/api/v2/video/sip/routing_rules/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateSIPInboundRoutingRuleRequest, UpdateSIPInboundRoutingRuleResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_routing_rules/{id}", nil, request, &result, pathParams) return res, err } // List all SIP trunks for the application func (c *VideoClient) ListSIPTrunks(ctx context.Context, request *ListSIPTrunksRequest) (*StreamResponse[ListSIPTrunksResponse], error) { var result ListSIPTrunksResponse - res, err := MakeRequest[any, ListSIPTrunksResponse](c.client, ctx, "GET", "/api/v2/video/sip/trunks", nil, nil, &result, nil) + res, err := MakeRequest[any, ListSIPTrunksResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_trunks", nil, nil, &result, nil) return res, err } // Create a new SIP trunk for the application func (c *VideoClient) CreateSIPTrunk(ctx context.Context, request *CreateSIPTrunkRequest) (*StreamResponse[CreateSIPTrunkResponse], error) { var result CreateSIPTrunkResponse - res, err := MakeRequest[CreateSIPTrunkRequest, CreateSIPTrunkResponse](c.client, ctx, "POST", "/api/v2/video/sip/trunks", nil, request, &result, nil) + res, err := MakeRequest[CreateSIPTrunkRequest, CreateSIPTrunkResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_trunks", nil, request, &result, nil) return res, err } @@ -686,7 +693,7 @@ func (c *VideoClient) DeleteSIPTrunk(ctx context.Context, id string, request *De pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteSIPTrunkResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/trunks/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteSIPTrunkResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_trunks/{id}", nil, nil, &result, pathParams) return res, err } @@ -696,7 +703,14 @@ func (c *VideoClient) UpdateSIPTrunk(ctx context.Context, id string, request *Up pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateSIPTrunkRequest, UpdateSIPTrunkResponse](c.client, ctx, "PUT", "/api/v2/video/sip/trunks/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateSIPTrunkRequest, UpdateSIPTrunkResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_trunks/{id}", nil, request, &result, pathParams) + return res, err +} + +// Resolve SIP inbound routing based on trunk number, caller number, and challenge authentication +func (c *VideoClient) ResolveSipInbound(ctx context.Context, request *ResolveSipInboundRequest) (*StreamResponse[ResolveSipInboundResponse], error) { + var result ResolveSipInboundResponse + res, err := MakeRequest[ResolveSipInboundRequest, ResolveSipInboundResponse](c.client, ctx, "POST", "/api/v2/video/sip/resolve", nil, request, &result, nil) return res, err } diff --git a/video_test.go b/video_test.go index 286f4da..12cdc11 100644 --- a/video_test.go +++ b/video_test.go @@ -149,6 +149,20 @@ func TestVideoListRecordings(t *testing.T) { _, err = client.Video().ListRecordings(context.Background(), "", "", &getstream.ListRecordingsRequest{}) require.NoError(t, err) } +func TestVideoStartRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartRecording(context.Background(), "", "", "", &getstream.StartRecordingRequest{}) + require.NoError(t, err) +} +func TestVideoStopRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopRecording(context.Background(), "", "", "", &getstream.StopRecordingRequest{}) + require.NoError(t, err) +} func TestVideoGetCallReport(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -184,6 +198,13 @@ func TestVideoStopRTMPBroadcast(t *testing.T) { _, err = client.Video().StopRTMPBroadcast(context.Background(), "", "", "", &getstream.StopRTMPBroadcastRequest{}) require.NoError(t, err) } +func TestVideoQueryCallParticipantSessions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallParticipantSessions(context.Background(), "", "", "", &getstream.QueryCallParticipantSessionsRequest{}) + require.NoError(t, err) +} func TestVideoStartHLSBroadcasting(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -205,13 +226,6 @@ func TestVideoStartFrameRecording(t *testing.T) { _, err = client.Video().StartFrameRecording(context.Background(), "", "", &getstream.StartFrameRecordingRequest{}) require.NoError(t, err) } -func TestVideoStartRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartRecording(context.Background(), "", "", &getstream.StartRecordingRequest{}) - require.NoError(t, err) -} func TestVideoStartTranscription(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -247,13 +261,6 @@ func TestVideoStopLive(t *testing.T) { _, err = client.Video().StopLive(context.Background(), "", "", &getstream.StopLiveRequest{}) require.NoError(t, err) } -func TestVideoStopRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopRecording(context.Background(), "", "", &getstream.StopRecordingRequest{}) - require.NoError(t, err) -} func TestVideoStopTranscription(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -380,13 +387,6 @@ func TestVideoGetEdges(t *testing.T) { _, err = client.Video().GetEdges(context.Background(), &getstream.GetEdgesRequest{}) require.NoError(t, err) } -func TestVideoResolveSipInbound(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ResolveSipInbound(context.Background(), &getstream.ResolveSipInboundRequest{}) - require.NoError(t, err) -} func TestVideoListSIPInboundRoutingRule(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -443,6 +443,13 @@ func TestVideoUpdateSIPTrunk(t *testing.T) { _, err = client.Video().UpdateSIPTrunk(context.Background(), "", &getstream.UpdateSIPTrunkRequest{}) require.NoError(t, err) } +func TestVideoResolveSipInbound(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ResolveSipInbound(context.Background(), &getstream.ResolveSipInboundRequest{}) + require.NoError(t, err) +} func TestVideoQueryAggregateCallStats(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err)