diff --git a/call.go b/call.go index 66c7bb0..7204074 100644 --- a/call.go +++ b/call.go @@ -1,8 +1,10 @@ // Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT. package getstream -import "context" -import "reflect" +import ( + "context" + "reflect" +) type Call struct { callType string diff --git a/chat.go b/chat.go index ba1626b..df75c4a 100644 --- a/chat.go +++ b/chat.go @@ -917,6 +917,7 @@ func (c *ChatClient) UnreadCountsBatch(ctx context.Context, request *UnreadCount // // Sends events: // - * +// - * func (c *ChatClient) SendUserCustomEvent(ctx context.Context, userID string, request *SendUserCustomEventRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ diff --git a/chat_test.go b/chat_test.go index d7d419f..d4bad7a 100644 --- a/chat_test.go +++ b/chat_test.go @@ -121,14 +121,6 @@ func TestChatDeleteChannelFile(t *testing.T) { _, err = client.Chat().DeleteChannelFile(context.Background(), "", "", &getstream.DeleteChannelFileRequest{}) require.NoError(t, err) } -func TestChatUploadChannelFile(t *testing.T) { - t.Skip("current test is wrong, autogenerated, skipping due to seperate integration test for upload") - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UploadChannelFile(context.Background(), "", "", &getstream.UploadChannelFileRequest{}) - require.NoError(t, err) -} func TestChatHideChannel(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -143,14 +135,6 @@ func TestChatDeleteChannelImage(t *testing.T) { _, err = client.Chat().DeleteChannelImage(context.Background(), "", "", &getstream.DeleteChannelImageRequest{}) require.NoError(t, err) } -func TestChatUploadChannelImage(t *testing.T) { - t.Skip("current test is wrong, autogenerated, skipping due to seperate integration test for upload") - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UploadChannelImage(context.Background(), "", "", &getstream.UploadChannelImageRequest{}) - require.NoError(t, err) -} func TestChatUpdateMemberPartial(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) diff --git a/client_test.go b/client_test.go index 2449a56..eac5239 100644 --- a/client_test.go +++ b/client_test.go @@ -69,35 +69,35 @@ func setup(t *testing.T, rm *ResourceManager, createCallType bool) (*Stream, *Ca }, } - notificationSettings := &NotificationSettings{ - Enabled: true, - CallNotification: EventNotificationSettings{ - APNS: APNS{ - Title: "{{ user.display_name }} invites you to a call", - Body: "", + notificationSettings := &NotificationSettingsRequest{ + Enabled: PtrTo(true), + CallNotification: &EventNotificationSettingsRequest{ + APNS: &APNSPayload{ + Title: PtrTo("{{ user.display_name }} invites you to a call"), + Body: PtrTo(""), }, - Enabled: true, + Enabled: PtrTo(true), }, - SessionStarted: EventNotificationSettings{ - APNS: APNS{ - Body: "", - Title: "{{ user.display_name }} invites you to a call", + SessionStarted: &EventNotificationSettingsRequest{ + APNS: &APNSPayload{ + Body: PtrTo(""), + Title: PtrTo("{{ user.display_name }} invites you to a call"), }, - Enabled: false, + Enabled: PtrTo(false), }, - CallLiveStarted: EventNotificationSettings{ - APNS: APNS{ - Body: "", - Title: "{{ user.display_name }} invites you to a call", + CallLiveStarted: &EventNotificationSettingsRequest{ + APNS: &APNSPayload{ + Body: PtrTo(""), + Title: PtrTo("{{ user.display_name }} invites you to a call"), }, - Enabled: false, + Enabled: PtrTo(false), }, - CallRing: EventNotificationSettings{ - APNS: APNS{ - Body: "", - Title: "{{ user.display_name }} invites you to a call", + CallRing: &EventNotificationSettingsRequest{ + APNS: &APNSPayload{ + Body: PtrTo(""), + Title: PtrTo("{{ user.display_name }} invites you to a call"), }, - Enabled: false, + Enabled: PtrTo(false), }, } diff --git a/common_test.go b/common_test.go index 5984509..6e6bc08 100644 --- a/common_test.go +++ b/common_test.go @@ -359,15 +359,6 @@ func TestCommonDeleteFile(t *testing.T) { _, err = client.DeleteFile(context.Background(), &getstream.DeleteFileRequest{}) require.NoError(t, err) } -func TestCommonUploadFile(t *testing.T) { - t.Skip("current test is wrong, autogenerated, skipping due to seperate integration test for upload") - - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UploadFile(context.Background(), &getstream.UploadFileRequest{}) - require.NoError(t, err) -} func TestCommonDeleteImage(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -375,14 +366,6 @@ func TestCommonDeleteImage(t *testing.T) { _, err = client.DeleteImage(context.Background(), &getstream.DeleteImageRequest{}) require.NoError(t, err) } -func TestCommonUploadImage(t *testing.T) { - t.Skip("current test is wrong, autogenerated, skipping due to seperate integration test for upload") - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UploadImage(context.Background(), &getstream.UploadImageRequest{}) - require.NoError(t, err) -} func TestCommonQueryUsers(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..8a77eeb 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 } @@ -783,13 +790,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..3b3ab3d 100644 --- a/models.go +++ b/models.go @@ -115,6 +115,20 @@ type APNS struct { Data map[string]any `json:"data,omitempty"` } +type APNSPayload struct { + Body *string `json:"body,omitempty"` + + ContentAvailable *int `json:"content-available,omitempty"` + + MutableContent *int `json:"mutable-content,omitempty"` + + Sound *string `json:"sound,omitempty"` + + Title *string `json:"title,omitempty"` + + Data map[string]any `json:"data,omitempty"` +} + type AWSRekognitionRule struct { Action string `json:"action"` @@ -384,28 +398,6 @@ func (*ActivityMarkEvent) GetEventType() string { return "feeds.activity.marked" } -type ActivityMarkedEvent struct { - AllRead bool `json:"all_read"` - - AllSeen bool `json:"all_seen"` - - CreatedAt Timestamp `json:"created_at"` - - FeedID string `json:"feed_id"` - - UserID string `json:"user_id"` - - Type string `json:"type"` - - MarkedRead []string `json:"marked_read,omitempty"` - - MarkedWatched []string `json:"marked_watched,omitempty"` -} - -func (*ActivityMarkedEvent) GetEventType() string { - return "activity.marked" -} - type ActivityPinResponse struct { // When the pin was created CreatedAt Timestamp `json:"created_at"` @@ -665,7 +657,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 @@ -753,6 +745,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 +767,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. @@ -929,16 +926,6 @@ type AggregationConfig struct { Format *string `json:"format,omitempty"` } -type AnyEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` -} - -func (*AnyEvent) GetEventType() string { - return "*" -} - type AppResponseFields struct { AllowMultiUserDevices bool `json:"allow_multi_user_devices"` @@ -1108,7 +1095,7 @@ type AsyncExportErrorEvent struct { } func (*AsyncExportErrorEvent) GetEventType() string { - return "export.channels.error" + return "export.users.error" } type AsyncExportModerationLogsEvent struct { @@ -1269,14 +1256,14 @@ type AudioSettingsResponse struct { NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` } -type AutomodDetails struct { +type AutomodDetailsResponse struct { Action *string `json:"action,omitempty"` OriginalMessageType *string `json:"original_message_type,omitempty"` ImageLabels []string `json:"image_labels,omitempty"` - MessageDetails *FlagMessageDetails `json:"message_details,omitempty"` + MessageDetails *FlagMessageDetailsResponse `json:"message_details,omitempty"` Result *MessageModerationResult `json:"result,omitempty"` } @@ -1354,34 +1341,44 @@ type BackstageSettingsResponse struct { JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` } -type Ban struct { - CreatedAt Timestamp `json:"created_at"` +// Configuration for ban moderation action +type BanActionRequestPayload struct { + // Ban only from specific channel + ChannelBanOnly *bool `json:"channel_ban_only,omitempty"` - Shadow bool `json:"shadow"` + // Message deletion mode: soft, pruning, or hard + DeleteMessages *string `json:"delete_messages,omitempty"` - Expires *Timestamp `json:"expires,omitempty"` + // Whether to ban by IP address + IpBan *bool `json:"ip_ban,omitempty"` + // Reason for the ban Reason *string `json:"reason,omitempty"` - Channel *Channel `json:"channel,omitempty"` - - CreatedBy *User `json:"created_by,omitempty"` + // Whether this is a shadow ban + Shadow *bool `json:"shadow,omitempty"` - Target *User `json:"target,omitempty"` + // Duration of ban in minutes + Timeout *int `json:"timeout,omitempty"` } -type BanActionRequest struct { - ChannelBanOnly *bool `json:"channel_ban_only,omitempty"` - - DeleteMessages *string `json:"delete_messages,omitempty"` +// Ban information +type BanInfoResponse struct { + // When the ban was created + CreatedAt Timestamp `json:"created_at"` - IpBan *bool `json:"ip_ban,omitempty"` + // When the ban expires + Expires *Timestamp `json:"expires,omitempty"` + // Reason for the ban Reason *string `json:"reason,omitempty"` + // Whether this is a shadow ban Shadow *bool `json:"shadow,omitempty"` - Timeout *int `json:"timeout,omitempty"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + + User *UserResponse `json:"user,omitempty"` } type BanOptions struct { @@ -1412,7 +1409,9 @@ type BanResponse struct { User *UserResponse `json:"user,omitempty"` } -type BlockActionRequest struct { +// Configuration for block action +type BlockActionRequestPayload struct { + // Reason for blocking Reason *string `json:"reason,omitempty"` } @@ -3023,7 +3022,7 @@ type CallTypeResponse struct { // the permissions granted to each role Grants map[string][]string `json:"grants"` - NotificationSettings NotificationSettings `json:"notification_settings"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` Settings CallSettingsResponse `json:"settings"` @@ -3241,63 +3240,7 @@ type CampaignStatsResponse struct { StatsUsersSent int `json:"stats_users_sent"` } -type Channel struct { - AutoTranslationLanguage string `json:"auto_translation_language"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Disabled bool `json:"disabled"` - - Frozen bool `json:"frozen"` - - ID string `json:"id"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - Custom map[string]any `json:"custom"` - - AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` - - Cooldown *int `json:"cooldown,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - LastCampaigns *string `json:"last_campaigns,omitempty"` - - LastMessageAt *Timestamp `json:"last_message_at,omitempty"` - - MemberCount *int `json:"member_count,omitempty"` - - MessageCount *int `json:"message_count,omitempty"` - - MessageCountUpdatedAt *Timestamp `json:"message_count_updated_at,omitempty"` - - Team *string `json:"team,omitempty"` - - ActiveLiveLocations []SharedLocation `json:"active_live_locations,omitempty"` - - FilterTags []string `json:"filter_tags,omitempty"` - - Invites []ChannelMember `json:"invites,omitempty"` - - Members []ChannelMember `json:"members,omitempty"` - - Config *ChannelConfig `json:"config,omitempty"` - - ConfigOverrides *ConfigOverrides `json:"config_overrides,omitempty"` - - CreatedBy *User `json:"created_by,omitempty"` - - MembersLookup map[string]*ChannelMemberLookup `json:"members_lookup,omitempty"` - - 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 +3264,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 +3292,7 @@ type ChannelBatchUpdatedStartedEvent struct { ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*ChannelBatchUpdatedStartedEvent) GetEventType() string { +func (*ChannelBatchStartedEvent) GetEventType() string { return "channel_batch_update.started" } @@ -3496,32 +3439,80 @@ type ChannelConfigWithInfo struct { Grants map[string][]string `json:"grants,omitempty"` } +// Emitted when a channel is successfully created. type ChannelCreatedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + + Custom map[string]any `json:"custom"` + + // The type of event: "channel.created" in this case Type string `json:"type"` + + // The ID of the channel which was created + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel which was created + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was created + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelCreatedEvent) GetEventType() string { return "channel.created" } +// Emitted when a channel is successfully deleted. type ChannelDeletedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelMemberCount int `json:"channel_member_count"` + Channel ChannelResponse `json:"channel"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + // The type of event: "channel.deleted" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was deleted + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + // The type of the channel which was deleted + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was deleted + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - Channel *ChannelResponse `json:"channel,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelDeletedEvent) GetEventType() string { @@ -3544,16 +3535,26 @@ type ChannelExport struct { Type *string `json:"type,omitempty"` } +// Emitted when a channel is successfully frozen. type ChannelFrozenEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + // The type of event: "channel.frozen" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was frozen + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The type of the channel which was frozen + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was frozen + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (*ChannelFrozenEvent) GetEventType() string { @@ -3578,24 +3579,43 @@ type ChannelGetOrCreateRequest struct { Watchers *PaginationParams `json:"watchers,omitempty"` } +// Emitted when a channel is successfully hidden. type ChannelHiddenEvent struct { - ChannelID string `json:"channel_id"` + // Whether the history was cleared + ClearHistory bool `json:"clear_history"` - ChannelMemberCount int `json:"channel_member_count"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Channel ChannelResponse `json:"channel"` - Cid string `json:"cid"` + Custom map[string]any `json:"custom"` - ClearHistory bool `json:"clear_history"` + // The type of event: "channel.hidden" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was hidden + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` - Channel *ChannelResponse `json:"channel,omitempty"` + ChannelMessageCount *int `json:"channel_message_count,omitempty"` - User *User `json:"user,omitempty"` + // The type of the channel which was hidden + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was hidden + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelHiddenEvent) GetEventType() string { @@ -3645,81 +3665,15 @@ type ChannelInputRequest struct { Team *string `json:"team,omitempty"` - Invites []ChannelMember `json:"invites,omitempty"` - - Members []ChannelMember `json:"members,omitempty"` - - ConfigOverrides *ConfigOverrides `json:"config_overrides,omitempty"` - - CreatedBy *User `json:"created_by,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` -} - -type ChannelMember struct { - ArchivedAt *Timestamp `json:"archived_at,omitempty"` - - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - Banned *bool `json:"banned,omitempty"` - - Blocked *bool `json:"blocked,omitempty"` - - ChannelRole *string `json:"channel_role,omitempty"` - - CreatedAt *Timestamp `json:"created_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Hidden *bool `json:"hidden,omitempty"` - - InviteAcceptedAt *Timestamp `json:"invite_accepted_at,omitempty"` - - InviteRejectedAt *Timestamp `json:"invite_rejected_at,omitempty"` - - Invited *bool `json:"invited,omitempty"` - - IsGlobalBanned *bool `json:"is_global_banned,omitempty"` - - IsModerator *bool `json:"is_moderator,omitempty"` - - NotificationsMuted *bool `json:"notifications_muted,omitempty"` - - PinnedAt *Timestamp `json:"pinned_at,omitempty"` - - ShadowBanned *bool `json:"shadow_banned,omitempty"` - - Status *string `json:"status,omitempty"` - - UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Invites []ChannelMemberRequest `json:"invites,omitempty"` - UserID *string `json:"user_id,omitempty"` + Members []ChannelMemberRequest `json:"members,omitempty"` - DeletedMessages []string `json:"deleted_messages,omitempty"` + ConfigOverrides *ConfigOverridesRequest `json:"config_overrides,omitempty"` - Channel *DenormalizedChannelFields `json:"channel,omitempty"` + CreatedBy *UserRequest `json:"created_by,omitempty"` Custom map[string]any `json:"custom,omitempty"` - - User *User `json:"user,omitempty"` -} - -type ChannelMemberLookup struct { - Archived bool `json:"archived"` - - Banned bool `json:"banned"` - - Blocked bool `json:"blocked"` - - Hidden bool `json:"hidden"` - - Pinned bool `json:"pinned"` - - ArchivedAt *Timestamp `json:"archived_at,omitempty"` - - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - PinnedAt *Timestamp `json:"pinned_at,omitempty"` } type ChannelMemberRequest struct { @@ -3786,10 +3740,12 @@ type ChannelMemberResponse struct { User *UserResponse `json:"user,omitempty"` } -type ChannelMessages struct { - Messages []Message `json:"messages"` +// Response containing channel and its messages +type ChannelMessagesResponse struct { + // List of messages + Messages []MessageResponse `json:"messages"` - Channel *ChannelResponse `json:"channel,omitempty"` + Channel ChannelResponse `json:"channel"` } type ChannelMute struct { @@ -3807,10 +3763,24 @@ type ChannelMute struct { User *UserResponse `json:"user,omitempty"` } +// Emitted when a channel is successfully muted. type ChannelMutedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + + // The type of event: "channel.muted" in this case Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The mute objects + Mutes []ChannelMute `json:"mutes,omitempty"` + + Mute *ChannelMute `json:"mute,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelMutedEvent) GetEventType() string { @@ -3863,12 +3833,6 @@ func (c ChannelOwnCapability) String() string { return string(c) } -type ChannelPushPreferences struct { - ChatLevel *string `json:"chat_level,omitempty"` - - DisabledUntil *Timestamp `json:"disabled_until,omitempty"` -} - type ChannelPushPreferencesResponse struct { ChatLevel *string `json:"chat_level,omitempty"` @@ -4034,20 +3998,44 @@ type ChannelStateResponseFields struct { PushPreferences *ChannelPushPreferencesResponse `json:"push_preferences,omitempty"` } +// Emitted when a channel is successfully truncated. type ChannelTruncatedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelMemberCount int `json:"channel_member_count"` + Channel ChannelResponse `json:"channel"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + // The type of event: "channel.truncated" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was truncated + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` - Channel *ChannelResponse `json:"channel,omitempty"` + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel which was truncated + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was truncated + Cid *string `json:"cid,omitempty"` + + MessageID *string `json:"message_id,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + Message *MessageResponse `json:"message,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelTruncatedEvent) GetEventType() string { @@ -4128,70 +4116,134 @@ type ChannelTypeConfig struct { AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` } +// Emitted when a channel is successfully unfrozen. type ChannelUnFrozenEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + // The type of event: "channel.unfrozen" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was unfrozen + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The type of the channel which was unfrozen + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was unfrozen + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (*ChannelUnFrozenEvent) GetEventType() string { return "channel.unfrozen" } +// Emitted when a channel is successfully unmuted. type ChannelUnmutedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + + // The type of event: "channel.unmuted" in this case Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The mute objects + Mutes []ChannelMute `json:"mutes,omitempty"` + + Mute *ChannelMute `json:"mute,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelUnmutedEvent) GetEventType() string { return "channel.unmuted" } +// Emitted when a channel is successfully updated. type ChannelUpdatedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelMemberCount int `json:"channel_member_count"` + Channel ChannelResponse `json:"channel"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + // The type of event: "channel.updated" in this case + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + // The ID of the channel which was updated + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel which was updated + ChannelType *string `json:"channel_type,omitempty"` + // The CID of the channel which was updated + Cid *string `json:"cid,omitempty"` + + MessageID *string `json:"message_id,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - Channel *ChannelResponse `json:"channel,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - Message *Message `json:"message,omitempty"` + Message *MessageResponse `json:"message,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelUpdatedEvent) GetEventType() string { return "channel.updated" } +// Emitted when a channel is successfully shown. type ChannelVisibleEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - Cid string `json:"cid"` + Channel ChannelResponse `json:"channel"` - CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.visible" in this case Type string `json:"type"` - User *User `json:"user,omitempty"` + // The ID of the channel which was shown + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel which was shown + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel which was shown + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ChannelVisibleEvent) GetEventType() string { @@ -4521,7 +4573,7 @@ type CommentResponse struct { // Score of the comment based on reactions Score int `json:"score"` - // Status of the comment (e.g., active, deleted) + // Status of the comment Status string `json:"status"` // When the comment was last updated @@ -4550,6 +4602,7 @@ type CommentResponse struct { // Text content of the comment Text *string `json:"text,omitempty"` + // Attachments associated with the comment Attachments []Attachment `json:"attachments,omitempty"` // Recent reactions to the comment @@ -4589,33 +4642,48 @@ func (*CommentUpdatedEvent) GetEventType() string { return "feeds.comment.updated" } -type ConfigOverrides struct { +// Channel configuration overrides +type ConfigOverridesRequest struct { + // Blocklist name Blocklist *string `json:"blocklist,omitempty"` + // Blocklist behavior (flag or block) BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + // Enable/disable message counting CountMessages *bool `json:"count_messages,omitempty"` + // Maximum message length MaxMessageLength *int `json:"max_message_length,omitempty"` + // Enable/disable quotes Quotes *bool `json:"quotes,omitempty"` + // Enable/disable reactions Reactions *bool `json:"reactions,omitempty"` + // Enable/disable replies Replies *bool `json:"replies,omitempty"` + // Enable/disable shared locations SharedLocations *bool `json:"shared_locations,omitempty"` + // Enable/disable typing events TypingEvents *bool `json:"typing_events,omitempty"` + // Enable/disable uploads Uploads *bool `json:"uploads,omitempty"` + // Enable/disable URL enrichment UrlEnrichment *bool `json:"url_enrichment,omitempty"` + // Enable/disable user message reminders UserMessageReminders *bool `json:"user_message_reminders,omitempty"` + // List of available commands Commands []string `json:"commands,omitempty"` + // Permission grants modifiers Grants map[string][]string `json:"grants,omitempty"` } @@ -4664,9 +4732,12 @@ type ContentCountRuleParameters struct { TimeWindow *string `json:"time_window,omitempty"` } -type Coordinates struct { +// Geographic coordinates +type CoordinatesResponse struct { + // Latitude coordinate Latitude float64 `json:"latitude"` + // Longitude coordinate Longitude float64 `json:"longitude"` } @@ -4700,7 +4771,7 @@ type CreateCallTypeResponse struct { // the permissions granted to each role Grants map[string][]string `json:"grants"` - NotificationSettings NotificationSettings `json:"notification_settings"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` Settings CallSettingsResponse `json:"settings"` @@ -4871,9 +4942,12 @@ type CreateSIPTrunkResponse struct { SipTrunk *SIPTrunkResponse `json:"sip_trunk,omitempty"` } -type CustomActionRequest struct { +// Configuration for custom moderation action +type CustomActionRequestPayload struct { + // Custom action identifier ID *string `json:"id,omitempty"` + // Custom action options Options map[string]any `json:"options,omitempty"` } @@ -4903,6 +4977,20 @@ type CustomCheckResponse struct { Item *ReviewQueueItemResponse `json:"item,omitempty"` } +type CustomEvent struct { + CreatedAt Timestamp `json:"created_at"` + + Custom map[string]any `json:"custom"` + + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} + +func (*CustomEvent) GetEventType() string { + return "*" +} + // A custom event, this event is used to send custom events to other participants in the call. type CustomVideoEvent struct { CallCid string `json:"call_cid"` @@ -5036,6 +5124,15 @@ type DeleteActivityReactionResponse struct { Reaction FeedsReactionResponse `json:"reaction"` } +// Configuration for activity deletion action +type DeleteActivityRequestPayload struct { + // Whether to permanently delete the activity + HardDelete *bool `json:"hard_delete,omitempty"` + + // Reason for deletion + Reason *string `json:"reason,omitempty"` +} + type DeleteActivityResponse struct { Duration string `json:"duration"` } @@ -5102,6 +5199,15 @@ type DeleteCommentReactionResponse struct { Reaction FeedsReactionResponse `json:"reaction"` } +// Configuration for comment deletion action +type DeleteCommentRequestPayload struct { + // Whether to permanently delete the comment + HardDelete *bool `json:"hard_delete,omitempty"` + + // Reason for deletion + Reason *string `json:"reason,omitempty"` +} + type DeleteCommentResponse struct { Duration string `json:"duration"` @@ -5131,23 +5237,30 @@ 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"` - - // Number of comments that were deleted - DeletedComments int `json:"deleted_comments"` + Duration string `json:"duration"` - // Number of reactions that were deleted - DeletedReactions int `json:"deleted_reactions"` + // The task ID for the deletion task + TaskID string `json:"task_id"` +} +type DeleteFeedViewResponse struct { Duration string `json:"duration"` } -type DeleteFeedViewResponse struct { +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"` +} + +// Configuration for message deletion action +type DeleteMessageRequestPayload struct { + // Whether to permanently delete the message + HardDelete *bool `json:"hard_delete,omitempty"` + + // Reason for deletion + Reason *string `json:"reason,omitempty"` } // Basic response information @@ -5172,6 +5285,15 @@ type DeleteModerationTemplateResponse struct { Duration string `json:"duration"` } +// Configuration for reaction deletion action +type DeleteReactionRequestPayload struct { + // Whether to permanently delete the reaction + HardDelete *bool `json:"hard_delete,omitempty"` + + // Reason for deletion + Reason *string `json:"reason,omitempty"` +} + // Basic response information type DeleteReactionResponse struct { // Duration of the request in milliseconds @@ -5210,15 +5332,21 @@ type DeleteTranscriptionResponse struct { Duration string `json:"duration"` } -type DeleteUserRequest struct { +// Configuration for user deletion action +type DeleteUserRequestPayload struct { + // Also delete all user conversations DeleteConversationChannels *bool `json:"delete_conversation_channels,omitempty"` + // Delete flagged feeds content DeleteFeedsContent *bool `json:"delete_feeds_content,omitempty"` + // Whether to permanently delete the user HardDelete *bool `json:"hard_delete,omitempty"` + // Also delete all user messages MarkMessagesDeleted *bool `json:"mark_messages_deleted,omitempty"` + // Reason for deletion Reason *string `json:"reason,omitempty"` } @@ -5236,56 +5364,10 @@ type DeliveredMessagePayload struct { ID *string `json:"id,omitempty"` } -type DeliveryReceipts struct { - Enabled *bool `json:"enabled,omitempty"` -} - type DeliveryReceiptsResponse struct { Enabled *bool `json:"enabled,omitempty"` } -type DenormalizedChannelFields struct { - CreatedAt *string `json:"created_at,omitempty"` - - CreatedByID *string `json:"created_by_id,omitempty"` - - Disabled *bool `json:"disabled,omitempty"` - - Frozen *bool `json:"frozen,omitempty"` - - ID *string `json:"id,omitempty"` - - LastMessageAt *string `json:"last_message_at,omitempty"` - - MemberCount *int `json:"member_count,omitempty"` - - Team *string `json:"team,omitempty"` - - UpdatedAt *string `json:"updated_at,omitempty"` - - Type *string `json:"type,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` -} - -type Device struct { - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - PushProvider string `json:"push_provider"` - - UserID string `json:"user_id"` - - Disabled *bool `json:"disabled,omitempty"` - - DisabledReason *string `json:"disabled_reason,omitempty"` - - PushProviderName *string `json:"push_provider_name,omitempty"` - - Voip *bool `json:"voip,omitempty"` -} - type DeviceDataResponse struct { Name *string `json:"name,omitempty"` @@ -5327,31 +5409,43 @@ type DeviceResponse struct { Voip *bool `json:"voip,omitempty"` } +// Contains the draft message content type DraftPayloadResponse struct { + // Message ID is unique string identifier of the message ID string `json:"id"` + // Text of the message Text string `json:"text"` Custom map[string]any `json:"custom"` + // Contains HTML markup of the message Html *string `json:"html,omitempty"` + // MML content of the message Mml *string `json:"mml,omitempty"` + // ID of parent message (thread) ParentID *string `json:"parent_id,omitempty"` + // Identifier of the poll to include in the message PollID *string `json:"poll_id,omitempty"` QuotedMessageID *string `json:"quoted_message_id,omitempty"` + // Whether thread reply should be shown in the channel as well ShowInChannel *bool `json:"show_in_channel,omitempty"` + // Whether message is silent or not Silent *bool `json:"silent,omitempty"` + // Contains type of the message Type *string `json:"type,omitempty"` + // Array of message attachments Attachments []Attachment `json:"attachments,omitempty"` + // List of mentioned users MentionedUsers []UserResponse `json:"mentioned_users,omitempty"` } @@ -5661,6 +5755,22 @@ type EventNotificationSettings struct { Fcm FCM `json:"fcm"` } +type EventNotificationSettingsRequest struct { + Enabled *bool `json:"enabled,omitempty"` + + APNS *APNSPayload `json:"apns,omitempty"` + + Fcm *FCMPayload `json:"fcm,omitempty"` +} + +type EventNotificationSettingsResponse struct { + Enabled bool `json:"enabled"` + + APNS APNSPayload `json:"apns"` + + Fcm FCMPayload `json:"fcm"` +} + type EventRequest struct { Type string `json:"type"` @@ -5732,6 +5842,10 @@ type FCM struct { Data map[string]any `json:"data,omitempty"` } +type FCMPayload struct { + Data map[string]any `json:"data,omitempty"` +} + type FailedChannelUpdates struct { Reason string `json:"reason"` @@ -6077,6 +6191,16 @@ 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 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 +6231,8 @@ type FeedRequest struct { } type FeedResponse struct { + ActivityCount int `json:"activity_count"` + // When the feed was created CreatedAt Timestamp `json:"created_at"` @@ -6164,6 +6290,8 @@ type FeedResponse struct { } type FeedSuggestionResponse struct { + ActivityCount int `json:"activity_count"` + // When the feed was created CreatedAt Timestamp `json:"created_at"` @@ -6276,9 +6404,12 @@ type FeedVisibilityResponse struct { Grants map[string][]string `json:"grants"` } -type FeedsModerationTemplateConfig struct { +// Configuration for a feeds moderation template +type FeedsModerationTemplateConfigPayload struct { + // Key of the moderation configuration to use ConfigKey string `json:"config_key"` + // Map of data type names to their content types DataTypes map[string]string `json:"data_types"` } @@ -6310,6 +6441,8 @@ type FeedsPreferencesResponse struct { CommentReaction *string `json:"comment_reaction,omitempty"` + CommentReply *string `json:"comment_reply,omitempty"` + Follow *string `json:"follow,omitempty"` Mention *string `json:"mention,omitempty"` @@ -6413,65 +6546,28 @@ type FirebaseConfigFields struct { ServerKey *string `json:"server_key,omitempty"` } -// Contains information about flagged user or message -type Flag struct { - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` +type FlagCountRuleParameters struct { + Threshold *int `json:"threshold,omitempty"` +} - CreatedByAutomod bool `json:"created_by_automod"` +type FlagDetailsResponse struct { + OriginalText string `json:"original_text"` - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` + Automod *AutomodDetailsResponse `json:"automod,omitempty"` - // Date of the approval - ApprovedAt *Timestamp `json:"approved_at,omitempty"` + Extra map[string]any `json:"extra,omitempty"` +} - Reason *string `json:"reason,omitempty"` +type FlagFeedbackResponse struct { + CreatedAt Timestamp `json:"created_at"` - // Date of the rejection - RejectedAt *Timestamp `json:"rejected_at,omitempty"` + MessageID string `json:"message_id"` - // Date of the review - ReviewedAt *Timestamp `json:"reviewed_at,omitempty"` + Labels []LabelResponse `json:"labels"` +} - ReviewedBy *string `json:"reviewed_by,omitempty"` - - // ID of flagged message - TargetMessageID *string `json:"target_message_id,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - Details *FlagDetails `json:"details,omitempty"` - - TargetMessage *Message `json:"target_message,omitempty"` - - TargetUser *User `json:"target_user,omitempty"` - - User *User `json:"user,omitempty"` -} - -type FlagCountRuleParameters struct { - Threshold *int `json:"threshold,omitempty"` -} - -type FlagDetails struct { - OriginalText string `json:"original_text"` - - Extra map[string]any `json:"Extra"` - - Automod *AutomodDetails `json:"automod,omitempty"` -} - -type FlagFeedback struct { - CreatedAt Timestamp `json:"created_at"` - - MessageID string `json:"message_id"` - - Labels []Label `json:"labels"` -} - -type FlagMessageDetails struct { - PinChanged *bool `json:"pin_changed,omitempty"` +type FlagMessageDetailsResponse struct { + PinChanged *bool `json:"pin_changed,omitempty"` ShouldEnrich *bool `json:"should_enrich,omitempty"` @@ -6514,7 +6610,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"` } @@ -6842,7 +6941,7 @@ type GetCallTypeResponse struct { Grants map[string][]string `json:"grants"` - NotificationSettings NotificationSettings `json:"notification_settings"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` Settings CallSettingsResponse `json:"settings"` @@ -7214,7 +7313,7 @@ type GetPushTemplatesResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - Templates []PushTemplate `json:"templates"` + Templates []PushTemplateResponse `json:"templates"` } type GetRateLimitsResponse struct { @@ -7650,7 +7749,7 @@ type LLMRule struct { SeverityRules []BodyguardSeverityRule `json:"severity_rules,omitempty"` } -type Label struct { +type LabelResponse struct { Name string `json:"name"` HarmLabels []string `json:"harm_labels,omitempty"` @@ -7872,11 +7971,15 @@ type ListTranscriptionsResponse struct { Transcriptions []CallTranscription `json:"transcriptions"` } -type Location struct { +// Geographic location metadata +type LocationResponse struct { + // Continent code ContinentCode string `json:"continent_code"` + // Country ISO code CountryIsoCode string `json:"country_iso_code"` + // Subdivision ISO code SubdivisionIsoCode string `json:"subdivision_iso_code"` } @@ -7893,48 +7996,109 @@ type MarkReadResponse struct { Event *MessageReadEvent `json:"event,omitempty"` } -type MarkReviewedRequest struct { +// Configuration for mark reviewed action +type MarkReviewedRequestPayload struct { + // Maximum content items to mark as reviewed ContentToMarkAsReviewedLimit *int `json:"content_to_mark_as_reviewed_limit,omitempty"` + // Skip marking content as reviewed DisableMarkingContentAsReviewed *bool `json:"disable_marking_content_as_reviewed,omitempty"` } -type MemberAddedEvent struct { - ChannelID string `json:"channel_id"` +type MaxStreakChangedEvent struct { + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + Type string `json:"type"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} + +func (*MaxStreakChangedEvent) GetEventType() string { + return "channel.max_streak_changed" +} +// Emitted when a member is added to a channel. +type MemberAddedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + + Custom map[string]any `json:"custom"` + + Member ChannelMemberResponse `json:"member"` + + // The type of event: "member.added" in this case Type string `json:"type"` + // The ID of the channel to which the member was added + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel to which the member was added + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel to which the member was added + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - Member *ChannelMember `json:"member,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MemberAddedEvent) GetEventType() string { return "member.added" } +// Emitted when a member is removed from a channel. type MemberRemovedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Channel ChannelResponse `json:"channel"` - Cid string `json:"cid"` + Custom map[string]any `json:"custom"` - CreatedAt Timestamp `json:"created_at"` + Member ChannelMemberResponse `json:"member"` + // The type of event: "member.removed" in this case Type string `json:"type"` - Member *ChannelMember `json:"member,omitempty"` + // The ID of the channel from which the member was removed + ChannelID *string `json:"channel_id,omitempty"` - User *User `json:"user,omitempty"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel from which the member was removed + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel from which the member was removed + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MemberRemovedEvent) GetEventType() string { @@ -7972,22 +8136,43 @@ type MemberResponse struct { Role *string `json:"role,omitempty"` } +// Emitted when a member is updated in a channel. type MemberUpdatedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Channel ChannelResponse `json:"channel"` - Cid string `json:"cid"` + Custom map[string]any `json:"custom"` - CreatedAt Timestamp `json:"created_at"` + Member ChannelMemberResponse `json:"member"` + // The type of event: "member.updated" in this case Type string `json:"type"` + // The ID of the channel in which the member was updated + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel in which the member was updated + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel in which the member was updated + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - Member *ChannelMember `json:"member,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MemberUpdatedEvent) GetEventType() string { @@ -8028,96 +8213,6 @@ type MembershipLevelResponse struct { Custom map[string]any `json:"custom,omitempty"` } -type Message struct { - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - DeletedReplyCount int `json:"deleted_reply_count"` - - Html string `json:"html"` - - ID string `json:"id"` - - Pinned bool `json:"pinned"` - - ReplyCount int `json:"reply_count"` - - Shadowed bool `json:"shadowed"` - - Silent bool `json:"silent"` - - Text string `json:"text"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - Attachments []Attachment `json:"attachments"` - - LatestReactions []Reaction `json:"latest_reactions"` - - MentionedUsers []User `json:"mentioned_users"` - - OwnReactions []Reaction `json:"own_reactions"` - - RestrictedVisibility []string `json:"restricted_visibility"` - - Custom map[string]any `json:"custom"` - - ReactionCounts map[string]int `json:"reaction_counts"` - - ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups"` - - ReactionScores map[string]int `json:"reaction_scores"` - - BeforeMessageSendFailed *bool `json:"before_message_send_failed,omitempty"` - - Command *string `json:"command,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - DeletedForMe *bool `json:"deleted_for_me,omitempty"` - - MessageTextUpdatedAt *Timestamp `json:"message_text_updated_at,omitempty"` - - Mml *string `json:"mml,omitempty"` - - ParentID *string `json:"parent_id,omitempty"` - - PinExpires *Timestamp `json:"pin_expires,omitempty"` - - PinnedAt *Timestamp `json:"pinned_at,omitempty"` - - PollID *string `json:"poll_id,omitempty"` - - QuotedMessageID *string `json:"quoted_message_id,omitempty"` - - ShowInChannel *bool `json:"show_in_channel,omitempty"` - - ThreadParticipants []User `json:"thread_participants,omitempty"` - - I18n map[string]string `json:"i18n,omitempty"` - - ImageLabels map[string][]string `json:"image_labels,omitempty"` - - Member *ChannelMember `json:"member,omitempty"` - - Moderation *ModerationV2Response `json:"moderation,omitempty"` - - PinnedBy *User `json:"pinned_by,omitempty"` - - Poll *Poll `json:"poll,omitempty"` - - QuotedMessage *Message `json:"quoted_message,omitempty"` - - Reminder *MessageReminder `json:"reminder,omitempty"` - - SharedLocation *SharedLocation `json:"shared_location,omitempty"` - - User *User `json:"user,omitempty"` -} - type MessageActionRequest struct { // ReadOnlyData to execute command with FormData map[string]string `json:"form_data"` @@ -8147,28 +8242,49 @@ type MessageChangeSet struct { Text bool `json:"text"` } +// Emitted when a message is deleted. type MessageDeletedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + // Whether the message was hard deleted + HardDelete bool `json:"hard_delete"` - Cid string `json:"cid"` + MessageID string `json:"message_id"` - CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` - HardDelete bool `json:"hard_delete"` + Message MessageResponse `json:"message"` + // The type of event: "message.deleted" in this case Type string `json:"type"` + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` + + // Whether the message was deleted only for the current user DeletedForMe *bool `json:"deleted_for_me,omitempty"` - Team *string `json:"team,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The team ID + Team *string `json:"team,omitempty"` - Message *Message `json:"message,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MessageDeletedEvent) GetEventType() string { @@ -8192,11 +8308,11 @@ type MessageFlagResponse struct { Custom map[string]any `json:"custom,omitempty"` - Details *FlagDetails `json:"details,omitempty"` + Details *FlagDetailsResponse `json:"details,omitempty"` - Message *Message `json:"message,omitempty"` + Message *MessageResponse `json:"message,omitempty"` - ModerationFeedback *FlagFeedback `json:"moderation_feedback,omitempty"` + ModerationFeedback *FlagFeedbackResponse `json:"moderation_feedback,omitempty"` ModerationResult *MessageModerationResult `json:"moderation_result,omitempty"` @@ -8205,20 +8321,54 @@ type MessageFlagResponse struct { User *UserResponse `json:"user,omitempty"` } +// This event is sent when a message gets flagged. The event contains information about the message that was flagged. type MessageFlaggedEvent struct { - Cid string `json:"cid"` - + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + + Message MessageResponse `json:"message"` + + // The type of event: "message.flagged" in this case Type string `json:"type"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` - Flag *Flag `json:"flag,omitempty"` + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` - Message *Message `json:"message,omitempty"` + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` - User *User `json:"user,omitempty"` + // The reason for the flag + Reason *string `json:"reason,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + // The total number of flags for the user + TotalFlags *int `json:"total_flags,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + // Custom data + Custom map[string]any `json:"custom,omitempty"` + + Details *MessageModerationResult `json:"details,omitempty"` + + Flag *FlagResponse `json:"flag,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MessageFlaggedEvent) GetEventType() string { @@ -8275,26 +8425,61 @@ type MessageModerationResult struct { ModerationThresholds *Thresholds `json:"moderation_thresholds,omitempty"` } +// Emitted when a message was successfully sent or when a message became visible after command execution. type MessageNewEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + MessageID string `json:"message_id"` - Cid string `json:"cid"` + // The number of watchers + WatcherCount int `json:"watcher_count"` - CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` - WatcherCount int `json:"watcher_count"` + Message MessageResponse `json:"message"` + // The type of event: "message.new" in this case Type string `json:"type"` + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` + + // The author of the parent message + ParentAuthor *string `json:"parent_author,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + TotalUnreadCount *int `json:"total_unread_count,omitempty"` - Message *Message `json:"message,omitempty"` + UnreadChannels *int `json:"unread_channels,omitempty"` - User *User `json:"user,omitempty"` + // The number of unread messages + UnreadCount *int `json:"unread_count,omitempty"` + + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` + + Channel *ChannelResponse `json:"channel,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MessageNewEvent) GetEventType() string { @@ -8364,61 +8549,55 @@ type MessageReadEvent struct { User *UserResponseCommonFields `json:"user,omitempty"` } -type MessageReminder struct { - ChannelCid string `json:"channel_cid"` - - CreatedAt Timestamp `json:"created_at"` - - MessageID string `json:"message_id"` - - TaskID string `json:"task_id"` - - UpdatedAt Timestamp `json:"updated_at"` - - UserID string `json:"user_id"` - - RemindAt *Timestamp `json:"remind_at,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,omitempty"` -} - +// Message data for creating or updating a message type MessageRequest struct { + // Contains HTML markup of the message. Can only be set when using server-side API Html *string `json:"html,omitempty"` + // Message ID is unique string identifier of the message ID *string `json:"id,omitempty"` + // Should be empty if `text` is provided. Can only be set when using server-side API Mml *string `json:"mml,omitempty"` + // ID of parent message (thread) ParentID *string `json:"parent_id,omitempty"` + // Date when pinned message expires PinExpires *Timestamp `json:"pin_expires,omitempty"` + // Whether message is pinned or not Pinned *bool `json:"pinned,omitempty"` + // Date when message got pinned PinnedAt *Timestamp `json:"pinned_at,omitempty"` + // Identifier of the poll to include in the message PollID *string `json:"poll_id,omitempty"` QuotedMessageID *string `json:"quoted_message_id,omitempty"` + // Whether thread reply should be shown in the channel as well ShowInChannel *bool `json:"show_in_channel,omitempty"` + // Whether message is silent or not Silent *bool `json:"silent,omitempty"` + // Text of the message. Should be empty if `mml` is provided Text *string `json:"text,omitempty"` UserID *string `json:"user_id,omitempty"` + // Contains type of the message Type *string `json:"type,omitempty"` + // Array of message attachments Attachments []Attachment `json:"attachments,omitempty"` + // Array of user IDs to mention MentionedUsers []string `json:"mentioned_users,omitempty"` + // A list of user ids that have restricted visibility to the message RestrictedVisibility []string `json:"restricted_visibility,omitempty"` Custom map[string]any `json:"custom,omitempty"` @@ -8552,42 +8731,67 @@ type MessageStatsResponse struct { CountOverTime []CountByMinuteResponse `json:"count_over_time,omitempty"` } +// Emitted when a message is unblocked. type MessageUnblockedEvent struct { - Cid string `json:"cid"` - + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + + Custom map[string]any `json:"custom"` + + Message MessageResponse `json:"message"` + + // The type of event: "message.unblocked" in this case Type string `json:"type"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The CID of the channel where the message was unblocked + Cid *string `json:"cid,omitempty"` - Message *Message `json:"message,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MessageUnblockedEvent) GetEventType() string { return "message.unblocked" } +// Emitted when a message is undeleted. type MessageUndeletedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + MessageID string `json:"message_id"` - Cid string `json:"cid"` + Custom map[string]any `json:"custom"` - CreatedAt Timestamp `json:"created_at"` + Message MessageResponse `json:"message"` + // The type of event: "message.undeleted" in this case Type string `json:"type"` - Team *string `json:"team,omitempty"` + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` - Message *Message `json:"message,omitempty"` + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` - User *User `json:"user,omitempty"` + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` } func (*MessageUndeletedEvent) GetEventType() string { @@ -8600,24 +8804,45 @@ type MessageUpdate struct { ChangeSet *MessageChangeSet `json:"change_set,omitempty"` } +// Emitted when a BaseEvent is updated with translation data or when a message is updated. type MessageUpdatedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + MessageID string `json:"message_id"` - Cid string `json:"cid"` + Custom map[string]any `json:"custom"` - CreatedAt Timestamp `json:"created_at"` + Message MessageResponse `json:"message"` + // The type of event: "message.updated" in this case Type string `json:"type"` + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - Message *Message `json:"message,omitempty"` + MessageUpdate *MessageUpdate `json:"message_update,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (*MessageUpdatedEvent) GetEventType() string { @@ -8766,18 +8991,25 @@ type MetricThreshold struct { WindowSeconds *int `json:"window_seconds,omitempty"` } -type ModerationActionConfig struct { +// Configuration for a moderation action +type ModerationActionConfigResponse struct { + // The action to take Action string `json:"action"` + // Description of what this action does Description string `json:"description"` + // Type of entity this action applies to EntityType string `json:"entity_type"` + // Icon for the dashboard Icon string `json:"icon"` + // Display order (lower numbers shown first) Order int `json:"order"` - Custom map[string]any `json:"custom"` + // Custom data for the action + Custom map[string]any `json:"custom,omitempty"` } // This event is sent when a moderation check is completed @@ -8907,23 +9139,28 @@ type ModerationFlagResponse struct { Custom map[string]any `json:"custom,omitempty"` - ModerationPayload *ModerationPayload `json:"moderation_payload,omitempty"` + ModerationPayload *ModerationPayloadResponse `json:"moderation_payload,omitempty"` ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` User *UserResponse `json:"user,omitempty"` } +// This event is sent when content is flagged for moderation type ModerationFlaggedEvent struct { + // The type of content that was flagged + ContentType string `json:"content_type"` + CreatedAt Timestamp `json:"created_at"` - Type string `json:"type"` + // The ID of the flagged content + ObjectID string `json:"object_id"` - Item *string `json:"item,omitempty"` + Custom map[string]any `json:"custom"` - ObjectID *string `json:"object_id,omitempty"` + Type string `json:"type"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (*ModerationFlaggedEvent) GetEventType() string { @@ -8959,6 +9196,36 @@ type ModerationPayload struct { Custom map[string]any `json:"custom,omitempty"` } +// Content payload for moderation +type ModerationPayloadRequest struct { + // Image URLs to moderate (max 30) + Images []string `json:"images,omitempty"` + + // Text content to moderate + Texts []string `json:"texts,omitempty"` + + // Video URLs to moderate + Videos []string `json:"videos,omitempty"` + + // Custom data for moderation + Custom map[string]any `json:"custom,omitempty"` +} + +// Content payload for moderation +type ModerationPayloadResponse struct { + // Image URLs to moderate + Images []string `json:"images,omitempty"` + + // Text content to moderate + Texts []string `json:"texts,omitempty"` + + // Video URLs to moderate + Videos []string `json:"videos,omitempty"` + + // Custom data for moderation + Custom map[string]any `json:"custom,omitempty"` +} + type ModerationResponse struct { Action string `json:"action"` @@ -9023,19 +9290,19 @@ type MuteChannelResponse struct { ChannelMute *ChannelMute `json:"channel_mute,omitempty"` - OwnUser *OwnUser `json:"own_user,omitempty"` + OwnUser *OwnUserResponse `json:"own_user,omitempty"` } type MuteResponse struct { Duration string `json:"duration"` // Object with mutes (if multiple users were muted) - Mutes []UserMute `json:"mutes,omitempty"` + Mutes []UserMuteResponse `json:"mutes,omitempty"` // A list of users that can't be found. Common cause for this is deleted users NonExistingUsers []string `json:"non_existing_users,omitempty"` - OwnUser *OwnUser `json:"own_user,omitempty"` + OwnUser *OwnUserResponse `json:"own_user,omitempty"` } // MuteUsersResponse is the response payload for the mute users endpoint. @@ -9114,42 +9381,70 @@ func (*NotificationFeedUpdatedEvent) GetEventType() string { return "feeds.notification_feed.updated" } +// Emitted when a channel/thread is marked as unread. type NotificationMarkUnreadEvent struct { - ChannelID string `json:"channel_id"` - - ChannelMemberCount int `json:"channel_member_count"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - FirstUnreadMessageID string `json:"first_unread_message_id"` + Custom map[string]any `json:"custom"` + + // The type of event: "notification.mark_unread" in this case + Type string `json:"type"` - LastReadAt Timestamp `json:"last_read_at"` + // The ID of the channel which was marked as unread + ChannelID *string `json:"channel_id,omitempty"` - TotalUnreadCount int `json:"total_unread_count"` + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` - UnreadChannels int `json:"unread_channels"` + ChannelMessageCount *int `json:"channel_message_count,omitempty"` - UnreadCount int `json:"unread_count"` + // The type of the channel which was marked as unread + ChannelType *string `json:"channel_type,omitempty"` - UnreadMessages int `json:"unread_messages"` + // The CID of the channel which was marked as unread + Cid *string `json:"cid,omitempty"` - UnreadThreads int `json:"unread_threads"` + // The ID of the first unread message + FirstUnreadMessageID *string `json:"first_unread_message_id,omitempty"` - Type string `json:"type"` + // The time when the channel/thread was marked as unread + LastReadAt *Timestamp `json:"last_read_at,omitempty"` + // The ID of the last read message LastReadMessageID *string `json:"last_read_message_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` + // The ID of the thread which was marked as unread ThreadID *string `json:"thread_id,omitempty"` + // The total number of unread messages + TotalUnreadCount *int `json:"total_unread_count,omitempty"` + + // The number of channels with unread messages + UnreadChannels *int `json:"unread_channels,omitempty"` + + // The total number of unread messages + UnreadCount *int `json:"unread_count,omitempty"` + + // The number of unread messages in the channel/thread after first_unread_message_id + UnreadMessages *int `json:"unread_messages,omitempty"` + + // The total number of unread messages in the threads + UnreadThreadMessages *int `json:"unread_thread_messages,omitempty"` + + // The number of unread threads + UnreadThreads *int `json:"unread_threads,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` - User *User `json:"user,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*NotificationMarkUnreadEvent) GetEventType() string { @@ -9170,6 +9465,34 @@ type NotificationSettings struct { SessionStarted EventNotificationSettings `json:"session_started"` } +type NotificationSettingsRequest struct { + Enabled *bool `json:"enabled,omitempty"` + + CallLiveStarted *EventNotificationSettingsRequest `json:"call_live_started,omitempty"` + + CallMissed *EventNotificationSettingsRequest `json:"call_missed,omitempty"` + + CallNotification *EventNotificationSettingsRequest `json:"call_notification,omitempty"` + + CallRing *EventNotificationSettingsRequest `json:"call_ring,omitempty"` + + SessionStarted *EventNotificationSettingsRequest `json:"session_started,omitempty"` +} + +type NotificationSettingsResponse struct { + Enabled bool `json:"enabled"` + + CallLiveStarted EventNotificationSettingsResponse `json:"call_live_started"` + + CallMissed EventNotificationSettingsResponse `json:"call_missed"` + + CallNotification EventNotificationSettingsResponse `json:"call_notification"` + + CallRing EventNotificationSettingsResponse `json:"call_ring"` + + SessionStarted EventNotificationSettingsResponse `json:"session_started"` +} + type NotificationStatusResponse struct { // Number of unread notifications Unread int `json:"unread"` @@ -9210,6 +9533,62 @@ type NotificationTarget struct { Comment *NotificationComment `json:"comment,omitempty"` } +// Emitted when a new message was sent to a thread. +type NotificationThreadMessageNewEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + + MessageID string `json:"message_id"` + + // The ID of the thread + ThreadID string `json:"thread_id"` + + // The number of watchers + WatcherCount int `json:"watcher_count"` + + Channel ChannelResponse `json:"channel"` + + Custom map[string]any `json:"custom"` + + Message MessageResponse `json:"message"` + + // The type of event: "notification.message_new" in this case + Type string `json:"type"` + + // The ID of the channel where the message was sent + ChannelID *string `json:"channel_id,omitempty"` + + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel where the message was sent + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the message was sent + Cid *string `json:"cid,omitempty"` + + ParentAuthor *string `json:"parent_author,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID + Team *string `json:"team,omitempty"` + + UnreadThreadMessages *int `json:"unread_thread_messages,omitempty"` + + UnreadThreads *int `json:"unread_threads,omitempty"` + + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` + + ChannelCustom map[string]any `json:"channel_custom,omitempty"` +} + +func (*NotificationThreadMessageNewEvent) GetEventType() string { + return "notification.thread_message_new" +} + type NotificationTrigger struct { // Human-readable text describing the notification Text string `json:"text"` @@ -9236,11 +9615,11 @@ 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 @@ -9284,64 +9663,6 @@ func (c OwnCapability) String() string { return string(c) } -type OwnUser struct { - Banned bool `json:"banned"` - - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Language string `json:"language"` - - Online bool `json:"online"` - - Role string `json:"role"` - - TotalUnreadCount int `json:"total_unread_count"` - - UnreadChannels int `json:"unread_channels"` - - UnreadCount int `json:"unread_count"` - - UnreadThreads int `json:"unread_threads"` - - UpdatedAt Timestamp `json:"updated_at"` - - ChannelMutes []ChannelMute `json:"channel_mutes"` - - Devices []Device `json:"devices"` - - Mutes []UserMute `json:"mutes"` - - Custom map[string]any `json:"custom"` - - TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Invisible *bool `json:"invisible,omitempty"` - - LastActive *Timestamp `json:"last_active,omitempty"` - - LastEngagedAt *Timestamp `json:"last_engaged_at,omitempty"` - - BlockedUserIds []string `json:"blocked_user_ids,omitempty"` - - LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"` - - Teams []string `json:"teams,omitempty"` - - PrivacySettings *PrivacySettings `json:"privacy_settings,omitempty"` - - PushPreferences *PushPreferences `json:"push_preferences,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` -} - type OwnUserResponse struct { Banned bool `json:"banned"` @@ -9551,13 +9872,14 @@ type PendingMessageEvent struct { ReceivedAt *Timestamp `json:"received_at,omitempty"` - Channel *Channel `json:"channel,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` - Message *Message `json:"message,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + // Metadata attached to the pending message Metadata map[string]string `json:"metadata,omitempty"` - User *User `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } func (*PendingMessageEvent) GetEventType() string { @@ -9708,58 +10030,6 @@ type PolicyRequest struct { Roles []string `json:"roles"` } -type Poll struct { - AllowAnswers bool `json:"allow_answers"` - - AllowUserSuggestedOptions bool `json:"allow_user_suggested_options"` - - AnswersCount int `json:"answers_count"` - - CreatedAt Timestamp `json:"created_at"` - - CreatedByID string `json:"created_by_id"` - - Description string `json:"description"` - - EnforceUniqueVote bool `json:"enforce_unique_vote"` - - ID string `json:"id"` - - Name string `json:"name"` - - UpdatedAt Timestamp `json:"updated_at"` - - VoteCount int `json:"vote_count"` - - LatestAnswers []PollVote `json:"latest_answers"` - - Options []PollOption `json:"options"` - - OwnVotes []PollVote `json:"own_votes"` - - Custom map[string]any `json:"Custom"` - - LatestVotesByOption map[string][]PollVote `json:"latest_votes_by_option"` - - VoteCountsByOption map[string]int `json:"vote_counts_by_option"` - - IsClosed *bool `json:"is_closed,omitempty"` - - MaxVotesAllowed *int `json:"max_votes_allowed,omitempty"` - - VotingVisibility *string `json:"voting_visibility,omitempty"` - - CreatedBy *User `json:"created_by,omitempty"` -} - -type PollOption struct { - ID string `json:"id"` - - Text string `json:"text"` - - Custom map[string]any `json:"custom"` -} - type PollOptionInput struct { Text *string `json:"text,omitempty"` @@ -9840,26 +10110,6 @@ type PollResponseData struct { CreatedBy *UserResponse `json:"created_by,omitempty"` } -type PollVote struct { - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - OptionID string `json:"option_id"` - - PollID string `json:"poll_id"` - - UpdatedAt Timestamp `json:"updated_at"` - - AnswerText *string `json:"answer_text,omitempty"` - - IsAnswer *bool `json:"is_answer,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - User *User `json:"user,omitempty"` -} - type PollVoteResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` @@ -9899,14 +10149,6 @@ type PollVotesResponse struct { Prev *string `json:"prev,omitempty"` } -type PrivacySettings struct { - DeliveryReceipts *DeliveryReceipts `json:"delivery_receipts,omitempty"` - - ReadReceipts *ReadReceipts `json:"read_receipts,omitempty"` - - TypingIndicators *TypingIndicators `json:"typing_indicators,omitempty"` -} - type PrivacySettingsResponse struct { DeliveryReceipts *DeliveryReceiptsResponse `json:"delivery_receipts,omitempty"` @@ -10022,18 +10264,6 @@ type PushPreferenceInput struct { FeedsPreferences *FeedsPreferences `json:"feeds_preferences,omitempty"` } -type PushPreferences struct { - CallLevel *string `json:"call_level,omitempty"` - - ChatLevel *string `json:"chat_level,omitempty"` - - DisabledUntil *Timestamp `json:"disabled_until,omitempty"` - - FeedsLevel *string `json:"feeds_level,omitempty"` - - FeedsPreferences *FeedsPreferences `json:"feeds_preferences,omitempty"` -} - type PushPreferencesResponse struct { CallLevel *string `json:"call_level,omitempty"` @@ -10174,6 +10404,23 @@ type PushTemplate struct { Template *string `json:"template,omitempty"` } +type PushTemplateResponse struct { + // Time when the template was created + CreatedAt Timestamp `json:"created_at"` + + // Whether push notification is enabled for this event + EnablePush bool `json:"enable_push"` + + // Type of event this template applies to + EventType string `json:"event_type"` + + // Time when the template was last updated + UpdatedAt Timestamp `json:"updated_at"` + + // The push notification template + Template *string `json:"template,omitempty"` +} + type QualityScoreReport struct { Histogram []ReportByHistogramBucket `json:"histogram"` } @@ -10487,7 +10734,7 @@ type QueryFeedModerationTemplate struct { // When the template was last updated UpdatedAt Timestamp `json:"updated_at"` - Config *FeedsModerationTemplateConfig `json:"config,omitempty"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type QueryFeedModerationTemplatesResponse struct { @@ -10697,7 +10944,7 @@ type QueryReviewQueueResponse struct { Items []ReviewQueueItemResponse `json:"items"` // Configuration for moderation actions - ActionConfig map[string][]ModerationActionConfig `json:"action_config"` + ActionConfig map[string][]ModerationActionConfigResponse `json:"action_config"` // Statistics about the review queue Stats map[string]any `json:"stats"` @@ -10757,6 +11004,7 @@ type QueryUserFeedbackResponse struct { Prev *string `json:"prev,omitempty"` } +// Client request type QueryUsersPayload struct { FilterConditions map[string]any `json:"filter_conditions"` @@ -10856,43 +11104,85 @@ type RankingConfig struct { } type Reaction struct { - CreatedAt Timestamp `json:"created_at"` + ActivityID string `json:"activity_id"` - MessageID string `json:"message_id"` + CreatedAt Timestamp `json:"created_at"` - Score int `json:"score"` + Kind string `json:"kind"` UpdatedAt Timestamp `json:"updated_at"` - Type string `json:"type"` + UserID string `json:"user_id"` + + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + + ID *string `json:"id,omitempty"` + + Parent *string `json:"parent,omitempty"` + + Score *float64 `json:"score,omitempty"` + + TargetFeeds []string `json:"target_feeds,omitempty"` + + ChildrenCounts map[string]any `json:"children_counts,omitempty"` + + Data map[string]any `json:"data,omitempty"` + + LatestChildren map[string][]Reaction `json:"latest_children,omitempty"` + + Moderation map[string]any `json:"moderation,omitempty"` - Custom map[string]any `json:"custom"` + OwnChildren map[string][]Reaction `json:"own_children,omitempty"` - UserID *string `json:"user_id,omitempty"` + TargetFeedsExtraData map[string]any `json:"target_feeds_extra_data,omitempty"` User *User `json:"user,omitempty"` } +// Emitted when a reaction is deleted from a message. type ReactionDeletedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - Cid string `json:"cid"` + Channel ChannelResponse `json:"channel"` - CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "reaction.deleted" in this case Type string `json:"type"` + // The ID of the channel containing the message + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel containing the message + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel containing the message + Cid *string `json:"cid,omitempty"` + + MessageID *string `json:"message_id,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` - Message *Message `json:"message,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - Reaction *Reaction `json:"reaction,omitempty"` + Message *MessageResponse `json:"message,omitempty"` - User *User `json:"user,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ReactionDeletedEvent) GetEventType() string { @@ -10914,26 +11204,50 @@ type ReactionGroupResponse struct { SumScores int `json:"sum_scores"` } +// Emitted when a new reaction is added to a message. type ReactionNewEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - Cid string `json:"cid"` + Channel ChannelResponse `json:"channel"` - CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "reaction.new" in this case Type string `json:"type"` + // The ID of the channel containing the message + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel containing the message + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel containing the message + Cid *string `json:"cid,omitempty"` + + MessageID *string `json:"message_id,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - ThreadParticipants []User `json:"thread_participants,omitempty"` + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` - Message *Message `json:"message,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - Reaction *Reaction `json:"reaction,omitempty"` + Message *MessageResponse `json:"message,omitempty"` - User *User `json:"user,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ReactionNewEvent) GetEventType() string { @@ -10986,24 +11300,47 @@ type ReactionResponse struct { User UserResponse `json:"user"` } +// Emitted when a reaction is updated on a message. type ReactionUpdatedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - Cid string `json:"cid"` + MessageID string `json:"message_id"` - CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` - Message Message `json:"message"` + Custom map[string]any `json:"custom"` - Reaction Reaction `json:"reaction"` + Message MessageResponse `json:"message"` + // The type of event: "reaction.updated" in this case Type string `json:"type"` + // The ID of the channel containing the message + ChannelID *string `json:"channel_id,omitempty"` + + // The number of members in the channel + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + // The number of messages in the channel + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel containing the message + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel containing the message + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // The team ID Team *string `json:"team,omitempty"` - User *User `json:"user,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + Reaction *ReactionResponse `json:"reaction,omitempty"` + + User *UserResponseCommonFields `json:"user,omitempty"` } func (*ReactionUpdatedEvent) GetEventType() string { @@ -11032,10 +11369,6 @@ type ReadCollectionsResponse struct { Collections []CollectionResponse `json:"collections"` } -type ReadReceipts struct { - Enabled *bool `json:"enabled,omitempty"` -} - type ReadReceiptsResponse struct { Enabled *bool `json:"enabled,omitempty"` } @@ -11292,7 +11625,8 @@ type Response struct { Duration string `json:"duration"` } -type RestoreActionRequest struct{} +// Configuration for restore action +type RestoreActionRequestPayload struct{} // This event is sent when a new moderation review queue item is created type ReviewQueueItemNewEvent struct { @@ -11355,7 +11689,7 @@ type ReviewQueueItemResponse struct { Actions []ActionLogResponse `json:"actions"` // Associated ban records - Bans []Ban `json:"bans"` + Bans []BanInfoResponse `json:"bans"` // Associated flag records Flags []ModerationFlagResponse `json:"flags"` @@ -11395,7 +11729,7 @@ type ReviewQueueItemResponse struct { Message *MessageResponse `json:"message,omitempty"` - ModerationPayload *ModerationPayload `json:"moderation_payload,omitempty"` + ModerationPayload *ModerationPayloadResponse `json:"moderation_payload,omitempty"` Reaction *Reaction `json:"reaction,omitempty"` } @@ -11567,9 +11901,9 @@ type SFULocationResponse struct { ID string `json:"id"` - Coordinates Coordinates `json:"coordinates"` + Coordinates CoordinatesResponse `json:"coordinates"` - Location Location `json:"location"` + Location LocationResponse `json:"location"` Count *int `json:"count,omitempty"` } @@ -11604,37 +11938,54 @@ type SIPCallerConfigsResponse struct { CustomData map[string]any `json:"custom_data"` } -type SIPChallenge struct { +// SIP digest challenge authentication data +type SIPChallengeRequest struct { + // Deprecated: A1 hash for backward compatibility A1 *string `json:"a1,omitempty"` + // Hash algorithm (e.g., MD5, SHA-256) Algorithm *string `json:"algorithm,omitempty"` + // Character set Charset *string `json:"charset,omitempty"` + // Client nonce for qop=auth Cnonce *string `json:"cnonce,omitempty"` + // SIP method (e.g., INVITE) Method *string `json:"method,omitempty"` + // Nonce count for qop=auth Nc *string `json:"nc,omitempty"` + // Server nonce Nonce *string `json:"nonce,omitempty"` + // Opaque value Opaque *string `json:"opaque,omitempty"` + // Authentication realm Realm *string `json:"realm,omitempty"` + // Digest response hash from client Response *string `json:"response,omitempty"` + // Whether the nonce is stale Stale *bool `json:"stale,omitempty"` + // Request URI Uri *string `json:"uri,omitempty"` + // Whether to hash the username Userhash *bool `json:"userhash,omitempty"` + // Username for authentication Username *string `json:"username,omitempty"` + // Domain list Domain []string `json:"domain,omitempty"` + // Quality of protection options Qop []string `json:"qop,omitempty"` } @@ -11842,6 +12193,8 @@ type SearchPayload struct { // Channel filter conditions FilterConditions map[string]any `json:"filter_conditions"` + ForceDefaultSearch *bool `json:"force_default_search,omitempty"` + // Number of messages to return Limit *int `json:"limit,omitempty"` @@ -12090,7 +12443,9 @@ type SessionSettingsResponse struct { InactivityTimeoutSeconds int `json:"inactivity_timeout_seconds"` } -type ShadowBlockActionRequest struct { +// Configuration for shadow block action +type ShadowBlockActionRequestPayload struct { + // Reason for shadow blocking Reason *string `json:"reason,omitempty"` } @@ -12202,18 +12557,15 @@ type SipInboundCredentials struct { UserCustomData map[string]any `json:"user_custom_data"` } -type SortParam struct { - Direction *int `json:"direction,omitempty"` - - Field *string `json:"field,omitempty"` -} - type SortParamRequest struct { // Direction of sorting, 1 for Ascending, -1 for Descending, default is 1 Direction *int `json:"direction,omitempty"` // 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 { @@ -12563,19 +12915,21 @@ type ThreadStateResponse struct { } type ThreadUpdatedEvent struct { - ChannelID string `json:"channel_id"` + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + Type string `json:"type"` - CreatedAt Timestamp `json:"created_at"` + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + ChannelType *string `json:"channel_type,omitempty"` - Thread *ThreadResponse `json:"thread,omitempty"` + Cid *string `json:"cid,omitempty"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + Thread *ThreadResponse `json:"thread,omitempty"` } func (*ThreadUpdatedEvent) GetEventType() string { @@ -12723,21 +13077,22 @@ type TruncateChannelResponse struct { Message *MessageResponse `json:"message,omitempty"` } -type TypingIndicators struct { - Enabled *bool `json:"enabled,omitempty"` -} - type TypingIndicatorsResponse struct { Enabled *bool `json:"enabled,omitempty"` } -type UnbanActionRequest struct{} +// Configuration for unban moderation action +type UnbanActionRequestPayload struct { + // Channel CID for channel-specific unban + ChannelCid *string `json:"channel_cid,omitempty"` +} type UnbanResponse struct { Duration string `json:"duration"` } -type UnblockActionRequest struct{} +// Configuration for unblock action +type UnblockActionRequestPayload struct{} // UnblockUserResponse is the payload for unblocking a user. type UnblockUserResponse struct { @@ -12930,7 +13285,7 @@ type UpdateCallTypeResponse struct { // the permissions granted to each role Grants map[string][]string `json:"grants"` - NotificationSettings NotificationSettings `json:"notification_settings"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` Settings CallSettingsResponse `json:"settings"` @@ -13296,7 +13651,7 @@ type UpsertModerationTemplateRequest struct { // Name of the moderation template Name string `json:"name"` - Config FeedsModerationTemplateConfig `json:"config"` + Config FeedsModerationTemplateConfigPayload `json:"config"` } type UpsertModerationTemplateResponse struct { @@ -13311,7 +13666,7 @@ type UpsertModerationTemplateResponse struct { // When the template was last updated UpdatedAt Timestamp `json:"updated_at"` - Config *FeedsModerationTemplateConfig `json:"config,omitempty"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type UpsertPushPreferencesRequest struct { @@ -13324,10 +13679,10 @@ type UpsertPushPreferencesResponse struct { Duration string `json:"duration"` // The channel specific push notification preferences, only returned for channels you've edited. - UserChannelPreferences map[string]map[string]*ChannelPushPreferences `json:"user_channel_preferences"` + UserChannelPreferences map[string]map[string]*ChannelPushPreferencesResponse `json:"user_channel_preferences"` // The user preferences, always returned regardless if you edited it - UserPreferences map[string]*PushPreferences `json:"user_preferences"` + UserPreferences map[string]*PushPreferencesResponse `json:"user_preferences"` } // Basic response information @@ -13343,55 +13698,59 @@ type UpsertPushTemplateResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - Template *PushTemplate `json:"template,omitempty"` + Template *PushTemplateResponse `json:"template,omitempty"` } type User struct { ID string `json:"id"` - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - Banned *bool `json:"banned,omitempty"` - - Invisible *bool `json:"invisible,omitempty"` - - Language *string `json:"language,omitempty"` + Data map[string]any `json:"data,omitempty"` +} - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` +// This event is sent when a user gets banned. The event contains information about the user that was banned. +type UserBannedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - Role *string `json:"role,omitempty"` + Custom map[string]any `json:"custom"` - Teams []string `json:"teams,omitempty"` + User UserResponseCommonFields `json:"user"` - Custom map[string]any `json:"custom,omitempty"` + // The type of event: "user.banned" in this case + Type string `json:"type"` - PrivacySettings *PrivacySettings `json:"privacy_settings,omitempty"` + // The ID of the channel where the target user was banned + ChannelID *string `json:"channel_id,omitempty"` - TeamsRole map[string]string `json:"teams_role,omitempty"` -} + ChannelMemberCount *int `json:"channel_member_count,omitempty"` -type UserBannedEvent struct { - ChannelID string `json:"channel_id"` + ChannelMessageCount *int `json:"channel_message_count,omitempty"` - ChannelType string `json:"channel_type"` + // The type of the channel where the target user was banned + ChannelType *string `json:"channel_type,omitempty"` - Cid string `json:"cid"` + // The CID of the channel where the target user was banned + Cid *string `json:"cid,omitempty"` - CreatedAt Timestamp `json:"created_at"` + // The expiration date of the ban + Expiration *Timestamp `json:"expiration,omitempty"` - Shadow bool `json:"shadow"` + // The reason for the ban + Reason *string `json:"reason,omitempty"` - CreatedBy User `json:"created_by"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - Type string `json:"type"` + // Whether the user was shadow banned + Shadow *bool `json:"shadow,omitempty"` - Expiration *Timestamp `json:"expiration,omitempty"` + // The team of the channel where the target user was banned + Team *string `json:"team,omitempty"` - Reason *string `json:"reason,omitempty"` + TotalBans *int `json:"total_bans,omitempty"` - Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` - User *User `json:"user,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (*UserBannedEvent) GetEventType() string { @@ -13414,32 +13773,58 @@ type UserCustomPropertyParameters struct { PropertyKey *string `json:"property_key,omitempty"` } +// This event is sent when a user gets deactivated. The event contains information about the user that was deactivated. type UserDeactivatedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - CreatedBy User `json:"created_by"` + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + // The type of event: "user.deactivated" in this case Type string `json:"type"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (*UserDeactivatedEvent) GetEventType() string { return "user.deactivated" } +// This event is sent when a user gets deleted. The event contains information about the user that was deleted and the deletion options that were used. type UserDeletedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + // The type of deletion that was used for the user's conversations + DeleteConversation string `json:"delete_conversation"` + + // Whether the user's conversation channels were deleted DeleteConversationChannels bool `json:"delete_conversation_channels"` + // The type of deletion that was used for the user's messages + DeleteMessages string `json:"delete_messages"` + + // The type of deletion that was used for the user + DeleteUser string `json:"delete_user"` + + // Whether the user was hard deleted HardDelete bool `json:"hard_delete"` + // Whether the user's messages were marked as deleted MarkMessagesDeleted bool `json:"mark_messages_deleted"` + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + + // The type of event: "user.deleted" in this case Type string `json:"type"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (*UserDeletedEvent) GetEventType() string { @@ -13476,16 +13861,28 @@ type UserFeedbackResponse struct { Custom map[string]any `json:"custom,omitempty"` } +// This event is sent when a user gets flagged. The event contains information about the user that was flagged. type UserFlaggedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + // The reason for the flag + Reason string `json:"reason"` + + // The total number of flags for the user + TotalFlags int `json:"total_flags"` + + User UserResponseCommonFields `json:"user"` + + // The type of event: "user.flagged" in this case Type string `json:"type"` - TargetUser *string `json:"target_user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - TargetUsers []string `json:"target_users,omitempty"` + // Custom data + Custom map[string]any `json:"custom,omitempty"` - User *User `json:"user,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } func (*UserFlaggedEvent) GetEventType() string { @@ -13532,21 +13929,6 @@ func (*UserMessagesDeletedEvent) GetEventType() string { return "user.messages.deleted" } -type UserMute struct { - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - - // Date/time of mute expiration - Expires *Timestamp `json:"expires,omitempty"` - - Target *User `json:"target,omitempty"` - - User *User `json:"user,omitempty"` -} - type UserMuteResponse struct { CreatedAt Timestamp `json:"created_at"` @@ -13559,16 +13941,24 @@ type UserMuteResponse struct { User *UserResponse `json:"user,omitempty"` } +// This event is sent when a user gets muted. The event contains information about the user that was muted. type UserMutedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + + // The type of event: "user.muted" in this case Type string `json:"type"` - TargetUser *string `json:"target_user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - TargetUsers []string `json:"target_users,omitempty"` + // The target users that were muted + TargetUsers []UserResponseCommonFields `json:"target_users,omitempty"` - User *User `json:"user,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } func (*UserMutedEvent) GetEventType() string { @@ -13581,12 +13971,21 @@ type UserRatingReportResponse struct { Count int `json:"count"` } +// This event is sent when a user gets reactivated. The event contains information about the user that was reactivated. type UserReactivatedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + + // The type of event: "user.reactivated" in this case Type string `json:"type"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (*UserReactivatedEvent) GetEventType() string { @@ -13775,52 +14174,88 @@ type UserRuleParameters struct { MaxAge *string `json:"max_age,omitempty"` } +// This event is sent when a user gets unbanned. The event contains information about the user that was unbanned. type UserUnbannedEvent struct { - ChannelID string `json:"channel_id"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` - ChannelType string `json:"channel_type"` + Custom map[string]any `json:"custom"` - Cid string `json:"cid"` + User UserResponseCommonFields `json:"user"` - CreatedAt Timestamp `json:"created_at"` + // The type of event: "user.unbanned" in this case + Type string `json:"type"` - Shadow bool `json:"shadow"` + // The ID of the channel where the target user was unbanned + ChannelID *string `json:"channel_id,omitempty"` - Type string `json:"type"` + ChannelMemberCount *int `json:"channel_member_count,omitempty"` + + ChannelMessageCount *int `json:"channel_message_count,omitempty"` + + // The type of the channel where the target user was unbanned + ChannelType *string `json:"channel_type,omitempty"` + + // The CID of the channel where the target user was unbanned + Cid *string `json:"cid,omitempty"` + + ReceivedAt *Timestamp `json:"received_at,omitempty"` + + // Whether the target user was shadow unbanned + Shadow *bool `json:"shadow,omitempty"` + // The team of the channel where the target user was unbanned Team *string `json:"team,omitempty"` - User *User `json:"user,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (*UserUnbannedEvent) GetEventType() string { return "user.unbanned" } +// This event is sent when a user gets unmuted. The event contains information about the user that was unmuted. type UserUnmutedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + + // The type of event: "user.unmuted" in this case Type string `json:"type"` - TargetUser *string `json:"target_user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` - TargetUsers []string `json:"target_users,omitempty"` + // The target users that were unmuted + TargetUsers []UserResponseCommonFields `json:"target_users,omitempty"` - User *User `json:"user,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } func (*UserUnmutedEvent) GetEventType() string { return "user.unmuted" } +// Reminder events allow you to notify your users about unread messages. Reminders can be used to trigger an email, push notification or SMS to the user. type UserUnreadReminderEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - Channels map[string]*ChannelMessages `json:"channels"` + // The channels with unread messages + Channels map[string]*ChannelMessagesResponse `json:"channels"` + + Custom map[string]any `json:"custom"` + + User UserResponseCommonFields `json:"user"` + // The type of event: "user.unread_message_reminder" in this case Type string `json:"type"` - User *User `json:"user,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (*UserUnreadReminderEvent) GetEventType() string { @@ -13904,9 +14339,11 @@ type VideoContentParameters struct { HarmLabels []string `json:"harm_labels,omitempty"` } -type VideoEndCallRequest struct{} +// Configuration for ending video call +type VideoEndCallRequestPayload struct{} -type VideoKickUserRequest struct{} +// Configuration for kicking user from video call +type VideoKickUserRequestPayload struct{} type VideoReactionOverTimeResponse struct { ByMinute []CountByMinuteResponse `json:"by_minute,omitempty"` diff --git a/requests.go b/requests.go index 674a764..40501c7 100644 --- a/requests.go +++ b/requests.go @@ -1131,9 +1131,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"` } @@ -1245,6 +1251,7 @@ type GetOrCreateUnfollowsRequest struct { } type DeleteFeedUserDataRequest struct { + HardDelete *bool `json:"hard_delete"` } type ExportFeedUserDataRequest struct { @@ -1340,13 +1347,13 @@ type QueryModerationConfigsRequest struct { } type CustomCheckRequest struct { - EntityID string `json:"entity_id"` - EntityType string `json:"entity_type"` - Flags []CustomCheckFlag `json:"flags"` - EntityCreatorID *string `json:"entity_creator_id"` - UserID *string `json:"user_id"` - ModerationPayload *ModerationPayload `json:"moderation_payload"` - User *UserRequest `json:"user"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + Flags []CustomCheckFlag `json:"flags"` + EntityCreatorID *string `json:"entity_creator_id"` + UserID *string `json:"user_id"` + ModerationPayload *ModerationPayloadRequest `json:"moderation_payload"` + User *UserRequest `json:"user"` } type V2DeleteTemplateRequest struct { @@ -1356,8 +1363,8 @@ type V2QueryTemplatesRequest struct { } type V2UpsertTemplateRequest struct { - Name string `json:"name"` - Config FeedsModerationTemplateConfig `json:"config"` + Name string `json:"name"` + Config FeedsModerationTemplateConfigPayload `json:"config"` } type FlagRequest struct { @@ -1372,11 +1379,11 @@ type FlagRequest struct { } type QueryModerationFlagsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParam `json:"sort"` - Filter map[string]any `json:"filter"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` } type QueryModerationLogsRequest struct { @@ -1444,21 +1451,21 @@ type GetReviewQueueItemRequest struct { } type SubmitActionRequest struct { - ActionType string `json:"action_type"` - ItemID string `json:"item_id"` - UserID *string `json:"user_id"` - Ban *BanActionRequest `json:"ban"` - Block *BlockActionRequest `json:"block"` - Custom *CustomActionRequest `json:"custom"` - DeleteActivity *DeleteActivityRequest `json:"delete_activity"` - DeleteComment *DeleteCommentRequest `json:"delete_comment"` - DeleteMessage *DeleteMessageRequest `json:"delete_message"` - DeleteReaction *DeleteReactionRequest `json:"delete_reaction"` - DeleteUser *DeleteUserRequest `json:"delete_user"` - MarkReviewed *MarkReviewedRequest `json:"mark_reviewed"` - ShadowBlock *ShadowBlockActionRequest `json:"shadow_block"` - Unban *UnbanActionRequest `json:"unban"` - User *UserRequest `json:"user"` + ActionType string `json:"action_type"` + ItemID string `json:"item_id"` + UserID *string `json:"user_id"` + Ban *BanActionRequestPayload `json:"ban"` + Block *BlockActionRequestPayload `json:"block"` + Custom *CustomActionRequestPayload `json:"custom"` + DeleteActivity *DeleteActivityRequestPayload `json:"delete_activity"` + DeleteComment *DeleteCommentRequestPayload `json:"delete_comment"` + DeleteMessage *DeleteMessageRequestPayload `json:"delete_message"` + DeleteReaction *DeleteReactionRequestPayload `json:"delete_reaction"` + DeleteUser *DeleteUserRequestPayload `json:"delete_user"` + MarkReviewed *MarkReviewedRequestPayload `json:"mark_reviewed"` + ShadowBlock *ShadowBlockActionRequestPayload `json:"shadow_block"` + Unban *UnbanActionRequestPayload `json:"unban"` + User *UserRequest `json:"user"` } type UnbanRequest struct { @@ -1989,11 +1996,11 @@ type ListCallTypesRequest struct { } type CreateCallTypeRequest struct { - Name string `json:"name"` - ExternalStorage *string `json:"external_storage"` - Grants map[string][]string `json:"grants"` - NotificationSettings *NotificationSettings `json:"notification_settings"` - Settings *CallSettingsRequest `json:"settings"` + Name string `json:"name"` + ExternalStorage *string `json:"external_storage"` + Grants map[string][]string `json:"grants"` + NotificationSettings *NotificationSettingsRequest `json:"notification_settings"` + Settings *CallSettingsRequest `json:"settings"` } type DeleteCallTypeRequest struct { @@ -2003,20 +2010,20 @@ type GetCallTypeRequest struct { } type UpdateCallTypeRequest struct { - ExternalStorage *string `json:"external_storage"` - Grants map[string][]string `json:"grants"` - NotificationSettings *NotificationSettings `json:"notification_settings"` - Settings *CallSettingsRequest `json:"settings"` + ExternalStorage *string `json:"external_storage"` + Grants map[string][]string `json:"grants"` + NotificationSettings *NotificationSettingsRequest `json:"notification_settings"` + Settings *CallSettingsRequest `json:"settings"` } 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"` + SipCallerNumber string `json:"sip_caller_number"` + SipTrunkNumber string `json:"sip_trunk_number"` + Challenge SIPChallengeRequest `json:"challenge"` + SipHeaders map[string]string `json:"sip_headers"` } type ListSIPInboundRoutingRuleRequest struct {