diff --git a/call.go b/call.go index 216de69..0017421 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 @@ -227,7 +229,7 @@ func (c *Call) StopRTMPBroadcast(ctx context.Context, name string, request *Stop } func (c *Call) GetCallParticipantSessionMetrics(ctx context.Context, session string, user string, userSession string, request *GetCallParticipantSessionMetricsRequest) (*StreamResponse[GetCallParticipantSessionMetricsResponse], error) { - response, err := c.client.GetCallParticipantSessionMetrics(ctx, session, user, userSession, request) + response, err := c.client.GetCallParticipantSessionMetrics(ctx, c.callType, c.callID, session, user, userSession, request) if err != nil { return nil, err } diff --git a/chat.go b/chat.go index 2051be9..4d4fb6e 100644 --- a/chat.go +++ b/chat.go @@ -44,12 +44,12 @@ func (c *ChatClient) StartCampaign(ctx context.Context, id string, request *Star } // Stops a campaign -func (c *ChatClient) ScheduleCampaign(ctx context.Context, id string, request *ScheduleCampaignRequest) (*StreamResponse[CampaignResponse], error) { +func (c *ChatClient) StopCampaign(ctx context.Context, id string, request *StopCampaignRequest) (*StreamResponse[CampaignResponse], error) { var result CampaignResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[ScheduleCampaignRequest, CampaignResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/{id}/stop", nil, request, &result, pathParams) + res, err := MakeRequest[StopCampaignRequest, CampaignResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/{id}/stop", nil, request, &result, pathParams) return res, err } @@ -81,7 +81,6 @@ func (c *ChatClient) ChannelBatchUpdate(ctx context.Context, request *ChannelBat // // Sends events: // - channel.deleted -// - channel.deleted func (c *ChatClient) DeleteChannels(ctx context.Context, request *DeleteChannelsRequest) (*StreamResponse[DeleteChannelsResponse], error) { var result DeleteChannelsResponse res, err := MakeRequest[DeleteChannelsRequest, DeleteChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/channels/delete", nil, request, &result, nil) @@ -100,7 +99,6 @@ func (c *ChatClient) MarkDelivered(ctx context.Context, request *MarkDeliveredRe // // Sends events: // - message.read -// - message.read func (c *ChatClient) MarkChannelsRead(ctx context.Context, request *MarkChannelsReadRequest) (*StreamResponse[MarkReadResponse], error) { var result MarkReadResponse res, err := MakeRequest[MarkChannelsReadRequest, MarkReadResponse](c.client, ctx, "POST", "/api/v2/chat/channels/read", nil, request, &result, nil) @@ -115,8 +113,6 @@ func (c *ChatClient) MarkChannelsRead(ctx context.Context, request *MarkChannels // - member.removed // - member.updated // - user.watching.start -// - channel.created -// - user.watching.start func (c *ChatClient) GetOrCreateDistinctChannel(ctx context.Context, _type string, request *GetOrCreateDistinctChannelRequest) (*StreamResponse[ChannelStateResponse], error) { var result ChannelStateResponse pathParams := map[string]string{ @@ -130,7 +126,6 @@ func (c *ChatClient) GetOrCreateDistinctChannel(ctx context.Context, _type strin // // Sends events: // - channel.deleted -// - channel.deleted func (c *ChatClient) DeleteChannel(ctx context.Context, _type string, id string, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse], error) { var result DeleteChannelResponse pathParams := map[string]string{ @@ -146,7 +141,6 @@ func (c *ChatClient) DeleteChannel(ctx context.Context, _type string, id string, // // Sends events: // - channel.updated -// - channel.updated func (c *ChatClient) UpdateChannelPartial(ctx context.Context, _type string, id string, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse], error) { var result UpdateChannelPartialResponse pathParams := map[string]string{ @@ -165,8 +159,6 @@ func (c *ChatClient) UpdateChannelPartial(ctx context.Context, _type string, id // - member.removed // - member.updated // - message.new -// - channel.updated -// - message.new func (c *ChatClient) UpdateChannel(ctx context.Context, _type string, id string, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse], error) { var result UpdateChannelResponse pathParams := map[string]string{ @@ -242,7 +234,6 @@ func (c *ChatClient) UploadChannelFile(ctx context.Context, _type string, id str // // Sends events: // - channel.hidden -// - channel.hidden func (c *ChatClient) HideChannel(ctx context.Context, _type string, id string, request *HideChannelRequest) (*StreamResponse[HideChannelResponse], error) { var result HideChannelResponse pathParams := map[string]string{ @@ -292,8 +283,6 @@ func (c *ChatClient) UpdateMemberPartial(ctx context.Context, _type string, id s // Sends events: // - message.new // - message.updated -// - message.new -// - message.updated func (c *ChatClient) SendMessage(ctx context.Context, _type string, id string, request *SendMessageRequest) (*StreamResponse[SendMessageResponse], error) { var result SendMessageResponse pathParams := map[string]string{ @@ -324,8 +313,6 @@ func (c *ChatClient) GetManyMessages(ctx context.Context, _type string, id strin // - member.removed // - member.updated // - user.watching.start -// - channel.created -// - user.watching.start func (c *ChatClient) GetOrCreateChannel(ctx context.Context, _type string, id string, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse], error) { var result ChannelStateResponse pathParams := map[string]string{ @@ -340,7 +327,6 @@ func (c *ChatClient) GetOrCreateChannel(ctx context.Context, _type string, id st // // Sends events: // - message.read -// - message.read func (c *ChatClient) MarkRead(ctx context.Context, _type string, id string, request *MarkReadRequest) (*StreamResponse[MarkReadResponse], error) { var result MarkReadResponse pathParams := map[string]string{ @@ -355,7 +341,6 @@ func (c *ChatClient) MarkRead(ctx context.Context, _type string, id string, requ // // Sends events: // - channel.visible -// - channel.visible func (c *ChatClient) ShowChannel(ctx context.Context, _type string, id string, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse], error) { var result ShowChannelResponse pathParams := map[string]string{ @@ -370,7 +355,6 @@ func (c *ChatClient) ShowChannel(ctx context.Context, _type string, id string, r // // Sends events: // - channel.truncated -// - channel.truncated func (c *ChatClient) TruncateChannel(ctx context.Context, _type string, id string, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse], error) { var result TruncateChannelResponse pathParams := map[string]string{ @@ -513,7 +497,6 @@ func (c *ChatClient) QueryMessageHistory(ctx context.Context, request *QueryMess // // Sends events: // - message.deleted -// - message.deleted func (c *ChatClient) DeleteMessage(ctx context.Context, id string, request *DeleteMessageRequest) (*StreamResponse[DeleteMessageResponse], error) { var result DeleteMessageResponse pathParams := map[string]string{ @@ -539,7 +522,6 @@ func (c *ChatClient) GetMessage(ctx context.Context, id string, request *GetMess // // Sends events: // - message.updated -// - message.updated func (c *ChatClient) UpdateMessage(ctx context.Context, id string, request *UpdateMessageRequest) (*StreamResponse[UpdateMessageResponse], error) { var result UpdateMessageResponse pathParams := map[string]string{ @@ -553,7 +535,6 @@ func (c *ChatClient) UpdateMessage(ctx context.Context, id string, request *Upda // // Sends events: // - message.updated -// - message.updated func (c *ChatClient) UpdateMessagePartial(ctx context.Context, id string, request *UpdateMessagePartialRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { var result UpdateMessagePartialResponse pathParams := map[string]string{ @@ -567,13 +548,12 @@ func (c *ChatClient) UpdateMessagePartial(ctx context.Context, id string, reques // // Sends events: // - message.new -// - message.new -func (c *ChatClient) RunMessageAction(ctx context.Context, id string, request *RunMessageActionRequest) (*StreamResponse[MessageResponse], error) { - var result MessageResponse +func (c *ChatClient) RunMessageAction(ctx context.Context, id string, request *RunMessageActionRequest) (*StreamResponse[MessageActionResponse], error) { + var result MessageActionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[RunMessageActionRequest, MessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/action", nil, request, &result, pathParams) + res, err := MakeRequest[RunMessageActionRequest, MessageActionResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/action", nil, request, &result, pathParams) return res, err } @@ -582,14 +562,12 @@ func (c *ChatClient) RunMessageAction(ctx context.Context, id string, request *R // Sends events: // - message.new // - message.updated -// - message.new -// - message.updated -func (c *ChatClient) CommitMessage(ctx context.Context, id string, request *CommitMessageRequest) (*StreamResponse[MessageResponse], error) { - var result MessageResponse +func (c *ChatClient) CommitMessage(ctx context.Context, id string, request *CommitMessageRequest) (*StreamResponse[MessageActionResponse], error) { + var result MessageActionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[CommitMessageRequest, MessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/commit", nil, request, &result, pathParams) + res, err := MakeRequest[CommitMessageRequest, MessageActionResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/commit", nil, request, &result, pathParams) return res, err } @@ -597,7 +575,6 @@ func (c *ChatClient) CommitMessage(ctx context.Context, id string, request *Comm // // Sends events: // - message.updated -// - message.updated func (c *ChatClient) EphemeralMessageUpdate(ctx context.Context, id string, request *EphemeralMessageUpdateRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { var result UpdateMessagePartialResponse pathParams := map[string]string{ @@ -661,13 +638,12 @@ func (c *ChatClient) QueryReactions(ctx context.Context, id string, request *Que // // Sends events: // - message.updated -// - message.updated -func (c *ChatClient) TranslateMessage(ctx context.Context, id string, request *TranslateMessageRequest) (*StreamResponse[MessageResponse], error) { - var result MessageResponse +func (c *ChatClient) TranslateMessage(ctx context.Context, id string, request *TranslateMessageRequest) (*StreamResponse[MessageActionResponse], error) { + var result MessageActionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[TranslateMessageRequest, MessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/translate", nil, request, &result, pathParams) + res, err := MakeRequest[TranslateMessageRequest, MessageActionResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/translate", nil, request, &result, pathParams) return res, err } @@ -675,13 +651,12 @@ func (c *ChatClient) TranslateMessage(ctx context.Context, id string, request *T // // Sends events: // - message.undeleted -// - message.undeleted -func (c *ChatClient) UndeleteMessage(ctx context.Context, id string, request *UndeleteMessageRequest) (*StreamResponse[UpdateMessageResponse], error) { - var result UpdateMessageResponse +func (c *ChatClient) UndeleteMessage(ctx context.Context, id string, request *UndeleteMessageRequest) (*StreamResponse[UndeleteMessageResponse], error) { + var result UndeleteMessageResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UndeleteMessageRequest, UpdateMessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/undelete", nil, request, &result, pathParams) + res, err := MakeRequest[UndeleteMessageRequest, UndeleteMessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/undelete", nil, request, &result, pathParams) return res, err } @@ -784,7 +759,6 @@ func (c *ChatClient) QueryMessageFlags(ctx context.Context, request *QueryMessag // // Sends events: // - channel.muted -// - channel.muted func (c *ChatClient) MuteChannel(ctx context.Context, request *MuteChannelRequest) (*StreamResponse[MuteChannelResponse], error) { var result MuteChannelResponse res, err := MakeRequest[MuteChannelRequest, MuteChannelResponse](c.client, ctx, "POST", "/api/v2/chat/moderation/mute/channel", nil, request, &result, nil) @@ -795,7 +769,6 @@ func (c *ChatClient) MuteChannel(ctx context.Context, request *MuteChannelReques // // Sends events: // - channel.unmuted -// - channel.unmuted func (c *ChatClient) UnmuteChannel(ctx context.Context, request *UnmuteChannelRequest) (*StreamResponse[UnmuteResponse], error) { var result UnmuteResponse res, err := MakeRequest[UnmuteChannelRequest, UnmuteResponse](c.client, ctx, "POST", "/api/v2/chat/moderation/unmute/channel", nil, request, &result, nil) @@ -891,6 +864,21 @@ func (c *ChatClient) QuerySegmentTargets(ctx context.Context, id string, request return res, err } +// Retrieve team-level usage statistics from the warehouse database. +// Returns all 16 metrics grouped by team with cursor-based pagination. +// +// **Date Range Options (mutually exclusive):** +// - Use 'month' parameter (YYYY-MM format) for monthly aggregated values +// - Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown +// - If neither provided, defaults to current month (monthly mode) +// +// This endpoint is server-side only. +func (c *ChatClient) QueryTeamUsageStats(ctx context.Context, request *QueryTeamUsageStatsRequest) (*StreamResponse[QueryTeamUsageStatsResponse], error) { + var result QueryTeamUsageStatsResponse + res, err := MakeRequest[QueryTeamUsageStatsRequest, QueryTeamUsageStatsResponse](c.client, ctx, "POST", "/api/v2/chat/stats/team_usage", nil, request, &result, nil) + return res, err +} + // Returns the list of threads for specific user func (c *ChatClient) QueryThreads(ctx context.Context, request *QueryThreadsRequest) (*StreamResponse[QueryThreadsResponse], error) { var result QueryThreadsResponse @@ -913,7 +901,6 @@ func (c *ChatClient) GetThread(ctx context.Context, messageID string, request *G // // Sends events: // - thread.updated -// - thread.updated func (c *ChatClient) UpdateThreadPartial(ctx context.Context, messageID string, request *UpdateThreadPartialRequest) (*StreamResponse[UpdateThreadPartialResponse], error) { var result UpdateThreadPartialResponse pathParams := map[string]string{ diff --git a/chat_test.go b/chat_test.go index 4b91d8b..d9dcf2a 100644 --- a/chat_test.go +++ b/chat_test.go @@ -30,11 +30,11 @@ func TestChatStartCampaign(t *testing.T) { _, err = client.Chat().StartCampaign(context.Background(), "", &getstream.StartCampaignRequest{}) require.NoError(t, err) } -func TestChatScheduleCampaign(t *testing.T) { +func TestChatStopCampaign(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.Chat().ScheduleCampaign(context.Background(), "", &getstream.ScheduleCampaignRequest{}) + _, err = client.Chat().StopCampaign(context.Background(), "", &getstream.StopCampaignRequest{}) require.NoError(t, err) } func TestChatQueryChannels(t *testing.T) { @@ -128,13 +128,6 @@ func TestChatDeleteChannelFile(t *testing.T) { _, err = client.Chat().DeleteChannelFile(context.Background(), "", "", &getstream.DeleteChannelFileRequest{}) require.NoError(t, err) } -func TestChatUploadChannelFile(t *testing.T) { - 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) @@ -149,13 +142,6 @@ func TestChatDeleteChannelImage(t *testing.T) { _, err = client.Chat().DeleteChannelImage(context.Background(), "", "", &getstream.DeleteChannelImageRequest{}) require.NoError(t, err) } -func TestChatUploadChannelImage(t *testing.T) { - 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) @@ -534,6 +520,13 @@ func TestChatQuerySegmentTargets(t *testing.T) { _, err = client.Chat().QuerySegmentTargets(context.Background(), "", &getstream.QuerySegmentTargetsRequest{}) require.NoError(t, err) } +func TestChatQueryTeamUsageStats(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryTeamUsageStats(context.Background(), &getstream.QueryTeamUsageStatsRequest{}) + require.NoError(t, err) +} func TestChatQueryThreads(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.go b/common.go index 4201499..e0e00eb 100644 --- a/common.go +++ b/common.go @@ -512,6 +512,81 @@ func (c *Client) UploadImage(ctx context.Context, request *UploadImageRequest) ( return res, err } +// Lists user groups with cursor-based pagination +func (c *Client) ListUserGroups(ctx context.Context, request *ListUserGroupsRequest) (*StreamResponse[ListUserGroupsResponse], error) { + var result ListUserGroupsResponse + params := extractQueryParams(request) + res, err := MakeRequest[any, ListUserGroupsResponse](c, ctx, "GET", "/api/v2/usergroups", params, nil, &result, nil) + return res, err +} + +// Creates a new user group, optionally with initial members +func (c *Client) CreateUserGroup(ctx context.Context, request *CreateUserGroupRequest) (*StreamResponse[CreateUserGroupResponse], error) { + var result CreateUserGroupResponse + res, err := MakeRequest[CreateUserGroupRequest, CreateUserGroupResponse](c, ctx, "POST", "/api/v2/usergroups", nil, request, &result, nil) + return res, err +} + +// Searches user groups by name prefix for autocomplete +func (c *Client) SearchUserGroups(ctx context.Context, request *SearchUserGroupsRequest) (*StreamResponse[SearchUserGroupsResponse], error) { + var result SearchUserGroupsResponse + params := extractQueryParams(request) + res, err := MakeRequest[any, SearchUserGroupsResponse](c, ctx, "GET", "/api/v2/usergroups/search", params, nil, &result, nil) + return res, err +} + +// Deletes a user group and all its members +func (c *Client) DeleteUserGroup(ctx context.Context, id string, request *DeleteUserGroupRequest) (*StreamResponse[Response], error) { + var result Response + pathParams := map[string]string{ + "id": id, + } + params := extractQueryParams(request) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/usergroups/{id}", params, nil, &result, pathParams) + return res, err +} + +// Gets a user group by ID, including its members +func (c *Client) GetUserGroup(ctx context.Context, id string, request *GetUserGroupRequest) (*StreamResponse[GetUserGroupResponse], error) { + var result GetUserGroupResponse + pathParams := map[string]string{ + "id": id, + } + params := extractQueryParams(request) + res, err := MakeRequest[any, GetUserGroupResponse](c, ctx, "GET", "/api/v2/usergroups/{id}", params, nil, &result, pathParams) + return res, err +} + +// Updates a user group's name and/or description. team_id is immutable. +func (c *Client) UpdateUserGroup(ctx context.Context, id string, request *UpdateUserGroupRequest) (*StreamResponse[UpdateUserGroupResponse], error) { + var result UpdateUserGroupResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[UpdateUserGroupRequest, UpdateUserGroupResponse](c, ctx, "PUT", "/api/v2/usergroups/{id}", nil, request, &result, pathParams) + return res, err +} + +// Removes members from a user group. Users already not in the group are silently ignored. +func (c *Client) RemoveUserGroupMembers(ctx context.Context, id string, request *RemoveUserGroupMembersRequest) (*StreamResponse[RemoveUserGroupMembersResponse], error) { + var result RemoveUserGroupMembersResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[any, RemoveUserGroupMembersResponse](c, ctx, "DELETE", "/api/v2/usergroups/{id}/members", nil, nil, &result, pathParams) + return res, err +} + +// Adds members to a user group. All user IDs must exist. The operation is all-or-nothing. +func (c *Client) AddUserGroupMembers(ctx context.Context, id string, request *AddUserGroupMembersRequest) (*StreamResponse[AddUserGroupMembersResponse], error) { + var result AddUserGroupMembersResponse + pathParams := map[string]string{ + "id": id, + } + res, err := MakeRequest[AddUserGroupMembersRequest, AddUserGroupMembersResponse](c, ctx, "POST", "/api/v2/usergroups/{id}/members", nil, request, &result, pathParams) + return res, err +} + // Find and filter users func (c *Client) QueryUsers(ctx context.Context, request *QueryUsersRequest) (*StreamResponse[QueryUsersResponse], error) { var result QueryUsersResponse @@ -525,7 +600,6 @@ func (c *Client) QueryUsers(ctx context.Context, request *QueryUsersRequest) (*S // Sends events: // - user.presence.changed // - user.updated -// - user.presence.changed func (c *Client) UpdateUsersPartial(ctx context.Context, request *UpdateUsersPartialRequest) (*StreamResponse[UpdateUsersResponse], error) { var result UpdateUsersResponse res, err := MakeRequest[UpdateUsersPartialRequest, UpdateUsersResponse](c, ctx, "PATCH", "/api/v2/users", nil, request, &result, nil) @@ -598,7 +672,6 @@ func (c *Client) UpdateLiveLocation(ctx context.Context, request *UpdateLiveLoca // // Sends events: // - user.reactivated -// - user.reactivated func (c *Client) ReactivateUsers(ctx context.Context, request *ReactivateUsersRequest) (*StreamResponse[ReactivateUsersResponse], error) { var result ReactivateUsersResponse res, err := MakeRequest[ReactivateUsersRequest, ReactivateUsersResponse](c, ctx, "POST", "/api/v2/users/reactivate", nil, request, &result, nil) diff --git a/common_test.go b/common_test.go index cc32059..1feb9c4 100644 --- a/common_test.go +++ b/common_test.go @@ -387,28 +387,67 @@ 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") +func TestCommonDeleteImage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + _, err = client.DeleteImage(context.Background(), &getstream.DeleteImageRequest{}) + require.NoError(t, err) +} +func TestCommonListUserGroups(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.UploadFile(context.Background(), &getstream.UploadFileRequest{}) + _, err = client.ListUserGroups(context.Background(), &getstream.ListUserGroupsRequest{}) require.NoError(t, err) } -func TestCommonDeleteImage(t *testing.T) { +func TestCommonCreateUserGroup(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.DeleteImage(context.Background(), &getstream.DeleteImageRequest{}) + _, err = client.CreateUserGroup(context.Background(), &getstream.CreateUserGroupRequest{}) + require.NoError(t, err) +} +func TestCommonSearchUserGroups(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.SearchUserGroups(context.Background(), &getstream.SearchUserGroupsRequest{}) + require.NoError(t, err) +} +func TestCommonDeleteUserGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteUserGroup(context.Background(), "", &getstream.DeleteUserGroupRequest{}) + require.NoError(t, err) +} +func TestCommonGetUserGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetUserGroup(context.Background(), "", &getstream.GetUserGroupRequest{}) + require.NoError(t, err) +} +func TestCommonUpdateUserGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateUserGroup(context.Background(), "", &getstream.UpdateUserGroupRequest{}) + require.NoError(t, err) +} +func TestCommonRemoveUserGroupMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.RemoveUserGroupMembers(context.Background(), "", &getstream.RemoveUserGroupMembersRequest{}) require.NoError(t, err) } -func TestCommonUploadImage(t *testing.T) { - t.Skip("current test is wrong, autogenerated, skipping due to seperate integration test for upload") +func TestCommonAddUserGroupMembers(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.UploadImage(context.Background(), &getstream.UploadImageRequest{}) + _, err = client.AddUserGroupMembers(context.Background(), "", &getstream.AddUserGroupMembersRequest{}) require.NoError(t, err) } func TestCommonQueryUsers(t *testing.T) { diff --git a/feeds-v3.go b/feeds-v3.go index 9819a2f..863d560 100644 --- a/feeds-v3.go +++ b/feeds-v3.go @@ -29,6 +29,16 @@ func (c *FeedsClient) UpsertActivities(ctx context.Context, request *UpsertActiv return res, err } +// Updates certain fields of multiple activities in a batch. Use 'set' to update specific fields and 'unset' to remove fields. Activities that fail due to not found, permission denied, or no changes detected are silently skipped and not included in the response. However, validation errors (e.g., updating reserved fields, invalid field values) will fail the entire batch request. +// +// Sends events: +// - feeds.activity.updated +func (c *FeedsClient) UpdateActivitiesPartialBatch(ctx context.Context, request *UpdateActivitiesPartialBatchRequest) (*StreamResponse[UpdateActivitiesPartialBatchResponse], error) { + var result UpdateActivitiesPartialBatchResponse + res, err := MakeRequest[UpdateActivitiesPartialBatchRequest, UpdateActivitiesPartialBatchResponse](c.client, ctx, "PATCH", "/api/v2/feeds/activities/batch/partial", nil, request, &result, nil) + return res, err +} + // Delete one or more activities by their IDs func (c *FeedsClient) DeleteActivities(ctx context.Context, request *DeleteActivitiesRequest) (*StreamResponse[DeleteActivitiesResponse], error) { var result DeleteActivitiesResponse @@ -512,6 +522,17 @@ func (c *FeedsClient) RejectFeedMemberInvite(ctx context.Context, feedGroupID st return res, err } +// Query pinned activities for a feed with filter query +func (c *FeedsClient) QueryPinnedActivities(ctx context.Context, feedGroupID string, feedID string, request *QueryPinnedActivitiesRequest) (*StreamResponse[QueryPinnedActivitiesResponse], error) { + var result QueryPinnedActivitiesResponse + pathParams := map[string]string{ + "feed_group_id": feedGroupID, + "feed_id": feedID, + } + res, err := MakeRequest[QueryPinnedActivitiesRequest, QueryPinnedActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/pinned_activities/query", nil, request, &result, pathParams) + return res, err +} + // Get follow suggestions for a feed group func (c *FeedsClient) GetFollowSuggestions(ctx context.Context, feedGroupID string, request *GetFollowSuggestionsRequest) (*StreamResponse[GetFollowSuggestionsResponse], error) { var result GetFollowSuggestionsResponse @@ -523,6 +544,16 @@ func (c *FeedsClient) GetFollowSuggestions(ctx context.Context, feedGroupID stri return res, err } +// Restores a soft-deleted feed group by its ID. Only clears DeletedAt in the database; no other fields are updated. +func (c *FeedsClient) RestoreFeedGroup(ctx context.Context, feedGroupID string, request *RestoreFeedGroupRequest) (*StreamResponse[RestoreFeedGroupResponse], error) { + var result RestoreFeedGroupResponse + pathParams := map[string]string{ + "feed_group_id": feedGroupID, + } + res, err := MakeRequest[any, RestoreFeedGroupResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/restore", nil, nil, &result, pathParams) + return res, err +} + // Delete a feed group by its ID. Can perform a soft delete (default) or hard delete. func (c *FeedsClient) DeleteFeedGroup(ctx context.Context, id string, request *DeleteFeedGroupRequest) (*StreamResponse[DeleteFeedGroupResponse], error) { var result DeleteFeedGroupResponse diff --git a/feeds.go b/feeds.go index aa4eb59..75e8422 100644 --- a/feeds.go +++ b/feeds.go @@ -57,6 +57,10 @@ func (c *Feeds) RejectFeedMemberInvite(ctx context.Context, request *RejectFeedM return c.client.RejectFeedMemberInvite(ctx, c.feedType, c.feedID, request) } +func (c *Feeds) QueryPinnedActivities(ctx context.Context, request *QueryPinnedActivitiesRequest) (*StreamResponse[QueryPinnedActivitiesResponse], error) { + return c.client.QueryPinnedActivities(ctx, c.feedType, c.feedID, request) +} + func (c *FeedsClient) Feed(feedType, feedID string) *Feeds { return NewFeed(feedType, feedID, c) } diff --git a/feeds_test.go b/feeds_test.go index 491ea26..1e65f96 100644 --- a/feeds_test.go +++ b/feeds_test.go @@ -23,6 +23,13 @@ func TestFeedsUpsertActivities(t *testing.T) { _, err = client.Feeds().UpsertActivities(context.Background(), &getstream.UpsertActivitiesRequest{}) require.NoError(t, err) } +func TestFeedsUpdateActivitiesPartialBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateActivitiesPartialBatch(context.Background(), &getstream.UpdateActivitiesPartialBatchRequest{}) + require.NoError(t, err) +} func TestFeedsDeleteActivities(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -359,6 +366,13 @@ func TestFeedsRejectFeedMemberInvite(t *testing.T) { _, err = client.Feeds().RejectFeedMemberInvite(context.Background(), "", "", &getstream.RejectFeedMemberInviteRequest{}) require.NoError(t, err) } +func TestFeedsQueryPinnedActivities(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryPinnedActivities(context.Background(), "", "", &getstream.QueryPinnedActivitiesRequest{}) + require.NoError(t, err) +} func TestFeedsGetFollowSuggestions(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) @@ -366,6 +380,13 @@ func TestFeedsGetFollowSuggestions(t *testing.T) { _, err = client.Feeds().GetFollowSuggestions(context.Background(), "", &getstream.GetFollowSuggestionsRequest{}) require.NoError(t, err) } +func TestFeedsRestoreFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().RestoreFeedGroup(context.Background(), "", &getstream.RestoreFeedGroupRequest{}) + require.NoError(t, err) +} func TestFeedsDeleteFeedGroup(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) diff --git a/models.go b/models.go index a59a62e..3ef5c1b 100644 --- a/models.go +++ b/models.go @@ -2,346 +2,256 @@ package getstream type AIImageConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - OcrRules []OCRRule `json:"ocr_rules,omitempty"` - - Rules []AWSRekognitionRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + OcrRules []OCRRule `json:"ocr_rules,omitempty"` + Rules []AWSRekognitionRule `json:"rules,omitempty"` } type AITextConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Profile *string `json:"profile,omitempty"` - - Rules []BodyguardRule `json:"rules,omitempty"` - + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Profile *string `json:"profile,omitempty"` + Rules []BodyguardRule `json:"rules,omitempty"` SeverityRules []BodyguardSeverityRule `json:"severity_rules,omitempty"` } type AIVideoConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []AWSRekognitionRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []AWSRekognitionRule `json:"rules,omitempty"` } type APIError struct { // API error code Code int `json:"code"` - // Request duration Duration string `json:"duration"` - // Message describing an error Message string `json:"message"` - // URL with additional information MoreInfo string `json:"more_info"` - // Response HTTP status code StatusCode int `json:"StatusCode"` - // Additional error-specific information Details []int `json:"details"` - // Flag that indicates if the error is unrecoverable, requests that return unrecoverable errors should not be retried, this error only applies to the request that caused it Unrecoverable *bool `json:"unrecoverable,omitempty"` - // Additional error info ExceptionFields map[string]string `json:"exception_fields,omitempty"` } type APNConfig struct { - AuthKey *string `json:"auth_key,omitempty"` - - AuthType *string `json:"auth_type,omitempty"` - - BundleID *string `json:"bundle_id,omitempty"` - - Development *bool `json:"development,omitempty"` - - Disabled *bool `json:"Disabled,omitempty"` - - Host *string `json:"host,omitempty"` - - KeyID *string `json:"key_id,omitempty"` - + AuthKey *string `json:"auth_key,omitempty"` + AuthType *string `json:"auth_type,omitempty"` + BundleID *string `json:"bundle_id,omitempty"` + Development *bool `json:"development,omitempty"` + Disabled *bool `json:"Disabled,omitempty"` + Host *string `json:"host,omitempty"` + KeyID *string `json:"key_id,omitempty"` NotificationTemplate *string `json:"notification_template,omitempty"` - - P12Cert *string `json:"p12_cert,omitempty"` - - TeamID *string `json:"team_id,omitempty"` + P12Cert *string `json:"p12_cert,omitempty"` + TeamID *string `json:"team_id,omitempty"` } type APNConfigFields struct { - Development bool `json:"development"` - - Enabled bool `json:"enabled"` - - AuthKey *string `json:"auth_key,omitempty"` - - AuthType *string `json:"auth_type,omitempty"` - - BundleID *string `json:"bundle_id,omitempty"` - - Host *string `json:"host,omitempty"` - - KeyID *string `json:"key_id,omitempty"` - + Development bool `json:"development"` + Enabled bool `json:"enabled"` + AuthKey *string `json:"auth_key,omitempty"` + AuthType *string `json:"auth_type,omitempty"` + BundleID *string `json:"bundle_id,omitempty"` + Host *string `json:"host,omitempty"` + KeyID *string `json:"key_id,omitempty"` NotificationTemplate *string `json:"notification_template,omitempty"` - - P12Cert *string `json:"p12_cert,omitempty"` - - TeamID *string `json:"team_id,omitempty"` + P12Cert *string `json:"p12_cert,omitempty"` + TeamID *string `json:"team_id,omitempty"` } type APNS struct { - Body string `json:"body"` - - Title string `json:"title"` - - ContentAvailable *int `json:"content-available,omitempty"` - - MutableContent *int `json:"mutable-content,omitempty"` - - Sound *string `json:"sound,omitempty"` + Body string `json:"body"` + Title string `json:"title"` + ContentAvailable *int `json:"content-available,omitempty"` + MutableContent *int `json:"mutable-content,omitempty"` + Sound *string `json:"sound,omitempty"` + Data map[string]any `json:"data,omitempty"` +} - 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"` - - Label string `json:"label"` - - MinConfidence float64 `json:"min_confidence"` + Action string `json:"action"` + Label string `json:"label"` + MinConfidence float64 `json:"min_confidence"` + Subclassifications map[string]bool `json:"subclassifications,omitempty"` } type AcceptFeedMemberInviteResponse struct { - Duration string `json:"duration"` - - Member FeedMemberResponse `json:"member"` + Duration string `json:"duration"` + Member FeedMemberResponse `json:"member"` } type AcceptFollowResponse struct { - Duration string `json:"duration"` - - Follow FollowResponse `json:"follow"` + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` } type Action struct { - Name string `json:"name"` - - Text string `json:"text"` - - Type string `json:"type"` - + Name string `json:"name"` + Text string `json:"text"` + Type string `json:"type"` Style *string `json:"style,omitempty"` - Value *string `json:"value,omitempty"` } type ActionLogResponse struct { // Timestamp when the action was taken CreatedAt Timestamp `json:"created_at"` - // Unique identifier of the action log ID string `json:"id"` - // Reason for the moderation action Reason string `json:"reason"` - // ID of the user who was the target of the action TargetUserID string `json:"target_user_id"` - // ID of the user who performed the action UserID string `json:"user_id"` - // Type of moderation action - Type string `json:"type"` - + Type string `json:"type"` AiProviders []string `json:"ai_providers"` - // Additional metadata about the action - Custom map[string]any `json:"custom"` - + Custom map[string]any `json:"custom"` ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` - - TargetUser *UserResponse `json:"target_user,omitempty"` - - User *UserResponse `json:"user,omitempty"` + TargetUser *UserResponse `json:"target_user,omitempty"` + User *UserResponse `json:"user,omitempty"` } type ActionSequence struct { - Action *string `json:"action,omitempty"` - - Blur *bool `json:"blur,omitempty"` - - CooldownPeriod *int `json:"cooldown_period,omitempty"` - - Threshold *int `json:"threshold,omitempty"` - - TimeWindow *int `json:"time_window,omitempty"` - - Warning *bool `json:"warning,omitempty"` - - WarningText *string `json:"warning_text,omitempty"` + Action *string `json:"action,omitempty"` + Blur *bool `json:"blur,omitempty"` + CooldownPeriod *int `json:"cooldown_period,omitempty"` + Threshold *int `json:"threshold,omitempty"` + TimeWindow *int `json:"time_window,omitempty"` + Warning *bool `json:"warning,omitempty"` + WarningText *string `json:"warning_text,omitempty"` } type ActiveCallsBitrateStats struct { P10 float64 `json:"p10"` - P50 float64 `json:"p50"` } type ActiveCallsFPSStats struct { P05 float64 `json:"p05"` - P10 float64 `json:"p10"` - P50 float64 `json:"p50"` - P90 float64 `json:"p90"` } type ActiveCallsLatencyStats struct { P50 float64 `json:"p50"` - P90 float64 `json:"p90"` } type ActiveCallsMetrics struct { JoinCallAPI *JoinCallAPIMetrics `json:"join_call_api,omitempty"` - - Publishers *PublishersMetrics `json:"publishers,omitempty"` - + Publishers *PublishersMetrics `json:"publishers,omitempty"` Subscribers *SubscribersMetrics `json:"subscribers,omitempty"` } type ActiveCallsResolutionStats struct { P10 float64 `json:"p10"` - P50 float64 `json:"p50"` } type ActiveCallsSummary struct { - ActiveCalls int `json:"active_calls"` - - ActivePublishers int `json:"active_publishers"` - + ActiveCalls int `json:"active_calls"` + ActivePublishers int `json:"active_publishers"` ActiveSubscribers int `json:"active_subscribers"` - - Participants int `json:"participants"` + Participants int `json:"participants"` } // Emitted when an activity is added to a feed. type ActivityAddedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.activity.added" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityAddedEvent) GetEventType() string { - return "feeds.activity.added" +func (e *ActivityAddedEvent) GetEventType() string { + return e.Type } // Emitted when an activity is deleted. type ActivityDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.activity.deleted" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityDeletedEvent) GetEventType() string { - return "feeds.activity.deleted" +func (e *ActivityDeletedEvent) GetEventType() string { + return e.Type } // Emitted when activity feedback is provided. type ActivityFeedbackEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - + CreatedAt Timestamp `json:"created_at"` ActivityFeedback ActivityFeedbackEventPayload `json:"activity_feedback"` - - Custom map[string]any `json:"custom"` - + Custom map[string]any `json:"custom"` // The type of event: "feeds.activity.feedback" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityFeedbackEvent) GetEventType() string { - return "feeds.activity.feedback" +func (e *ActivityFeedbackEvent) GetEventType() string { + return e.Type } type ActivityFeedbackEventPayload struct { - // The type of feedback action + // The type of feedback action. One of: hide, show_more, show_less Action string `json:"action"` - // The activity that received feedback ActivityID string `json:"activity_id"` - // When the feedback was created CreatedAt Timestamp `json:"created_at"` - // When the feedback was last updated UpdatedAt Timestamp `json:"updated_at"` - // The feedback value (true/false) - Value string `json:"value"` - - User UserResponse `json:"user"` + Value string `json:"value"` + User UserResponse `json:"user"` } // Response for activity feedback submission type ActivityFeedbackResponse struct { // The ID of the activity that received feedback ActivityID string `json:"activity_id"` - - Duration string `json:"duration"` + Duration string `json:"duration"` } type ActivityLocation struct { // Latitude coordinate Lat float64 `json:"lat"` - // Longitude coordinate Lng float64 `json:"lng"` } @@ -349,102 +259,58 @@ type ActivityLocation struct { // Emitted when activities are marked as read, seen, or watched. type ActivityMarkEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.activity.marked" in this case - Type string `json:"type"` - + Type string `json:"type"` FeedVisibility *string `json:"feed_visibility,omitempty"` - // Whether all activities were marked as read MarkAllRead *bool `json:"mark_all_read,omitempty"` - // Whether all activities were marked as seen - MarkAllSeen *bool `json:"mark_all_seen,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + MarkAllSeen *bool `json:"mark_all_seen,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // The IDs of activities marked as read MarkRead []string `json:"mark_read,omitempty"` - // The IDs of activities marked as seen MarkSeen []string `json:"mark_seen,omitempty"` - // The IDs of activities marked as watched - MarkWatched []string `json:"mark_watched,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` -} - -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"` + MarkWatched []string `json:"mark_watched,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityMarkedEvent) GetEventType() string { - return "activity.marked" +func (e *ActivityMarkEvent) GetEventType() string { + return e.Type } type ActivityPinResponse struct { // When the pin was created CreatedAt Timestamp `json:"created_at"` - // ID of the feed where activity is pinned Feed string `json:"feed"` - // When the pin was last updated - UpdatedAt Timestamp `json:"updated_at"` - - Activity ActivityResponse `json:"activity"` - - User UserResponse `json:"user"` + UpdatedAt Timestamp `json:"updated_at"` + Activity ActivityResponse `json:"activity"` + User UserResponse `json:"user"` } // Emitted when an activity is pinned. type ActivityPinnedEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the feed - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` PinnedActivity PinActivityResponse `json:"pinned_activity"` - // The type of event: "feeds.activity.pinned" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityPinnedEvent) GetEventType() string { - return "feeds.activity.pinned" +func (e *ActivityPinnedEvent) GetEventType() string { + return e.Type } type ActivityProcessorConfig struct { @@ -455,172 +321,122 @@ type ActivityProcessorConfig struct { // Emitted when a reaction is added to an activity. type ActivityReactionAddedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` // The type of event: "feeds.activity.reaction.added" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityReactionAddedEvent) GetEventType() string { - return "feeds.activity.reaction.added" +func (e *ActivityReactionAddedEvent) GetEventType() string { + return e.Type } // Emitted when a reaction is deleted from an activity. type ActivityReactionDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` // The type of the reaction that was removed - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityReactionDeletedEvent) GetEventType() string { - return "feeds.activity.reaction.deleted" +func (e *ActivityReactionDeletedEvent) GetEventType() string { + return e.Type } // Emitted when a reaction is updated on an activity. type ActivityReactionUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` // The type of event: "feeds.activity.reaction.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityReactionUpdatedEvent) GetEventType() string { - return "feeds.activity.reaction.updated" +func (e *ActivityReactionUpdatedEvent) GetEventType() string { + return e.Type } // Emitted when an activity is removed from a feed. type ActivityRemovedFromFeedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.activity.removed_from_feed" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityRemovedFromFeedEvent) GetEventType() string { - return "feeds.activity.removed_from_feed" +func (e *ActivityRemovedFromFeedEvent) GetEventType() string { + return e.Type } type ActivityRequest struct { // Type of activity Type string `json:"type"` - // List of feeds to add the activity to with a default max limit of 25 feeds Feeds []string `json:"feeds"` - + // Whether to copy custom data to the notification activity (only applies when create_notification_activity is true) + CopyCustomToNotification *bool `json:"copy_custom_to_notification,omitempty"` // Whether to create notification activities for mentioned users CreateNotificationActivity *bool `json:"create_notification_activity,omitempty"` - // Expiration time for the activity ExpiresAt *string `json:"expires_at,omitempty"` - // Optional ID for the activity ID *string `json:"id,omitempty"` - // ID of parent activity for replies/comments ParentID *string `json:"parent_id,omitempty"` - // ID of a poll to attach to activity PollID *string `json:"poll_id,omitempty"` - - // Controls who can add comments/replies to this activity. Options: 'everyone' (default - anyone can reply), 'people_i_follow' (only people the activity creator follows can reply), 'nobody' (no one can reply) + // Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody RestrictReplies *string `json:"restrict_replies,omitempty"` - // Whether to skip URL enrichment for the activity SkipEnrichUrl *bool `json:"skip_enrich_url,omitempty"` - // Whether to skip push notifications SkipPush *bool `json:"skip_push,omitempty"` - // Text content of the activity Text *string `json:"text,omitempty"` - // ID of the user creating the activity UserID *string `json:"user_id,omitempty"` - - // Visibility setting for the activity + // Visibility setting for the activity. One of: public, private, tag Visibility *string `json:"visibility,omitempty"` - // If visibility is 'tag', this is the tag name and is required VisibilityTag *string `json:"visibility_tag,omitempty"` - // List of attachments for the activity Attachments []Attachment `json:"attachments,omitempty"` - // Collections that this activity references CollectionRefs []string `json:"collection_refs,omitempty"` - // Tags for filtering activities FilterTags []string `json:"filter_tags,omitempty"` - // Tags for indicating user interests InterestTags []string `json:"interest_tags,omitempty"` - // List of users mentioned in the activity MentionedUserIds []string `json:"mentioned_user_ids,omitempty"` - // Custom data for the activity - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` Location *ActivityLocation `json:"location,omitempty"` - // Additional data for search indexing SearchData map[string]any `json:"search_data,omitempty"` } @@ -628,188 +444,136 @@ type ActivityRequest struct { type ActivityResponse struct { // Number of bookmarks on the activity BookmarkCount int `json:"bookmark_count"` - // Number of comments on the activity CommentCount int `json:"comment_count"` - // When the activity was created CreatedAt Timestamp `json:"created_at"` - // If this activity is hidden by this user (using activity feedback) Hidden bool `json:"hidden"` - // Unique identifier for the activity ID string `json:"id"` - // Popularity score of the activity Popularity int `json:"popularity"` - // If this activity is obfuscated for this user. For premium content where you want to show a preview Preview bool `json:"preview"` - // Number of reactions to the activity ReactionCount int `json:"reaction_count"` - - // Controls who can reply to this activity. Values: everyone, people_i_follow, nobody + // Controls who can add comments/replies to this activity. One of: everyone, people_i_follow, nobody RestrictReplies string `json:"restrict_replies"` - // Ranking score for this activity Score float64 `json:"score"` - // Number of times the activity was shared ShareCount int `json:"share_count"` - // When the activity was last updated UpdatedAt Timestamp `json:"updated_at"` - - // Visibility setting for the activity + // Visibility setting for the activity. One of: public, private, tag Visibility string `json:"visibility"` - // Type of activity Type string `json:"type"` - // Media attachments for the activity Attachments []Attachment `json:"attachments"` - // Latest 5 comments of this activity (comment replies excluded) Comments []CommentResponse `json:"comments"` - // List of feed IDs containing this activity Feeds []string `json:"feeds"` - // Tags for filtering FilterTags []string `json:"filter_tags"` - // Tags for user interests InterestTags []string `json:"interest_tags"` - // Recent reactions to the activity LatestReactions []FeedsReactionResponse `json:"latest_reactions"` - // Users mentioned in the activity MentionedUsers []UserResponse `json:"mentioned_users"` - // Current user's bookmarks for this activity OwnBookmarks []BookmarkResponse `json:"own_bookmarks"` - // Current user's reactions to this activity OwnReactions []FeedsReactionResponse `json:"own_reactions"` - // Enriched collection data referenced by this activity Collections map[string]EnrichedCollectionResponse `json:"collections"` - // Custom data for the activity Custom map[string]any `json:"custom"` - // Grouped reactions by type - ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups"` - + ReactionGroups map[string]FeedsReactionGroupResponse `json:"reaction_groups"` // Data for search indexing SearchData map[string]any `json:"search_data"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // When the activity was deleted DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // When the activity was last edited EditedAt *Timestamp `json:"edited_at,omitempty"` - // When the activity will expire ExpiresAt *Timestamp `json:"expires_at,omitempty"` - - IsWatched *bool `json:"is_watched,omitempty"` - + // Total count of reactions from friends on this activity + FriendReactionCount *int `json:"friend_reaction_count,omitempty"` + // Whether this activity has been read. Only set for feed groups with notification config (track_seen/track_read enabled). + IsRead *bool `json:"is_read,omitempty"` + // Whether this activity has been seen. Only set for feed groups with notification config (track_seen/track_read enabled). + IsSeen *bool `json:"is_seen,omitempty"` + IsWatched *bool `json:"is_watched,omitempty"` ModerationAction *string `json:"moderation_action,omitempty"` - // Which activity selector provided this activity (e.g., 'following', 'popular', 'interest'). Only set when using multiple activity selectors with ranking. SelectorSource *string `json:"selector_source,omitempty"` - // Text content of the activity Text *string `json:"text,omitempty"` - // If visibility is 'tag', this is the tag name VisibilityTag *string `json:"visibility_tag,omitempty"` - - CurrentFeed *FeedResponse `json:"current_feed,omitempty"` - - Location *ActivityLocation `json:"location,omitempty"` - - Moderation *ModerationV2Response `json:"moderation,omitempty"` - - NotificationContext *NotificationContext `json:"notification_context,omitempty"` - - Parent *ActivityResponse `json:"parent,omitempty"` - - Poll *PollResponseData `json:"poll,omitempty"` + // Reactions from users the current user follows or has mutual follows with + FriendReactions []FeedsReactionResponse `json:"friend_reactions,omitempty"` + CurrentFeed *FeedResponse `json:"current_feed,omitempty"` + Location *ActivityLocation `json:"location,omitempty"` + Moderation *ModerationV2Response `json:"moderation,omitempty"` + NotificationContext *NotificationContext `json:"notification_context,omitempty"` + Parent *ActivityResponse `json:"parent,omitempty"` + Poll *PollResponseData `json:"poll,omitempty"` } // Emitted when an activity is restored. type ActivityRestoredEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` // The type of the event - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityRestoredEvent) GetEventType() string { - return "feeds.activity.restored" +func (e *ActivityRestoredEvent) GetEventType() string { + return e.Type } type ActivitySelectorConfig struct { - // Type of selector + // Type of selector. One of: popular, proximity, following, current_feed, query, interest, follow_suggestion Type string `json:"type"` - // Time threshold for activity selection (string). Expected RFC3339 format (e.g., 2006-01-02T15:04:05Z07:00). Cannot be used together with cutoff_window CutoffTime *string `json:"cutoff_time,omitempty"` - // Flexible relative time window for activity selection (e.g., '1h', '3d', '1y'). Activities older than this duration will be filtered out. Cannot be used together with cutoff_time CutoffWindow *string `json:"cutoff_window,omitempty"` - // Minimum popularity threshold MinPopularity *int `json:"min_popularity,omitempty"` - // Sort parameters for activity selection Sort []SortParamRequest `json:"sort,omitempty"` - // Filter for activity selection Filter map[string]any `json:"filter,omitempty"` - Params map[string]any `json:"params,omitempty"` } type ActivitySelectorConfigResponse struct { // Type of selector Type string `json:"type"` - // Time threshold for activity selection (timestamp) CutoffTime *Timestamp `json:"cutoff_time,omitempty"` - // Flexible relative time window for activity selection (e.g., '1h', '3d', '1y') CutoffWindow *string `json:"cutoff_window,omitempty"` - // Minimum popularity threshold MinPopularity *int `json:"min_popularity,omitempty"` - // Sort parameters for activity selection Sort []SortParamRequest `json:"sort,omitempty"` - // Filter for activity selection Filter map[string]any `json:"filter,omitempty"` - // Generic params for selector-specific configuration Params map[string]any `json:"params,omitempty"` } @@ -818,95 +582,71 @@ type ActivitySelectorConfigResponse struct { type ActivityUnpinnedEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the feed - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` PinnedActivity PinActivityResponse `json:"pinned_activity"` - // The type of event: "feeds.activity.unpinned" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityUnpinnedEvent) GetEventType() string { - return "feeds.activity.unpinned" +func (e *ActivityUnpinnedEvent) GetEventType() string { + return e.Type } // Emitted when an activity is updated. type ActivityUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Custom map[string]any `json:"custom"` // The type of the event - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ActivityUpdatedEvent) GetEventType() string { - return "feeds.activity.updated" +func (e *ActivityUpdatedEvent) GetEventType() string { + return e.Type } type AddActivityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` - // Number of mention notification activities created for mentioned users MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` } type AddBookmarkResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Bookmark BookmarkResponse `json:"bookmark"` } type AddCommentReactionResponse struct { // Duration of the request - Duration string `json:"duration"` - - Comment CommentResponse `json:"comment"` - + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` Reaction FeedsReactionResponse `json:"reaction"` - // Whether a notification activity was successfully created NotificationCreated *bool `json:"notification_created,omitempty"` } type AddCommentResponse struct { - Duration string `json:"duration"` - - Comment CommentResponse `json:"comment"` - + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` // Number of mention notification activities created for mentioned users MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` - // Whether a notification activity was successfully created NotificationCreated *bool `json:"notification_created,omitempty"` } type AddCommentsBatchResponse struct { Duration string `json:"duration"` - // List of comments added Comments []CommentResponse `json:"comments"` } @@ -914,7 +654,6 @@ type AddCommentsBatchResponse struct { type AddFolderRequest struct { // Name of the folder Name string `json:"name"` - // Custom data for the folder Custom map[string]any `json:"custom,omitempty"` } @@ -922,59 +661,54 @@ type AddFolderRequest struct { type AddReactionRequest struct { // Type of reaction Type string `json:"type"` - + // Whether to copy custom data to the notification activity (only applies when create_notification_activity is true) + CopyCustomToNotification *bool `json:"copy_custom_to_notification,omitempty"` // Whether to create a notification activity for this reaction CreateNotificationActivity *bool `json:"create_notification_activity,omitempty"` - // Whether to enforce unique reactions per user (remove other reaction types from the user when adding this one) - EnforceUnique *bool `json:"enforce_unique,omitempty"` - - SkipPush *bool `json:"skip_push,omitempty"` - - UserID *string `json:"user_id,omitempty"` - + EnforceUnique *bool `json:"enforce_unique,omitempty"` + SkipPush *bool `json:"skip_push,omitempty"` + UserID *string `json:"user_id,omitempty"` // Custom data for the reaction Custom map[string]any `json:"custom,omitempty"` - - User *UserRequest `json:"user,omitempty"` + User *UserRequest `json:"user,omitempty"` } type AddReactionResponse struct { - Duration string `json:"duration"` - - Activity ActivityResponse `json:"activity"` - + Duration string `json:"duration"` + Activity ActivityResponse `json:"activity"` Reaction FeedsReactionResponse `json:"reaction"` - // Whether a notification activity was successfully created NotificationCreated *bool `json:"notification_created,omitempty"` } +// Response for adding members to a user group +type AddUserGroupMembersResponse struct { + Duration string `json:"duration"` + UserGroup *UserGroupResponse `json:"user_group,omitempty"` +} + type AggregatedActivityResponse struct { // Number of activities in this aggregation ActivityCount int `json:"activity_count"` - // When the aggregation was created CreatedAt Timestamp `json:"created_at"` - // Grouping identifier Group string `json:"group"` - // Ranking score for this aggregation Score float64 `json:"score"` - // When the aggregation was last updated UpdatedAt Timestamp `json:"updated_at"` - // Number of unique users in this aggregation UserCount int `json:"user_count"` - // Whether this activity group has been truncated due to exceeding the group size limit UserCountTruncated bool `json:"user_count_truncated"` - // List of activities in this aggregation Activities []ActivityResponse `json:"activities"` - + // Whether this aggregated group has been read. Only set for feed groups with notification config (track_seen/track_read enabled). + IsRead *bool `json:"is_read,omitempty"` + // Whether this aggregated group has been seen. Only set for feed groups with notification config (track_seen/track_read enabled). + IsSeen *bool `json:"is_seen,omitempty"` IsWatched *bool `json:"is_watched,omitempty"` } @@ -983,631 +717,430 @@ 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"` - - AsyncUrlEnrichEnabled bool `json:"async_url_enrich_enabled"` - - AutoTranslationEnabled bool `json:"auto_translation_enabled"` - - CampaignEnabled bool `json:"campaign_enabled"` - - CdnExpirationSeconds int `json:"cdn_expiration_seconds"` - - CustomActionHandlerUrl string `json:"custom_action_handler_url"` - - DisableAuthChecks bool `json:"disable_auth_checks"` - - DisablePermissionsChecks bool `json:"disable_permissions_checks"` - - EnforceUniqueUsernames string `json:"enforce_unique_usernames"` - - GuestUserCreationDisabled bool `json:"guest_user_creation_disabled"` - - ID int `json:"id"` - - ImageModerationEnabled bool `json:"image_moderation_enabled"` - - MaxAggregatedActivitiesLength int `json:"max_aggregated_activities_length"` - - ModerationBulkSubmitActionEnabled bool `json:"moderation_bulk_submit_action_enabled"` - - ModerationEnabled bool `json:"moderation_enabled"` - - ModerationLlmConfigurabilityEnabled bool `json:"moderation_llm_configurability_enabled"` - - ModerationMultitenantBlocklistEnabled bool `json:"moderation_multitenant_blocklist_enabled"` - - ModerationWebhookUrl string `json:"moderation_webhook_url"` - - MultiTenantEnabled bool `json:"multi_tenant_enabled"` - - Name string `json:"name"` - - Organization string `json:"organization"` - - PermissionVersion string `json:"permission_version"` - - Placement string `json:"placement"` - - RemindersInterval int `json:"reminders_interval"` - - SnsKey string `json:"sns_key"` - - SnsSecret string `json:"sns_secret"` - - SnsTopicArn string `json:"sns_topic_arn"` - - SqsKey string `json:"sqs_key"` - - SqsSecret string `json:"sqs_secret"` - - SqsUrl string `json:"sqs_url"` - - Suspended bool `json:"suspended"` - - SuspendedExplanation string `json:"suspended_explanation"` - - UseHookV2 bool `json:"use_hook_v2"` - - UserResponseTimeEnabled bool `json:"user_response_time_enabled"` - - WebhookUrl string `json:"webhook_url"` - - EventHooks []EventHook `json:"event_hooks"` - - UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles"` - - WebhookEvents []string `json:"webhook_events"` - - CallTypes map[string]*CallType `json:"call_types"` - - ChannelConfigs map[string]*ChannelConfig `json:"channel_configs"` - - FileUploadConfig FileUploadConfig `json:"file_upload_config"` - - Grants map[string][]string `json:"grants"` - - ImageUploadConfig FileUploadConfig `json:"image_upload_config"` - - Policies map[string][]Policy `json:"policies"` - - PushNotifications PushNotificationFields `json:"push_notifications"` - - BeforeMessageSendHookUrl *string `json:"before_message_send_hook_url,omitempty"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Geofences []GeofenceResponse `json:"geofences,omitempty"` - - ImageModerationLabels []string `json:"image_moderation_labels,omitempty"` - - DatadogInfo *DataDogInfo `json:"datadog_info,omitempty"` - - ModerationDashboardPreferences *ModerationDashboardPreferences `json:"moderation_dashboard_preferences,omitempty"` + AllowMultiUserDevices bool `json:"allow_multi_user_devices"` + AsyncUrlEnrichEnabled bool `json:"async_url_enrich_enabled"` + AutoTranslationEnabled bool `json:"auto_translation_enabled"` + CampaignEnabled bool `json:"campaign_enabled"` + CdnExpirationSeconds int `json:"cdn_expiration_seconds"` + CustomActionHandlerUrl string `json:"custom_action_handler_url"` + DisableAuthChecks bool `json:"disable_auth_checks"` + DisablePermissionsChecks bool `json:"disable_permissions_checks"` + EnforceUniqueUsernames string `json:"enforce_unique_usernames"` + GuestUserCreationDisabled bool `json:"guest_user_creation_disabled"` + ID int `json:"id"` + ImageModerationEnabled bool `json:"image_moderation_enabled"` + MaxAggregatedActivitiesLength int `json:"max_aggregated_activities_length"` + ModerationAudioCallModerationEnabled bool `json:"moderation_audio_call_moderation_enabled"` + ModerationEnabled bool `json:"moderation_enabled"` + ModerationLlmConfigurabilityEnabled bool `json:"moderation_llm_configurability_enabled"` + ModerationMultitenantBlocklistEnabled bool `json:"moderation_multitenant_blocklist_enabled"` + ModerationVideoCallModerationEnabled bool `json:"moderation_video_call_moderation_enabled"` + ModerationWebhookUrl string `json:"moderation_webhook_url"` + MultiTenantEnabled bool `json:"multi_tenant_enabled"` + Name string `json:"name"` + Organization string `json:"organization"` + PermissionVersion string `json:"permission_version"` + Placement string `json:"placement"` + RemindersInterval int `json:"reminders_interval"` + SnsKey string `json:"sns_key"` + SnsSecret string `json:"sns_secret"` + SnsTopicArn string `json:"sns_topic_arn"` + SqsKey string `json:"sqs_key"` + SqsSecret string `json:"sqs_secret"` + SqsUrl string `json:"sqs_url"` + Suspended bool `json:"suspended"` + SuspendedExplanation string `json:"suspended_explanation"` + UseHookV2 bool `json:"use_hook_v2"` + UserResponseTimeEnabled bool `json:"user_response_time_enabled"` + WebhookUrl string `json:"webhook_url"` + EventHooks []EventHook `json:"event_hooks"` + UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles"` + WebhookEvents []string `json:"webhook_events"` + CallTypes map[string]*CallType `json:"call_types"` + ChannelConfigs map[string]*ChannelConfig `json:"channel_configs"` + FileUploadConfig FileUploadConfig `json:"file_upload_config"` + Grants map[string][]string `json:"grants"` + ImageUploadConfig FileUploadConfig `json:"image_upload_config"` + Policies map[string][]Policy `json:"policies"` + PushNotifications PushNotificationFields `json:"push_notifications"` + BeforeMessageSendHookUrl *string `json:"before_message_send_hook_url,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Geofences []GeofenceResponse `json:"geofences,omitempty"` + ImageModerationLabels []string `json:"image_moderation_labels,omitempty"` + DatadogInfo *DataDogInfo `json:"datadog_info,omitempty"` + ModerationDashboardPreferences *ModerationDashboardPreferences `json:"moderation_dashboard_preferences,omitempty"` } // This event is sent when an appeal is accepted type AppealAcceptedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Appeal *AppealItemResponse `json:"appeal,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Appeal *AppealItemResponse `json:"appeal,omitempty"` } -func (*AppealAcceptedEvent) GetEventType() string { - return "appeal.accepted" +func (e *AppealAcceptedEvent) GetEventType() string { + return e.Type } // This event is sent when an appeal is created type AppealCreatedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Appeal *AppealItemResponse `json:"appeal,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Appeal *AppealItemResponse `json:"appeal,omitempty"` } -func (*AppealCreatedEvent) GetEventType() string { - return "appeal.created" +func (e *AppealCreatedEvent) GetEventType() string { + return e.Type } type AppealItemResponse struct { // Reason Text of the Appeal Item AppealReason string `json:"appeal_reason"` - // When the flag was created CreatedAt Timestamp `json:"created_at"` - // ID of the entity EntityID string `json:"entity_id"` - // Type of entity EntityType string `json:"entity_type"` - - ID string `json:"id"` - + ID string `json:"id"` // Status of the Appeal Item Status string `json:"status"` - // When the flag was last updated UpdatedAt Timestamp `json:"updated_at"` - // Decision Reason of the Appeal Item DecisionReason *string `json:"decision_reason,omitempty"` - // Attachments(e.g. Images) of the Appeal Item - Attachments []string `json:"attachments,omitempty"` - + Attachments []string `json:"attachments,omitempty"` EntityContent *ModerationPayload `json:"entity_content,omitempty"` - - User *UserResponse `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } // This event is sent when an appeal is rejected type AppealRejectedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Appeal *AppealItemResponse `json:"appeal,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Appeal *AppealItemResponse `json:"appeal,omitempty"` } -func (*AppealRejectedEvent) GetEventType() string { - return "appeal.rejected" +func (e *AppealRejectedEvent) GetEventType() string { + return e.Type } type AppealResponse struct { // Unique identifier of the created Appeal item AppealID string `json:"appeal_id"` - Duration string `json:"duration"` } type AsyncBulkImageModerationEvent struct { - CreatedAt Timestamp `json:"created_at"` + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + StartedAt Timestamp `json:"started_at"` + TaskID string `json:"task_id"` + Url string `json:"url"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - FinishedAt Timestamp `json:"finished_at"` +func (e *AsyncBulkImageModerationEvent) GetEventType() string { + return e.Type +} - StartedAt Timestamp `json:"started_at"` +type AsyncExportChannelsEvent struct { + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + StartedAt Timestamp `json:"started_at"` + TaskID string `json:"task_id"` + Url string `json:"url"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - TaskID string `json:"task_id"` +func (e *AsyncExportChannelsEvent) GetEventType() string { + return e.Type +} - Url string `json:"url"` +type AsyncExportErrorEvent struct { + CreatedAt Timestamp `json:"created_at"` + Error string `json:"error"` + FinishedAt Timestamp `json:"finished_at"` + StartedAt Timestamp `json:"started_at"` + TaskID string `json:"task_id"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - Custom map[string]any `json:"custom"` +func (e *AsyncExportErrorEvent) GetEventType() string { + return e.Type +} - Type string `json:"type"` +type AsyncExportModerationLogsEvent struct { + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + StartedAt Timestamp `json:"started_at"` + TaskID string `json:"task_id"` + Url string `json:"url"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - ReceivedAt *Timestamp `json:"received_at,omitempty"` +func (e *AsyncExportModerationLogsEvent) GetEventType() string { + return e.Type } -func (*AsyncBulkImageModerationEvent) GetEventType() string { - return "export.bulk_image_moderation.success" +type AsyncExportUsersEvent struct { + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + StartedAt Timestamp `json:"started_at"` + TaskID string `json:"task_id"` + Url string `json:"url"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -type AsyncExportChannelsEvent struct { - CreatedAt Timestamp `json:"created_at"` - - FinishedAt Timestamp `json:"finished_at"` - - StartedAt Timestamp `json:"started_at"` - - TaskID string `json:"task_id"` - - Url string `json:"url"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*AsyncExportChannelsEvent) GetEventType() string { - return "export.channels.success" -} - -type AsyncExportErrorEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Error string `json:"error"` - - FinishedAt Timestamp `json:"finished_at"` - - StartedAt Timestamp `json:"started_at"` - - TaskID string `json:"task_id"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*AsyncExportErrorEvent) GetEventType() string { - return "export.bulk_image_moderation.error" -} - -type AsyncExportModerationLogsEvent struct { - CreatedAt Timestamp `json:"created_at"` - - FinishedAt Timestamp `json:"finished_at"` - - StartedAt Timestamp `json:"started_at"` - - TaskID string `json:"task_id"` - - Url string `json:"url"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*AsyncExportModerationLogsEvent) GetEventType() string { - return "export.moderation_logs.success" -} - -type AsyncExportUsersEvent struct { - CreatedAt Timestamp `json:"created_at"` - - FinishedAt Timestamp `json:"finished_at"` - - StartedAt Timestamp `json:"started_at"` - - TaskID string `json:"task_id"` - - Url string `json:"url"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*AsyncExportUsersEvent) GetEventType() string { - return "export.users.success" +func (e *AsyncExportUsersEvent) GetEventType() string { + return e.Type } type AsyncModerationCallbackConfig struct { - Mode *string `json:"mode,omitempty"` - + Mode *string `json:"mode,omitempty"` ServerUrl *string `json:"server_url,omitempty"` } type AsyncModerationConfiguration struct { - TimeoutMs *int `json:"timeout_ms,omitempty"` - - Callback *AsyncModerationCallbackConfig `json:"callback,omitempty"` + TimeoutMs *int `json:"timeout_ms,omitempty"` + Callback *AsyncModerationCallbackConfig `json:"callback,omitempty"` } // An attachment is a message object that represents a file uploaded by a user. type Attachment struct { - Custom map[string]any `json:"custom"` - - AssetUrl *string `json:"asset_url,omitempty"` - - AuthorIcon *string `json:"author_icon,omitempty"` - - AuthorLink *string `json:"author_link,omitempty"` - - AuthorName *string `json:"author_name,omitempty"` - - Color *string `json:"color,omitempty"` - - Fallback *string `json:"fallback,omitempty"` - - Footer *string `json:"footer,omitempty"` - - FooterIcon *string `json:"footer_icon,omitempty"` - - ImageUrl *string `json:"image_url,omitempty"` - - OGScrapeUrl *string `json:"og_scrape_url,omitempty"` - - OriginalHeight *int `json:"original_height,omitempty"` - - OriginalWidth *int `json:"original_width,omitempty"` - - Pretext *string `json:"pretext,omitempty"` - - Text *string `json:"text,omitempty"` - - ThumbUrl *string `json:"thumb_url,omitempty"` - - Title *string `json:"title,omitempty"` - - TitleLink *string `json:"title_link,omitempty"` - + Custom map[string]any `json:"custom"` + AssetUrl *string `json:"asset_url,omitempty"` + AuthorIcon *string `json:"author_icon,omitempty"` + AuthorLink *string `json:"author_link,omitempty"` + AuthorName *string `json:"author_name,omitempty"` + Color *string `json:"color,omitempty"` + Fallback *string `json:"fallback,omitempty"` + Footer *string `json:"footer,omitempty"` + FooterIcon *string `json:"footer_icon,omitempty"` + ImageUrl *string `json:"image_url,omitempty"` + OGScrapeUrl *string `json:"og_scrape_url,omitempty"` + OriginalHeight *int `json:"original_height,omitempty"` + OriginalWidth *int `json:"original_width,omitempty"` + Pretext *string `json:"pretext,omitempty"` + Text *string `json:"text,omitempty"` + ThumbUrl *string `json:"thumb_url,omitempty"` + Title *string `json:"title,omitempty"` + TitleLink *string `json:"title_link,omitempty"` // Attachment type (e.g. image, video, url) - Type *string `json:"type,omitempty"` - + Type *string `json:"type,omitempty"` Actions []Action `json:"actions,omitempty"` - - Fields []Field `json:"fields,omitempty"` - - Giphy *Images `json:"giphy,omitempty"` + Fields []Field `json:"fields,omitempty"` + Giphy *Images `json:"giphy,omitempty"` } type AudioSettings struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - DefaultDevice string `json:"default_device"` - - HifiAudioEnabled bool `json:"hifi_audio_enabled"` - - MicDefaultOn bool `json:"mic_default_on"` - - OpusDtxEnabled bool `json:"opus_dtx_enabled"` - - RedundantCodingEnabled bool `json:"redundant_coding_enabled"` - - SpeakerDefaultOn bool `json:"speaker_default_on"` - - NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` + AccessRequestEnabled bool `json:"access_request_enabled"` + DefaultDevice string `json:"default_device"` + HifiAudioEnabled bool `json:"hifi_audio_enabled"` + MicDefaultOn bool `json:"mic_default_on"` + OpusDtxEnabled bool `json:"opus_dtx_enabled"` + RedundantCodingEnabled bool `json:"redundant_coding_enabled"` + SpeakerDefaultOn bool `json:"speaker_default_on"` + NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` } type AudioSettingsRequest struct { - DefaultDevice string `json:"default_device"` - - AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` - - HifiAudioEnabled *bool `json:"hifi_audio_enabled,omitempty"` - - MicDefaultOn *bool `json:"mic_default_on,omitempty"` - - OpusDtxEnabled *bool `json:"opus_dtx_enabled,omitempty"` - - RedundantCodingEnabled *bool `json:"redundant_coding_enabled,omitempty"` - - SpeakerDefaultOn *bool `json:"speaker_default_on,omitempty"` - - NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` + DefaultDevice string `json:"default_device"` + AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` + HifiAudioEnabled *bool `json:"hifi_audio_enabled,omitempty"` + MicDefaultOn *bool `json:"mic_default_on,omitempty"` + OpusDtxEnabled *bool `json:"opus_dtx_enabled,omitempty"` + RedundantCodingEnabled *bool `json:"redundant_coding_enabled,omitempty"` + SpeakerDefaultOn *bool `json:"speaker_default_on,omitempty"` + NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` } type AudioSettingsResponse struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - DefaultDevice string `json:"default_device"` - - HifiAudioEnabled bool `json:"hifi_audio_enabled"` - - MicDefaultOn bool `json:"mic_default_on"` - - OpusDtxEnabled bool `json:"opus_dtx_enabled"` - - RedundantCodingEnabled bool `json:"redundant_coding_enabled"` - - SpeakerDefaultOn bool `json:"speaker_default_on"` - - NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` + AccessRequestEnabled bool `json:"access_request_enabled"` + DefaultDevice string `json:"default_device"` + HifiAudioEnabled bool `json:"hifi_audio_enabled"` + MicDefaultOn bool `json:"mic_default_on"` + OpusDtxEnabled bool `json:"opus_dtx_enabled"` + RedundantCodingEnabled bool `json:"redundant_coding_enabled"` + SpeakerDefaultOn bool `json:"speaker_default_on"` + NoiseCancellation *NoiseCancellationSettings `json:"noise_cancellation,omitempty"` } -type AutomodDetails 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"` - - Result *MessageModerationResult `json:"result,omitempty"` +type AutomodDetailsResponse struct { + Action *string `json:"action,omitempty"` + OriginalMessageType *string `json:"original_message_type,omitempty"` + ImageLabels []string `json:"image_labels,omitempty"` + MessageDetails *FlagMessageDetailsResponse `json:"message_details,omitempty"` + Result *MessageModerationResult `json:"result,omitempty"` } type AutomodPlatformCircumventionConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []AutomodRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []AutomodRule `json:"rules,omitempty"` } type AutomodRule struct { - Action string `json:"action"` - - Label string `json:"label"` - + Action string `json:"action"` + Label string `json:"label"` Threshold float64 `json:"threshold"` } type AutomodSemanticFiltersConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []AutomodSemanticFiltersRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []AutomodSemanticFiltersRule `json:"rules,omitempty"` } type AutomodSemanticFiltersRule struct { - Action string `json:"action"` - - Name string `json:"name"` - + Action string `json:"action"` + Name string `json:"name"` Threshold float64 `json:"threshold"` } type AutomodToxicityConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []AutomodRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []AutomodRule `json:"rules,omitempty"` } // Config for creating Azure Blob Storage storage type AzureRequest struct { // The account name AbsAccountName string `json:"abs_account_name"` - // The client id AbsClientID string `json:"abs_client_id"` - // The client secret AbsClientSecret string `json:"abs_client_secret"` - // The tenant id AbsTenantID string `json:"abs_tenant_id"` } type BackstageSettings struct { - Enabled bool `json:"enabled"` - + Enabled bool `json:"enabled"` JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` } type BackstageSettingsRequest struct { - Enabled *bool `json:"enabled,omitempty"` - - JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` } type BackstageSettingsResponse struct { - Enabled bool `json:"enabled"` - + Enabled bool `json:"enabled"` JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` } -type Ban struct { - CreatedAt Timestamp `json:"created_at"` - - Shadow bool `json:"shadow"` - - Expires *Timestamp `json:"expires,omitempty"` - - Reason *string `json:"reason,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - CreatedBy *User `json:"created_by,omitempty"` - - Target *User `json:"target,omitempty"` -} - -type BanActionRequest struct { +// Configuration for ban moderation action +type BanActionRequestPayload struct { + // Ban only from specific channel ChannelBanOnly *bool `json:"channel_ban_only,omitempty"` - + // Message deletion mode: soft, pruning, or hard DeleteMessages *string `json:"delete_messages,omitempty"` - + // Whether to ban by IP address IpBan *bool `json:"ip_ban,omitempty"` - + // Reason for the ban Reason *string `json:"reason,omitempty"` - + // Whether this is a shadow ban Shadow *bool `json:"shadow,omitempty"` - + // Optional: ban user directly without review item + TargetUserID *string `json:"target_user_id,omitempty"` + // Duration of ban in minutes Timeout *int `json:"timeout,omitempty"` } -type BanOptions struct { - DeleteMessages *string `json:"delete_messages,omitempty"` - - Duration *int `json:"duration,omitempty"` - - IpBan *bool `json:"ip_ban,omitempty"` - - Reason *string `json:"reason,omitempty"` - - ShadowBan *bool `json:"shadow_ban,omitempty"` -} - -type BanResponse struct { +// Ban information +type BanInfoResponse struct { + // When the ban was created CreatedAt Timestamp `json:"created_at"` - + // 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"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + User *UserResponse `json:"user,omitempty"` +} - Shadow *bool `json:"shadow,omitempty"` - - BannedBy *UserResponse `json:"banned_by,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - User *UserResponse `json:"user,omitempty"` +type BanOptions struct { + DeleteMessages *string `json:"delete_messages,omitempty"` + Duration *int `json:"duration,omitempty"` + IpBan *bool `json:"ip_ban,omitempty"` + Reason *string `json:"reason,omitempty"` + ShadowBan *bool `json:"shadow_ban,omitempty"` } -type BlockActionRequest struct { +type BanResponse struct { + CreatedAt Timestamp `json:"created_at"` + Expires *Timestamp `json:"expires,omitempty"` + Reason *string `json:"reason,omitempty"` + Shadow *bool `json:"shadow,omitempty"` + BannedBy *UserResponse `json:"banned_by,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + User *UserResponse `json:"user,omitempty"` +} + +// Configuration for block action +type BlockActionRequestPayload struct { + // Reason for blocking Reason *string `json:"reason,omitempty"` } type BlockListConfig struct { - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []BlockListRule `json:"rules,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []BlockListRule `json:"rules,omitempty"` } type BlockListOptions struct { - // Blocklist behavior + // Blocklist behavior. One of: flag, block, shadow_block Behavior string `json:"behavior"` - // Blocklist name Blocklist string `json:"blocklist"` } // Block list contains restricted words type BlockListResponse struct { - IsLeetCheckEnabled bool `json:"is_leet_check_enabled"` - + IsLeetCheckEnabled bool `json:"is_leet_check_enabled"` IsPluralCheckEnabled bool `json:"is_plural_check_enabled"` - // Block list name Name string `json:"name"` - - // Block list type. + // Block list type. One of: regex, domain, domain_allowlist, email, email_allowlist, word Type string `json:"type"` - // List of words to block Words []string `json:"words"` - // Date/time of creation CreatedAt *Timestamp `json:"created_at,omitempty"` - - ID *string `json:"id,omitempty"` - - Team *string `json:"team,omitempty"` - + ID *string `json:"id,omitempty"` + Team *string `json:"team,omitempty"` // Date/time of the last update UpdatedAt *Timestamp `json:"updated_at,omitempty"` } type BlockListRule struct { - Action string `json:"action"` - - Name *string `json:"name,omitempty"` - - Team *string `json:"team,omitempty"` + Action string `json:"action"` + Name *string `json:"name,omitempty"` + Team *string `json:"team,omitempty"` } // BlockUserResponse is the payload for blocking a user. @@ -1619,13 +1152,10 @@ type BlockUserResponse struct { type BlockUsersResponse struct { // User id who blocked another user BlockedByUserID string `json:"blocked_by_user_id"` - // User id who got blocked BlockedUserID string `json:"blocked_user_id"` - // Timestamp when the user was blocked CreatedAt Timestamp `json:"created_at"` - // Duration of the request in milliseconds Duration string `json:"duration"` } @@ -1633,34 +1163,26 @@ type BlockUsersResponse struct { // This event is sent to call participants to notify when a user is blocked on a call, clients can use this event to show a notification. // If the user is the current user, the client should leave the call screen as well type BlockedUserEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - User UserResponse `json:"user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + User UserResponse `json:"user"` // The type of event: "call.blocked_user" in this case - Type string `json:"type"` - + Type string `json:"type"` BlockedByUser *UserResponse `json:"blocked_by_user,omitempty"` } -func (*BlockedUserEvent) GetEventType() string { - return "call.blocked_user" +func (e *BlockedUserEvent) GetEventType() string { + return e.Type } type BlockedUserResponse struct { // ID of the user who got blocked - BlockedUserID string `json:"blocked_user_id"` - - CreatedAt Timestamp `json:"created_at"` - + BlockedUserID string `json:"blocked_user_id"` + CreatedAt Timestamp `json:"created_at"` // ID of the user who blocked another user - UserID string `json:"user_id"` - + UserID string `json:"user_id"` BlockedUser UserResponse `json:"blocked_user"` - - User UserResponse `json:"user"` + User UserResponse `json:"user"` } type BodyguardImageAnalysisConfig struct { @@ -1668,97 +1190,74 @@ type BodyguardImageAnalysisConfig struct { } type BodyguardRule struct { - Label string `json:"label"` - - Action *string `json:"action,omitempty"` - + Label string `json:"label"` + Action *string `json:"action,omitempty"` SeverityRules []BodyguardSeverityRule `json:"severity_rules,omitempty"` } type BodyguardSeverityRule struct { - Action string `json:"action"` - + Action string `json:"action"` Severity string `json:"severity"` } // Emitted when a user bookmarks an activity. type BookmarkAddedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Bookmark BookmarkResponse `json:"bookmark"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Bookmark BookmarkResponse `json:"bookmark"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.bookmark.added" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*BookmarkAddedEvent) GetEventType() string { - return "feeds.bookmark.added" +func (e *BookmarkAddedEvent) GetEventType() string { + return e.Type } // Emitted when a user deletes a bookmark from an activity. type BookmarkDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` + CreatedAt Timestamp `json:"created_at"` + Bookmark BookmarkResponse `json:"bookmark"` + Custom map[string]any `json:"custom"` + // The type of event: "feeds.bookmark.deleted" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} - Bookmark BookmarkResponse `json:"bookmark"` - - Custom map[string]any `json:"custom"` - - // The type of event: "feeds.bookmark.deleted" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` -} - -func (*BookmarkDeletedEvent) GetEventType() string { - return "feeds.bookmark.deleted" -} +func (e *BookmarkDeletedEvent) GetEventType() string { + return e.Type +} // Emitted when a bookmark folder is deleted. type BookmarkFolderDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - + CreatedAt Timestamp `json:"created_at"` BookmarkFolder BookmarkFolderResponse `json:"bookmark_folder"` - - Custom map[string]any `json:"custom"` - + Custom map[string]any `json:"custom"` // The type of event: "feeds.bookmark_folder.deleted" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*BookmarkFolderDeletedEvent) GetEventType() string { - return "feeds.bookmark_folder.deleted" +func (e *BookmarkFolderDeletedEvent) GetEventType() string { + return e.Type } type BookmarkFolderResponse struct { // When the folder was created CreatedAt Timestamp `json:"created_at"` - // Unique identifier for the folder ID string `json:"id"` - // Name of the folder Name string `json:"name"` - // When the folder was last updated - UpdatedAt Timestamp `json:"updated_at"` - - User UserResponse `json:"user"` - + UpdatedAt Timestamp `json:"updated_at"` + User UserResponse `json:"user"` // Custom data for the folder Custom map[string]any `json:"custom,omitempty"` } @@ -1766,221 +1265,208 @@ type BookmarkFolderResponse struct { // Emitted when a bookmark folder is updated. type BookmarkFolderUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - + CreatedAt Timestamp `json:"created_at"` BookmarkFolder BookmarkFolderResponse `json:"bookmark_folder"` - - Custom map[string]any `json:"custom"` - + Custom map[string]any `json:"custom"` // The type of event: "feeds.bookmark_folder.updated" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*BookmarkFolderUpdatedEvent) GetEventType() string { - return "feeds.bookmark_folder.updated" +func (e *BookmarkFolderUpdatedEvent) GetEventType() string { + return e.Type } type BookmarkResponse struct { // When the bookmark was created CreatedAt Timestamp `json:"created_at"` - // When the bookmark was last updated - UpdatedAt Timestamp `json:"updated_at"` - - Activity ActivityResponse `json:"activity"` - - User UserResponse `json:"user"` - + UpdatedAt Timestamp `json:"updated_at"` + Activity ActivityResponse `json:"activity"` + User UserResponse `json:"user"` // Custom data for the bookmark - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` Folder *BookmarkFolderResponse `json:"folder,omitempty"` } // Emitted when a user updates a bookmark. type BookmarkUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Bookmark BookmarkResponse `json:"bookmark"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Bookmark BookmarkResponse `json:"bookmark"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.bookmark.updated" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*BookmarkUpdatedEvent) GetEventType() string { - return "feeds.bookmark.updated" +func (e *BookmarkUpdatedEvent) GetEventType() string { + return e.Type } type Bound struct { - Inclusive bool `json:"inclusive"` - - Value float64 `json:"value"` + Inclusive bool `json:"inclusive"` + Value float64 `json:"value"` } type BroadcastSettings struct { - Enabled bool `json:"enabled"` - - HLS *HLSSettings `json:"hls,omitempty"` - - RTMP *RTMPSettings `json:"rtmp,omitempty"` + Enabled bool `json:"enabled"` + HLS *HLSSettings `json:"hls,omitempty"` + RTMP *RTMPSettings `json:"rtmp,omitempty"` } type BroadcastSettingsRequest struct { - Enabled *bool `json:"enabled,omitempty"` - - HLS *HLSSettingsRequest `json:"hls,omitempty"` - - RTMP *RTMPSettingsRequest `json:"rtmp,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + HLS *HLSSettingsRequest `json:"hls,omitempty"` + RTMP *RTMPSettingsRequest `json:"rtmp,omitempty"` } // BroadcastSettingsResponse is the payload for broadcasting settings type BroadcastSettingsResponse struct { - Enabled bool `json:"enabled"` - - HLS HLSSettingsResponse `json:"hls"` - - RTMP RTMPSettingsResponse `json:"rtmp"` + Enabled bool `json:"enabled"` + HLS HLSSettingsResponse `json:"hls"` + RTMP RTMPSettingsResponse `json:"rtmp"` } type BrowserDataResponse struct { - Name *string `json:"name,omitempty"` - + Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` } type BulkImageModerationResponse struct { Duration string `json:"duration"` - // ID of the task for processing the bulk image moderation TaskID string `json:"task_id"` } // This event is sent when a user accepts a notification to join a call. type CallAcceptedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Call CallResponse `json:"call"` - - User UserResponse `json:"user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` + User UserResponse `json:"user"` // The type of event: "call.accepted" in this case Type string `json:"type"` } -func (*CallAcceptedEvent) GetEventType() string { - return "call.accepted" +func (e *CallAcceptedEvent) GetEventType() string { + return e.Type +} + +type CallActionOptions struct { + Duration *int `json:"duration,omitempty"` + FlagReason *string `json:"flag_reason,omitempty"` + KickReason *string `json:"kick_reason,omitempty"` + MuteAudio *bool `json:"mute_audio,omitempty"` + MuteVideo *bool `json:"mute_video,omitempty"` + Reason *string `json:"reason,omitempty"` + WarningText *string `json:"warning_text,omitempty"` } // CallClosedCaption represents a closed caption of a call. type CallClosedCaption struct { - EndTime Timestamp `json:"end_time"` - - ID string `json:"id"` - - Language string `json:"language"` - - SpeakerID string `json:"speaker_id"` - - StartTime Timestamp `json:"start_time"` - - Text string `json:"text"` - - Translated bool `json:"translated"` - - User UserResponse `json:"user"` - - Service *string `json:"service,omitempty"` + EndTime Timestamp `json:"end_time"` + ID string `json:"id"` + Language string `json:"language"` + SpeakerID string `json:"speaker_id"` + StartTime Timestamp `json:"start_time"` + Text string `json:"text"` + Translated bool `json:"translated"` + User UserResponse `json:"user"` + Service *string `json:"service,omitempty"` } // This event is sent when call closed captions has failed type CallClosedCaptionsFailedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The type of event: "call.closed_captions_failed" in this case Type string `json:"type"` } -func (*CallClosedCaptionsFailedEvent) GetEventType() string { - return "call.closed_captions_failed" +func (e *CallClosedCaptionsFailedEvent) GetEventType() string { + return e.Type } // This event is sent when call closed caption has started type CallClosedCaptionsStartedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The type of event: "call.closed_captions_started" in this case Type string `json:"type"` } -func (*CallClosedCaptionsStartedEvent) GetEventType() string { - return "call.closed_captions_started" +func (e *CallClosedCaptionsStartedEvent) GetEventType() string { + return e.Type } // This event is sent when call closed captions has stopped type CallClosedCaptionsStoppedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The type of event: "call.transcription_stopped" in this case Type string `json:"type"` } -func (*CallClosedCaptionsStoppedEvent) GetEventType() string { - return "call.closed_captions_stopped" +func (e *CallClosedCaptionsStoppedEvent) GetEventType() string { + return e.Type } // This event is sent when a call is created. Clients receiving this event should check if the ringing // field is set to true and if so, show the call screen type CallCreatedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // the members added to this call Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - + Call CallResponse `json:"call"` // The type of event: "call.created" in this case Type string `json:"type"` } -func (*CallCreatedEvent) GetEventType() string { - return "call.created" +func (e *CallCreatedEvent) GetEventType() string { + return e.Type } -// This event is sent when a call is deleted. Clients receiving this event should leave the call screen -type CallDeletedEvent struct { - CallCid string `json:"call_cid"` +type CallCustomPropertyParameters struct { + Operator *string `json:"operator,omitempty"` + PropertyKey *string `json:"property_key,omitempty"` +} +// This event is sent asynchronously when a single DTMF digit is received from a SIP participant. The event is broadcast after the digit press ends. Use seq_number for ordering within a session and timestamp for the actual detection time. +type CallDTMFEvent struct { + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` + // The DTMF digit (0-9, *, #, A-D) + Digit string `json:"digit"` + // Duration of the digit press in milliseconds + DurationMs int `json:"duration_ms"` + // Monotonically increasing sequence number for ordering DTMF events within a session + SeqNumber int `json:"seq_number"` + // When the digit press ended and was detected + Timestamp Timestamp `json:"timestamp"` + User UserResponse `json:"user"` + // The type of event: "call.dtmf" in this case + Type string `json:"type"` +} - Call CallResponse `json:"call"` +func (e *CallDTMFEvent) GetEventType() string { + return e.Type +} +// This event is sent when a call is deleted. Clients receiving this event should leave the call screen +type CallDeletedEvent struct { + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` // The type of event: "call.deleted" in this case Type string `json:"type"` } -func (*CallDeletedEvent) GetEventType() string { - return "call.deleted" +func (e *CallDeletedEvent) GetEventType() string { + return e.Type } type CallDurationReport struct { @@ -1993,351 +1479,274 @@ type CallDurationReportResponse struct { // This event is sent when a call is mark as ended for all its participants. Clients receiving this event should leave the call screen type CallEndedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` // The type of event: "call.ended" in this case Type string `json:"type"` - // The reason why the call ended, if available - Reason *string `json:"reason,omitempty"` - - User *UserResponse `json:"user,omitempty"` + Reason *string `json:"reason,omitempty"` + User *UserResponse `json:"user,omitempty"` } -func (*CallEndedEvent) GetEventType() string { - return "call.ended" +func (e *CallEndedEvent) GetEventType() string { + return e.Type } // This event is sent when frame recording has failed type CallFrameRecordingFailedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + EgressID string `json:"egress_id"` + Call CallResponse `json:"call"` // The type of event: "call.frame_recording_failed" in this case Type string `json:"type"` } -func (*CallFrameRecordingFailedEvent) GetEventType() string { - return "call.frame_recording_failed" +func (e *CallFrameRecordingFailedEvent) GetEventType() string { + return e.Type } // This event is sent when a frame is captured from a call type CallFrameRecordingFrameReadyEvent struct { CallCid string `json:"call_cid"` - // The time the frame was captured CapturedAt Timestamp `json:"captured_at"` - - CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + CreatedAt Timestamp `json:"created_at"` + EgressID string `json:"egress_id"` // Call session ID SessionID string `json:"session_id"` - // The type of the track frame was captured from (TRACK_TYPE_VIDEO|TRACK_TYPE_SCREEN_SHARE) TrackType string `json:"track_type"` - // The URL of the frame Url string `json:"url"` - // The users in the frame Users map[string]UserResponse `json:"users"` - // The type of event: "call.frame_recording_ready" in this case Type string `json:"type"` } -func (*CallFrameRecordingFrameReadyEvent) GetEventType() string { - return "call.frame_recording_ready" +func (e *CallFrameRecordingFrameReadyEvent) GetEventType() string { + return e.Type } // This event is sent when frame recording has started type CallFrameRecordingStartedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + EgressID string `json:"egress_id"` + Call CallResponse `json:"call"` // The type of event: "call.frame_recording_started" in this case Type string `json:"type"` } -func (*CallFrameRecordingStartedEvent) GetEventType() string { - return "call.frame_recording_started" +func (e *CallFrameRecordingStartedEvent) GetEventType() string { + return e.Type } // This event is sent when frame recording has stopped type CallFrameRecordingStoppedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + EgressID string `json:"egress_id"` + Call CallResponse `json:"call"` // The type of event: "call.frame_recording_stopped" in this case Type string `json:"type"` } -func (*CallFrameRecordingStoppedEvent) GetEventType() string { - return "call.frame_recording_stopped" +func (e *CallFrameRecordingStoppedEvent) GetEventType() string { + return e.Type } // This event is sent when HLS broadcasting has failed type CallHLSBroadcastingFailedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The type of event: "call.hls_broadcasting_failed" in this case Type string `json:"type"` } -func (*CallHLSBroadcastingFailedEvent) GetEventType() string { - return "call.hls_broadcasting_failed" +func (e *CallHLSBroadcastingFailedEvent) GetEventType() string { + return e.Type } // This event is sent when HLS broadcasting has started type CallHLSBroadcastingStartedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - HLSPlaylistUrl string `json:"hls_playlist_url"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + HLSPlaylistUrl string `json:"hls_playlist_url"` + Call CallResponse `json:"call"` // The type of event: "call.hls_broadcasting_started" in this case Type string `json:"type"` } -func (*CallHLSBroadcastingStartedEvent) GetEventType() string { - return "call.hls_broadcasting_started" +func (e *CallHLSBroadcastingStartedEvent) GetEventType() string { + return e.Type } // This event is sent when HLS broadcasting has stopped type CallHLSBroadcastingStoppedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The type of event: "call.hls_broadcasting_stopped" in this case Type string `json:"type"` } -func (*CallHLSBroadcastingStoppedEvent) GetEventType() string { - return "call.hls_broadcasting_stopped" +func (e *CallHLSBroadcastingStoppedEvent) GetEventType() string { + return e.Type } // CallIngressResponse is the payload for ingress settings type CallIngressResponse struct { RTMP RTMPIngress `json:"rtmp"` - - Srt SRTIngress `json:"srt"` - + Srt SRTIngress `json:"srt"` Whip WHIPIngress `json:"whip"` } // This event is sent when a call is started. Clients receiving this event should start the call. type CallLiveStartedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` // The type of event: "call.live_started" in this case Type string `json:"type"` } -func (*CallLiveStartedEvent) GetEventType() string { - return "call.live_started" +func (e *CallLiveStartedEvent) GetEventType() string { + return e.Type } // This event is sent when one or more members are added to a call type CallMemberAddedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // the members added to this call Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - + Call CallResponse `json:"call"` // The type of event: "call.member_added" in this case Type string `json:"type"` } -func (*CallMemberAddedEvent) GetEventType() string { - return "call.member_added" +func (e *CallMemberAddedEvent) GetEventType() string { + return e.Type } // This event is sent when one or more members are removed from a call type CallMemberRemovedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // the list of member IDs removed from the call - Members []string `json:"members"` - - Call CallResponse `json:"call"` - + Members []string `json:"members"` + Call CallResponse `json:"call"` // The type of event: "call.member_removed" in this case Type string `json:"type"` } -func (*CallMemberRemovedEvent) GetEventType() string { - return "call.member_removed" +func (e *CallMemberRemovedEvent) GetEventType() string { + return e.Type } // This event is sent when one or more members are updated type CallMemberUpdatedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The list of members that were updated Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - + Call CallResponse `json:"call"` // The type of event: "call.member_updated" in this case Type string `json:"type"` } -func (*CallMemberUpdatedEvent) GetEventType() string { - return "call.member_updated" +func (e *CallMemberUpdatedEvent) GetEventType() string { + return e.Type } // This event is sent when one or more members get its role updated type CallMemberUpdatedPermissionEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The list of members that were updated Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - + Call CallResponse `json:"call"` // The capabilities by role for this call CapabilitiesByRole map[string][]string `json:"capabilities_by_role"` - // The type of event: "call.member_added" in this case Type string `json:"type"` } -func (*CallMemberUpdatedPermissionEvent) GetEventType() string { - return "call.member_updated_permission" +func (e *CallMemberUpdatedPermissionEvent) GetEventType() string { + return e.Type } // This event is sent to call members who did not accept/reject/join the call to notify they missed the call type CallMissedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - NotifyUser bool `json:"notify_user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + NotifyUser bool `json:"notify_user"` // Call session ID SessionID string `json:"session_id"` - // List of members who missed the call Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - - User UserResponse `json:"user"` - + Call CallResponse `json:"call"` + User UserResponse `json:"user"` // The type of event: "call.notification" in this case Type string `json:"type"` } -func (*CallMissedEvent) GetEventType() string { - return "call.missed" +func (e *CallMissedEvent) GetEventType() string { + return e.Type } // This event is sent when a moderation blur action is applied to a user's video stream type CallModerationBlurEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The user ID whose video stream is being blurred UserID string `json:"user_id"` - // Custom data associated with the moderation action Custom map[string]any `json:"custom"` - // The type of event: "call.moderation_blur" in this case Type string `json:"type"` } -func (*CallModerationBlurEvent) GetEventType() string { - return "call.moderation_blur" +func (e *CallModerationBlurEvent) GetEventType() string { + return e.Type } // This event is sent when a moderation warning is issued to a user type CallModerationWarningEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The warning message Message string `json:"message"` - // The user ID who is receiving the warning UserID string `json:"user_id"` - // Custom data associated with the moderation action Custom map[string]any `json:"custom"` - // The type of event: "call.moderation_warning" in this case Type string `json:"type"` } -func (*CallModerationWarningEvent) GetEventType() string { - return "call.moderation_warning" +func (e *CallModerationWarningEvent) GetEventType() string { + return e.Type } // This event is sent to all call members to notify they are getting called type CallNotificationEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID SessionID string `json:"session_id"` - // Call members Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - - User UserResponse `json:"user"` - + Call CallResponse `json:"call"` + User UserResponse `json:"user"` // The type of event: "call.notification" in this case Type string `json:"type"` } -func (*CallNotificationEvent) GetEventType() string { - return "call.notification" +func (e *CallNotificationEvent) GetEventType() string { + return e.Type } type CallParticipantCountReport struct { @@ -2349,610 +1758,434 @@ type CallParticipantCountReportResponse struct { } type CallParticipantResponse struct { - JoinedAt Timestamp `json:"joined_at"` - - Role string `json:"role"` - - UserSessionID string `json:"user_session_id"` - - User UserResponse `json:"user"` + JoinedAt Timestamp `json:"joined_at"` + Role string `json:"role"` + UserSessionID string `json:"user_session_id"` + User UserResponse `json:"user"` } type CallParticipantTimeline struct { - Severity string `json:"severity"` - - Timestamp Timestamp `json:"timestamp"` - - Type string `json:"type"` - - Data map[string]any `json:"data"` + Severity string `json:"severity"` + Timestamp Timestamp `json:"timestamp"` + Type string `json:"type"` + Data map[string]any `json:"data"` } // This event is sent when a reaction is sent in a call, clients should use this to show the reaction in the call screen type CallReactionEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Reaction ReactionResponse `json:"reaction"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Reaction VideoReactionResponse `json:"reaction"` // The type of event: "call.reaction_new" in this case Type string `json:"type"` } -func (*CallReactionEvent) GetEventType() string { - return "call.reaction_new" +func (e *CallReactionEvent) GetEventType() string { + return e.Type } // CallRecording represents a recording of a call. type CallRecording struct { - EndTime Timestamp `json:"end_time"` - - Filename string `json:"filename"` - - RecordingType string `json:"recording_type"` - - SessionID string `json:"session_id"` - - StartTime Timestamp `json:"start_time"` - - Url string `json:"url"` + EndTime Timestamp `json:"end_time"` + Filename string `json:"filename"` + RecordingType string `json:"recording_type"` + SessionID string `json:"session_id"` + StartTime Timestamp `json:"start_time"` + Url string `json:"url"` } // This event is sent when call recording has failed type CallRecordingFailedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of recording RecordingType string `json:"recording_type"` - // The type of event: "call.recording_failed" in this case Type string `json:"type"` } -func (*CallRecordingFailedEvent) GetEventType() string { - return "call.recording_failed" +func (e *CallRecordingFailedEvent) GetEventType() string { + return e.Type } // This event is sent when call recording is ready type CallRecordingReadyEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of recording - RecordingType string `json:"recording_type"` - + RecordingType string `json:"recording_type"` CallRecording CallRecording `json:"call_recording"` - // The type of event: "call.recording_ready" in this case Type string `json:"type"` } -func (*CallRecordingReadyEvent) GetEventType() string { - return "call.recording_ready" +func (e *CallRecordingReadyEvent) GetEventType() string { + return e.Type } // This event is sent when call recording has started type CallRecordingStartedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of recording RecordingType string `json:"recording_type"` - // The type of event: "call.recording_started" in this case Type string `json:"type"` } -func (*CallRecordingStartedEvent) GetEventType() string { - return "call.recording_started" +func (e *CallRecordingStartedEvent) GetEventType() string { + return e.Type } // This event is sent when call recording has stopped type CallRecordingStoppedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of recording RecordingType string `json:"recording_type"` - // The type of event: "call.recording_stopped" in this case Type string `json:"type"` } -func (*CallRecordingStoppedEvent) GetEventType() string { - return "call.recording_stopped" +func (e *CallRecordingStoppedEvent) GetEventType() string { + return e.Type } // This event is sent when a user rejects a notification to join a call. type CallRejectedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Call CallResponse `json:"call"` - - User UserResponse `json:"user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` + User UserResponse `json:"user"` // The type of event: "call.rejected" in this case Type string `json:"type"` - // Provides information about why the call was rejected. You can provide any value, but the Stream API and SDKs use these default values: rejected, cancel, timeout and busy Reason *string `json:"reason,omitempty"` } -func (*CallRejectedEvent) GetEventType() string { - return "call.rejected" +func (e *CallRejectedEvent) GetEventType() string { + return e.Type } type CallReportResponse struct { - Score float64 `json:"score"` - - EndedAt *Timestamp `json:"ended_at,omitempty"` - + Score float64 `json:"score"` + EndedAt *Timestamp `json:"ended_at,omitempty"` StartedAt *Timestamp `json:"started_at,omitempty"` } // CallRequest is the payload for creating a call. type CallRequest struct { - ChannelCid *string `json:"channel_cid,omitempty"` - - CreatedByID *string `json:"created_by_id,omitempty"` - - StartsAt *Timestamp `json:"starts_at,omitempty"` - - Team *string `json:"team,omitempty"` - - Video *bool `json:"video,omitempty"` - - Members []MemberRequest `json:"members,omitempty"` - - CreatedBy *UserRequest `json:"created_by,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - + ChannelCid *string `json:"channel_cid,omitempty"` + CreatedByID *string `json:"created_by_id,omitempty"` + StartsAt *Timestamp `json:"starts_at,omitempty"` + Team *string `json:"team,omitempty"` + Video *bool `json:"video,omitempty"` + Members []MemberRequest `json:"members,omitempty"` + CreatedBy *UserRequest `json:"created_by,omitempty"` + Custom map[string]any `json:"custom,omitempty"` SettingsOverride *CallSettingsRequest `json:"settings_override,omitempty"` } // Represents a call type CallResponse struct { - Backstage bool `json:"backstage"` - + Backstage bool `json:"backstage"` Captioning bool `json:"captioning"` - // The unique identifier for a call (:) Cid string `json:"cid"` - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - CurrentSessionID string `json:"current_session_id"` - + CreatedAt Timestamp `json:"created_at"` + CurrentSessionID string `json:"current_session_id"` // Call ID - ID string `json:"id"` - - Recording bool `json:"recording"` - - Transcribing bool `json:"transcribing"` - - Translating bool `json:"translating"` - + ID string `json:"id"` + Recording bool `json:"recording"` + Transcribing bool `json:"transcribing"` + Translating bool `json:"translating"` // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // The type of call - Type string `json:"type"` - - BlockedUserIds []string `json:"blocked_user_ids"` - - CreatedBy UserResponse `json:"created_by"` - + Type string `json:"type"` + BlockedUserIds []string `json:"blocked_user_ids"` + CreatedBy UserResponse `json:"created_by"` // Custom data for this object - Custom map[string]any `json:"custom"` - - Egress EgressResponse `json:"egress"` - - Ingress CallIngressResponse `json:"ingress"` - - Settings CallSettingsResponse `json:"settings"` - - ChannelCid *string `json:"channel_cid,omitempty"` - + Custom map[string]any `json:"custom"` + Egress EgressResponse `json:"egress"` + Ingress CallIngressResponse `json:"ingress"` + Settings CallSettingsResponse `json:"settings"` + ChannelCid *string `json:"channel_cid,omitempty"` // Date/time when the call ended - EndedAt *Timestamp `json:"ended_at,omitempty"` - - JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` - + EndedAt *Timestamp `json:"ended_at,omitempty"` + JoinAheadTimeSeconds *int `json:"join_ahead_time_seconds,omitempty"` // 10-digit routing number for SIP routing RoutingNumber *string `json:"routing_number,omitempty"` - // Date/time when the call will start - StartsAt *Timestamp `json:"starts_at,omitempty"` - - Team *string `json:"team,omitempty"` - - Session *CallSessionResponse `json:"session,omitempty"` - - Thumbnails *ThumbnailResponse `json:"thumbnails,omitempty"` + StartsAt *Timestamp `json:"starts_at,omitempty"` + Team *string `json:"team,omitempty"` + Session *CallSessionResponse `json:"session,omitempty"` + Thumbnails *ThumbnailResponse `json:"thumbnails,omitempty"` } // This event is sent to all call members to notify they are getting called type CallRingEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID SessionID string `json:"session_id"` - - Video bool `json:"video"` - + Video bool `json:"video"` // Call members Members []MemberResponse `json:"members"` - - Call CallResponse `json:"call"` - - User UserResponse `json:"user"` - + Call CallResponse `json:"call"` + User UserResponse `json:"user"` // The type of event: "call.notification" in this case Type string `json:"type"` } -func (*CallRingEvent) GetEventType() string { - return "call.ring" +func (e *CallRingEvent) GetEventType() string { + return e.Type } // This event is sent when a call RTMP broadcast has failed type CallRtmpBroadcastFailedEvent struct { // The unique identifier for a call (:) CallCid string `json:"call_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Name of the given RTMP broadcast Name string `json:"name"` - // The type of event: "call.rtmp_broadcast_failed" in this case Type string `json:"type"` } -func (*CallRtmpBroadcastFailedEvent) GetEventType() string { - return "call.rtmp_broadcast_failed" +func (e *CallRtmpBroadcastFailedEvent) GetEventType() string { + return e.Type } // This event is sent when RTMP broadcast has started type CallRtmpBroadcastStartedEvent struct { // The unique identifier for a call (:) CallCid string `json:"call_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Name of the given RTMP broadcast Name string `json:"name"` - // The type of event: "call.rtmp_broadcast_started" in this case Type string `json:"type"` } -func (*CallRtmpBroadcastStartedEvent) GetEventType() string { - return "call.rtmp_broadcast_started" +func (e *CallRtmpBroadcastStartedEvent) GetEventType() string { + return e.Type } // This event is sent when RTMP broadcast has stopped type CallRtmpBroadcastStoppedEvent struct { // The unique identifier for a call (:) CallCid string `json:"call_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Name of the given RTMP broadcast Name string `json:"name"` - // The type of event: "call.rtmp_broadcast_stopped" in this case Type string `json:"type"` } -func (*CallRtmpBroadcastStoppedEvent) GetEventType() string { - return "call.rtmp_broadcast_stopped" +func (e *CallRtmpBroadcastStoppedEvent) GetEventType() string { + return e.Type +} + +type CallRuleActionSequence struct { + ViolationNumber *int `json:"violation_number,omitempty"` + Actions []string `json:"actions,omitempty"` + CallOptions *CallActionOptions `json:"call_options,omitempty"` } // This event is sent when a call session ends type CallSessionEndedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID - SessionID string `json:"session_id"` - - Call CallResponse `json:"call"` - + SessionID string `json:"session_id"` + Call CallResponse `json:"call"` // The type of event: "call.session_ended" in this case Type string `json:"type"` } -func (*CallSessionEndedEvent) GetEventType() string { - return "call.session_ended" +func (e *CallSessionEndedEvent) GetEventType() string { + return e.Type } // This event is sent when the participant counts in a call session are updated type CallSessionParticipantCountsUpdatedEvent struct { - AnonymousParticipantCount int `json:"anonymous_participant_count"` - - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - + AnonymousParticipantCount int `json:"anonymous_participant_count"` + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` // Call session ID - SessionID string `json:"session_id"` - + SessionID string `json:"session_id"` ParticipantsCountByRole map[string]int `json:"participants_count_by_role"` - // The type of event: "call.session_participant_count_updated" in this case Type string `json:"type"` } -func (*CallSessionParticipantCountsUpdatedEvent) GetEventType() string { - return "call.session_participant_count_updated" +func (e *CallSessionParticipantCountsUpdatedEvent) GetEventType() string { + return e.Type } // This event is sent when a participant joins a call session type CallSessionParticipantJoinedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID - SessionID string `json:"session_id"` - + SessionID string `json:"session_id"` Participant CallParticipantResponse `json:"participant"` - // The type of event: "call.session_participant_joined" in this case Type string `json:"type"` } -func (*CallSessionParticipantJoinedEvent) GetEventType() string { - return "call.session_participant_joined" +func (e *CallSessionParticipantJoinedEvent) GetEventType() string { + return e.Type } // This event is sent when a participant leaves a call session type CallSessionParticipantLeftEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The duration participant was in the session in seconds DurationSeconds int `json:"duration_seconds"` - // Call session ID - SessionID string `json:"session_id"` - + SessionID string `json:"session_id"` Participant CallParticipantResponse `json:"participant"` - // The type of event: "call.session_participant_left" in this case Type string `json:"type"` - // The reason why the participant left the session Reason *string `json:"reason,omitempty"` } -func (*CallSessionParticipantLeftEvent) GetEventType() string { - return "call.session_participant_left" +func (e *CallSessionParticipantLeftEvent) GetEventType() string { + return e.Type } type CallSessionResponse struct { - AnonymousParticipantCount int `json:"anonymous_participant_count"` - - ID string `json:"id"` - - Participants []CallParticipantResponse `json:"participants"` - - AcceptedBy map[string]Timestamp `json:"accepted_by"` - - MissedBy map[string]Timestamp `json:"missed_by"` - - ParticipantsCountByRole map[string]int `json:"participants_count_by_role"` - - RejectedBy map[string]Timestamp `json:"rejected_by"` - - EndedAt *Timestamp `json:"ended_at,omitempty"` - - LiveEndedAt *Timestamp `json:"live_ended_at,omitempty"` - - LiveStartedAt *Timestamp `json:"live_started_at,omitempty"` - - StartedAt *Timestamp `json:"started_at,omitempty"` - - TimerEndsAt *Timestamp `json:"timer_ends_at,omitempty"` + AnonymousParticipantCount int `json:"anonymous_participant_count"` + ID string `json:"id"` + Participants []CallParticipantResponse `json:"participants"` + AcceptedBy map[string]Timestamp `json:"accepted_by"` + MissedBy map[string]Timestamp `json:"missed_by"` + ParticipantsCountByRole map[string]int `json:"participants_count_by_role"` + RejectedBy map[string]Timestamp `json:"rejected_by"` + EndedAt *Timestamp `json:"ended_at,omitempty"` + LiveEndedAt *Timestamp `json:"live_ended_at,omitempty"` + LiveStartedAt *Timestamp `json:"live_started_at,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + TimerEndsAt *Timestamp `json:"timer_ends_at,omitempty"` } // This event is sent when a call session starts type CallSessionStartedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID - SessionID string `json:"session_id"` - - Call CallResponse `json:"call"` - + SessionID string `json:"session_id"` + Call CallResponse `json:"call"` // The type of event: "call.session_started" in this case Type string `json:"type"` } -func (*CallSessionStartedEvent) GetEventType() string { - return "call.session_started" +func (e *CallSessionStartedEvent) GetEventType() string { + return e.Type } type CallSettings struct { - Audio *AudioSettings `json:"audio,omitempty"` - - Backstage *BackstageSettings `json:"backstage,omitempty"` - - Broadcasting *BroadcastSettings `json:"broadcasting,omitempty"` - - FrameRecording *FrameRecordSettings `json:"frame_recording,omitempty"` - - Geofencing *GeofenceSettings `json:"geofencing,omitempty"` - + Audio *AudioSettings `json:"audio,omitempty"` + Backstage *BackstageSettings `json:"backstage,omitempty"` + Broadcasting *BroadcastSettings `json:"broadcasting,omitempty"` + FrameRecording *FrameRecordSettings `json:"frame_recording,omitempty"` + Geofencing *GeofenceSettings `json:"geofencing,omitempty"` IndividualRecording *IndividualRecordSettings `json:"individual_recording,omitempty"` - - Ingress *IngressSettings `json:"ingress,omitempty"` - - Limits *LimitsSettings `json:"limits,omitempty"` - - RawRecording *RawRecordSettings `json:"raw_recording,omitempty"` - - Recording *RecordSettings `json:"recording,omitempty"` - - Ring *RingSettings `json:"ring,omitempty"` - - Screensharing *ScreensharingSettings `json:"screensharing,omitempty"` - - Session *SessionSettings `json:"session,omitempty"` - - Thumbnails *ThumbnailsSettings `json:"thumbnails,omitempty"` - - Transcription *TranscriptionSettings `json:"transcription,omitempty"` - - Video *VideoSettings `json:"video,omitempty"` + Ingress *IngressSettings `json:"ingress,omitempty"` + Limits *LimitsSettings `json:"limits,omitempty"` + RawRecording *RawRecordSettings `json:"raw_recording,omitempty"` + Recording *RecordSettings `json:"recording,omitempty"` + Ring *RingSettings `json:"ring,omitempty"` + Screensharing *ScreensharingSettings `json:"screensharing,omitempty"` + Session *SessionSettings `json:"session,omitempty"` + Thumbnails *ThumbnailsSettings `json:"thumbnails,omitempty"` + Transcription *TranscriptionSettings `json:"transcription,omitempty"` + Video *VideoSettings `json:"video,omitempty"` } type CallSettingsRequest struct { - Audio *AudioSettingsRequest `json:"audio,omitempty"` - - Backstage *BackstageSettingsRequest `json:"backstage,omitempty"` - - Broadcasting *BroadcastSettingsRequest `json:"broadcasting,omitempty"` - - FrameRecording *FrameRecordingSettingsRequest `json:"frame_recording,omitempty"` - - Geofencing *GeofenceSettingsRequest `json:"geofencing,omitempty"` - + Audio *AudioSettingsRequest `json:"audio,omitempty"` + Backstage *BackstageSettingsRequest `json:"backstage,omitempty"` + Broadcasting *BroadcastSettingsRequest `json:"broadcasting,omitempty"` + FrameRecording *FrameRecordingSettingsRequest `json:"frame_recording,omitempty"` + Geofencing *GeofenceSettingsRequest `json:"geofencing,omitempty"` IndividualRecording *IndividualRecordingSettingsRequest `json:"individual_recording,omitempty"` - - Ingress *IngressSettingsRequest `json:"ingress,omitempty"` - - Limits *LimitsSettingsRequest `json:"limits,omitempty"` - - RawRecording *RawRecordingSettingsRequest `json:"raw_recording,omitempty"` - - Recording *RecordSettingsRequest `json:"recording,omitempty"` - - Ring *RingSettingsRequest `json:"ring,omitempty"` - - Screensharing *ScreensharingSettingsRequest `json:"screensharing,omitempty"` - - Session *SessionSettingsRequest `json:"session,omitempty"` - - Thumbnails *ThumbnailsSettingsRequest `json:"thumbnails,omitempty"` - - Transcription *TranscriptionSettingsRequest `json:"transcription,omitempty"` - - Video *VideoSettingsRequest `json:"video,omitempty"` + Ingress *IngressSettingsRequest `json:"ingress,omitempty"` + Limits *LimitsSettingsRequest `json:"limits,omitempty"` + RawRecording *RawRecordingSettingsRequest `json:"raw_recording,omitempty"` + Recording *RecordSettingsRequest `json:"recording,omitempty"` + Ring *RingSettingsRequest `json:"ring,omitempty"` + Screensharing *ScreensharingSettingsRequest `json:"screensharing,omitempty"` + Session *SessionSettingsRequest `json:"session,omitempty"` + Thumbnails *ThumbnailsSettingsRequest `json:"thumbnails,omitempty"` + Transcription *TranscriptionSettingsRequest `json:"transcription,omitempty"` + Video *VideoSettingsRequest `json:"video,omitempty"` } type CallSettingsResponse struct { - Audio AudioSettingsResponse `json:"audio"` - - Backstage BackstageSettingsResponse `json:"backstage"` - - Broadcasting BroadcastSettingsResponse `json:"broadcasting"` - - FrameRecording FrameRecordingSettingsResponse `json:"frame_recording"` - - Geofencing GeofenceSettingsResponse `json:"geofencing"` - + Audio AudioSettingsResponse `json:"audio"` + Backstage BackstageSettingsResponse `json:"backstage"` + Broadcasting BroadcastSettingsResponse `json:"broadcasting"` + FrameRecording FrameRecordingSettingsResponse `json:"frame_recording"` + Geofencing GeofenceSettingsResponse `json:"geofencing"` IndividualRecording IndividualRecordingSettingsResponse `json:"individual_recording"` - - Limits LimitsSettingsResponse `json:"limits"` - - RawRecording RawRecordingSettingsResponse `json:"raw_recording"` - - Recording RecordSettingsResponse `json:"recording"` - - Ring RingSettingsResponse `json:"ring"` - - Screensharing ScreensharingSettingsResponse `json:"screensharing"` - - Session SessionSettingsResponse `json:"session"` - - Thumbnails ThumbnailsSettingsResponse `json:"thumbnails"` - - Transcription TranscriptionSettingsResponse `json:"transcription"` - - Video VideoSettingsResponse `json:"video"` - - Ingress *IngressSettingsResponse `json:"ingress,omitempty"` + Limits LimitsSettingsResponse `json:"limits"` + RawRecording RawRecordingSettingsResponse `json:"raw_recording"` + Recording RecordSettingsResponse `json:"recording"` + Ring RingSettingsResponse `json:"ring"` + Screensharing ScreensharingSettingsResponse `json:"screensharing"` + Session SessionSettingsResponse `json:"session"` + Thumbnails ThumbnailsSettingsResponse `json:"thumbnails"` + Transcription TranscriptionSettingsResponse `json:"transcription"` + Video VideoSettingsResponse `json:"video"` + Ingress *IngressSettingsResponse `json:"ingress,omitempty"` } // CallStateResponseFields is the payload for call state response type CallStateResponseFields struct { // List of call members - Members []MemberResponse `json:"members"` - - OwnCapabilities []OwnCapability `json:"own_capabilities"` - - Call CallResponse `json:"call"` + Members []MemberResponse `json:"members"` + OwnCapabilities []OwnCapability `json:"own_capabilities"` + Call CallResponse `json:"call"` } type CallStatsLocation struct { - AccuracyRadiusMeters *int `json:"accuracy_radius_meters,omitempty"` - - City *string `json:"city,omitempty"` - - Continent *string `json:"continent,omitempty"` - - Country *string `json:"country,omitempty"` - - CountryIsoCode *string `json:"country_iso_code,omitempty"` - - Latitude *float64 `json:"latitude,omitempty"` - - Longitude *float64 `json:"longitude,omitempty"` - - Subdivision *string `json:"subdivision,omitempty"` + AccuracyRadiusMeters *int `json:"accuracy_radius_meters,omitempty"` + City *string `json:"city,omitempty"` + Continent *string `json:"continent,omitempty"` + Country *string `json:"country,omitempty"` + CountryIsoCode *string `json:"country_iso_code,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + Subdivision *string `json:"subdivision,omitempty"` } type CallStatsMapLocation struct { - Count int `json:"count"` - - LiveCount int `json:"live_count"` - - Location *CallStatsLocation `json:"location,omitempty"` + Count int `json:"count"` + LiveCount int `json:"live_count"` + Location *CallStatsLocation `json:"location,omitempty"` } type CallStatsMapPublisher struct { - IsLive bool `json:"is_live"` - - UserID string `json:"user_id"` - - UserSessionID string `json:"user_session_id"` - + IsLive bool `json:"is_live"` + UserID string `json:"user_id"` + UserSessionID string `json:"user_session_id"` PublishedTracks PublishedTrackFlags `json:"published_tracks"` - - Name *string `json:"name,omitempty"` - - PublisherType *string `json:"publisher_type,omitempty"` - - Location *CallStatsLocation `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PublisherType *string `json:"publisher_type,omitempty"` + Location *CallStatsLocation `json:"location,omitempty"` } type CallStatsMapPublishers struct { @@ -2964,316 +2197,238 @@ type CallStatsMapSFUs struct { } type CallStatsMapSubscriber struct { - IsLive bool `json:"is_live"` - - UserID string `json:"user_id"` - - UserSessionID string `json:"user_session_id"` - - Name *string `json:"name,omitempty"` - - Location *CallStatsLocation `json:"location,omitempty"` + IsLive bool `json:"is_live"` + UserID string `json:"user_id"` + UserSessionID string `json:"user_session_id"` + Name *string `json:"name,omitempty"` + Location *CallStatsLocation `json:"location,omitempty"` } type CallStatsMapSubscribers struct { - Locations []CallStatsMapLocation `json:"locations"` - + Locations []CallStatsMapLocation `json:"locations"` Participants []CallStatsMapSubscriber `json:"participants,omitempty"` } type CallStatsParticipant struct { - UserID string `json:"user_id"` - - Sessions []CallStatsParticipantSession `json:"sessions"` - - LatestActivityAt *Timestamp `json:"latest_activity_at,omitempty"` - - Name *string `json:"name,omitempty"` - - Roles []string `json:"roles,omitempty"` + UserID string `json:"user_id"` + Sessions []CallStatsParticipantSession `json:"sessions"` + LatestActivityAt *Timestamp `json:"latest_activity_at,omitempty"` + Name *string `json:"name,omitempty"` + Roles []string `json:"roles,omitempty"` } type CallStatsParticipantCounts struct { - LiveSessions int `json:"live_sessions"` - - Participants int `json:"participants"` - - PeakConcurrentSessions int `json:"peak_concurrent_sessions"` - - PeakConcurrentUsers int `json:"peak_concurrent_users"` - - Publishers int `json:"publishers"` - - Sessions int `json:"sessions"` - + LiveSessions int `json:"live_sessions"` + Participants int `json:"participants"` + PeakConcurrentSessions int `json:"peak_concurrent_sessions"` + PeakConcurrentUsers int `json:"peak_concurrent_users"` + Publishers int `json:"publishers"` + Sessions int `json:"sessions"` TotalParticipantDuration *int `json:"total_participant_duration,omitempty"` } type CallStatsParticipantSession struct { - IsLive bool `json:"is_live"` - - UserSessionID string `json:"user_session_id"` - - PublishedTracks PublishedTrackFlags `json:"published_tracks"` - - Browser *string `json:"browser,omitempty"` - - BrowserVersion *string `json:"browser_version,omitempty"` - - CqScore *int `json:"cq_score,omitempty"` - - CurrentIp *string `json:"current_ip,omitempty"` - - CurrentSfu *string `json:"current_sfu,omitempty"` - - DistanceToSfuKilometers *float64 `json:"distance_to_sfu_kilometers,omitempty"` - - EndedAt *Timestamp `json:"ended_at,omitempty"` - - Os *string `json:"os,omitempty"` - - PublisherType *string `json:"publisher_type,omitempty"` - - Sdk *string `json:"sdk,omitempty"` - - SdkVersion *string `json:"sdk_version,omitempty"` - - StartedAt *Timestamp `json:"started_at,omitempty"` - - UnifiedSessionID *string `json:"unified_session_id,omitempty"` - - WebrtcVersion *string `json:"webrtc_version,omitempty"` - - Location *CallStatsLocation `json:"location,omitempty"` + IsLive bool `json:"is_live"` + UserSessionID string `json:"user_session_id"` + PublishedTracks PublishedTrackFlags `json:"published_tracks"` + Browser *string `json:"browser,omitempty"` + BrowserVersion *string `json:"browser_version,omitempty"` + CqScore *int `json:"cq_score,omitempty"` + CurrentIp *string `json:"current_ip,omitempty"` + CurrentSfu *string `json:"current_sfu,omitempty"` + DistanceToSfuKilometers *float64 `json:"distance_to_sfu_kilometers,omitempty"` + EndedAt *Timestamp `json:"ended_at,omitempty"` + Os *string `json:"os,omitempty"` + PublisherType *string `json:"publisher_type,omitempty"` + Sdk *string `json:"sdk,omitempty"` + SdkVersion *string `json:"sdk_version,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + UnifiedSessionID *string `json:"unified_session_id,omitempty"` + WebrtcVersion *string `json:"webrtc_version,omitempty"` + Location *CallStatsLocation `json:"location,omitempty"` } // This event is sent when the insights report is ready type CallStatsReportReadyEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Call session ID SessionID string `json:"session_id"` - // The type of event, "call.report_ready" in this case Type string `json:"type"` + // Whether participants_overview is truncated by the server-side limit + IsTrimmed *bool `json:"is_trimmed,omitempty"` + // Top participant sessions overview + ParticipantsOverview []CallStatsParticipant `json:"participants_overview,omitempty"` } -func (*CallStatsReportReadyEvent) GetEventType() string { - return "call.stats_report_ready" +func (e *CallStatsReportReadyEvent) GetEventType() string { + return e.Type } type CallStatsReportSummaryResponse struct { - CallCid string `json:"call_cid"` - - CallDurationSeconds int `json:"call_duration_seconds"` - - CallSessionID string `json:"call_session_id"` - - CallStatus string `json:"call_status"` - - FirstStatsTime Timestamp `json:"first_stats_time"` - - CreatedAt *Timestamp `json:"created_at,omitempty"` - - MinUserRating *int `json:"min_user_rating,omitempty"` - - QualityScore *int `json:"quality_score,omitempty"` + CallCid string `json:"call_cid"` + CallDurationSeconds int `json:"call_duration_seconds"` + CallSessionID string `json:"call_session_id"` + CallStatus string `json:"call_status"` + FirstStatsTime Timestamp `json:"first_stats_time"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + MinUserRating *int `json:"min_user_rating,omitempty"` + QualityScore *int `json:"quality_score,omitempty"` } // CallTranscription represents a transcription of a call. type CallTranscription struct { - EndTime Timestamp `json:"end_time"` - - Filename string `json:"filename"` - - SessionID string `json:"session_id"` - + EndTime Timestamp `json:"end_time"` + Filename string `json:"filename"` + SessionID string `json:"session_id"` StartTime Timestamp `json:"start_time"` - - Url string `json:"url"` + Url string `json:"url"` } // This event is sent when call transcription has failed type CallTranscriptionFailedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of event: "call.transcription_failed" in this case Type string `json:"type"` - // The error message detailing why transcription failed. Error *string `json:"error,omitempty"` } -func (*CallTranscriptionFailedEvent) GetEventType() string { - return "call.transcription_failed" +func (e *CallTranscriptionFailedEvent) GetEventType() string { + return e.Type } // This event is sent when call transcription is ready type CallTranscriptionReadyEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + EgressID string `json:"egress_id"` CallTranscription CallTranscription `json:"call_transcription"` - // The type of event: "call.transcription_ready" in this case Type string `json:"type"` } -func (*CallTranscriptionReadyEvent) GetEventType() string { - return "call.transcription_ready" +func (e *CallTranscriptionReadyEvent) GetEventType() string { + return e.Type } // This event is sent when call transcription has started type CallTranscriptionStartedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of event: "call.transcription_started" in this case Type string `json:"type"` } -func (*CallTranscriptionStartedEvent) GetEventType() string { - return "call.transcription_started" +func (e *CallTranscriptionStartedEvent) GetEventType() string { + return e.Type } // This event is sent when call transcription has stopped type CallTranscriptionStoppedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - - EgressID string `json:"egress_id"` - + EgressID string `json:"egress_id"` // The type of event: "call.transcription_stopped" in this case Type string `json:"type"` } -func (*CallTranscriptionStoppedEvent) GetEventType() string { - return "call.transcription_stopped" +func (e *CallTranscriptionStoppedEvent) GetEventType() string { + return e.Type } type CallType struct { - App int `json:"app"` - - CreatedAt Timestamp `json:"created_at"` - - ID int `json:"id"` - - Name string `json:"name"` - - RecordingExternalStorage string `json:"recording_external_storage"` - - UpdatedAt Timestamp `json:"updated_at"` - - NotificationSettings *NotificationSettings `json:"notification_settings,omitempty"` - - Settings *CallSettings `json:"settings,omitempty"` + App int `json:"app"` + CreatedAt Timestamp `json:"created_at"` + ID int `json:"id"` + Name string `json:"name"` + RecordingExternalStorage string `json:"recording_external_storage"` + UpdatedAt Timestamp `json:"updated_at"` + NotificationSettings *NotificationSettings `json:"notification_settings,omitempty"` + Settings *CallSettings `json:"settings,omitempty"` } // CallTypeResponse is the payload for a call type. type CallTypeResponse struct { // the time the call type was created CreatedAt Timestamp `json:"created_at"` - // the name of the call type Name string `json:"name"` - // the time the call type was last updated UpdatedAt Timestamp `json:"updated_at"` - // the permissions granted to each role - Grants map[string][]string `json:"grants"` - - NotificationSettings NotificationSettings `json:"notification_settings"` - - Settings CallSettingsResponse `json:"settings"` - + Grants map[string][]string `json:"grants"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` + Settings CallSettingsResponse `json:"settings"` // the external storage for the call type ExternalStorage *string `json:"external_storage,omitempty"` } +type CallTypeRuleParameters struct { + CallType *string `json:"call_type,omitempty"` +} + // This event is sent when a call is updated, clients should use this update the local state of the call. // This event also contains the capabilities by role for the call, clients should update the own_capability for the current. type CallUpdatedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Call CallResponse `json:"call"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + Call CallResponse `json:"call"` // The capabilities by role for this call CapabilitiesByRole map[string][]string `json:"capabilities_by_role"` - // The type of event: "call.updated" in this case Type string `json:"type"` } -func (*CallUpdatedEvent) GetEventType() string { - return "call.updated" +func (e *CallUpdatedEvent) GetEventType() string { + return e.Type } // This event is sent when a user submits feedback for a call. type CallUserFeedbackSubmittedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The rating given by the user (1-5) Rating int `json:"rating"` - // Call session ID - SessionID string `json:"session_id"` - - User UserResponse `json:"user"` - + SessionID string `json:"session_id"` + User UserResponse `json:"user"` // The type of event, "call.user_feedback" in this case Type string `json:"type"` - // The reason provided by the user for the rating - Reason *string `json:"reason,omitempty"` - - Sdk *string `json:"sdk,omitempty"` - + Reason *string `json:"reason,omitempty"` + Sdk *string `json:"sdk,omitempty"` SdkVersion *string `json:"sdk_version,omitempty"` - // Custom data provided by the user Custom map[string]any `json:"custom,omitempty"` } -func (*CallUserFeedbackSubmittedEvent) GetEventType() string { - return "call.user_feedback_submitted" +func (e *CallUserFeedbackSubmittedEvent) GetEventType() string { + return e.Type } // This event is sent when a call member is muted type CallUserMutedEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - FromUserID string `json:"from_user_id"` - - Reason string `json:"reason"` - - MutedUserIds []string `json:"muted_user_ids"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + FromUserID string `json:"from_user_id"` + Reason string `json:"reason"` + MutedUserIds []string `json:"muted_user_ids"` // The type of event: "call.user_muted" in this case Type string `json:"type"` } -func (*CallUserMutedEvent) GetEventType() string { - return "call.user_muted" +func (e *CallUserMutedEvent) GetEventType() string { + return e.Type +} + +type CallViolationCountParameters struct { + Threshold *int `json:"threshold,omitempty"` + TimeWindow *string `json:"time_window,omitempty"` } type CallsPerDayReport struct { @@ -3285,740 +2440,464 @@ type CallsPerDayReportResponse struct { } type CampaignChannelMember struct { - UserID string `json:"user_id"` - - ChannelRole *string `json:"channel_role,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` + UserID string `json:"user_id"` + ChannelRole *string `json:"channel_role,omitempty"` + Custom map[string]any `json:"custom,omitempty"` } type CampaignChannelTemplate struct { - Type string `json:"type"` - - Custom map[string]any `json:"custom"` - - ID *string `json:"id,omitempty"` - - Team *string `json:"team,omitempty"` - - Members []string `json:"members,omitempty"` - + Type string `json:"type"` + Custom map[string]any `json:"custom"` + ID *string `json:"id,omitempty"` + Team *string `json:"team,omitempty"` + Members []string `json:"members,omitempty"` MembersTemplate []CampaignChannelMember `json:"members_template,omitempty"` } type CampaignCompletedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Campaign *CampaignResponse `json:"campaign,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Campaign *CampaignResponse `json:"campaign,omitempty"` } -func (*CampaignCompletedEvent) GetEventType() string { - return "campaign.completed" +func (e *CampaignCompletedEvent) GetEventType() string { + return e.Type } type CampaignMessageTemplate struct { - PollID string `json:"poll_id"` - - Searchable bool `json:"searchable"` - - Text string `json:"text"` - - Attachments []Attachment `json:"attachments"` - - Custom map[string]any `json:"custom"` + PollID string `json:"poll_id"` + Searchable bool `json:"searchable"` + Text string `json:"text"` + Attachments []Attachment `json:"attachments"` + Custom map[string]any `json:"custom"` } type CampaignResponse struct { - CreateChannels bool `json:"create_channels"` - - CreatedAt Timestamp `json:"created_at"` - - Description string `json:"description"` - - ID string `json:"id"` - - Name string `json:"name"` - - SenderID string `json:"sender_id"` - - SenderMode string `json:"sender_mode"` - - SenderVisibility string `json:"sender_visibility"` - - ShowChannels bool `json:"show_channels"` - - SkipPush bool `json:"skip_push"` - - SkipWebhook bool `json:"skip_webhook"` - - Status string `json:"status"` + CreateChannels bool `json:"create_channels"` + CreatedAt Timestamp `json:"created_at"` + Description string `json:"description"` + ID string `json:"id"` + Name string `json:"name"` + SenderID string `json:"sender_id"` + SenderMode string `json:"sender_mode"` + SenderVisibility string `json:"sender_visibility"` + ShowChannels bool `json:"show_channels"` + SkipPush bool `json:"skip_push"` + SkipWebhook bool `json:"skip_webhook"` + Status string `json:"status"` + UpdatedAt Timestamp `json:"updated_at"` + SegmentIds []string `json:"segment_ids"` + Segments []Segment `json:"segments"` + UserIds []string `json:"user_ids"` + Users []UserResponse `json:"users"` + Stats CampaignStatsResponse `json:"stats"` + ScheduledFor *Timestamp `json:"scheduled_for,omitempty"` + StopAt *Timestamp `json:"stop_at,omitempty"` + ChannelTemplate *CampaignChannelTemplate `json:"channel_template,omitempty"` + MessageTemplate *CampaignMessageTemplate `json:"message_template,omitempty"` + Sender *UserResponse `json:"sender,omitempty"` +} - UpdatedAt Timestamp `json:"updated_at"` +type CampaignStartedEvent struct { + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Campaign *CampaignResponse `json:"campaign,omitempty"` +} - SegmentIds []string `json:"segment_ids"` +func (e *CampaignStartedEvent) GetEventType() string { + return e.Type +} - Segments []Segment `json:"segments"` +type CampaignStatsResponse struct { + Progress float64 `json:"progress"` + StatsChannelsCreated int `json:"stats_channels_created"` + StatsCompletedAt Timestamp `json:"stats_completed_at"` + StatsMessagesSent int `json:"stats_messages_sent"` + StatsStartedAt Timestamp `json:"stats_started_at"` + StatsUsersRead int `json:"stats_users_read"` + StatsUsersSent int `json:"stats_users_sent"` +} - UserIds []string `json:"user_ids"` +type ChannelBatchCompletedEvent struct { + BatchCreatedAt Timestamp `json:"batch_created_at"` + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + Operation string `json:"operation"` + Status string `json:"status"` + SuccessChannelsCount int `json:"success_channels_count"` + TaskID string `json:"task_id"` + FailedChannels []FailedChannelUpdates `json:"failed_channels"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - Users []UserResponse `json:"users"` +func (e *ChannelBatchCompletedEvent) GetEventType() string { + return e.Type +} - Stats CampaignStatsResponse `json:"stats"` +type ChannelBatchMemberRequest struct { + UserID string `json:"user_id"` + ChannelRole *string `json:"channel_role,omitempty"` +} - ScheduledFor *Timestamp `json:"scheduled_for,omitempty"` +type ChannelBatchStartedEvent struct { + BatchCreatedAt Timestamp `json:"batch_created_at"` + CreatedAt Timestamp `json:"created_at"` + FinishedAt Timestamp `json:"finished_at"` + Operation string `json:"operation"` + Status string `json:"status"` + SuccessChannelsCount int `json:"success_channels_count"` + TaskID string `json:"task_id"` + FailedChannels []FailedChannelUpdates `json:"failed_channels"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - StopAt *Timestamp `json:"stop_at,omitempty"` +func (e *ChannelBatchStartedEvent) GetEventType() string { + return e.Type +} - ChannelTemplate *CampaignChannelTemplate `json:"channel_template,omitempty"` +// Basic response information +type ChannelBatchUpdateResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + TaskID *string `json:"task_id,omitempty"` +} - MessageTemplate *CampaignMessageTemplate `json:"message_template,omitempty"` +type ChannelConfig struct { + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + // List of commands that channel supports + Commands []string `json:"commands"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` +} - Sender *UserResponse `json:"sender,omitempty"` +type ChannelConfigWithInfo struct { + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + Commands []Command `json:"commands"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` + 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"` } -type CampaignStartedEvent struct { - CreatedAt Timestamp `json:"created_at"` +func (e *ChannelCreatedEvent) GetEventType() string { + return e.Type +} - Custom map[string]any `json:"custom"` +type ChannelDataUpdate struct { + AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` + AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Frozen *bool `json:"frozen,omitempty"` + Team *string `json:"team,omitempty"` + ConfigOverrides *ChannelConfig `json:"config_overrides,omitempty"` + Custom map[string]any `json:"custom,omitempty"` +} +// Emitted when a channel is successfully deleted. +type ChannelDeletedEvent 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.deleted" in this case Type string `json:"type"` - + // The ID of the channel which was deleted + 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 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} - Campaign *CampaignResponse `json:"campaign,omitempty"` +func (e *ChannelDeletedEvent) GetEventType() string { + return e.Type } -func (*CampaignStartedEvent) GetEventType() string { - return "campaign.started" +type ChannelExport struct { + Cid *string `json:"cid,omitempty"` + // Channel ID + ID *string `json:"id,omitempty"` + // Date to export messages since + MessagesSince *Timestamp `json:"messages_since,omitempty"` + // Date to export messages until + MessagesUntil *Timestamp `json:"messages_until,omitempty"` + // Channel type + Type *string `json:"type,omitempty"` } -type CampaignStatsResponse struct { - Progress float64 `json:"progress"` +// Emitted when a channel is successfully frozen. +type ChannelFrozenEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.frozen" in this case + Type string `json:"type"` + // The ID of the channel which was frozen + ChannelID *string `json:"channel_id,omitempty"` + // 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"` +} - StatsChannelsCreated int `json:"stats_channels_created"` +func (e *ChannelFrozenEvent) GetEventType() string { + return e.Type +} - StatsCompletedAt Timestamp `json:"stats_completed_at"` +type ChannelGetOrCreateRequest struct { + // Whether this channel will be hidden for the user who created the channel or not + HideForCreator *bool `json:"hide_for_creator,omitempty"` + // Refresh channel state + State *bool `json:"state,omitempty"` + ThreadUnreadCounts *bool `json:"thread_unread_counts,omitempty"` + Data *ChannelInput `json:"data,omitempty"` + Members *PaginationParams `json:"members,omitempty"` + Messages *MessagePaginationParams `json:"messages,omitempty"` + Watchers *PaginationParams `json:"watchers,omitempty"` +} - StatsMessagesSent int `json:"stats_messages_sent"` +// Emitted when a channel is successfully hidden. +type ChannelHiddenEvent struct { + // Whether the history was cleared + ClearHistory bool `json:"clear_history"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.hidden" in this case + Type string `json:"type"` + // The ID of the channel which was hidden + 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 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"` +} - StatsStartedAt Timestamp `json:"stats_started_at"` +func (e *ChannelHiddenEvent) GetEventType() string { + return e.Type +} - StatsUsersRead int `json:"stats_users_read"` +type ChannelInput struct { + // Enable or disable auto translation + AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` + // Switch auto translation language + AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` + CreatedByID *string `json:"created_by_id,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + // Freeze or unfreeze the channel + Frozen *bool `json:"frozen,omitempty"` + // Team the channel belongs to (if multi-tenant mode is enabled) + Team *string `json:"team,omitempty"` + TruncatedByID *string `json:"truncated_by_id,omitempty"` + FilterTags []string `json:"filter_tags,omitempty"` + Invites []ChannelMemberRequest `json:"invites,omitempty"` + Members []ChannelMemberRequest `json:"members,omitempty"` + ConfigOverrides *ChannelConfig `json:"config_overrides,omitempty"` + CreatedBy *UserRequest `json:"created_by,omitempty"` + Custom map[string]any `json:"custom,omitempty"` +} - StatsUsersSent int `json:"stats_users_sent"` +type ChannelInputRequest struct { + AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` + AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Frozen *bool `json:"frozen,omitempty"` + Team *string `json:"team,omitempty"` + Invites []ChannelMemberRequest `json:"invites,omitempty"` + Members []ChannelMemberRequest `json:"members,omitempty"` + ConfigOverrides *ConfigOverridesRequest `json:"config_overrides,omitempty"` + CreatedBy *UserRequest `json:"created_by,omitempty"` + Custom map[string]any `json:"custom,omitempty"` } -type Channel struct { - AutoTranslationLanguage string `json:"auto_translation_language"` +type ChannelMemberRequest struct { + UserID string `json:"user_id"` + // Role of the member in the channel + ChannelRole *string `json:"channel_role,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + User *UserResponse `json:"user,omitempty"` +} - Cid string `json:"cid"` +type ChannelMemberResponse struct { + // Whether member is banned this channel or not + Banned bool `json:"banned"` + // Role of the member in the channel + ChannelRole string `json:"channel_role"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + NotificationsMuted bool `json:"notifications_muted"` + // Whether member is shadow banned in this channel or not + ShadowBanned bool `json:"shadow_banned"` + // Date/time of the last update + UpdatedAt Timestamp `json:"updated_at"` + Custom map[string]any `json:"custom"` + ArchivedAt *Timestamp `json:"archived_at,omitempty"` + // Expiration date of the ban + BanExpires *Timestamp `json:"ban_expires,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + // Date when invite was accepted + InviteAcceptedAt *Timestamp `json:"invite_accepted_at,omitempty"` + // Date when invite was rejected + InviteRejectedAt *Timestamp `json:"invite_rejected_at,omitempty"` + // Whether member was invited or not + Invited *bool `json:"invited,omitempty"` + // Whether member is channel moderator or not + IsModerator *bool `json:"is_moderator,omitempty"` + PinnedAt *Timestamp `json:"pinned_at,omitempty"` + // Permission level of the member in the channel (DEPRECATED: use channel_role instead). One of: member, moderator, admin, owner + Role *string `json:"role,omitempty"` + Status *string `json:"status,omitempty"` + UserID *string `json:"user_id,omitempty"` + DeletedMessages []string `json:"deleted_messages,omitempty"` + User *UserResponse `json:"user,omitempty"` +} + +// Response containing channel and its messages +type ChannelMessagesResponse struct { + // List of messages + Messages []MessageResponse `json:"messages"` + Channel ChannelResponse `json:"channel"` +} +type ChannelMute struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - - Disabled bool `json:"disabled"` - - Frozen bool `json:"frozen"` - - ID string `json:"id"` - + // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` + // Date/time of mute expiration + Expires *Timestamp `json:"expires,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + User *UserResponse `json:"user,omitempty"` +} - Type string `json:"type"` +// 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"` +} - 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 ChannelBatchCompletedEvent struct { - BatchCreatedAt Timestamp `json:"batch_created_at"` - - CreatedAt Timestamp `json:"created_at"` - - FinishedAt Timestamp `json:"finished_at"` - - Operation string `json:"operation"` - - Status string `json:"status"` - - SuccessChannelsCount int `json:"success_channels_count"` - - TaskID string `json:"task_id"` - - FailedChannels []FailedChannelUpdates `json:"failed_channels"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*ChannelBatchCompletedEvent) GetEventType() string { - return "channel_batch_update.completed" -} - -type ChannelBatchMemberRequest struct { - UserID string `json:"user_id"` - - ChannelRole *string `json:"channel_role,omitempty"` -} - -type ChannelBatchStartedEvent struct { - BatchCreatedAt Timestamp `json:"batch_created_at"` - - CreatedAt Timestamp `json:"created_at"` - - FinishedAt Timestamp `json:"finished_at"` - - Operation string `json:"operation"` - - Status string `json:"status"` - - SuccessChannelsCount int `json:"success_channels_count"` - - TaskID string `json:"task_id"` - - FailedChannels []FailedChannelUpdates `json:"failed_channels"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*ChannelBatchStartedEvent) GetEventType() string { - return "channel_batch_update.started" -} - -// Basic response information -type ChannelBatchUpdateResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - TaskID *string `json:"task_id,omitempty"` -} - -type ChannelConfig struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - // List of commands that channel supports - Commands []string `json:"commands"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Blocklists []BlockListOptions `json:"blocklists,omitempty"` - - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` -} - -type ChannelConfigWithInfo struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - Commands []Command `json:"commands"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Blocklists []BlockListOptions `json:"blocklists,omitempty"` - - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` - - Grants map[string][]string `json:"grants,omitempty"` -} - -type ChannelCreatedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` -} - -func (*ChannelCreatedEvent) GetEventType() string { - return "channel.created" -} - -type ChannelDataUpdate struct { - AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` - - AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` - - Disabled *bool `json:"disabled,omitempty"` - - Frozen *bool `json:"frozen,omitempty"` - - Team *string `json:"team,omitempty"` - - ConfigOverrides *ChannelConfig `json:"config_overrides,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` -} - -type ChannelDeletedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelMemberCount int `json:"channel_member_count"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` -} - -func (*ChannelDeletedEvent) GetEventType() string { - return "channel.deleted" -} - -type ChannelExport struct { - Cid *string `json:"cid,omitempty"` - - // Channel ID - ID *string `json:"id,omitempty"` - - // Date to export messages since - MessagesSince *Timestamp `json:"messages_since,omitempty"` - - // Date to export messages until - MessagesUntil *Timestamp `json:"messages_until,omitempty"` - - // Channel type - Type *string `json:"type,omitempty"` -} - -type ChannelFrozenEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` -} - -func (*ChannelFrozenEvent) GetEventType() string { - return "channel.frozen" -} - -type ChannelGetOrCreateRequest struct { - // Whether this channel will be hidden for the user who created the channel or not - HideForCreator *bool `json:"hide_for_creator,omitempty"` - - // Refresh channel state - State *bool `json:"state,omitempty"` - - ThreadUnreadCounts *bool `json:"thread_unread_counts,omitempty"` - - Data *ChannelInput `json:"data,omitempty"` - - Members *PaginationParams `json:"members,omitempty"` - - Messages *MessagePaginationParams `json:"messages,omitempty"` - - Watchers *PaginationParams `json:"watchers,omitempty"` -} - -type ChannelHiddenEvent struct { - ChannelID string `json:"channel_id"` - - ChannelMemberCount int `json:"channel_member_count"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - ClearHistory bool `json:"clear_history"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*ChannelHiddenEvent) GetEventType() string { - return "channel.hidden" -} - -type ChannelInput struct { - // Enable or disable auto translation - AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` - - // Switch auto translation language - AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` - - CreatedByID *string `json:"created_by_id,omitempty"` - - Disabled *bool `json:"disabled,omitempty"` - - // Freeze or unfreeze the channel - Frozen *bool `json:"frozen,omitempty"` - - // Team the channel belongs to (if multi-tenant mode is enabled) - Team *string `json:"team,omitempty"` - - TruncatedByID *string `json:"truncated_by_id,omitempty"` - - FilterTags []string `json:"filter_tags,omitempty"` - - Invites []ChannelMemberRequest `json:"invites,omitempty"` - - Members []ChannelMemberRequest `json:"members,omitempty"` - - ConfigOverrides *ChannelConfig `json:"config_overrides,omitempty"` - - CreatedBy *UserRequest `json:"created_by,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` -} - -type ChannelInputRequest struct { - AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` - - AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` - - Disabled *bool `json:"disabled,omitempty"` - - Frozen *bool `json:"frozen,omitempty"` - - 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"` - - UserID *string `json:"user_id,omitempty"` - - DeletedMessages []string `json:"deleted_messages,omitempty"` - - Channel *DenormalizedChannelFields `json:"channel,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 { - UserID string `json:"user_id"` - - // Role of the member in the channel - ChannelRole *string `json:"channel_role,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - User *UserResponse `json:"user,omitempty"` -} - -type ChannelMemberResponse struct { - // Whether member is banned this channel or not - Banned bool `json:"banned"` - - // Role of the member in the channel - ChannelRole string `json:"channel_role"` - - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - NotificationsMuted bool `json:"notifications_muted"` - - // Whether member is shadow banned in this channel or not - ShadowBanned bool `json:"shadow_banned"` - - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - - Custom map[string]any `json:"custom"` - - ArchivedAt *Timestamp `json:"archived_at,omitempty"` - - // Expiration date of the ban - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - // Date when invite was accepted - InviteAcceptedAt *Timestamp `json:"invite_accepted_at,omitempty"` - - // Date when invite was rejected - InviteRejectedAt *Timestamp `json:"invite_rejected_at,omitempty"` - - // Whether member was invited or not - Invited *bool `json:"invited,omitempty"` - - // Whether member is channel moderator or not - IsModerator *bool `json:"is_moderator,omitempty"` - - PinnedAt *Timestamp `json:"pinned_at,omitempty"` - - // Permission level of the member in the channel (DEPRECATED: use channel_role instead) - Role *string `json:"role,omitempty"` - - Status *string `json:"status,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - DeletedMessages []string `json:"deleted_messages,omitempty"` - - User *UserResponse `json:"user,omitempty"` -} - -type ChannelMessages struct { - Messages []Message `json:"messages"` - - Channel *ChannelResponse `json:"channel,omitempty"` -} - -type ChannelMute 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"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - User *UserResponse `json:"user,omitempty"` -} - -type ChannelMutedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` -} - -func (*ChannelMutedEvent) GetEventType() string { - return "channel.muted" -} +func (e *ChannelMutedEvent) GetEventType() string { + return e.Type +} type ChannelOwnCapability string @@ -4066,15 +2945,8 @@ 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"` - + ChatLevel *string `json:"chat_level,omitempty"` DisabledUntil *Timestamp `json:"disabled_until,omitempty"` } @@ -4082,323 +2954,269 @@ type ChannelPushPreferencesResponse struct { type ChannelResponse struct { // Channel CID (:) Cid string `json:"cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - - Disabled bool `json:"disabled"` - + Disabled bool `json:"disabled"` // Whether channel is frozen or not Frozen bool `json:"frozen"` - // Channel unique ID ID string `json:"id"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // Type of the channel Type string `json:"type"` - // Custom data for this object Custom map[string]any `json:"custom"` - // Whether auto translation is enabled or not AutoTranslationEnabled *bool `json:"auto_translation_enabled,omitempty"` - // Language to translate to when auto translation is active AutoTranslationLanguage *string `json:"auto_translation_language,omitempty"` - // Whether this channel is blocked by current user or not Blocked *bool `json:"blocked,omitempty"` - // Cooldown period after sending each message Cooldown *int `json:"cooldown,omitempty"` - // Date/time of deletion DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // Whether this channel is hidden by current user or not Hidden *bool `json:"hidden,omitempty"` - // Date since when the message history is accessible HideMessagesBefore *Timestamp `json:"hide_messages_before,omitempty"` - // Date of the last message sent LastMessageAt *Timestamp `json:"last_message_at,omitempty"` - // Number of members in the channel MemberCount *int `json:"member_count,omitempty"` - // Number of messages in the channel MessageCount *int `json:"message_count,omitempty"` - // Date of mute expiration MuteExpiresAt *Timestamp `json:"mute_expires_at,omitempty"` - // Whether this channel is muted or not Muted *bool `json:"muted,omitempty"` - // Team the channel belongs to (multi-tenant only) Team *string `json:"team,omitempty"` - // Date of the latest truncation of the channel TruncatedAt *Timestamp `json:"truncated_at,omitempty"` - // List of filter tags associated with the channel FilterTags []string `json:"filter_tags,omitempty"` - // List of channel members (max 100) Members []ChannelMemberResponse `json:"members,omitempty"` - // List of channel capabilities of authenticated user OwnCapabilities []ChannelOwnCapability `json:"own_capabilities,omitempty"` - - Config *ChannelConfigWithInfo `json:"config,omitempty"` - - CreatedBy *UserResponse `json:"created_by,omitempty"` - - TruncatedBy *UserResponse `json:"truncated_by,omitempty"` + Config *ChannelConfigWithInfo `json:"config,omitempty"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + TruncatedBy *UserResponse `json:"truncated_by,omitempty"` } type ChannelStateResponse struct { - Duration string `json:"duration"` - - Members []ChannelMemberResponse `json:"members"` - - Messages []MessageResponse `json:"messages"` - - PinnedMessages []MessageResponse `json:"pinned_messages"` - - Threads []ThreadStateResponse `json:"threads"` - - Hidden *bool `json:"hidden,omitempty"` - - HideMessagesBefore *Timestamp `json:"hide_messages_before,omitempty"` - - WatcherCount *int `json:"watcher_count,omitempty"` - - ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations,omitempty"` - - PendingMessages []PendingMessageResponse `json:"pending_messages,omitempty"` - - Read []ReadStateResponse `json:"read,omitempty"` - - Watchers []UserResponse `json:"watchers,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - - Membership *ChannelMemberResponse `json:"membership,omitempty"` - - PushPreferences *ChannelPushPreferencesResponse `json:"push_preferences,omitempty"` + Duration string `json:"duration"` + Members []ChannelMemberResponse `json:"members"` + Messages []MessageResponse `json:"messages"` + PinnedMessages []MessageResponse `json:"pinned_messages"` + Threads []ThreadStateResponse `json:"threads"` + Hidden *bool `json:"hidden,omitempty"` + HideMessagesBefore *Timestamp `json:"hide_messages_before,omitempty"` + WatcherCount *int `json:"watcher_count,omitempty"` + ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations,omitempty"` + PendingMessages []PendingMessageResponse `json:"pending_messages,omitempty"` + Read []ReadStateResponse `json:"read,omitempty"` + Watchers []UserResponse `json:"watchers,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Draft *DraftResponse `json:"draft,omitempty"` + Membership *ChannelMemberResponse `json:"membership,omitempty"` + PushPreferences *ChannelPushPreferencesResponse `json:"push_preferences,omitempty"` } type ChannelStateResponseFields struct { // List of channel members Members []ChannelMemberResponse `json:"members"` - // List of channel messages Messages []MessageResponse `json:"messages"` - // List of pinned messages in the channel - PinnedMessages []MessageResponse `json:"pinned_messages"` - - Threads []ThreadStateResponse `json:"threads"` - + PinnedMessages []MessageResponse `json:"pinned_messages"` + Threads []ThreadStateResponse `json:"threads"` // Whether this channel is hidden or not Hidden *bool `json:"hidden,omitempty"` - // Messages before this date are hidden from the user HideMessagesBefore *Timestamp `json:"hide_messages_before,omitempty"` - // Number of channel watchers WatcherCount *int `json:"watcher_count,omitempty"` - // Active live locations in the channel ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations,omitempty"` - // Pending messages that this user has sent PendingMessages []PendingMessageResponse `json:"pending_messages,omitempty"` - // List of read states Read []ReadStateResponse `json:"read,omitempty"` - // List of user who is watching the channel - Watchers []UserResponse `json:"watchers,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - - Membership *ChannelMemberResponse `json:"membership,omitempty"` - + Watchers []UserResponse `json:"watchers,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Draft *DraftResponse `json:"draft,omitempty"` + Membership *ChannelMemberResponse `json:"membership,omitempty"` PushPreferences *ChannelPushPreferencesResponse `json:"push_preferences,omitempty"` } +// Emitted when a channel is successfully truncated. type ChannelTruncatedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelMemberCount int `json:"channel_member_count"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.truncated" in this case Type string `json:"type"` - - Channel *ChannelResponse `json:"channel,omitempty"` + // The ID of the channel which was truncated + 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 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 { - return "channel.truncated" +func (e *ChannelTruncatedEvent) GetEventType() string { + return e.Type } type ChannelTypeConfig struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - Commands []Command `json:"commands"` - - Permissions []PolicyRequest `json:"permissions"` - - Grants map[string][]string `json:"grants"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Blocklists []BlockListOptions `json:"blocklists,omitempty"` - - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` -} - + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + Commands []Command `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + Grants map[string][]string `json:"grants"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` +} + +// Emitted when a channel is successfully unfrozen. type ChannelUnFrozenEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.unfrozen" in this case Type string `json:"type"` + // The ID of the channel which was unfrozen + ChannelID *string `json:"channel_id,omitempty"` + // 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" +func (e *ChannelUnFrozenEvent) GetEventType() string { + return e.Type } +// Emitted when a channel is successfully unmuted. type ChannelUnmutedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` + // 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" +func (e *ChannelUnmutedEvent) GetEventType() string { + return e.Type } +// Emitted when a channel is successfully updated. type ChannelUpdatedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelMemberCount int `json:"channel_member_count"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + Custom map[string]any `json:"custom"` + // The type of event: "channel.updated" in this case Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,omitempty"` + // The ID of the channel which was updated + 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 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ChannelUpdatedEvent) GetEventType() string { - return "channel.updated" +func (e *ChannelUpdatedEvent) GetEventType() string { + return e.Type } +// Emitted when a channel is successfully shown. type ChannelVisibleEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + 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 { - return "channel.visible" +func (e *ChannelVisibleEvent) GetEventType() string { + return e.Type } type ChatActivityStatsResponse struct { @@ -4409,95 +3227,78 @@ type ChatActivityStatsResponse struct { type CheckExternalStorageResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - FileUrl string `json:"file_url"` + FileUrl string `json:"file_url"` } type CheckPushResponse struct { Duration string `json:"duration"` - // The event type that was tested - EventType *string `json:"event_type,omitempty"` - - RenderedApnTemplate *string `json:"rendered_apn_template,omitempty"` - + EventType *string `json:"event_type,omitempty"` + RenderedApnTemplate *string `json:"rendered_apn_template,omitempty"` RenderedFirebaseTemplate *string `json:"rendered_firebase_template,omitempty"` - // Don't require existing devices to render templates SkipDevices *bool `json:"skip_devices,omitempty"` - // List of general errors GeneralErrors []string `json:"general_errors,omitempty"` - // Object with device errors - DeviceErrors map[string]DeviceErrorInfo `json:"device_errors,omitempty"` - - RenderedMessage map[string]string `json:"rendered_message,omitempty"` + DeviceErrors map[string]DeviceErrorInfo `json:"device_errors,omitempty"` + RenderedMessage map[string]string `json:"rendered_message,omitempty"` } type CheckResponse struct { Duration string `json:"duration"` - // Suggested action based on moderation results RecommendedAction string `json:"recommended_action"` - // Status of the moderation check (completed or pending) Status string `json:"status"` - // ID of the running moderation task - TaskID *string `json:"task_id,omitempty"` - - Item *ReviewQueueItemResponse `json:"item,omitempty"` + TaskID *string `json:"task_id,omitempty"` + Item *ReviewQueueItemResponse `json:"item,omitempty"` } type CheckSNSResponse struct { Duration string `json:"duration"` - - // Validation result + // Validation result. One of: ok, error Status string `json:"status"` - // Error text Error *string `json:"error,omitempty"` - // Error data Data map[string]any `json:"data,omitempty"` } type CheckSQSResponse struct { Duration string `json:"duration"` - - // Validation result + // Validation result. One of: ok, error Status string `json:"status"` - // Error text Error *string `json:"error,omitempty"` - // Error data Data map[string]any `json:"data,omitempty"` } type ClientOSDataResponse struct { Architecture *string `json:"architecture,omitempty"` - - Name *string `json:"name,omitempty"` - - Version *string `json:"version,omitempty"` + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` } // This event is sent when closed captions are being sent in a call, clients should use this to show the closed captions in the call screen type ClosedCaptionEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` ClosedCaption CallClosedCaption `json:"closed_caption"` - // The type of event: "call.closed_caption" in this case Type string `json:"type"` } -func (*ClosedCaptionEvent) GetEventType() string { - return "call.closed_caption" +func (e *ClosedCaptionEvent) GetEventType() string { + return e.Type +} + +type ClosedCaptionRuleParameters struct { + Threshold *int `json:"threshold,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` + LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` } // Basic response information @@ -4509,13 +3310,10 @@ type CollectUserFeedbackResponse struct { type CollectionRequest struct { // Name/type of the collection Name string `json:"name"` - // Custom data for the collection (required, must contain at least one key) Custom map[string]any `json:"custom"` - // Unique identifier for the collection within its name (optional, will be auto-generated if not provided) ID *string `json:"id,omitempty"` - // ID of the user who owns this collection UserID *string `json:"user_id,omitempty"` } @@ -4523,19 +3321,14 @@ type CollectionRequest struct { type CollectionResponse struct { // Unique identifier for the collection within its name ID string `json:"id"` - // Name/type of the collection Name string `json:"name"` - // When the collection was created CreatedAt *Timestamp `json:"created_at,omitempty"` - // When the collection was last updated UpdatedAt *Timestamp `json:"updated_at,omitempty"` - // ID of the user who owns this collection UserID *string `json:"user_id,omitempty"` - // Custom data for the collection Custom map[string]any `json:"custom,omitempty"` } @@ -4544,19 +3337,14 @@ type CollectionResponse struct { type Command struct { // Arguments help text, shown in commands auto-completion Args string `json:"args"` - // Description, shown in commands auto-completion Description string `json:"description"` - // Unique command name Name string `json:"name"` - // Set name used for grouping commands Set string `json:"set"` - // Date/time of creation CreatedAt *Timestamp `json:"created_at,omitempty"` - // Date/time of the last update UpdatedAt *Timestamp `json:"updated_at,omitempty"` } @@ -4564,333 +3352,251 @@ type Command struct { // Emitted when a comment is added to an activity. type CommentAddedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.comment.added" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*CommentAddedEvent) GetEventType() string { - return "feeds.comment.added" +func (e *CommentAddedEvent) GetEventType() string { + return e.Type } // Emitted when a comment is deleted. type CommentDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.comment.deleted" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*CommentDeletedEvent) GetEventType() string { - return "feeds.comment.deleted" +func (e *CommentDeletedEvent) GetEventType() string { + return e.Type } // Emitted when a reaction is added to a comment. -type CommentReactionAddedEvent struct { - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - - // The type of event: "feeds.comment.reaction.added" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` +type CommentReactionAddedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` + // The type of event: "feeds.comment.reaction.added" in this case + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*CommentReactionAddedEvent) GetEventType() string { - return "feeds.comment.reaction.added" +func (e *CommentReactionAddedEvent) GetEventType() string { + return e.Type } // Emitted when a reaction is deleted from a comment. type CommentReactionDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` // The type of reaction that was removed - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*CommentReactionDeletedEvent) GetEventType() string { - return "feeds.comment.reaction.deleted" +func (e *CommentReactionDeletedEvent) GetEventType() string { + return e.Type } // Emitted when a reaction is updated on a comment. type CommentReactionUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Activity ActivityResponse `json:"activity"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - - Reaction FeedsReactionResponse `json:"reaction"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Activity ActivityResponse `json:"activity"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` + Reaction FeedsReactionResponse `json:"reaction"` // The type of event: "feeds.comment.reaction.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*CommentReactionUpdatedEvent) GetEventType() string { - return "feeds.comment.reaction.updated" +func (e *CommentReactionUpdatedEvent) GetEventType() string { + return e.Type } type CommentResponse struct { // Confidence score of the comment ConfidenceScore float64 `json:"confidence_score"` - // When the comment was created CreatedAt Timestamp `json:"created_at"` - // Number of downvotes for this comment DownvoteCount int `json:"downvote_count"` - // Unique identifier for the comment ID string `json:"id"` - // ID of the object this comment is associated with ObjectID string `json:"object_id"` - // Type of the object this comment is associated with ObjectType string `json:"object_type"` - // Number of reactions to this comment ReactionCount int `json:"reaction_count"` - // Number of replies to this comment ReplyCount int `json:"reply_count"` - // Score of the comment based on reactions Score int `json:"score"` - - // Status of the comment (e.g., active, deleted) + // Status of the comment. One of: active, deleted, removed, hidden Status string `json:"status"` - // When the comment was last updated UpdatedAt Timestamp `json:"updated_at"` - // Number of upvotes for this comment UpvoteCount int `json:"upvote_count"` - // Users mentioned in the comment MentionedUsers []UserResponse `json:"mentioned_users"` - // Current user's reactions to this activity OwnReactions []FeedsReactionResponse `json:"own_reactions"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // Controversy score of the comment ControversyScore *float64 `json:"controversy_score,omitempty"` - // When the comment was deleted DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // When the comment was last edited EditedAt *Timestamp `json:"edited_at,omitempty"` - // ID of parent comment for nested replies ParentID *string `json:"parent_id,omitempty"` - // 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 LatestReactions []FeedsReactionResponse `json:"latest_reactions,omitempty"` - // Custom data for the comment - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` Moderation *ModerationV2Response `json:"moderation,omitempty"` - // Grouped reactions by type - ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` + ReactionGroups map[string]FeedsReactionGroupResponse `json:"reaction_groups,omitempty"` } // Emitted when a comment is updated. type CommentUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Comment CommentResponse `json:"comment"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Comment CommentResponse `json:"comment"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.comment.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*CommentUpdatedEvent) GetEventType() string { - return "feeds.comment.updated" +func (e *CommentUpdatedEvent) GetEventType() string { + return e.Type } type CompositeRecordingResponse struct { Status string `json:"status"` } -type ConfigOverrides struct { +// Channel configuration overrides +type ConfigOverridesRequest struct { + // Blocklist name Blocklist *string `json:"blocklist,omitempty"` - + // Blocklist behavior. One of: flag, 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"` } type ConfigResponse struct { // Whether moderation should be performed asynchronously Async bool `json:"async"` - // When the configuration was created CreatedAt Timestamp `json:"created_at"` - // Unique identifier for the moderation configuration Key string `json:"key"` - // Team associated with the configuration Team string `json:"team"` - // When the configuration was last updated - UpdatedAt Timestamp `json:"updated_at"` - - SupportedVideoCallHarmTypes []string `json:"supported_video_call_harm_types"` - - AiImageConfig *AIImageConfig `json:"ai_image_config,omitempty"` - - AiTextConfig *AITextConfig `json:"ai_text_config,omitempty"` - - AiVideoConfig *AIVideoConfig `json:"ai_video_config,omitempty"` - + UpdatedAt Timestamp `json:"updated_at"` + SupportedVideoCallHarmTypes []string `json:"supported_video_call_harm_types"` + AiImageConfig *AIImageConfig `json:"ai_image_config,omitempty"` + // Available L2 subclassifications per L1 image moderation label, based on the active provider + AiImageSubclassifications map[string][]string `json:"ai_image_subclassifications,omitempty"` + AiTextConfig *AITextConfig `json:"ai_text_config,omitempty"` + AiVideoConfig *AIVideoConfig `json:"ai_video_config,omitempty"` AutomodPlatformCircumventionConfig *AutomodPlatformCircumventionConfig `json:"automod_platform_circumvention_config,omitempty"` - - AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config,omitempty"` - - AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config,omitempty"` - - BlockListConfig *BlockListConfig `json:"block_list_config,omitempty"` - - LlmConfig *LLMConfig `json:"llm_config,omitempty"` - - VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config,omitempty"` - - VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config,omitempty"` + AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config,omitempty"` + AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config,omitempty"` + BlockListConfig *BlockListConfig `json:"block_list_config,omitempty"` + LlmConfig *LLMConfig `json:"llm_config,omitempty"` + VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config,omitempty"` + VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config,omitempty"` } type ContentCountRuleParameters struct { - Threshold *int `json:"threshold,omitempty"` - + Threshold *int `json:"threshold,omitempty"` 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"` } type CountByMinuteResponse struct { - Count int `json:"count"` - + Count int `json:"count"` StartTs Timestamp `json:"start_ts"` } // Basic response information type CreateBlockListResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Blocklist *BlockListResponse `json:"blocklist,omitempty"` } @@ -4898,113 +3604,69 @@ type CreateBlockListResponse struct { type CreateCallTypeResponse struct { // the time the call type was created CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // the name of the call type Name string `json:"name"` - // the time the call type was last updated UpdatedAt Timestamp `json:"updated_at"` - // the permissions granted to each role - Grants map[string][]string `json:"grants"` - - NotificationSettings NotificationSettings `json:"notification_settings"` - - Settings CallSettingsResponse `json:"settings"` - + Grants map[string][]string `json:"grants"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` + Settings CallSettingsResponse `json:"settings"` // the external storage for the call type ExternalStorage *string `json:"external_storage,omitempty"` } type CreateChannelTypeResponse struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - Duration string `json:"duration"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - Commands []string `json:"commands"` - - Permissions []PolicyRequest `json:"permissions"` - - Grants map[string][]string `json:"grants"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Blocklists []BlockListOptions `json:"blocklists,omitempty"` - - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + Duration string `json:"duration"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + Commands []string `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + Grants map[string][]string `json:"grants"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` } type CreateCollectionsResponse struct { Duration string `json:"duration"` - // List of created collections Collections []CollectionResponse `json:"collections"` } type CreateCommandResponse struct { - Duration string `json:"duration"` - - Command *Command `json:"command,omitempty"` + Duration string `json:"duration"` + Command *Command `json:"command,omitempty"` } // Basic response information @@ -5014,20 +3676,17 @@ type CreateExternalStorageResponse struct { } type CreateFeedGroupResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedGroup FeedGroupResponse `json:"feed_group"` } type CreateFeedViewResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedView FeedViewResponse `json:"feed_view"` } type CreateFeedsBatchResponse struct { Duration string `json:"duration"` - // List of created feeds Feeds []FeedResponse `json:"feeds"` } @@ -5035,54 +3694,41 @@ type CreateFeedsBatchResponse struct { type CreateGuestResponse struct { // the access token to authenticate the user AccessToken string `json:"access_token"` - // Duration of the request in milliseconds - Duration string `json:"duration"` - - User UserResponse `json:"user"` + Duration string `json:"duration"` + User UserResponse `json:"user"` } // Basic response information type CreateImportResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ImportTask *ImportTask `json:"import_task,omitempty"` } // Basic response information type CreateImportURLResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Path string `json:"path"` - + Duration string `json:"duration"` + Path string `json:"path"` UploadUrl string `json:"upload_url"` } // Basic response information type CreateImportV2TaskResponse struct { - AppPk int `json:"app_pk"` - + AppPk int `json:"app_pk"` CreatedAt Timestamp `json:"created_at"` - // Duration of the request in milliseconds - Duration string `json:"duration"` - - ID string `json:"id"` - - Product string `json:"product"` - - State int `json:"state"` - - UpdatedAt Timestamp `json:"updated_at"` - - Settings ImportV2TaskSettings `json:"settings"` + Duration string `json:"duration"` + ID string `json:"id"` + Product string `json:"product"` + State int `json:"state"` + UpdatedAt Timestamp `json:"updated_at"` + Settings ImportV2TaskSettings `json:"settings"` } type CreateMembershipLevelResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` MembershipLevel MembershipLevelResponse `json:"membership_level"` } @@ -5090,108 +3736,108 @@ type CreateMembershipLevelResponse struct { type CreateRoleResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - Role Role `json:"role"` + Role Role `json:"role"` } // Response containing the created SIP trunk type CreateSIPTrunkResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` SipTrunk *SIPTrunkResponse `json:"sip_trunk,omitempty"` } -type CustomActionRequest struct { - ID *string `json:"id,omitempty"` +// Response for creating a user group +type CreateUserGroupResponse struct { + Duration string `json:"duration"` + UserGroup *UserGroupResponse `json:"user_group,omitempty"` +} +// 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"` } type CustomCheckFlag struct { // Type of check (custom_check_text, custom_check_image, custom_check_video) Type string `json:"type"` - // Optional explanation for the flag Reason *string `json:"reason,omitempty"` - // Labels from various moderation sources Labels []string `json:"labels,omitempty"` - // Additional metadata for the flag Custom map[string]any `json:"custom,omitempty"` } type CustomCheckResponse struct { Duration string `json:"duration"` - // Unique identifier of the custom check ID string `json:"id"` - // Status of the custom check - Status string `json:"status"` + Status string `json:"status"` + Item *ReviewQueueItemResponse `json:"item,omitempty"` +} - 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 (e *CustomEvent) GetEventType() string { + return e.Type } // 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"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Custom data for this object Custom map[string]any `json:"custom"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // The type of event, "custom" in this case Type string `json:"type"` } -func (*CustomVideoEvent) GetEventType() string { - return "custom" +func (e *CustomVideoEvent) GetEventType() string { + return e.Type } type DailyAggregateCallDurationReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report CallDurationReport `json:"report"` } type DailyAggregateCallParticipantCountReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report CallParticipantCountReport `json:"report"` } type DailyAggregateCallsPerDayReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report CallsPerDayReport `json:"report"` } type DailyAggregateQualityScoreReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report QualityScoreReport `json:"report"` } type DailyAggregateSDKUsageReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report SDKUsageReport `json:"report"` } type DailyAggregateUserFeedbackReportResponse struct { - Date string `json:"date"` - + Date string `json:"date"` Report UserFeedbackReport `json:"report"` } type DailyMetricResponse struct { // Date in YYYY-MM-DD format Date string `json:"date"` - // Metric value for this date Value int `json:"value"` } @@ -5199,73 +3845,80 @@ type DailyMetricResponse struct { type DailyMetricStatsResponse struct { // Total value across all days in the date range Total int `json:"total"` - // Array of daily metric values Daily []DailyMetricResponse `json:"daily"` } +// Metric value for a specific date +type DailyValue struct { + // Date in YYYY-MM-DD format + Date string `json:"date"` + // Metric value for this date + Value int `json:"value"` +} + type Data struct { ID string `json:"id"` } type DataDogInfo struct { - APIKey *string `json:"api_key,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Site *string `json:"site,omitempty"` + APIKey *string `json:"api_key,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Site *string `json:"site,omitempty"` } type DeactivateUserResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - User *UserResponse `json:"user,omitempty"` + Duration string `json:"duration"` + User *UserResponse `json:"user,omitempty"` } // Basic response information type DeactivateUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - TaskID string `json:"task_id"` + TaskID string `json:"task_id"` } type DecayFunctionConfig struct { // Base value for decay function Base *string `json:"base,omitempty"` - // Decay rate Decay *string `json:"decay,omitempty"` - // Direction of decay Direction *string `json:"direction,omitempty"` - // Offset value for decay function Offset *string `json:"offset,omitempty"` - // Origin value for decay function Origin *string `json:"origin,omitempty"` - // Scale factor for decay function Scale *string `json:"scale,omitempty"` } type DeleteActivitiesResponse struct { Duration string `json:"duration"` - // List of activity IDs that were successfully deleted DeletedIds []string `json:"deleted_ids"` } type DeleteActivityReactionResponse struct { - Duration string `json:"duration"` - - Activity ActivityResponse `json:"activity"` - + Duration string `json:"duration"` + Activity ActivityResponse `json:"activity"` Reaction FeedsReactionResponse `json:"reaction"` } +// Configuration for activity deletion action +type DeleteActivityRequestPayload struct { + // ID of the activity to delete (alternative to item_id) + EntityID *string `json:"entity_id,omitempty"` + // Type of the entity (required for delete_activity to distinguish v2 vs v3) + EntityType *string `json:"entity_type,omitempty"` + // 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"` } @@ -5274,43 +3927,36 @@ type DeleteBookmarkFolderResponse struct { Duration string `json:"duration"` } -type DeleteBookmarkResponse struct { - Duration string `json:"duration"` - +type DeleteBookmarkResponse struct { + Duration string `json:"duration"` Bookmark BookmarkResponse `json:"bookmark"` } // DeleteCallResponse is the payload for deleting a call. type DeleteCallResponse struct { - Duration string `json:"duration"` - - Call CallResponse `json:"call"` - - TaskID *string `json:"task_id,omitempty"` + Duration string `json:"duration"` + Call CallResponse `json:"call"` + TaskID *string `json:"task_id,omitempty"` } // Basic response information type DeleteChannelResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Channel *ChannelResponse `json:"channel,omitempty"` + Duration string `json:"duration"` + Channel *ChannelResponse `json:"channel,omitempty"` } type DeleteChannelsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - TaskID *string `json:"task_id,omitempty"` - + Duration string `json:"duration"` + TaskID *string `json:"task_id,omitempty"` // Map of channel IDs and their deletion results Result map[string]*DeleteChannelsResultResponse `json:"result,omitempty"` } type DeleteChannelsResultResponse struct { - Status string `json:"status"` - - Error *string `json:"error,omitempty"` + Status string `json:"status"` + Error *string `json:"error,omitempty"` } type DeleteCollectionsResponse struct { @@ -5319,25 +3965,32 @@ type DeleteCollectionsResponse struct { type DeleteCommandResponse struct { Duration string `json:"duration"` - // Command name Name string `json:"name"` } type DeleteCommentReactionResponse struct { - Duration string `json:"duration"` - - Comment CommentResponse `json:"comment"` - + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` Reaction FeedsReactionResponse `json:"reaction"` } -type DeleteCommentResponse struct { - Duration string `json:"duration"` +// Configuration for comment deletion action +type DeleteCommentRequestPayload struct { + // ID of the comment to delete (alternative to item_id) + EntityID *string `json:"entity_id,omitempty"` + // Type of the entity + EntityType *string `json:"entity_type,omitempty"` + // 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"` Activity ActivityResponse `json:"activity"` - - Comment CommentResponse `json:"comment"` + Comment CommentResponse `json:"comment"` } // Basic response information @@ -5354,7 +4007,6 @@ type DeleteFeedGroupResponse struct { type DeleteFeedResponse struct { Duration string `json:"duration"` - // The ID of the async task that will handle feed cleanup and hard deletion TaskID string `json:"task_id"` } @@ -5362,7 +4014,6 @@ type DeleteFeedResponse struct { // Response for deleting feed user data type DeleteFeedUserDataResponse struct { Duration string `json:"duration"` - // The task ID for the deletion task TaskID string `json:"task_id"` } @@ -5373,7 +4024,6 @@ 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"` } @@ -5384,12 +4034,23 @@ type DeleteImportV2TaskResponse struct { Duration string `json:"duration"` } +// Configuration for message deletion action +type DeleteMessageRequestPayload struct { + // ID of the message to delete (alternative to item_id) + EntityID *string `json:"entity_id,omitempty"` + // Type of the entity + EntityType *string `json:"entity_type,omitempty"` + // Whether to permanently delete the message + HardDelete *bool `json:"hard_delete,omitempty"` + // Reason for deletion + Reason *string `json:"reason,omitempty"` +} + // Basic response information type DeleteMessageResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message MessageResponse `json:"message"` + Duration string `json:"duration"` + Message MessageResponse `json:"message"` } type DeleteModerationConfigResponse struct { @@ -5406,13 +4067,23 @@ type DeleteModerationTemplateResponse struct { Duration string `json:"duration"` } +// Configuration for reaction deletion action +type DeleteReactionRequestPayload struct { + // ID of the reaction to delete (alternative to item_id) + EntityID *string `json:"entity_id,omitempty"` + // Type of the entity + EntityType *string `json:"entity_type,omitempty"` + // 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 - Duration string `json:"duration"` - - Message MessageResponse `json:"message"` - + Duration string `json:"duration"` + Message MessageResponse `json:"message"` Reaction ReactionResponse `json:"reaction"` } @@ -5444,93 +4115,48 @@ 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"` - + // ID of the user to delete (alternative to item_id) + EntityID *string `json:"entity_id,omitempty"` + // Type of the entity + EntityType *string `json:"entity_type,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"` } type DeleteUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // ID of the task to delete users TaskID string `json:"task_id"` } type DeliveredMessagePayload struct { Cid *string `json:"cid,omitempty"` - - ID *string `json:"id,omitempty"` -} - -type DeliveryReceipts struct { - Enabled *bool `json:"enabled,omitempty"` + ID *string `json:"id,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"` - + Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` } type DeviceErrorInfo struct { ErrorMessage string `json:"error_message"` - - Provider string `json:"provider"` - + Provider string `json:"provider"` ProviderName string `json:"provider_name"` } @@ -5538,125 +4164,93 @@ type DeviceErrorInfo struct { type DeviceResponse struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Device ID ID string `json:"id"` - // Push provider PushProvider string `json:"push_provider"` - // User ID UserID string `json:"user_id"` - // Whether device is disabled or not Disabled *bool `json:"disabled,omitempty"` - // Reason explaining why device had been disabled DisabledReason *string `json:"disabled_reason,omitempty"` - // Push provider name PushProviderName *string `json:"push_provider_name,omitempty"` - // When true the token is for Apple VoIP push notifications 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 string `json:"text"` - + // 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"` - - PollID *string `json:"poll_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. One of: regular, system Type *string `json:"type,omitempty"` - + // Array of message attachments Attachments []Attachment `json:"attachments,omitempty"` - + // List of mentioned users MentionedUsers []UserResponse `json:"mentioned_users,omitempty"` } type DraftResponse struct { - ChannelCid string `json:"channel_cid"` - - CreatedAt Timestamp `json:"created_at"` - - Message DraftPayloadResponse `json:"message"` - - ParentID *string `json:"parent_id,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - ParentMessage *MessageResponse `json:"parent_message,omitempty"` - - QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` + ChannelCid string `json:"channel_cid"` + CreatedAt Timestamp `json:"created_at"` + Message DraftPayloadResponse `json:"message"` + ParentID *string `json:"parent_id,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + ParentMessage *MessageResponse `json:"parent_message,omitempty"` + QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` } type EdgeResponse struct { - ContinentCode string `json:"continent_code"` - - CountryIsoCode string `json:"country_iso_code"` - - Green int `json:"green"` - - ID string `json:"id"` - - LatencyTestUrl string `json:"latency_test_url"` - - Latitude float64 `json:"latitude"` - - Longitude float64 `json:"longitude"` - - Red int `json:"red"` - - SubdivisionIsoCode string `json:"subdivision_iso_code"` - - Yellow int `json:"yellow"` + ContinentCode string `json:"continent_code"` + CountryIsoCode string `json:"country_iso_code"` + Green int `json:"green"` + ID string `json:"id"` + LatencyTestUrl string `json:"latency_test_url"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + Red int `json:"red"` + SubdivisionIsoCode string `json:"subdivision_iso_code"` + Yellow int `json:"yellow"` } type EgressHLSResponse struct { PlaylistUrl string `json:"playlist_url"` - - Status string `json:"status"` + Status string `json:"status"` } type EgressRTMPResponse struct { - Name string `json:"name"` - + Name string `json:"name"` StartedAt Timestamp `json:"started_at"` - - StreamKey *string `json:"stream_key,omitempty"` - - StreamUrl *string `json:"stream_url,omitempty"` + StreamKey *string `json:"stream_key,omitempty"` + StreamUrl *string `json:"stream_url,omitempty"` } type EgressResponse struct { - Broadcasting bool `json:"broadcasting"` - - Rtmps []EgressRTMPResponse `json:"rtmps"` - - CompositeRecording *CompositeRecordingResponse `json:"composite_recording,omitempty"` - - FrameRecording *FrameRecordingResponse `json:"frame_recording,omitempty"` - - HLS *EgressHLSResponse `json:"hls,omitempty"` - + Broadcasting bool `json:"broadcasting"` + Rtmps []EgressRTMPResponse `json:"rtmps"` + CompositeRecording *CompositeRecordingResponse `json:"composite_recording,omitempty"` + FrameRecording *FrameRecordingResponse `json:"frame_recording,omitempty"` + HLS *EgressHLSResponse `json:"hls,omitempty"` IndividualRecording *IndividualRecordingResponse `json:"individual_recording,omitempty"` - - RawRecording *RawRecordingResponse `json:"raw_recording,omitempty"` + RawRecording *RawRecordingResponse `json:"raw_recording,omitempty"` } // Response for ending a call @@ -5666,288 +4260,195 @@ type EndCallResponse struct { } type EnrichedActivity struct { - ForeignID *string `json:"foreign_id,omitempty"` - - ID *string `json:"id,omitempty"` - - Score *float64 `json:"score,omitempty"` - - Verb *string `json:"verb,omitempty"` - - To []string `json:"to,omitempty"` - - Actor *Data `json:"actor,omitempty"` - + ForeignID *string `json:"foreign_id,omitempty"` + ID *string `json:"id,omitempty"` + Score *float64 `json:"score,omitempty"` + Verb *string `json:"verb,omitempty"` + To []string `json:"to,omitempty"` + Actor *Data `json:"actor,omitempty"` LatestReactions map[string][]EnrichedReaction `json:"latest_reactions,omitempty"` - - Object *Data `json:"object,omitempty"` - - Origin *Data `json:"origin,omitempty"` - - OwnReactions map[string][]EnrichedReaction `json:"own_reactions,omitempty"` - - ReactionCounts map[string]int `json:"reaction_counts,omitempty"` - - Target *Data `json:"target,omitempty"` + Object *Data `json:"object,omitempty"` + Origin *Data `json:"origin,omitempty"` + OwnReactions map[string][]EnrichedReaction `json:"own_reactions,omitempty"` + ReactionCounts map[string]int `json:"reaction_counts,omitempty"` + Target *Data `json:"target,omitempty"` } type EnrichedCollectionResponse struct { // Unique identifier for the collection within its name ID string `json:"id"` - // Name/type of the collection Name string `json:"name"` - - // Enrichment status of the collection + // Enrichment status of the collection. One of: ok, notfound Status string `json:"status"` - // When the collection was created CreatedAt *Timestamp `json:"created_at,omitempty"` - // When the collection was last updated UpdatedAt *Timestamp `json:"updated_at,omitempty"` - // ID of the user who owns this collection UserID *string `json:"user_id,omitempty"` - // Custom data for the collection Custom map[string]any `json:"custom,omitempty"` } type EnrichedReaction struct { - ActivityID string `json:"activity_id"` - - Kind string `json:"kind"` - - UserID string `json:"user_id"` - - ID *string `json:"id,omitempty"` - - Parent *string `json:"parent,omitempty"` - - TargetFeeds []string `json:"target_feeds,omitempty"` - - ChildrenCounts map[string]int `json:"children_counts,omitempty"` - - CreatedAt *Time `json:"created_at,omitempty"` - - Data map[string]any `json:"data,omitempty"` - + ActivityID string `json:"activity_id"` + Kind string `json:"kind"` + UserID string `json:"user_id"` + ID *string `json:"id,omitempty"` + Parent *string `json:"parent,omitempty"` + TargetFeeds []string `json:"target_feeds,omitempty"` + ChildrenCounts map[string]int `json:"children_counts,omitempty"` + CreatedAt *Time `json:"created_at,omitempty"` + Data map[string]any `json:"data,omitempty"` LatestChildren map[string][]EnrichedReaction `json:"latest_children,omitempty"` - - OwnChildren map[string][]EnrichedReaction `json:"own_children,omitempty"` - - UpdatedAt *Time `json:"updated_at,omitempty"` - - User *Data `json:"user,omitempty"` + OwnChildren map[string][]EnrichedReaction `json:"own_children,omitempty"` + UpdatedAt *Time `json:"updated_at,omitempty"` + User *Data `json:"user,omitempty"` } // Options to skip specific enrichments to improve performance. Default is false (enrichments are included). Setting a field to true skips that enrichment. type EnrichmentOptions struct { // Default: false. When true, includes fetching and enriching own_followings (follows where activity author's feeds follow current user's feeds). EnrichOwnFollowings *bool `json:"enrich_own_followings,omitempty"` - // Default: false. When true, skips all activity enrichments. SkipActivity *bool `json:"skip_activity,omitempty"` - // Default: false. When true, skips enriching collections on activities. SkipActivityCollections *bool `json:"skip_activity_collections,omitempty"` - // Default: false. When true, skips enriching comments on activities. SkipActivityComments *bool `json:"skip_activity_comments,omitempty"` - // Default: false. When true, skips enriching current_feed on activities. Note: CurrentFeed is still computed for permission checks, but enrichment is skipped. SkipActivityCurrentFeed *bool `json:"skip_activity_current_feed,omitempty"` - // Default: false. When true, skips enriching mentioned users on activities. SkipActivityMentionedUsers *bool `json:"skip_activity_mentioned_users,omitempty"` - // Default: false. When true, skips enriching own bookmarks on activities. SkipActivityOwnBookmarks *bool `json:"skip_activity_own_bookmarks,omitempty"` - // Default: false. When true, skips enriching parent activities. SkipActivityParents *bool `json:"skip_activity_parents,omitempty"` - // Default: false. When true, skips enriching poll data on activities. SkipActivityPoll *bool `json:"skip_activity_poll,omitempty"` - // Default: false. When true, skips fetching and enriching latest and own reactions on activities. Note: If reactions are already denormalized in the database, they will still be included. SkipActivityReactions *bool `json:"skip_activity_reactions,omitempty"` - // Default: false. When true, skips refreshing image URLs on activities. SkipActivityRefreshImageUrls *bool `json:"skip_activity_refresh_image_urls,omitempty"` - // Default: false. When true, skips all enrichments. SkipAll *bool `json:"skip_all,omitempty"` - // Default: false. When true, skips enriching user data on feed members. SkipFeedMemberUser *bool `json:"skip_feed_member_user,omitempty"` - // Default: false. When true, skips fetching and enriching followers. Note: If followers_pagination is explicitly provided, followers will be fetched regardless of this setting. SkipFollowers *bool `json:"skip_followers,omitempty"` - // Default: false. When true, skips fetching and enriching following. Note: If following_pagination is explicitly provided, following will be fetched regardless of this setting. SkipFollowing *bool `json:"skip_following,omitempty"` - // Default: false. When true, skips computing and including capabilities for feeds. SkipOwnCapabilities *bool `json:"skip_own_capabilities,omitempty"` - // Default: false. When true, skips fetching and enriching own_follows (follows where user's feeds follow target feeds). SkipOwnFollows *bool `json:"skip_own_follows,omitempty"` - // Default: false. When true, skips enriching pinned activities. SkipPins *bool `json:"skip_pins,omitempty"` } -type EntityCreatorResponse struct { - // Number of minor actions performed on the user - BanCount int `json:"ban_count"` - - Banned bool `json:"banned"` - - CreatedAt Timestamp `json:"created_at"` - - // Number of major actions performed on the user - DeletedContentCount int `json:"deleted_content_count"` - - // Number of flag actions performed on the user - FlaggedCount int `json:"flagged_count"` - - ID string `json:"id"` - - Invisible bool `json:"invisible"` - - Language string `json:"language"` - - Online bool `json:"online"` - - Role string `json:"role"` - - ShadowBanned bool `json:"shadow_banned"` - - UpdatedAt Timestamp `json:"updated_at"` - - BlockedUserIds []string `json:"blocked_user_ids"` - - Teams []string `json:"teams"` - - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Image *string `json:"image,omitempty"` - - LastActive *Timestamp `json:"last_active,omitempty"` - - Name *string `json:"name,omitempty"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - Devices []DeviceResponse `json:"devices,omitempty"` - - PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` - - PushNotifications *PushNotificationSettingsResponse `json:"push_notifications,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` +type EntityCreatorResponse struct { + // Number of minor actions performed on the user + BanCount int `json:"ban_count"` + Banned bool `json:"banned"` + CreatedAt Timestamp `json:"created_at"` + // Number of major actions performed on the user + DeletedContentCount int `json:"deleted_content_count"` + // Number of flag actions performed on the user + FlaggedCount int `json:"flagged_count"` + ID string `json:"id"` + Invisible bool `json:"invisible"` + Language string `json:"language"` + Online bool `json:"online"` + Role string `json:"role"` + ShadowBanned bool `json:"shadow_banned"` + UpdatedAt Timestamp `json:"updated_at"` + BlockedUserIds []string `json:"blocked_user_ids"` + Teams []string `json:"teams"` + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` + BanExpires *Timestamp `json:"ban_expires,omitempty"` + DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Image *string `json:"image,omitempty"` + LastActive *Timestamp `json:"last_active,omitempty"` + Name *string `json:"name,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + Devices []DeviceResponse `json:"devices,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` + PushNotifications *PushNotificationSettingsResponse `json:"push_notifications,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` } type ErrorResult struct { - Type string `json:"type"` - + Type string `json:"type"` Stacktrace *string `json:"stacktrace,omitempty"` - - Version *string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` } type EventHook struct { - CreatedAt *Timestamp `json:"created_at,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - HookType *string `json:"hook_type,omitempty"` - - ID *string `json:"id,omitempty"` - - Product *string `json:"product,omitempty"` - - ShouldSendCustomEvents *bool `json:"should_send_custom_events,omitempty"` - - SnsAuthType *string `json:"sns_auth_type,omitempty"` - - SnsEventBasedMessageGroupIDEnabled *bool `json:"sns_event_based_message_group_id_enabled,omitempty"` - - SnsKey *string `json:"sns_key,omitempty"` - - SnsRegion *string `json:"sns_region,omitempty"` - - SnsRoleArn *string `json:"sns_role_arn,omitempty"` - - SnsSecret *string `json:"sns_secret,omitempty"` - - SnsTopicArn *string `json:"sns_topic_arn,omitempty"` - - SqsAuthType *string `json:"sqs_auth_type,omitempty"` - - SqsKey *string `json:"sqs_key,omitempty"` - - SqsQueueUrl *string `json:"sqs_queue_url,omitempty"` - - SqsRegion *string `json:"sqs_region,omitempty"` - - SqsRoleArn *string `json:"sqs_role_arn,omitempty"` - - SqsSecret *string `json:"sqs_secret,omitempty"` - - TimeoutMs *int `json:"timeout_ms,omitempty"` - - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - - WebhookUrl *string `json:"webhook_url,omitempty"` - - EventTypes []string `json:"event_types,omitempty"` - - Callback *AsyncModerationCallbackConfig `json:"callback,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + HookType *string `json:"hook_type,omitempty"` + ID *string `json:"id,omitempty"` + Product *string `json:"product,omitempty"` + ShouldSendCustomEvents *bool `json:"should_send_custom_events,omitempty"` + SnsAuthType *string `json:"sns_auth_type,omitempty"` + SnsEventBasedMessageGroupIDEnabled *bool `json:"sns_event_based_message_group_id_enabled,omitempty"` + SnsKey *string `json:"sns_key,omitempty"` + SnsRegion *string `json:"sns_region,omitempty"` + SnsRoleArn *string `json:"sns_role_arn,omitempty"` + SnsSecret *string `json:"sns_secret,omitempty"` + SnsTopicArn *string `json:"sns_topic_arn,omitempty"` + SqsAuthType *string `json:"sqs_auth_type,omitempty"` + SqsKey *string `json:"sqs_key,omitempty"` + SqsQueueUrl *string `json:"sqs_queue_url,omitempty"` + SqsRegion *string `json:"sqs_region,omitempty"` + SqsRoleArn *string `json:"sqs_role_arn,omitempty"` + SqsSecret *string `json:"sqs_secret,omitempty"` + TimeoutMs *int `json:"timeout_ms,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + WebhookUrl *string `json:"webhook_url,omitempty"` + EventTypes []string `json:"event_types,omitempty"` + Callback *AsyncModerationCallbackConfig `json:"callback,omitempty"` } type EventNotificationSettings struct { Enabled bool `json:"enabled"` + APNS APNS `json:"apns"` + Fcm FCM `json:"fcm"` +} - APNS APNS `json:"apns"` +type EventNotificationSettingsRequest struct { + Enabled *bool `json:"enabled,omitempty"` + APNS *APNSPayload `json:"apns,omitempty"` + Fcm *FCMPayload `json:"fcm,omitempty"` +} - Fcm FCM `json:"fcm"` +type EventNotificationSettingsResponse struct { + Enabled bool `json:"enabled"` + APNS APNSPayload `json:"apns"` + Fcm FCMPayload `json:"fcm"` } type EventRequest struct { - Type string `json:"type"` - - ParentID *string `json:"parent_id,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - User *UserRequest `json:"user,omitempty"` + Type string `json:"type"` + ParentID *string `json:"parent_id,omitempty"` + UserID *string `json:"user_id,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + User *UserRequest `json:"user,omitempty"` } // Basic response information type EventResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Event WSEvent `json:"event"` + Duration string `json:"duration"` + Event WSEvent `json:"event"` } type ExportChannelsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // ID of the task to export channels TaskID string `json:"task_id"` } @@ -5955,7 +4456,6 @@ type ExportChannelsResponse struct { // Response for exporting feed user data type ExportFeedUserDataResponse struct { Duration string `json:"duration"` - // The task ID for the export task TaskID string `json:"task_id"` } @@ -5963,289 +4463,226 @@ type ExportFeedUserDataResponse struct { type ExportUserResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // List of exported messages Messages []MessageResponse `json:"messages,omitempty"` - // List of exported reactions Reactions []ReactionResponse `json:"reactions,omitempty"` - - User *UserResponse `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } // Basic response information type ExportUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - TaskID string `json:"task_id"` + TaskID string `json:"task_id"` } type ExternalStorageResponse struct { Bucket string `json:"bucket"` - - Name string `json:"name"` - - Path string `json:"path"` - - Type string `json:"type"` + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` } type FCM struct { Data map[string]any `json:"data,omitempty"` } -type FailedChannelUpdates struct { - Reason string `json:"reason"` +type FCMPayload struct { + Data map[string]any `json:"data,omitempty"` +} - Cids []string `json:"cids"` +type FailedChannelUpdates struct { + Reason string `json:"reason"` + Cids []string `json:"cids"` } // Emitted when a feed is created. type FeedCreatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Members []FeedMemberResponse `json:"members"` - - Custom map[string]any `json:"custom"` - - Feed FeedResponse `json:"feed"` - - User UserResponseCommonFields `json:"user"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Members []FeedMemberResponse `json:"members"` + Custom map[string]any `json:"custom"` + Feed FeedResponse `json:"feed"` + User UserResponseCommonFields `json:"user"` // The type of event: "feeds.feed.created" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*FeedCreatedEvent) GetEventType() string { - return "feeds.feed.created" +func (e *FeedCreatedEvent) GetEventType() string { + return e.Type } // Emitted when a feed is deleted. type FeedDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.feed.deleted" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedDeletedEvent) GetEventType() string { - return "feeds.feed.deleted" +func (e *FeedDeletedEvent) GetEventType() string { + return e.Type } type FeedGroup struct { - AggregationVersion int `json:"aggregation_version"` - - AppPk int `json:"app_pk"` - - CreatedAt Timestamp `json:"created_at"` - - DefaultVisibility string `json:"default_visibility"` - - GroupID string `json:"group_id"` - - UpdatedAt Timestamp `json:"updated_at"` - + AggregationVersion int `json:"aggregation_version"` + AppPk int `json:"app_pk"` + CreatedAt Timestamp `json:"created_at"` + DefaultVisibility string `json:"default_visibility"` + GroupID string `json:"group_id"` + UpdatedAt Timestamp `json:"updated_at"` ActivityProcessors []ActivityProcessorConfig `json:"activity_processors"` - - ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - - Custom map[string]any `json:"custom"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - LastFeedGetAt *Timestamp `json:"last_feed_get_at,omitempty"` - - Aggregation *AggregationConfig `json:"aggregation,omitempty"` - - Notification *NotificationConfig `json:"notification,omitempty"` - - PushNotification *PushNotificationConfig `json:"push_notification,omitempty"` - - Ranking *RankingConfig `json:"ranking,omitempty"` - - Stories *StoriesConfig `json:"stories,omitempty"` + ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` + Custom map[string]any `json:"custom"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + LastFeedGetAt *Timestamp `json:"last_feed_get_at,omitempty"` + Aggregation *AggregationConfig `json:"aggregation,omitempty"` + Notification *NotificationConfig `json:"notification,omitempty"` + PushNotification *PushNotificationConfig `json:"push_notification,omitempty"` + Ranking *RankingConfig `json:"ranking,omitempty"` + Stories *StoriesConfig `json:"stories,omitempty"` } // Emitted when a feed group is changed. type FeedGroupChangedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.feed_group.changed" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - FeedGroup *FeedGroup `json:"feed_group,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + FeedGroup *FeedGroup `json:"feed_group,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedGroupChangedEvent) GetEventType() string { - return "feeds.feed_group.changed" +func (e *FeedGroupChangedEvent) GetEventType() string { + return e.Type } // Emitted when a feed group is deleted. type FeedGroupDeletedEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - + Fid string `json:"fid"` // The ID of the feed group that was deleted - GroupID string `json:"group_id"` - - Custom map[string]any `json:"custom"` - + GroupID string `json:"group_id"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.feed_group.deleted" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*FeedGroupDeletedEvent) GetEventType() string { - return "feeds.feed_group.deleted" +func (e *FeedGroupDeletedEvent) GetEventType() string { + return e.Type } type FeedGroupResponse struct { // When the feed group was created CreatedAt Timestamp `json:"created_at"` - // Identifier within the group ID string `json:"id"` - // When the feed group was last updated UpdatedAt Timestamp `json:"updated_at"` - - // Default visibility for activities - DefaultVisibility *string `json:"default_visibility,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - + // Default visibility for activities. One of: public, visible, followers, members, private + DefaultVisibility *string `json:"default_visibility,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` // Configuration for activity processors ActivityProcessors []ActivityProcessorConfig `json:"activity_processors,omitempty"` - // Configuration for activity selectors ActivitySelectors []ActivitySelectorConfigResponse `json:"activity_selectors,omitempty"` - - Aggregation *AggregationConfig `json:"aggregation,omitempty"` - + Aggregation *AggregationConfig `json:"aggregation,omitempty"` // Custom data for the feed group - Custom map[string]any `json:"custom,omitempty"` - - Notification *NotificationConfig `json:"notification,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` + Notification *NotificationConfig `json:"notification,omitempty"` PushNotification *PushNotificationConfig `json:"push_notification,omitempty"` + Ranking *RankingConfig `json:"ranking,omitempty"` + Stories *StoriesConfig `json:"stories,omitempty"` +} - Ranking *RankingConfig `json:"ranking,omitempty"` +// Emitted when a feed group is restored. +type FeedGroupRestoredEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + // The ID of the feed group that was restored + GroupID string `json:"group_id"` + Custom map[string]any `json:"custom"` + // The type of event: "feeds.feed_group.restored" in this case + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - Stories *StoriesConfig `json:"stories,omitempty"` +func (e *FeedGroupRestoredEvent) GetEventType() string { + return e.Type } type FeedInput struct { - Description *string `json:"description,omitempty"` - - Name *string `json:"name,omitempty"` - - Visibility *string `json:"visibility,omitempty"` - - FilterTags []string `json:"filter_tags,omitempty"` - - Members []FeedMemberRequest `json:"members,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + FilterTags []string `json:"filter_tags,omitempty"` + Members []FeedMemberRequest `json:"members,omitempty"` + Custom map[string]any `json:"custom,omitempty"` } // Emitted when a feed member is added. type FeedMemberAddedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Member FeedMemberResponse `json:"member"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Member FeedMemberResponse `json:"member"` // The type of event: "feeds.feed_member.added" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedMemberAddedEvent) GetEventType() string { - return "feeds.feed_member.added" +func (e *FeedMemberAddedEvent) GetEventType() string { + return e.Type } // Emitted when a feed member is removed. type FeedMemberRemovedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - MemberID string `json:"member_id"` - - Custom map[string]any `json:"custom"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + MemberID string `json:"member_id"` + Custom map[string]any `json:"custom"` // The type of event: "feeds.feed_member.removed" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedMemberRemovedEvent) GetEventType() string { - return "feeds.feed_member.removed" +func (e *FeedMemberRemovedEvent) GetEventType() string { + return e.Type } type FeedMemberRequest struct { // ID of the user to add as a member UserID string `json:"user_id"` - // Whether this is an invite to become a member Invite *bool `json:"invite,omitempty"` - // ID of the membership level to assign to the member MembershipLevel *string `json:"membership_level,omitempty"` - // Role of the member in the feed Role *string `json:"role,omitempty"` - // Custom data for the member Custom map[string]any `json:"custom,omitempty"` } @@ -6253,53 +4690,38 @@ type FeedMemberRequest struct { type FeedMemberResponse struct { // When the membership was created CreatedAt Timestamp `json:"created_at"` - // Role of the member in the feed Role string `json:"role"` - - // Status of the membership + // Status of the membership. One of: member, pending, rejected Status string `json:"status"` - // When the membership was last updated - UpdatedAt Timestamp `json:"updated_at"` - - User UserResponse `json:"user"` - + UpdatedAt Timestamp `json:"updated_at"` + User UserResponse `json:"user"` // When the invite was accepted InviteAcceptedAt *Timestamp `json:"invite_accepted_at,omitempty"` - // When the invite was rejected InviteRejectedAt *Timestamp `json:"invite_rejected_at,omitempty"` - // Custom data for the membership - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` MembershipLevel *MembershipLevelResponse `json:"membership_level,omitempty"` } // Emitted when a feed member is updated. type FeedMemberUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Member FeedMemberResponse `json:"member"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Member FeedMemberResponse `json:"member"` // The type of event: "feeds.feed_member.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedMemberUpdatedEvent) GetEventType() string { - return "feeds.feed_member.updated" +func (e *FeedMemberUpdatedEvent) GetEventType() string { + return e.Type } type FeedOwnCapability string @@ -6343,454 +4765,311 @@ func (c FeedOwnCapability) String() string { type FeedOwnData struct { // Capabilities the current user has for this feed OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` - // Follow relationships where the feed owner's feeds are following the current user's feeds (up to 5 total) OwnFollowings []FollowResponse `json:"own_followings,omitempty"` - // Follow relationships where the current user's feeds are following this feed - OwnFollows []FollowResponse `json:"own_follows,omitempty"` - + 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"` - // ID of the feed FeedID string `json:"feed_id"` - // ID of the feed creator CreatedByID *string `json:"created_by_id,omitempty"` - // Description of the feed Description *string `json:"description,omitempty"` - // Name of the feed Name *string `json:"name,omitempty"` - - // Visibility setting for the feed + // Visibility setting for the feed. One of: public, visible, followers, members, private Visibility *string `json:"visibility,omitempty"` - // Tags used for filtering feeds FilterTags []string `json:"filter_tags,omitempty"` - // Initial members for the feed Members []FeedMemberRequest `json:"members,omitempty"` - // Custom data for the feed Custom map[string]any `json:"custom,omitempty"` } type FeedResponse struct { ActivityCount int `json:"activity_count"` - // When the feed was created CreatedAt Timestamp `json:"created_at"` - // Description of the feed Description string `json:"description"` - // Fully qualified feed ID (group_id:id) Feed string `json:"feed"` - // Number of followers of this feed FollowerCount int `json:"follower_count"` - // Number of feeds this feed follows FollowingCount int `json:"following_count"` - // Group this feed belongs to GroupID string `json:"group_id"` - // Unique identifier for the feed ID string `json:"id"` - // Number of members in this feed MemberCount int `json:"member_count"` - // Name of the feed Name string `json:"name"` - // Number of pinned activities in this feed PinCount int `json:"pin_count"` - // When the feed was last updated - UpdatedAt Timestamp `json:"updated_at"` - + UpdatedAt Timestamp `json:"updated_at"` CreatedBy UserResponse `json:"created_by"` - // When the feed was deleted DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // Visibility setting for the feed Visibility *string `json:"visibility,omitempty"` - // Tags used for filtering feeds FilterTags []string `json:"filter_tags,omitempty"` - // Capabilities the current user has for this feed OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` - // Follow relationships where the feed owner’s feeds are following the current user's feeds OwnFollowings []FollowResponse `json:"own_followings,omitempty"` - // Follow relationships where the current user's feeds are following this feed OwnFollows []FollowResponse `json:"own_follows,omitempty"` - // Custom data for the feed - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` OwnMembership *FeedMemberResponse `json:"own_membership,omitempty"` } type FeedSuggestionResponse struct { ActivityCount int `json:"activity_count"` - // When the feed was created CreatedAt Timestamp `json:"created_at"` - // Description of the feed Description string `json:"description"` - // Fully qualified feed ID (group_id:id) Feed string `json:"feed"` - // Number of followers of this feed FollowerCount int `json:"follower_count"` - // Number of feeds this feed follows FollowingCount int `json:"following_count"` - // Group this feed belongs to GroupID string `json:"group_id"` - // Unique identifier for the feed ID string `json:"id"` - // Number of members in this feed MemberCount int `json:"member_count"` - // Name of the feed Name string `json:"name"` - // Number of pinned activities in this feed PinCount int `json:"pin_count"` - // When the feed was last updated - UpdatedAt Timestamp `json:"updated_at"` - + UpdatedAt Timestamp `json:"updated_at"` CreatedBy UserResponse `json:"created_by"` - // When the feed was deleted - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Reason *string `json:"reason,omitempty"` - - RecommendationScore *float64 `json:"recommendation_score,omitempty"` - + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Reason *string `json:"reason,omitempty"` + RecommendationScore *float64 `json:"recommendation_score,omitempty"` // Visibility setting for the feed Visibility *string `json:"visibility,omitempty"` - // Tags used for filtering feeds FilterTags []string `json:"filter_tags,omitempty"` - // Capabilities the current user has for this feed OwnCapabilities []FeedOwnCapability `json:"own_capabilities,omitempty"` - // Follow relationships where the feed owner’s feeds are following the current user's feeds OwnFollowings []FollowResponse `json:"own_followings,omitempty"` - // Follow relationships where the current user's feeds are following this feed - OwnFollows []FollowResponse `json:"own_follows,omitempty"` - + OwnFollows []FollowResponse `json:"own_follows,omitempty"` AlgorithmScores map[string]float64 `json:"algorithm_scores,omitempty"` - // Custom data for the feed - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` OwnMembership *FeedMemberResponse `json:"own_membership,omitempty"` } -// Emitted when a feed is created. +// Emitted when a feed is updated. type FeedUpdatedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Feed FeedResponse `json:"feed"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Feed FeedResponse `json:"feed"` // The type of event: "feeds.feed.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*FeedUpdatedEvent) GetEventType() string { - return "feeds.feed.updated" +func (e *FeedUpdatedEvent) GetEventType() string { + return e.Type } type FeedViewResponse struct { // Unique identifier for the custom feed view ID string `json:"id"` - // When the feed view was last used LastUsedAt *Timestamp `json:"last_used_at,omitempty"` - // Configured activity selectors ActivitySelectors []ActivitySelectorConfigResponse `json:"activity_selectors,omitempty"` - - Aggregation *AggregationConfig `json:"aggregation,omitempty"` - - Ranking *RankingConfig `json:"ranking,omitempty"` + Aggregation *AggregationConfig `json:"aggregation,omitempty"` + Ranking *RankingConfig `json:"ranking,omitempty"` } type FeedVisibilityResponse struct { // Name of the feed visibility level Name string `json:"name"` - // List of permission policies Permissions []Permission `json:"permissions"` - // Permission grants for each role Grants map[string][]string `json:"grants"` } -type FeedsModerationTemplateConfig struct { - ConfigKey string `json:"config_key"` - +// Configuration for a feeds moderation template +type FeedsModerationTemplateConfigPayload struct { + // Map of data type names to their content types DataTypes map[string]string `json:"data_types"` + // Key of the moderation configuration to use + ConfigKey *string `json:"config_key,omitempty"` } type FeedsPreferences struct { - // Push notification preference for comments on user's activities + // Push notification preference for comments on user's activities. One of: all, none Comment *string `json:"comment,omitempty"` - - // Push notification preference for reactions on comments + // Push notification preference for reactions on comments. One of: all, none CommentReaction *string `json:"comment_reaction,omitempty"` - - // Push notification preference for replies to comments + // Push notification preference for replies to comments. One of: all, none CommentReply *string `json:"comment_reply,omitempty"` - - // Push notification preference for new followers + // Push notification preference for new followers. One of: all, none Follow *string `json:"follow,omitempty"` - - // Push notification preference for mentions in activities or comments + // Push notification preference for mentions in activities or comments. One of: all, none Mention *string `json:"mention,omitempty"` - - // Push notification preference for reactions on user's activities or comments + // Push notification preference for reactions on user's activities or comments. One of: all, none Reaction *string `json:"reaction,omitempty"` - // Push notification preferences for custom activity types. Map of activity type to preference (all or none) CustomActivityTypes map[string]string `json:"custom_activity_types,omitempty"` } type FeedsPreferencesResponse struct { - Comment *string `json:"comment,omitempty"` - - CommentReaction *string `json:"comment_reaction,omitempty"` - - Follow *string `json:"follow,omitempty"` - - Mention *string `json:"mention,omitempty"` - - Reaction *string `json:"reaction,omitempty"` - + Comment *string `json:"comment,omitempty"` + CommentReaction *string `json:"comment_reaction,omitempty"` + CommentReply *string `json:"comment_reply,omitempty"` + Follow *string `json:"follow,omitempty"` + Mention *string `json:"mention,omitempty"` + Reaction *string `json:"reaction,omitempty"` CustomActivityTypes map[string]string `json:"custom_activity_types,omitempty"` } +type FeedsReactionGroupResponse struct { + // Number of reactions in this group + Count int `json:"count"` + // Time of the first reaction + FirstReactionAt Timestamp `json:"first_reaction_at"` + // Time of the most recent reaction + LastReactionAt Timestamp `json:"last_reaction_at"` +} + type FeedsReactionResponse struct { // ID of the activity that was reacted to ActivityID string `json:"activity_id"` - // When the reaction was created CreatedAt Timestamp `json:"created_at"` - // When the reaction was last updated UpdatedAt Timestamp `json:"updated_at"` - // Type of reaction - Type string `json:"type"` - + Type string `json:"type"` User UserResponse `json:"user"` - // ID of the comment that was reacted to CommentID *string `json:"comment_id,omitempty"` - // Custom data for the reaction Custom map[string]any `json:"custom,omitempty"` } type Field struct { - Short bool `json:"short"` - + Short bool `json:"short"` Title string `json:"title"` - Value string `json:"value"` } type FileUploadConfig struct { - SizeLimit int `json:"size_limit"` - + SizeLimit int `json:"size_limit"` AllowedFileExtensions []string `json:"allowed_file_extensions,omitempty"` - - AllowedMimeTypes []string `json:"allowed_mime_types,omitempty"` - + AllowedMimeTypes []string `json:"allowed_mime_types,omitempty"` BlockedFileExtensions []string `json:"blocked_file_extensions,omitempty"` - - BlockedMimeTypes []string `json:"blocked_mime_types,omitempty"` + BlockedMimeTypes []string `json:"blocked_mime_types,omitempty"` } type FileUploadRequest struct { // file field - File *string `json:"file,omitempty"` - + File *string `json:"file,omitempty"` User *OnlyUserID `json:"user,omitempty"` } type FileUploadResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // URL to the uploaded asset. Should be used to put to `asset_url` attachment field File *string `json:"file,omitempty"` - // URL of the file thumbnail for supported file formats. Should be put to `thumb_url` attachment field ThumbUrl *string `json:"thumb_url,omitempty"` } type FilterConfigResponse struct { - LlmLabels []string `json:"llm_labels"` - + LlmLabels []string `json:"llm_labels"` AiTextLabels []string `json:"ai_text_labels,omitempty"` } type FirebaseConfig struct { - ApnTemplate *string `json:"apn_template,omitempty"` - - CredentialsJson *string `json:"credentials_json,omitempty"` - - DataTemplate *string `json:"data_template,omitempty"` - - Disabled *bool `json:"Disabled,omitempty"` - + ApnTemplate *string `json:"apn_template,omitempty"` + CredentialsJson *string `json:"credentials_json,omitempty"` + DataTemplate *string `json:"data_template,omitempty"` + Disabled *bool `json:"Disabled,omitempty"` NotificationTemplate *string `json:"notification_template,omitempty"` - - ServerKey *string `json:"server_key,omitempty"` + ServerKey *string `json:"server_key,omitempty"` } type FirebaseConfigFields struct { - Enabled bool `json:"enabled"` - - ApnTemplate *string `json:"apn_template,omitempty"` - - CredentialsJson *string `json:"credentials_json,omitempty"` - - DataTemplate *string `json:"data_template,omitempty"` - + Enabled bool `json:"enabled"` + ApnTemplate *string `json:"apn_template,omitempty"` + CredentialsJson *string `json:"credentials_json,omitempty"` + DataTemplate *string `json:"data_template,omitempty"` NotificationTemplate *string `json:"notification_template,omitempty"` - - 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"` - - CreatedByAutomod bool `json:"created_by_automod"` - - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - - // Date of the approval - ApprovedAt *Timestamp `json:"approved_at,omitempty"` - - Reason *string `json:"reason,omitempty"` - - // Date of the rejection - RejectedAt *Timestamp `json:"rejected_at,omitempty"` - - // Date of the review - ReviewedAt *Timestamp `json:"reviewed_at,omitempty"` - - 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"` + ServerKey *string `json:"server_key,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 FlagDetailsResponse struct { + OriginalText string `json:"original_text"` + Automod *AutomodDetailsResponse `json:"automod,omitempty"` + Extra map[string]any `json:"extra,omitempty"` } -type FlagFeedback struct { - CreatedAt Timestamp `json:"created_at"` - - MessageID string `json:"message_id"` - - Labels []Label `json:"labels"` +type FlagFeedbackResponse struct { + CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + Labels []LabelResponse `json:"labels"` } -type FlagMessageDetails struct { - PinChanged *bool `json:"pin_changed,omitempty"` - - ShouldEnrich *bool `json:"should_enrich,omitempty"` - - SkipPush *bool `json:"skip_push,omitempty"` - - UpdatedByID *string `json:"updated_by_id,omitempty"` +type FlagMessageDetailsResponse struct { + PinChanged *bool `json:"pin_changed,omitempty"` + ShouldEnrich *bool `json:"should_enrich,omitempty"` + SkipPush *bool `json:"skip_push,omitempty"` + UpdatedByID *string `json:"updated_by_id,omitempty"` } type FlagResponse struct { Duration string `json:"duration"` - // Unique identifier of the created moderation item ItemID string `json:"item_id"` } type FlagUpdatedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - CreatedBy *UserResponse `json:"CreatedBy,omitempty"` - - Message *MessageResponse `json:"Message,omitempty"` - - User *UserResponse `json:"User,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + CreatedBy *UserResponse `json:"CreatedBy,omitempty"` + Message *MessageResponse `json:"Message,omitempty"` + User *UserResponse `json:"User,omitempty"` } -func (*FlagUpdatedEvent) GetEventType() string { - return "flag.updated" +func (e *FlagUpdatedEvent) GetEventType() string { + return e.Type } type FlagUserOptions struct { @@ -6799,10 +5078,8 @@ type FlagUserOptions struct { type FollowBatchResponse struct { Duration string `json:"duration"` - // List of newly created follow relationships Created []FollowResponse `json:"created"` - // List of current follow relationships Follows []FollowResponse `json:"follows"` } @@ -6810,53 +5087,40 @@ type FollowBatchResponse struct { // Emitted when a feed follows another feed. type FollowCreatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Follow FollowResponse `json:"follow"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Follow FollowResponse `json:"follow"` // The type of event: "feeds.follow.created" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*FollowCreatedEvent) GetEventType() string { - return "feeds.follow.created" +func (e *FollowCreatedEvent) GetEventType() string { + return e.Type } // Emitted when a feed unfollows another feed. type FollowDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Follow FollowResponse `json:"follow"` - + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Follow FollowResponse `json:"follow"` // The type of event: "feeds.follow.deleted" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*FollowDeletedEvent) GetEventType() string { - return "feeds.follow.deleted" +func (e *FollowDeletedEvent) GetEventType() string { + return e.Type } type FollowPair struct { // Fully qualified ID of the source feed Source string `json:"source"` - // Fully qualified ID of the target feed Target string `json:"target"` } @@ -6864,167 +5128,119 @@ type FollowPair struct { type FollowResponse struct { // When the follow relationship was created CreatedAt Timestamp `json:"created_at"` - // Role of the follower (source user) in the follow relationship FollowerRole string `json:"follower_role"` - - // Push preference for notifications + // Push preference for notifications. One of: all, none PushPreference string `json:"push_preference"` - - // Status of the follow relationship + // Status of the follow relationship. One of: accepted, pending, rejected Status string `json:"status"` - // When the follow relationship was last updated - UpdatedAt Timestamp `json:"updated_at"` - + UpdatedAt Timestamp `json:"updated_at"` SourceFeed FeedResponse `json:"source_feed"` - TargetFeed FeedResponse `json:"target_feed"` - // When the follow request was accepted - RequestAcceptedAt *Timestamp `json:"request_accepted_at,omitempty"` - - // When the follow request was rejected - RequestRejectedAt *Timestamp `json:"request_rejected_at,omitempty"` - - // Custom data for the follow relationship - Custom map[string]any `json:"custom,omitempty"` -} - -// Emitted when a follow relationship is updated. -type FollowUpdatedEvent struct { - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Fid string `json:"fid"` - - Custom map[string]any `json:"custom"` - - Follow FollowResponse `json:"follow"` - - // The type of event: "feeds.follow.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` -} - -func (*FollowUpdatedEvent) GetEventType() string { - return "feeds.follow.updated" -} - -type FrameRecordSettings struct { - CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` - - Mode string `json:"mode"` - - Quality *string `json:"quality,omitempty"` -} - -type FrameRecordingResponse struct { - Status string `json:"status"` -} - -type FrameRecordingSettingsRequest struct { - CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` - - Mode string `json:"mode"` - - Quality *string `json:"quality,omitempty"` -} - -type FrameRecordingSettingsResponse struct { - CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` - - Mode string `json:"mode"` - - Quality *string `json:"quality,omitempty"` -} - -type FullUserResponse struct { - Banned bool `json:"banned"` - - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Invisible bool `json:"invisible"` - - Language string `json:"language"` - - Online bool `json:"online"` - - Role string `json:"role"` - - ShadowBanned bool `json:"shadow_banned"` - - 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"` - - BlockedUserIds []string `json:"blocked_user_ids"` - - ChannelMutes []ChannelMute `json:"channel_mutes"` - - Devices []DeviceResponse `json:"devices"` - - Mutes []UserMuteResponse `json:"mutes"` - - Teams []string `json:"teams"` - - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - BanExpires *Timestamp `json:"ban_expires,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + RequestAcceptedAt *Timestamp `json:"request_accepted_at,omitempty"` + // When the follow request was rejected + RequestRejectedAt *Timestamp `json:"request_rejected_at,omitempty"` + // Custom data for the follow relationship + Custom map[string]any `json:"custom,omitempty"` +} - DeletedAt *Timestamp `json:"deleted_at,omitempty"` +// Emitted when a follow relationship is updated. +type FollowUpdatedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Fid string `json:"fid"` + Custom map[string]any `json:"custom"` + Follow FollowResponse `json:"follow"` + // The type of event: "feeds.follow.updated" in this case + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - Image *string `json:"image,omitempty"` +func (e *FollowUpdatedEvent) GetEventType() string { + return e.Type +} - LastActive *Timestamp `json:"last_active,omitempty"` +type FrameRecordSettings struct { + CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` + Mode string `json:"mode"` + Quality *string `json:"quality,omitempty"` +} - Name *string `json:"name,omitempty"` +type FrameRecordingResponse struct { + Status string `json:"status"` +} - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` +type FrameRecordingSettingsRequest struct { + CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` + Mode string `json:"mode"` + Quality *string `json:"quality,omitempty"` +} - LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"` +type FrameRecordingSettingsResponse struct { + CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` + Mode string `json:"mode"` + Quality *string `json:"quality,omitempty"` +} - PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` +// Options to control fetching reactions from friends (users you follow or have mutual follows with). +type FriendReactionsOptions struct { + // Default: false. When true, fetches friend reactions for activities. + Enabled *bool `json:"enabled,omitempty"` + // Default: 3, Max: 10. The maximum number of friend reactions to return per activity. + Limit *int `json:"limit,omitempty"` + // Default: 'following'. The type of friend relationship to use. 'following' = users you follow, 'mutual' = users with mutual follows. One of: following, mutual + Type *string `json:"type,omitempty"` +} - TeamsRole map[string]string `json:"teams_role,omitempty"` +type FullUserResponse struct { + Banned bool `json:"banned"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Invisible bool `json:"invisible"` + Language string `json:"language"` + Online bool `json:"online"` + Role string `json:"role"` + ShadowBanned bool `json:"shadow_banned"` + 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"` + BlockedUserIds []string `json:"blocked_user_ids"` + ChannelMutes []ChannelMute `json:"channel_mutes"` + Devices []DeviceResponse `json:"devices"` + Mutes []UserMuteResponse `json:"mutes"` + Teams []string `json:"teams"` + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` + BanExpires *Timestamp `json:"ban_expires,omitempty"` + DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Image *string `json:"image,omitempty"` + LastActive *Timestamp `json:"last_active,omitempty"` + Name *string `json:"name,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` } type FutureChannelBanResponse struct { - CreatedAt Timestamp `json:"created_at"` - - Expires *Timestamp `json:"expires,omitempty"` - - Reason *string `json:"reason,omitempty"` - - Shadow *bool `json:"shadow,omitempty"` - - BannedBy *UserResponse `json:"banned_by,omitempty"` - - User *UserResponse `json:"user,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Expires *Timestamp `json:"expires,omitempty"` + Reason *string `json:"reason,omitempty"` + Shadow *bool `json:"shadow,omitempty"` + BannedBy *UserResponse `json:"banned_by,omitempty"` + User *UserResponse `json:"user,omitempty"` } type GeofenceResponse struct { - Name string `json:"name"` - - Description *string `json:"description,omitempty"` - - Type *string `json:"type,omitempty"` - + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Type *string `json:"type,omitempty"` CountryCodes []string `json:"country_codes,omitempty"` } @@ -7043,49 +5259,40 @@ type GeofenceSettingsResponse struct { // Response containing active calls status information type GetActiveCallsStatusResponse struct { Duration string `json:"duration"` - // End time of the status period EndTime Timestamp `json:"end_time"` - // Start time of the status period - StartTime Timestamp `json:"start_time"` - - Metrics *ActiveCallsMetrics `json:"metrics,omitempty"` - - Summary *ActiveCallsSummary `json:"summary,omitempty"` + StartTime Timestamp `json:"start_time"` + Metrics *ActiveCallsMetrics `json:"metrics,omitempty"` + Summary *ActiveCallsSummary `json:"summary,omitempty"` } type GetActivityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` } type GetAppealResponse struct { - Duration string `json:"duration"` - - Item *AppealItemResponse `json:"item,omitempty"` + Duration string `json:"duration"` + Item *AppealItemResponse `json:"item,omitempty"` } // Basic response information type GetApplicationResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - App AppResponseFields `json:"app"` + Duration string `json:"duration"` + App AppResponseFields `json:"app"` } // Response for get block list type GetBlockListResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Blocklist *BlockListResponse `json:"blocklist,omitempty"` } type GetBlockedUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Array of blocked user object Blocks []BlockedUserResponse `json:"blocks"` } @@ -7093,329 +5300,229 @@ type GetBlockedUsersResponse struct { // Basic response information type GetCallParticipantSessionMetricsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - IsPublisher *bool `json:"is_publisher,omitempty"` - - IsSubscriber *bool `json:"is_subscriber,omitempty"` - - JoinedAt *Timestamp `json:"joined_at,omitempty"` - - PublisherType *string `json:"publisher_type,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - UserSessionID *string `json:"user_session_id,omitempty"` - + Duration string `json:"duration"` + IsPublisher *bool `json:"is_publisher,omitempty"` + IsSubscriber *bool `json:"is_subscriber,omitempty"` + JoinedAt *Timestamp `json:"joined_at,omitempty"` + PublisherType *string `json:"publisher_type,omitempty"` + UserID *string `json:"user_id,omitempty"` + UserSessionID *string `json:"user_session_id,omitempty"` PublishedTracks []PublishedTrackMetrics `json:"published_tracks,omitempty"` - - Client *SessionClient `json:"client,omitempty"` + Client *SessionClient `json:"client,omitempty"` } // Basic response information type GetCallReportResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - SessionID string `json:"session_id"` - - Report ReportResponse `json:"report"` - - VideoReactions []VideoReactionsResponse `json:"video_reactions,omitempty"` - - ChatActivity *ChatActivityStatsResponse `json:"chat_activity,omitempty"` - - Session *CallSessionResponse `json:"session,omitempty"` + Duration string `json:"duration"` + SessionID string `json:"session_id"` + Report ReportResponse `json:"report"` + VideoReactions []VideoReactionsResponse `json:"video_reactions,omitempty"` + ChatActivity *ChatActivityStatsResponse `json:"chat_activity,omitempty"` + Session *CallSessionResponse `json:"session,omitempty"` } type GetCallResponse struct { - Duration string `json:"duration"` - - Members []MemberResponse `json:"members"` - - OwnCapabilities []OwnCapability `json:"own_capabilities"` - - Call CallResponse `json:"call"` + Duration string `json:"duration"` + Members []MemberResponse `json:"members"` + OwnCapabilities []OwnCapability `json:"own_capabilities"` + Call CallResponse `json:"call"` } // Basic response information type GetCallSessionParticipantStatsDetailsResponse struct { - CallID string `json:"call_id"` - + CallID string `json:"call_id"` CallSessionID string `json:"call_session_id"` - - CallType string `json:"call_type"` - + CallType string `json:"call_type"` // Duration of the request in milliseconds - Duration string `json:"duration"` - - UserID string `json:"user_id"` - - UserSessionID string `json:"user_session_id"` - - Publisher *ParticipantSeriesPublisherStats `json:"publisher,omitempty"` - - Subscriber *ParticipantSeriesSubscriberStats `json:"subscriber,omitempty"` - - Timeframe *ParticipantSeriesTimeframe `json:"timeframe,omitempty"` - - User *ParticipantSeriesUserStats `json:"user,omitempty"` + Duration string `json:"duration"` + UserID string `json:"user_id"` + UserSessionID string `json:"user_session_id"` + Publisher *ParticipantSeriesPublisherStats `json:"publisher,omitempty"` + Subscriber *ParticipantSeriesSubscriberStats `json:"subscriber,omitempty"` + Timeframe *ParticipantSeriesTimeframe `json:"timeframe,omitempty"` + User *ParticipantSeriesUserStats `json:"user,omitempty"` } type GetCallTypeResponse struct { - CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - - Name string `json:"name"` - - UpdatedAt Timestamp `json:"updated_at"` - - Grants map[string][]string `json:"grants"` - - NotificationSettings NotificationSettings `json:"notification_settings"` - - Settings CallSettingsResponse `json:"settings"` - - ExternalStorage *string `json:"external_storage,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Duration string `json:"duration"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + Grants map[string][]string `json:"grants"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` + Settings CallSettingsResponse `json:"settings"` + ExternalStorage *string `json:"external_storage,omitempty"` } // Basic response information type GetCampaignResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Campaign *CampaignResponse `json:"campaign,omitempty"` - - Users *PagerResponse `json:"users,omitempty"` + Users *PagerResponse `json:"users,omitempty"` } // Basic response information type GetChannelTypeResponse struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - // Duration of the request in milliseconds - Duration string `json:"duration"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - Commands []Command `json:"commands"` - - Permissions []PolicyRequest `json:"permissions"` - - Grants map[string][]string `json:"grants"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` - - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` - - Blocklists []BlockListOptions `json:"blocklists,omitempty"` - - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + // Duration of the request in milliseconds + Duration string `json:"duration"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + Commands []Command `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + Grants map[string][]string `json:"grants"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` } type GetCommandResponse struct { - Args string `json:"args"` - - Description string `json:"description"` - - Duration string `json:"duration"` - - Name string `json:"name"` - - Set string `json:"set"` - - CreatedAt *Timestamp `json:"created_at,omitempty"` - - UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Args string `json:"args"` + Description string `json:"description"` + Duration string `json:"duration"` + Name string `json:"name"` + Set string `json:"set"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` } type GetCommentRepliesResponse struct { Duration string `json:"duration"` - + // Sort order used for the replies (first, last, top, best, controversial) + Sort string `json:"sort"` // Threaded listing of replies to the comment Comments []ThreadedCommentResponse `json:"comments"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type GetCommentResponse struct { - Duration string `json:"duration"` - - Comment CommentResponse `json:"comment"` + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` } type GetCommentsResponse struct { Duration string `json:"duration"` - + // Sort order used for the comments (first, last, top, best, controversial) + Sort string `json:"sort"` // Threaded listing for the activity Comments []ThreadedCommentResponse `json:"comments"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type GetConfigResponse struct { - Duration string `json:"duration"` - - Config *ConfigResponse `json:"config,omitempty"` + Duration string `json:"duration"` + Config *ConfigResponse `json:"config,omitempty"` } // Basic response information type GetCustomPermissionResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Permission Permission `json:"permission"` } // Basic response information type GetDraftResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Draft DraftResponse `json:"draft"` + Duration string `json:"duration"` + Draft DraftResponse `json:"draft"` } // Basic response information type GetEdgesResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Edges []EdgeResponse `json:"edges"` + Duration string `json:"duration"` + Edges []EdgeResponse `json:"edges"` } type GetFeedGroupResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedGroup FeedGroupResponse `json:"feed_group"` } type GetFeedViewResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedView FeedViewResponse `json:"feed_view"` } type GetFeedVisibilityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedVisibility FeedVisibilityResponse `json:"feed_visibility"` } type GetFeedsRateLimitsResponse struct { Duration string `json:"duration"` - // Rate limits for Android platform (endpoint name -> limit info) - Android map[string]LimitInfo `json:"android,omitempty"` - + Android map[string]LimitInfoResponse `json:"android,omitempty"` // Rate limits for iOS platform (endpoint name -> limit info) - Ios map[string]LimitInfo `json:"ios,omitempty"` - + Ios map[string]LimitInfoResponse `json:"ios,omitempty"` // Rate limits for server-side platform (endpoint name -> limit info) - ServerSide map[string]LimitInfo `json:"server_side,omitempty"` - + ServerSide map[string]LimitInfoResponse `json:"server_side,omitempty"` // Rate limits for Web platform (endpoint name -> limit info) - Web map[string]LimitInfo `json:"web,omitempty"` + Web map[string]LimitInfoResponse `json:"web,omitempty"` } type GetFollowSuggestionsResponse struct { Duration string `json:"duration"` - // List of suggested feeds to follow - Suggestions []FeedSuggestionResponse `json:"suggestions"` - - AlgorithmUsed *string `json:"algorithm_used,omitempty"` + Suggestions []FeedSuggestionResponse `json:"suggestions"` + AlgorithmUsed *string `json:"algorithm_used,omitempty"` } // Basic response information type GetImportResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ImportTask *ImportTask `json:"import_task,omitempty"` } // Basic response information type GetImportV2TaskResponse struct { - AppPk int `json:"app_pk"` - + AppPk int `json:"app_pk"` CreatedAt Timestamp `json:"created_at"` - // Duration of the request in milliseconds - Duration string `json:"duration"` - - ID string `json:"id"` - - Product string `json:"product"` - - State int `json:"state"` - - UpdatedAt Timestamp `json:"updated_at"` - - Settings ImportV2TaskSettings `json:"settings"` + Duration string `json:"duration"` + ID string `json:"id"` + Product string `json:"product"` + State int `json:"state"` + UpdatedAt Timestamp `json:"updated_at"` + Settings ImportV2TaskSettings `json:"settings"` } type GetManyMessagesResponse struct { Duration string `json:"duration"` - // List of messages Messages []MessageResponse `json:"messages"` } @@ -7423,170 +5530,117 @@ type GetManyMessagesResponse struct { // Basic response information type GetMessageResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message MessageWithChannelResponse `json:"message"` - - PendingMessageMetadata map[string]string `json:"pending_message_metadata,omitempty"` + Duration string `json:"duration"` + Message MessageWithChannelResponse `json:"message"` + PendingMessageMetadata map[string]string `json:"pending_message_metadata,omitempty"` } // Basic response information type GetModerationRuleResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Rule *ModerationRuleV2Response `json:"rule,omitempty"` + Duration string `json:"duration"` + Rule *ModerationRuleV2Response `json:"rule,omitempty"` } type GetOGResponse struct { - Duration string `json:"duration"` - - Custom map[string]any `json:"custom"` - + Duration string `json:"duration"` + Custom map[string]any `json:"custom"` // URL of detected video or audio - AssetUrl *string `json:"asset_url,omitempty"` - + AssetUrl *string `json:"asset_url,omitempty"` AuthorIcon *string `json:"author_icon,omitempty"` - // og:site AuthorLink *string `json:"author_link,omitempty"` - // og:site_name AuthorName *string `json:"author_name,omitempty"` - - Color *string `json:"color,omitempty"` - - Fallback *string `json:"fallback,omitempty"` - - Footer *string `json:"footer,omitempty"` - + Color *string `json:"color,omitempty"` + Fallback *string `json:"fallback,omitempty"` + Footer *string `json:"footer,omitempty"` FooterIcon *string `json:"footer_icon,omitempty"` - // URL of detected image ImageUrl *string `json:"image_url,omitempty"` - // extracted url from the text - OGScrapeUrl *string `json:"og_scrape_url,omitempty"` - - OriginalHeight *int `json:"original_height,omitempty"` - - OriginalWidth *int `json:"original_width,omitempty"` - - Pretext *string `json:"pretext,omitempty"` - + OGScrapeUrl *string `json:"og_scrape_url,omitempty"` + OriginalHeight *int `json:"original_height,omitempty"` + OriginalWidth *int `json:"original_width,omitempty"` + Pretext *string `json:"pretext,omitempty"` // og:description Text *string `json:"text,omitempty"` - // URL of detected thumb image ThumbUrl *string `json:"thumb_url,omitempty"` - // og:title Title *string `json:"title,omitempty"` - // og:url TitleLink *string `json:"title_link,omitempty"` - // Attachment type, could be empty, image, audio or video - Type *string `json:"type,omitempty"` - + Type *string `json:"type,omitempty"` Actions []Action `json:"actions,omitempty"` - - Fields []Field `json:"fields,omitempty"` - - Giphy *Images `json:"giphy,omitempty"` + Fields []Field `json:"fields,omitempty"` + Giphy *Images `json:"giphy,omitempty"` } type GetOrCreateCallResponse struct { - Created bool `json:"created"` - - Duration string `json:"duration"` - - Members []MemberResponse `json:"members"` - - OwnCapabilities []OwnCapability `json:"own_capabilities"` - - Call CallResponse `json:"call"` + Created bool `json:"created"` + Duration string `json:"duration"` + Members []MemberResponse `json:"members"` + OwnCapabilities []OwnCapability `json:"own_capabilities"` + Call CallResponse `json:"call"` } type GetOrCreateFeedGroupResponse struct { Duration string `json:"duration"` - // Indicates whether the feed group was created (true) or already existed (false) - WasCreated bool `json:"was_created"` - - FeedGroup FeedGroupResponse `json:"feed_group"` + WasCreated bool `json:"was_created"` + FeedGroup FeedGroupResponse `json:"feed_group"` } // Basic response information type GetOrCreateFeedResponse struct { Created bool `json:"created"` - // Duration of the request in milliseconds - Duration string `json:"duration"` - - Activities []ActivityResponse `json:"activities"` - + Duration string `json:"duration"` + Activities []ActivityResponse `json:"activities"` AggregatedActivities []AggregatedActivityResponse `json:"aggregated_activities"` - - Followers []FollowResponse `json:"followers"` - - Following []FollowResponse `json:"following"` - - Members []FeedMemberResponse `json:"members"` - - PinnedActivities []ActivityPinResponse `json:"pinned_activities"` - - Feed FeedResponse `json:"feed"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` - - FollowersPagination *PagerResponse `json:"followers_pagination,omitempty"` - - FollowingPagination *PagerResponse `json:"following_pagination,omitempty"` - - MemberPagination *PagerResponse `json:"member_pagination,omitempty"` - - NotificationStatus *NotificationStatusResponse `json:"notification_status,omitempty"` + Followers []FollowResponse `json:"followers"` + Following []FollowResponse `json:"following"` + Members []FeedMemberResponse `json:"members"` + PinnedActivities []ActivityPinResponse `json:"pinned_activities"` + Feed FeedResponse `json:"feed"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` + FollowersPagination *PagerResponse `json:"followers_pagination,omitempty"` + FollowingPagination *PagerResponse `json:"following_pagination,omitempty"` + MemberPagination *PagerResponse `json:"member_pagination,omitempty"` + NotificationStatus *NotificationStatusResponse `json:"notification_status,omitempty"` } type GetOrCreateFeedViewResponse struct { Duration string `json:"duration"` - // Indicates whether the feed view was newly created (true) or already existed (false) - WasCreated bool `json:"was_created"` - - FeedView FeedViewResponse `json:"feed_view"` + WasCreated bool `json:"was_created"` + FeedView FeedViewResponse `json:"feed_view"` } // Basic response information type GetPushTemplatesResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Templates []PushTemplate `json:"templates"` + Duration string `json:"duration"` + Templates []PushTemplateResponse `json:"templates"` } type GetRateLimitsResponse struct { Duration string `json:"duration"` - // Map of endpoint rate limits for the Android platform - Android map[string]LimitInfo `json:"android,omitempty"` - + Android map[string]LimitInfoResponse `json:"android,omitempty"` // Map of endpoint rate limits for the iOS platform - Ios map[string]LimitInfo `json:"ios,omitempty"` - + Ios map[string]LimitInfoResponse `json:"ios,omitempty"` // Map of endpoint rate limits for the server-side platform - ServerSide map[string]LimitInfo `json:"server_side,omitempty"` - + ServerSide map[string]LimitInfoResponse `json:"server_side,omitempty"` // Map of endpoint rate limits for the web platform - Web map[string]LimitInfo `json:"web,omitempty"` + Web map[string]LimitInfoResponse `json:"web,omitempty"` } type GetReactionsResponse struct { Duration string `json:"duration"` - // List of reactions Reactions []ReactionResponse `json:"reactions"` } @@ -7594,55 +5648,50 @@ type GetReactionsResponse struct { // Basic response information type GetRepliesResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Messages []MessageResponse `json:"messages"` } type GetReviewQueueItemResponse struct { - Duration string `json:"duration"` - - Item *ReviewQueueItemResponse `json:"item,omitempty"` + Duration string `json:"duration"` + Item *ReviewQueueItemResponse `json:"item,omitempty"` } type GetSegmentResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Segment *SegmentResponse `json:"segment,omitempty"` + Duration string `json:"duration"` + Segment *SegmentResponse `json:"segment,omitempty"` } type GetTaskResponse struct { CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // Current status of task Status string `json:"status"` - // ID of task - TaskID string `json:"task_id"` - - UpdatedAt Timestamp `json:"updated_at"` - - Error *ErrorResult `json:"error,omitempty"` - + TaskID string `json:"task_id"` + UpdatedAt Timestamp `json:"updated_at"` + Error *ErrorResult `json:"error,omitempty"` // Result produced by task after completion Result map[string]any `json:"result,omitempty"` } type GetThreadResponse struct { - Duration string `json:"duration"` + Duration string `json:"duration"` + Thread ThreadStateResponse `json:"thread"` +} - Thread ThreadStateResponse `json:"thread"` +// Response for getting a user group +type GetUserGroupResponse struct { + Duration string `json:"duration"` + UserGroup *UserGroupResponse `json:"user_group,omitempty"` } // Basic response information type GoLiveResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Call CallResponse `json:"call"` + Duration string `json:"duration"` + Call CallResponse `json:"call"` } type GoogleVisionConfig struct { @@ -7650,52 +5699,41 @@ type GoogleVisionConfig struct { } type GroupedStatsResponse struct { - Name string `json:"name"` - - Unique int `json:"unique"` + Name string `json:"name"` + Unique int `json:"unique"` } type HLSSettings struct { - AutoOn bool `json:"auto_on"` - - Enabled bool `json:"enabled"` - - QualityTracks []string `json:"quality_tracks"` - - Layout *LayoutSettings `json:"layout,omitempty"` + AutoOn bool `json:"auto_on"` + Enabled bool `json:"enabled"` + QualityTracks []string `json:"quality_tracks"` + Layout *LayoutSettings `json:"layout,omitempty"` } type HLSSettingsRequest struct { + // Quality tracks for HLS. One of: 360p, 480p, 720p, 1080p, 1440p, portrait-360x640, portrait-480x854, portrait-720x1280, portrait-1080x1920, portrait-1440x2560 QualityTracks []string `json:"quality_tracks"` - + // Whether HLS broadcasting should start automatically AutoOn *bool `json:"auto_on,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Layout *LayoutSettingsRequest `json:"layout,omitempty"` + // Whether HLS broadcasting is enabled + Enabled *bool `json:"enabled,omitempty"` + Layout *LayoutSettingsRequest `json:"layout,omitempty"` } // HLSSettings is the payload for HLS settings type HLSSettingsResponse struct { - AutoOn bool `json:"auto_on"` - - Enabled bool `json:"enabled"` - - QualityTracks []string `json:"quality_tracks"` - - Layout LayoutSettingsResponse `json:"layout"` + AutoOn bool `json:"auto_on"` + Enabled bool `json:"enabled"` + QualityTracks []string `json:"quality_tracks"` + Layout LayoutSettingsResponse `json:"layout"` } type HarmConfig struct { - CooldownPeriod *int `json:"cooldown_period,omitempty"` - - Severity *int `json:"severity,omitempty"` - - Threshold *int `json:"threshold,omitempty"` - + CooldownPeriod *int `json:"cooldown_period,omitempty"` + Severity *int `json:"severity,omitempty"` + Threshold *int `json:"threshold,omitempty"` ActionSequences []ActionSequence `json:"action_sequences,omitempty"` - - HarmTypes []string `json:"harm_types,omitempty"` + HarmTypes []string `json:"harm_types,omitempty"` } // Basic response information @@ -7705,19 +5743,15 @@ type HideChannelResponse struct { } type HuaweiConfig struct { - Disabled *bool `json:"Disabled,omitempty"` - - ID *string `json:"id,omitempty"` - - Secret *string `json:"secret,omitempty"` + Disabled *bool `json:"Disabled,omitempty"` + ID *string `json:"id,omitempty"` + Secret *string `json:"secret,omitempty"` } type HuaweiConfigFields struct { - Enabled bool `json:"enabled"` - - ID *string `json:"id,omitempty"` - - Secret *string `json:"secret,omitempty"` + Enabled bool `json:"enabled"` + ID *string `json:"id,omitempty"` + Secret *string `json:"secret,omitempty"` } type ImageContentParameters struct { @@ -7726,137 +5760,99 @@ type ImageContentParameters struct { type ImageData struct { Frames string `json:"frames"` - Height string `json:"height"` - - Size string `json:"size"` - - Url string `json:"url"` - - Width string `json:"width"` + Size string `json:"size"` + Url string `json:"url"` + Width string `json:"width"` } type ImageRuleParameters struct { - Threshold *int `json:"threshold,omitempty"` - - TimeWindow *string `json:"time_window,omitempty"` - + Threshold *int `json:"threshold,omitempty"` + TimeWindow *string `json:"time_window,omitempty"` HarmLabels []string `json:"harm_labels,omitempty"` } type ImageSize struct { - // Crop mode + // Crop mode. One of: top, bottom, left, right, center Crop *string `json:"crop,omitempty"` - // Target image height Height *int `json:"height,omitempty"` - - // Resize method + // Resize method. One of: clip, crop, scale, fill Resize *string `json:"resize,omitempty"` - // Target image width Width *int `json:"width,omitempty"` } type ImageUploadRequest struct { File *string `json:"file,omitempty"` - // field with JSON-encoded array of image size configurations UploadSizes []ImageSize `json:"upload_sizes,omitempty"` - - User *OnlyUserID `json:"user,omitempty"` + User *OnlyUserID `json:"user,omitempty"` } type ImageUploadResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - File *string `json:"file,omitempty"` - + Duration string `json:"duration"` + File *string `json:"file,omitempty"` ThumbUrl *string `json:"thumb_url,omitempty"` - // Array of image size configurations UploadSizes []ImageSize `json:"upload_sizes,omitempty"` } type Images struct { - FixedHeight ImageData `json:"fixed_height"` - + FixedHeight ImageData `json:"fixed_height"` FixedHeightDownsampled ImageData `json:"fixed_height_downsampled"` - - FixedHeightStill ImageData `json:"fixed_height_still"` - - FixedWidth ImageData `json:"fixed_width"` - - FixedWidthDownsampled ImageData `json:"fixed_width_downsampled"` - - FixedWidthStill ImageData `json:"fixed_width_still"` - - Original ImageData `json:"original"` + FixedHeightStill ImageData `json:"fixed_height_still"` + FixedWidth ImageData `json:"fixed_width"` + FixedWidthDownsampled ImageData `json:"fixed_width_downsampled"` + FixedWidthStill ImageData `json:"fixed_width_still"` + Original ImageData `json:"original"` } type ImportTask struct { - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Mode string `json:"mode"` - - Path string `json:"path"` - - State string `json:"state"` - - UpdatedAt Timestamp `json:"updated_at"` - - History []ImportTaskHistory `json:"history"` - - Size *int `json:"size,omitempty"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Mode string `json:"mode"` + Path string `json:"path"` + State string `json:"state"` + UpdatedAt Timestamp `json:"updated_at"` + History []ImportTaskHistory `json:"history"` + Size *int `json:"size,omitempty"` } type ImportTaskHistory struct { CreatedAt Timestamp `json:"created_at"` - - NextState string `json:"next_state"` - - PrevState string `json:"prev_state"` + NextState string `json:"next_state"` + PrevState string `json:"prev_state"` } type ImportV2TaskItem struct { - AppPk int `json:"app_pk"` - - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Product string `json:"product"` - - State int `json:"state"` - - UpdatedAt Timestamp `json:"updated_at"` - - Settings ImportV2TaskSettings `json:"settings"` + AppPk int `json:"app_pk"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Product string `json:"product"` + State int `json:"state"` + UpdatedAt Timestamp `json:"updated_at"` + Settings ImportV2TaskSettings `json:"settings"` } type ImportV2TaskSettings struct { - Mode *string `json:"mode,omitempty"` - - Path *string `json:"path,omitempty"` - - SkipReferencesCheck *bool `json:"skip_references_check,omitempty"` - - S3 *ImportV2TaskSettingsS3 `json:"s3,omitempty"` + MergeCustom *bool `json:"merge_custom,omitempty"` + Mode *string `json:"mode,omitempty"` + Path *string `json:"path,omitempty"` + SkipReferencesCheck *bool `json:"skip_references_check,omitempty"` + S3 *ImportV2TaskSettingsS3 `json:"s3,omitempty"` } type ImportV2TaskSettingsS3 struct { Bucket *string `json:"bucket,omitempty"` - - Dir *string `json:"dir,omitempty"` - + Dir *string `json:"dir,omitempty"` Region *string `json:"region,omitempty"` } type IndividualRecordSettings struct { - Mode string `json:"mode"` + Mode string `json:"mode"` + OutputTypes []string `json:"output_types,omitempty"` } type IndividualRecordingResponse struct { @@ -7864,223 +5860,180 @@ type IndividualRecordingResponse struct { } type IndividualRecordingSettingsRequest struct { + // Recording mode. One of: available, disabled, auto-on Mode string `json:"mode"` + // Output types to include: audio_only, video_only, audio_video, screenshare_audio_only, screenshare_video_only, screenshare_audio_video + OutputTypes []string `json:"output_types,omitempty"` } type IndividualRecordingSettingsResponse struct { - Mode string `json:"mode"` + Mode string `json:"mode"` + OutputTypes []string `json:"output_types,omitempty"` } type IngressAudioEncodingOptions struct { - Bitrate int `json:"bitrate"` - - Channels int `json:"channels"` - + Bitrate int `json:"bitrate"` + Channels int `json:"channels"` EnableDtx bool `json:"enable_dtx"` } type IngressAudioEncodingOptionsRequest struct { - Bitrate int `json:"bitrate"` - - Channels int `json:"channels"` - + Bitrate int `json:"bitrate"` + Channels int `json:"channels"` EnableDtx *bool `json:"enable_dtx,omitempty"` } type IngressAudioEncodingResponse struct { - Bitrate int `json:"bitrate"` - - Channels int `json:"channels"` - + Bitrate int `json:"bitrate"` + Channels int `json:"channels"` EnableDtx bool `json:"enable_dtx"` } // This event is sent when a critical error occurs that breaks the streaming pipeline type IngressErrorEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Human-readable error message Error string `json:"error"` - // Unique identifier for the stream IngressStreamID string `json:"ingress_stream_id"` - // User who was streaming UserID string `json:"user_id"` - // The type of event: "ingress.error" in this case Type string `json:"type"` - // Error code Code *string `json:"code,omitempty"` } -func (*IngressErrorEvent) GetEventType() string { - return "ingress.error" +func (e *IngressErrorEvent) GetEventType() string { + return e.Type } type IngressSettings struct { - Enabled bool `json:"enabled"` - - AudioEncodingOptions *IngressAudioEncodingOptions `json:"audio_encoding_options,omitempty"` - + Enabled bool `json:"enabled"` + AudioEncodingOptions *IngressAudioEncodingOptions `json:"audio_encoding_options,omitempty"` VideoEncodingOptions map[string]IngressVideoEncodingOptions `json:"video_encoding_options,omitempty"` } type IngressSettingsRequest struct { - Enabled *bool `json:"enabled,omitempty"` - - AudioEncodingOptions *IngressAudioEncodingOptionsRequest `json:"audio_encoding_options,omitempty"` - + Enabled *bool `json:"enabled,omitempty"` + AudioEncodingOptions *IngressAudioEncodingOptionsRequest `json:"audio_encoding_options,omitempty"` VideoEncodingOptions map[string]IngressVideoEncodingOptionsRequest `json:"video_encoding_options,omitempty"` } type IngressSettingsResponse struct { - Enabled bool `json:"enabled"` - - AudioEncodingOptions *IngressAudioEncodingResponse `json:"audio_encoding_options,omitempty"` - + Enabled bool `json:"enabled"` + AudioEncodingOptions *IngressAudioEncodingResponse `json:"audio_encoding_options,omitempty"` VideoEncodingOptions map[string]IngressVideoEncodingResponse `json:"video_encoding_options,omitempty"` } type IngressSource struct { - Fps int `json:"fps"` - + Fps int `json:"fps"` Height int `json:"height"` - - Width int `json:"width"` + Width int `json:"width"` } type IngressSourceRequest struct { - Fps int `json:"fps"` - + Fps int `json:"fps"` Height int `json:"height"` - - Width int `json:"width"` + Width int `json:"width"` } type IngressSourceResponse struct { - Fps int `json:"fps"` - + Fps int `json:"fps"` Height int `json:"height"` - - Width int `json:"width"` + Width int `json:"width"` } // This event is sent when a user begins streaming into a call type IngressStartedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Unique identifier for this stream IngressStreamID string `json:"ingress_stream_id"` - // Streaming protocol (e.g., 'rtmps', 'srt', 'rtmp', 'rtsp') PublisherType string `json:"publisher_type"` - // User who started the stream UserID string `json:"user_id"` - // The type of event: "ingress.started" in this case Type string `json:"type"` - // Client IP address ClientIp *string `json:"client_ip,omitempty"` - // Streaming client software name (e.g., 'OBS Studio') ClientName *string `json:"client_name,omitempty"` - // Client software version Version *string `json:"version,omitempty"` } -func (*IngressStartedEvent) GetEventType() string { - return "ingress.started" +func (e *IngressStartedEvent) GetEventType() string { + return e.Type } // This event is sent when streaming stops due to user action or call ended type IngressStoppedEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // Unique identifier for the stream IngressStreamID string `json:"ingress_stream_id"` - // User who was streaming UserID string `json:"user_id"` - // The type of event: "ingress.stopped" in this case Type string `json:"type"` } -func (*IngressStoppedEvent) GetEventType() string { - return "ingress.stopped" +func (e *IngressStoppedEvent) GetEventType() string { + return e.Type } type IngressVideoEncodingOptions struct { Layers []IngressVideoLayer `json:"layers"` - - Source *IngressSource `json:"source,omitempty"` + Source *IngressSource `json:"source,omitempty"` } type IngressVideoEncodingOptionsRequest struct { Layers []IngressVideoLayerRequest `json:"layers"` - - Source IngressSourceRequest `json:"source"` + Source IngressSourceRequest `json:"source"` } type IngressVideoEncodingResponse struct { Layers []IngressVideoLayerResponse `json:"layers"` - - Source IngressSourceResponse `json:"source"` + Source IngressSourceResponse `json:"source"` } type IngressVideoLayer struct { - Bitrate int `json:"bitrate"` - - Codec string `json:"codec"` - - FrameRate int `json:"frame_rate"` - - MaxDimension int `json:"max_dimension"` - - MinDimension int `json:"min_dimension"` + Bitrate int `json:"bitrate"` + Codec string `json:"codec"` + FrameRate int `json:"frame_rate"` + MaxDimension int `json:"max_dimension"` + MinDimension int `json:"min_dimension"` } type IngressVideoLayerRequest struct { - Bitrate int `json:"bitrate"` - - Codec string `json:"codec"` - - FrameRateLimit int `json:"frame_rate_limit"` - - MaxDimension int `json:"max_dimension"` - - MinDimension int `json:"min_dimension"` + Bitrate int `json:"bitrate"` + Codec string `json:"codec"` + FrameRateLimit int `json:"frame_rate_limit"` + MaxDimension int `json:"max_dimension"` + MinDimension int `json:"min_dimension"` } type IngressVideoLayerResponse struct { - Bitrate int `json:"bitrate"` - - Codec string `json:"codec"` - - FrameRateLimit int `json:"frame_rate_limit"` - - MaxDimension int `json:"max_dimension"` - - MinDimension int `json:"min_dimension"` + Bitrate int `json:"bitrate"` + Codec string `json:"codec"` + FrameRateLimit int `json:"frame_rate_limit"` + MaxDimension int `json:"max_dimension"` + MinDimension int `json:"min_dimension"` } type JoinCallAPIMetrics struct { - Failures float64 `json:"failures"` - - Total float64 `json:"total"` + Failures float64 `json:"failures"` + Total float64 `json:"total"` + Latency *ActiveCallsLatencyStats `json:"latency,omitempty"` +} - Latency *ActiveCallsLatencyStats `json:"latency,omitempty"` +type KeyframeRuleParameters struct { + MinConfidence *float64 `json:"min_confidence,omitempty"` + Threshold *int `json:"threshold,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` } // KickUserResponse is the payload for kicking a user from a call. @@ -8091,162 +6044,121 @@ type KickUserResponse struct { // This event is sent to call participants to notify when a user is kicked from a call. Clients should make the kicked user leave the call UI. type KickedUserEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - User UserResponse `json:"user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + User UserResponse `json:"user"` // The type of event: "call.kicked_user" in this case - Type string `json:"type"` - + Type string `json:"type"` KickedByUser *UserResponse `json:"kicked_by_user,omitempty"` } -func (*KickedUserEvent) GetEventType() string { - return "call.kicked_user" +func (e *KickedUserEvent) GetEventType() string { + return e.Type } type LLMConfig struct { - AppContext *string `json:"app_context,omitempty"` - - Async *bool `json:"async,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - Rules []LLMRule `json:"rules,omitempty"` - + AppContext *string `json:"app_context,omitempty"` + Async *bool `json:"async,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Rules []LLMRule `json:"rules,omitempty"` SeverityDescriptions map[string]string `json:"severity_descriptions,omitempty"` } type LLMRule struct { - Description string `json:"description"` - - Label string `json:"label"` - - Action *string `json:"action,omitempty"` - + Description string `json:"description"` + Label string `json:"label"` + Action *string `json:"action,omitempty"` SeverityRules []BodyguardSeverityRule `json:"severity_rules,omitempty"` } -type Label struct { - Name string `json:"name"` - - HarmLabels []string `json:"harm_labels,omitempty"` - - PhraseListIds []int `json:"phrase_list_ids,omitempty"` +type LabelResponse struct { + Name string `json:"name"` + HarmLabels []string `json:"harm_labels,omitempty"` + PhraseListIds []int `json:"phrase_list_ids,omitempty"` } type LabelThresholds struct { // Threshold for automatic message block Block *float64 `json:"block,omitempty"` - // Threshold for automatic message flag Flag *float64 `json:"flag,omitempty"` } type LayoutSettings struct { - ExternalAppUrl string `json:"external_app_url"` - - ExternalCssUrl string `json:"external_css_url"` - - Name string `json:"name"` - - DetectOrientation *bool `json:"detect_orientation,omitempty"` - - Options map[string]any `json:"options,omitempty"` + ExternalAppUrl string `json:"external_app_url"` + ExternalCssUrl string `json:"external_css_url"` + Name string `json:"name"` + DetectOrientation *bool `json:"detect_orientation,omitempty"` + Options map[string]any `json:"options,omitempty"` } type LayoutSettingsRequest struct { - Name string `json:"name"` - - DetectOrientation *bool `json:"detect_orientation,omitempty"` - - ExternalAppUrl *string `json:"external_app_url,omitempty"` - - ExternalCssUrl *string `json:"external_css_url,omitempty"` - - Options map[string]any `json:"options,omitempty"` + Name string `json:"name"` + DetectOrientation *bool `json:"detect_orientation,omitempty"` + ExternalAppUrl *string `json:"external_app_url,omitempty"` + ExternalCssUrl *string `json:"external_css_url,omitempty"` + Options map[string]any `json:"options,omitempty"` } type LayoutSettingsResponse struct { - ExternalAppUrl string `json:"external_app_url"` - - ExternalCssUrl string `json:"external_css_url"` - - Name string `json:"name"` - - DetectOrientation *bool `json:"detect_orientation,omitempty"` - - Options map[string]any `json:"options,omitempty"` + ExternalAppUrl string `json:"external_app_url"` + ExternalCssUrl string `json:"external_css_url"` + Name string `json:"name"` + DetectOrientation *bool `json:"detect_orientation,omitempty"` + Options map[string]any `json:"options,omitempty"` } -type LimitInfo struct { - // The maximum number of calls allowed for the time window +type LimitInfoResponse struct { + // The maximum number of API calls allowed per time window Limit int `json:"limit"` - // The number of remaining calls in the current window Remaining int `json:"remaining"` - - // The Unix timestamp of the next window + // The Unix timestamp when the rate limit resets Reset int `json:"reset"` } type LimitsSettings struct { MaxParticipantsExcludeRoles []string `json:"max_participants_exclude_roles"` - - MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` - - MaxParticipants *int `json:"max_participants,omitempty"` - - MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` + MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` + MaxParticipants *int `json:"max_participants,omitempty"` + MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` } type LimitsSettingsRequest struct { - MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` - - MaxParticipants *int `json:"max_participants,omitempty"` - - MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` - + MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` + MaxParticipants *int `json:"max_participants,omitempty"` + MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` MaxParticipantsExcludeRoles []string `json:"max_participants_exclude_roles,omitempty"` } type LimitsSettingsResponse struct { MaxParticipantsExcludeRoles []string `json:"max_participants_exclude_roles"` - - MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` - - MaxParticipants *int `json:"max_participants,omitempty"` - - MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` + MaxDurationSeconds *int `json:"max_duration_seconds,omitempty"` + MaxParticipants *int `json:"max_participants,omitempty"` + MaxParticipantsExcludeOwner *bool `json:"max_participants_exclude_owner,omitempty"` } // Basic response information type ListBlockListResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Blocklists []BlockListResponse `json:"blocklists"` } // Response for ListCallType type ListCallTypeResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` CallTypes map[string]CallTypeResponse `json:"call_types"` } type ListChannelTypesResponse struct { Duration string `json:"duration"` - // Object with all channel types ChannelTypes map[string]*ChannelTypeConfig `json:"channel_types"` } type ListCommandsResponse struct { Duration string `json:"duration"` - // List of commands Commands []Command `json:"commands"` } @@ -8254,7 +6166,6 @@ type ListCommandsResponse struct { // List devices response type ListDevicesResponse struct { Duration string `json:"duration"` - // List of devices Devices []DeviceResponse `json:"devices"` } @@ -8262,29 +6173,25 @@ type ListDevicesResponse struct { // Basic response information type ListExternalStorageResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ExternalStorages map[string]ExternalStorageResponse `json:"external_storages"` } // Basic response information type ListFeedGroupsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Groups map[string]FeedGroupResponse `json:"groups"` + Duration string `json:"duration"` + Groups map[string]FeedGroupResponse `json:"groups"` } type ListFeedViewsResponse struct { Duration string `json:"duration"` - // Map of feed view ID to feed view Views map[string]FeedViewResponse `json:"views"` } type ListFeedVisibilitiesResponse struct { Duration string `json:"duration"` - // Map of feed visibility configurations by name FeedVisibilities map[string]FeedVisibilityResponse `json:"feed_visibilities"` } @@ -8292,43 +6199,36 @@ type ListFeedVisibilitiesResponse struct { // Basic response information type ListImportV2TasksResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ImportTasks []ImportV2TaskItem `json:"import_tasks"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type ListImportsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ImportTasks []ImportTask `json:"import_tasks"` } // Basic response information type ListPermissionsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Permissions []Permission `json:"permissions"` } // Basic response information type ListPushProvidersResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` PushProviders []PushProviderResponse `json:"push_providers"` } // Response for listing recordings type ListRecordingsResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Recordings []CallRecording `json:"recordings"` } @@ -8336,14 +6236,12 @@ type ListRecordingsResponse struct { type ListRolesResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - Roles []Role `json:"roles"` + Roles []Role `json:"roles"` } // Response containing the list of SIP Inbound Routing Rules type ListSIPInboundRoutingRuleResponse struct { Duration string `json:"duration"` - // List of SIP Inbound Routing Rules for the application SipInboundRoutingRules []SIPInboundRoutingRuleResponse `json:"sip_inbound_routing_rules"` } @@ -8351,447 +6249,406 @@ type ListSIPInboundRoutingRuleResponse struct { // Response containing the list of SIP trunks type ListSIPTrunksResponse struct { Duration string `json:"duration"` - // List of SIP trunks for the application SipTrunks []SIPTrunkResponse `json:"sip_trunks"` } -type ListTranscriptionsResponse struct { - Duration string `json:"duration"` - - // List of transcriptions for the call - Transcriptions []CallTranscription `json:"transcriptions"` -} - -type Location struct { - ContinentCode string `json:"continent_code"` - - CountryIsoCode string `json:"country_iso_code"` - - SubdivisionIsoCode string `json:"subdivision_iso_code"` -} - -// Basic response information -type MarkDeliveredResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` -} - -type MarkReadResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - Event *MessageReadEvent `json:"event,omitempty"` -} - -type MarkReviewedRequest struct { - ContentToMarkAsReviewedLimit *int `json:"content_to_mark_as_reviewed_limit,omitempty"` - - DecisionReason *string `json:"decision_reason,omitempty"` - - DisableMarkingContentAsReviewed *bool `json:"disable_marking_content_as_reviewed,omitempty"` -} - -type MemberAddedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - Member *ChannelMember `json:"member,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*MemberAddedEvent) GetEventType() string { - return "member.added" -} - -type MemberRemovedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Member *ChannelMember `json:"member,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*MemberRemovedEvent) GetEventType() string { - return "member.removed" -} - -// MemberRequest is the payload for adding a member to a call. -type MemberRequest struct { - UserID string `json:"user_id"` - - Role *string `json:"role,omitempty"` - - // Custom data for this object - Custom map[string]any `json:"custom,omitempty"` -} - -// MemberResponse is the payload for a member of a call. -type MemberResponse struct { - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - - UserID string `json:"user_id"` - - // Custom member response data - Custom map[string]any `json:"custom"` - - User UserResponse `json:"user"` - - // Date/time of deletion - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Role *string `json:"role,omitempty"` -} - -type MemberUpdatedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - Member *ChannelMember `json:"member,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*MemberUpdatedEvent) GetEventType() string { - return "member.updated" -} - -type MembersResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - // List of found members - Members []ChannelMemberResponse `json:"members"` -} - -type MembershipLevelResponse struct { - // When the membership level was created - CreatedAt Timestamp `json:"created_at"` - - // Unique identifier for the membership level - ID string `json:"id"` - - // Display name for the membership level - Name string `json:"name"` - - // Priority level - Priority int `json:"priority"` - - // When the membership level was last updated - UpdatedAt Timestamp `json:"updated_at"` - - // Activity tags this membership level gives access to - Tags []string `json:"tags"` - - // Description of the membership level - Description *string `json:"description,omitempty"` - - // Custom data for the membership level - 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"` - - UserID *string `json:"user_id,omitempty"` - - User *UserRequest `json:"user,omitempty"` -} - -type MessageChangeSet struct { - Attachments bool `json:"attachments"` - - Custom bool `json:"custom"` - - Html bool `json:"html"` - - MentionedUserIds bool `json:"mentioned_user_ids"` - - Mml bool `json:"mml"` - - Pin bool `json:"pin"` +type ListTranscriptionsResponse struct { + Duration string `json:"duration"` + // List of transcriptions for the call + Transcriptions []CallTranscription `json:"transcriptions"` +} - QuotedMessageID bool `json:"quoted_message_id"` +// Response for listing user groups +type ListUserGroupsResponse struct { + Duration string `json:"duration"` + // List of user groups + UserGroups []UserGroupResponse `json:"user_groups"` +} - Silent bool `json:"silent"` +// 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"` +} - Text bool `json:"text"` +// Basic response information +type MarkDeliveredResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` } -type MessageDeletedEvent struct { - ChannelID string `json:"channel_id"` +type MarkReadResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + Event *MarkReadResponseEvent `json:"event,omitempty"` +} - ChannelType string `json:"channel_type"` +type MarkReadResponseEvent struct { + ChannelID string `json:"channel_id"` + ChannelType string `json:"channel_type"` + Cid string `json:"cid"` + CreatedAt Timestamp `json:"created_at"` + Type string `json:"type"` + ChannelLastMessageAt *Timestamp `json:"channel_last_message_at,omitempty"` + LastReadMessageID *string `json:"last_read_message_id,omitempty"` + Team *string `json:"team,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Thread *ThreadResponse `json:"thread,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} - Cid string `json:"cid"` +// 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"` + // Reason for the appeal decision + DecisionReason *string `json:"decision_reason,omitempty"` + // Skip marking content as reviewed + DisableMarkingContentAsReviewed *bool `json:"disable_marking_content_as_reviewed,omitempty"` +} - CreatedAt Timestamp `json:"created_at"` +type MaxStreakChangedEvent struct { + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` +} - HardDelete bool `json:"hard_delete"` +func (e *MaxStreakChangedEvent) GetEventType() string { + return e.Type +} +// 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} - DeletedForMe *bool `json:"deleted_for_me,omitempty"` - - Team *string `json:"team,omitempty"` - - ThreadParticipants []User `json:"thread_participants,omitempty"` +func (e *MemberAddedEvent) GetEventType() string { + return e.Type +} - Message *Message `json:"message,omitempty"` +// Emitted when a member is removed from a channel. +type MemberRemovedEvent 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.removed" in this case + Type string `json:"type"` + // The ID of the channel from which the member was removed + 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 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"` +} - User *User `json:"user,omitempty"` +func (e *MemberRemovedEvent) GetEventType() string { + return e.Type } -func (*MessageDeletedEvent) GetEventType() string { - return "message.deleted" +// MemberRequest is the payload for adding a member to a call. +type MemberRequest struct { + UserID string `json:"user_id"` + Role *string `json:"role,omitempty"` + // Custom data for this object + Custom map[string]any `json:"custom,omitempty"` } -type MessageFlagResponse struct { +// MemberResponse is the payload for a member of a call. +type MemberResponse struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - - CreatedByAutomod bool `json:"created_by_automod"` - + // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` + UserID string `json:"user_id"` + // Custom member response data + Custom map[string]any `json:"custom"` + User UserResponse `json:"user"` + // Date/time of deletion + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Role *string `json:"role,omitempty"` +} - ApprovedAt *Timestamp `json:"approved_at,omitempty"` - - Reason *string `json:"reason,omitempty"` +// Emitted when a member is updated in a channel. +type MemberUpdatedEvent 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.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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} - RejectedAt *Timestamp `json:"rejected_at,omitempty"` +func (e *MemberUpdatedEvent) GetEventType() string { + return e.Type +} - ReviewedAt *Timestamp `json:"reviewed_at,omitempty"` +type MembersResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + // List of found members + Members []ChannelMemberResponse `json:"members"` +} +type MembershipLevelResponse struct { + // When the membership level was created + CreatedAt Timestamp `json:"created_at"` + // Unique identifier for the membership level + ID string `json:"id"` + // Display name for the membership level + Name string `json:"name"` + // Priority level + Priority int `json:"priority"` + // When the membership level was last updated + UpdatedAt Timestamp `json:"updated_at"` + // Activity tags this membership level gives access to + Tags []string `json:"tags"` + // Description of the membership level + Description *string `json:"description,omitempty"` + // Custom data for the membership level Custom map[string]any `json:"custom,omitempty"` +} - Details *FlagDetails `json:"details,omitempty"` - - Message *Message `json:"message,omitempty"` - - ModerationFeedback *FlagFeedback `json:"moderation_feedback,omitempty"` - - ModerationResult *MessageModerationResult `json:"moderation_result,omitempty"` - - ReviewedBy *UserResponse `json:"reviewed_by,omitempty"` +type MessageActionRequest struct { + // ReadOnlyData to execute command with + FormData map[string]string `json:"form_data"` + UserID *string `json:"user_id,omitempty"` + User *UserRequest `json:"user,omitempty"` +} - User *UserResponse `json:"user,omitempty"` +// Basic response information +type MessageActionResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + Message *MessageResponse `json:"message,omitempty"` } -type MessageFlaggedEvent struct { - Cid string `json:"cid"` +type MessageChangeSet struct { + Attachments bool `json:"attachments"` + Custom bool `json:"custom"` + Html bool `json:"html"` + MentionedUserIds bool `json:"mentioned_user_ids"` + Mml bool `json:"mml"` + Pin bool `json:"pin"` + QuotedMessageID bool `json:"quoted_message_id"` + Silent bool `json:"silent"` + Text bool `json:"text"` +} +// Emitted when a message is deleted. +type MessageDeletedEvent struct { + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - + // Whether the message was hard deleted + HardDelete bool `json:"hard_delete"` + MessageID string `json:"message_id"` + Custom map[string]any `json:"custom"` + 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"` + 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"` +} - ThreadParticipants []User `json:"thread_participants,omitempty"` - - Flag *Flag `json:"flag,omitempty"` - - Message *Message `json:"message,omitempty"` +func (e *MessageDeletedEvent) GetEventType() string { + return e.Type +} - User *User `json:"user,omitempty"` +type MessageFlagResponse struct { + CreatedAt Timestamp `json:"created_at"` + CreatedByAutomod bool `json:"created_by_automod"` + UpdatedAt Timestamp `json:"updated_at"` + ApprovedAt *Timestamp `json:"approved_at,omitempty"` + Reason *string `json:"reason,omitempty"` + RejectedAt *Timestamp `json:"rejected_at,omitempty"` + ReviewedAt *Timestamp `json:"reviewed_at,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + Details *FlagDetailsResponse `json:"details,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + ModerationFeedback *FlagFeedbackResponse `json:"moderation_feedback,omitempty"` + ModerationResult *MessageModerationResult `json:"moderation_result,omitempty"` + ReviewedBy *UserResponse `json:"reviewed_by,omitempty"` + 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 { + // 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"` + // 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 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 { - return "message.flagged" +func (e *MessageFlaggedEvent) GetEventType() string { + return e.Type } type MessageHistoryEntryResponse struct { - IsDeleted bool `json:"is_deleted"` - - MessageID string `json:"message_id"` - - MessageUpdatedAt Timestamp `json:"message_updated_at"` - - MessageUpdatedByID string `json:"message_updated_by_id"` - - Text string `json:"text"` - - Attachments []Attachment `json:"attachments"` - - Custom map[string]any `json:"Custom"` + IsDeleted bool `json:"is_deleted"` + MessageID string `json:"message_id"` + MessageUpdatedAt Timestamp `json:"message_updated_at"` + MessageUpdatedByID string `json:"message_updated_by_id"` + Text string `json:"text"` + Attachments []Attachment `json:"attachments"` + Custom map[string]any `json:"Custom"` } // Result of the message moderation type MessageModerationResult struct { // Action taken by automod Action string `json:"action"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // ID of the message MessageID string `json:"message_id"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // Whether user has bad karma UserBadKarma bool `json:"user_bad_karma"` - // Karma of the user UserKarma float64 `json:"user_karma"` - // Word that was blocked BlockedWord *string `json:"blocked_word,omitempty"` - // Name of the blocklist BlocklistName *string `json:"blocklist_name,omitempty"` - // User who moderated the message - ModeratedBy *string `json:"moderated_by,omitempty"` - + ModeratedBy *string `json:"moderated_by,omitempty"` AiModerationResponse *ModerationResponse `json:"ai_moderation_response,omitempty"` - - ModerationThresholds *Thresholds `json:"moderation_thresholds,omitempty"` + 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"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - + // Date/time of creation CreatedAt Timestamp `json:"created_at"` - - WatcherCount int `json:"watcher_count"` - + MessageID string `json:"message_id"` + // The number of watchers + WatcherCount int `json:"watcher_count"` + Custom map[string]any `json:"custom"` + Message MessageResponse `json:"message"` + // The type of event: "message.new" in this case Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - ThreadParticipants []User `json:"thread_participants,omitempty"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*MessageNewEvent) GetEventType() string { - return "message.new" + // 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"` + TotalUnreadCount *int `json:"total_unread_count,omitempty"` + UnreadChannels *int `json:"unread_channels,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 (e *MessageNewEvent) GetEventType() string { + return e.Type } type MessageOptions struct { @@ -8801,738 +6658,630 @@ type MessageOptions struct { type MessagePaginationParams struct { // The timestamp to get messages with a created_at timestamp greater than CreatedAtAfter *Timestamp `json:"created_at_after,omitempty"` - // The timestamp to get messages with a created_at timestamp greater than or equal to CreatedAtAfterOrEqual *Timestamp `json:"created_at_after_or_equal,omitempty"` - // The result will be a set of messages, that are both older and newer than the created_at timestamp provided, distributed evenly around the timestamp CreatedAtAround *Timestamp `json:"created_at_around,omitempty"` - // The timestamp to get messages with a created_at timestamp smaller than CreatedAtBefore *Timestamp `json:"created_at_before,omitempty"` - // The timestamp to get messages with a created_at timestamp smaller than or equal to CreatedAtBeforeOrEqual *Timestamp `json:"created_at_before_or_equal,omitempty"` - // The result will be a set of messages, that are both older and newer than the message with the provided ID, and the message with the ID provided will be in the middle of the set IDAround *string `json:"id_around,omitempty"` - // The ID of the message to get messages with a timestamp greater than IDGt *string `json:"id_gt,omitempty"` - // The ID of the message to get messages with a timestamp greater than or equal to IDGte *string `json:"id_gte,omitempty"` - // The ID of the message to get messages with a timestamp smaller than IDLt *string `json:"id_lt,omitempty"` - // The ID of the message to get messages with a timestamp smaller than or equal to IDLte *string `json:"id_lte,omitempty"` - // The maximum number of messages to return (max limit Limit *int `json:"limit,omitempty"` } +// Emitted when a channel or thread is marked as read. type MessageReadEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "message.read" in this case Type string `json:"type"` - - ChannelLastMessageAt *Timestamp `json:"channel_last_message_at,omitempty"` - - LastReadMessageID *string `json:"last_read_message_id,omitempty"` - - Team *string `json:"team,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Thread *ThreadResponse `json:"thread,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + // The ID of the channel where the message was read + 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 read + ChannelType *string `json:"channel_type,omitempty"` + // The CID of the channel where the message was read + Cid *string `json:"cid,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"` + Channel *ChannelResponse `json:"channel,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Thread *ThreadResponse `json:"thread,omitempty"` + 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"` +func (e *MessageReadEvent) GetEventType() string { + return e.Type } +// 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"` - - ID *string `json:"id,omitempty"` - + // Message ID is unique string identifier of the message + ID *string `json:"id,omitempty"` + MentionedChannel *bool `json:"mentioned_channel,omitempty"` + MentionedHere *bool `json:"mentioned_here,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"` - - PollID *string `json:"poll_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"` - - Text *string `json:"text,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. One of: regular, system Type *string `json:"type,omitempty"` - - Attachments []Attachment `json:"attachments,omitempty"` - + // Array of message attachments + Attachments []Attachment `json:"attachments,omitempty"` + MentionedRoles []string `json:"mentioned_roles,omitempty"` + // Array of user IDs to mention MentionedUsers []string `json:"mentioned_users,omitempty"` - - RestrictedVisibility []string `json:"restricted_visibility,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - SharedLocation *SharedLocation `json:"shared_location,omitempty"` - - User *UserRequest `json:"user,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"` + SharedLocation *SharedLocation `json:"shared_location,omitempty"` + User *UserRequest `json:"user,omitempty"` } // Represents any chat message type MessageResponse struct { // Channel unique identifier in : format Cid string `json:"cid"` - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - DeletedReplyCount int `json:"deleted_reply_count"` - + CreatedAt Timestamp `json:"created_at"` + DeletedReplyCount int `json:"deleted_reply_count"` // Contains HTML markup of the message. Can only be set when using server-side API Html string `json:"html"` - // Message ID is unique string identifier of the message ID string `json:"id"` - + // Whether the message mentioned the channel tag + MentionedChannel bool `json:"mentioned_channel"` + // Whether the message mentioned online users with @here tag + MentionedHere bool `json:"mentioned_here"` // Whether message is pinned or not Pinned bool `json:"pinned"` - // Number of replies to this message ReplyCount int `json:"reply_count"` - // Whether the message was shadowed or not Shadowed bool `json:"shadowed"` - // Whether message is silent or not Silent bool `json:"silent"` - // Text of the message. Should be empty if `mml` is provided Text string `json:"text"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - - // Contains type of the message + // Contains type of the message. One of: regular, ephemeral, error, reply, system, deleted Type string `json:"type"` - // Array of message attachments Attachments []Attachment `json:"attachments"` - // List of 10 latest reactions to this message LatestReactions []ReactionResponse `json:"latest_reactions"` - // List of mentioned users MentionedUsers []UserResponse `json:"mentioned_users"` - // List of 10 latest reactions of authenticated user to this message OwnReactions []ReactionResponse `json:"own_reactions"` - // A list of user ids that have restricted visibility to the message, if the list is not empty, the message is only visible to the users in the list - RestrictedVisibility []string `json:"restricted_visibility"` - - Custom map[string]any `json:"custom"` - + RestrictedVisibility []string `json:"restricted_visibility"` + Custom map[string]any `json:"custom"` // An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int) ReactionCounts map[string]int `json:"reaction_counts"` - // An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) ReactionScores map[string]int `json:"reaction_scores"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // Contains provided slash command Command *string `json:"command,omitempty"` - // Date/time of deletion - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - DeletedForMe *bool `json:"deleted_for_me,omitempty"` - + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + DeletedForMe *bool `json:"deleted_for_me,omitempty"` MessageTextUpdatedAt *Timestamp `json:"message_text_updated_at,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"` - // 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"` - + 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"` - + // List of roles mentioned in the message (e.g. admin, channel_moderator, custom roles). Members with matching roles will receive push notifications based on their push preferences. Max 10 roles + MentionedRoles []string `json:"mentioned_roles,omitempty"` // List of users who participate in thread ThreadParticipants []UserResponse `json:"thread_participants,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - + Draft *DraftResponse `json:"draft,omitempty"` // Object with translations. Key `language` contains the original language key. Other keys contain translations I18n map[string]string `json:"i18n,omitempty"` - // Contains image moderation information - ImageLabels map[string][]string `json:"image_labels,omitempty"` - - Member *ChannelMemberResponse `json:"member,omitempty"` - - Moderation *ModerationV2Response `json:"moderation,omitempty"` - - PinnedBy *UserResponse `json:"pinned_by,omitempty"` - - Poll *PollResponseData `json:"poll,omitempty"` - - QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` - + ImageLabels map[string][]string `json:"image_labels,omitempty"` + Member *ChannelMemberResponse `json:"member,omitempty"` + Moderation *ModerationV2Response `json:"moderation,omitempty"` + PinnedBy *UserResponse `json:"pinned_by,omitempty"` + Poll *PollResponseData `json:"poll,omitempty"` + QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` - - Reminder *ReminderResponseData `json:"reminder,omitempty"` - - SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` + SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` } type MessageStatsResponse struct { CountOverTime []CountByMinuteResponse `json:"count_over_time,omitempty"` } +// Emitted when a message is unblocked. type MessageUnblockedEvent struct { - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // 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"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,omitempty"` + // The CID of the channel where the message was unblocked + Cid *string `json:"cid,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*MessageUnblockedEvent) GetEventType() string { - return "message.unblocked" +func (e *MessageUnblockedEvent) GetEventType() string { + return e.Type } +// Emitted when a message is undeleted. type MessageUndeletedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // 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.undeleted" in this case Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - ThreadParticipants []User `json:"thread_participants,omitempty"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,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"` + // 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 { - return "message.undeleted" +func (e *MessageUndeletedEvent) GetEventType() string { + return e.Type } type MessageUpdate struct { - OldText *string `json:"old_text,omitempty"` - + OldText *string `json:"old_text,omitempty"` 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"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // 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.updated" in this case Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - ThreadParticipants []User `json:"thread_participants,omitempty"` - - Message *Message `json:"message,omitempty"` - - User *User `json:"user,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"` + // 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"` + MessageUpdate *MessageUpdate `json:"message_update,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*MessageUpdatedEvent) GetEventType() string { - return "message.updated" +func (e *MessageUpdatedEvent) GetEventType() string { + return e.Type } // Represents any chat message type MessageWithChannelResponse struct { // Channel unique identifier in : format Cid string `json:"cid"` - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - DeletedReplyCount int `json:"deleted_reply_count"` - + CreatedAt Timestamp `json:"created_at"` + DeletedReplyCount int `json:"deleted_reply_count"` // Contains HTML markup of the message. Can only be set when using server-side API Html string `json:"html"` - // Message ID is unique string identifier of the message ID string `json:"id"` - + // Whether the message mentioned the channel tag + MentionedChannel bool `json:"mentioned_channel"` + // Whether the message mentioned online users with @here tag + MentionedHere bool `json:"mentioned_here"` // Whether message is pinned or not Pinned bool `json:"pinned"` - // Number of replies to this message ReplyCount int `json:"reply_count"` - // Whether the message was shadowed or not Shadowed bool `json:"shadowed"` - // Whether message is silent or not Silent bool `json:"silent"` - // Text of the message. Should be empty if `mml` is provided Text string `json:"text"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - - // Contains type of the message + // Contains type of the message. One of: regular, ephemeral, error, reply, system, deleted Type string `json:"type"` - // Array of message attachments Attachments []Attachment `json:"attachments"` - // List of 10 latest reactions to this message LatestReactions []ReactionResponse `json:"latest_reactions"` - // List of mentioned users MentionedUsers []UserResponse `json:"mentioned_users"` - // List of 10 latest reactions of authenticated user to this message OwnReactions []ReactionResponse `json:"own_reactions"` - // A list of user ids that have restricted visibility to the message, if the list is not empty, the message is only visible to the users in the list - RestrictedVisibility []string `json:"restricted_visibility"` - - Channel ChannelResponse `json:"channel"` - - Custom map[string]any `json:"custom"` - + RestrictedVisibility []string `json:"restricted_visibility"` + Channel ChannelResponse `json:"channel"` + Custom map[string]any `json:"custom"` // An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int) ReactionCounts map[string]int `json:"reaction_counts"` - // An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) ReactionScores map[string]int `json:"reaction_scores"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // Contains provided slash command Command *string `json:"command,omitempty"` - // Date/time of deletion - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - DeletedForMe *bool `json:"deleted_for_me,omitempty"` - + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + DeletedForMe *bool `json:"deleted_for_me,omitempty"` MessageTextUpdatedAt *Timestamp `json:"message_text_updated_at,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"` - // 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"` - + 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"` - + // List of roles mentioned in the message (e.g. admin, channel_moderator, custom roles). Members with matching roles will receive push notifications based on their push preferences. Max 10 roles + MentionedRoles []string `json:"mentioned_roles,omitempty"` // List of users who participate in thread ThreadParticipants []UserResponse `json:"thread_participants,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - + Draft *DraftResponse `json:"draft,omitempty"` // Object with translations. Key `language` contains the original language key. Other keys contain translations I18n map[string]string `json:"i18n,omitempty"` - // Contains image moderation information - ImageLabels map[string][]string `json:"image_labels,omitempty"` - - Member *ChannelMemberResponse `json:"member,omitempty"` - - Moderation *ModerationV2Response `json:"moderation,omitempty"` - - PinnedBy *UserResponse `json:"pinned_by,omitempty"` - - Poll *PollResponseData `json:"poll,omitempty"` - - QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` - + ImageLabels map[string][]string `json:"image_labels,omitempty"` + Member *ChannelMemberResponse `json:"member,omitempty"` + Moderation *ModerationV2Response `json:"moderation,omitempty"` + PinnedBy *UserResponse `json:"pinned_by,omitempty"` + Poll *PollResponseData `json:"poll,omitempty"` + QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` - - Reminder *ReminderResponseData `json:"reminder,omitempty"` - - SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` + SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` } type MetricDescriptor struct { - Label string `json:"label"` - + Label string `json:"label"` Description *string `json:"description,omitempty"` + Unit *string `json:"unit,omitempty"` +} - Unit *string `json:"unit,omitempty"` +// Statistics for a single metric with optional daily breakdown +type MetricStats struct { + // Aggregated total value + Total int `json:"total"` + // Per-day values (only present in daily mode) + Daily []DailyValue `json:"daily,omitempty"` } type MetricThreshold struct { - Level string `json:"level"` - - Operator string `json:"operator"` - - Value float64 `json:"value"` - - ValueUnit *string `json:"value_unit,omitempty"` - - WindowSeconds *int `json:"window_seconds,omitempty"` + Level string `json:"level"` + Operator string `json:"operator"` + Value float64 `json:"value"` + ValueUnit *string `json:"value_unit,omitempty"` + WindowSeconds *int `json:"window_seconds,omitempty"` } type MetricTimeSeries struct { DataPoints [][]float64 `json:"data_points,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 type ModerationCheckCompletedEvent struct { CreatedAt Timestamp `json:"created_at"` - // The ID of entity which was moderated EntityID string `json:"entity_id"` - // The type of the entity which was moderated EntityType string `json:"entity_type"` - // The recommended action RecommendedAction string `json:"recommended_action"` - // The review queue item ID - ReviewQueueItemID string `json:"review_queue_item_id"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + ReviewQueueItemID string `json:"review_queue_item_id"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*ModerationCheckCompletedEvent) GetEventType() string { - return "moderation_check.completed" +func (e *ModerationCheckCompletedEvent) GetEventType() string { + return e.Type } type ModerationConfig struct { - Async *bool `json:"async,omitempty"` - - CreatedAt *Timestamp `json:"created_at,omitempty"` - - Key *string `json:"key,omitempty"` - - Team *string `json:"team,omitempty"` - - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - - SupportedVideoCallHarmTypes []string `json:"supported_video_call_harm_types,omitempty"` - - AiImageConfig *AIImageConfig `json:"ai_image_config,omitempty"` - - AiImageLiteConfig *BodyguardImageAnalysisConfig `json:"ai_image_lite_config,omitempty"` - - AiTextConfig *AITextConfig `json:"ai_text_config,omitempty"` - - AiVideoConfig *AIVideoConfig `json:"ai_video_config,omitempty"` - + Async *bool `json:"async,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Key *string `json:"key,omitempty"` + Team *string `json:"team,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + SupportedVideoCallHarmTypes []string `json:"supported_video_call_harm_types,omitempty"` + AiImageConfig *AIImageConfig `json:"ai_image_config,omitempty"` + AiImageLiteConfig *BodyguardImageAnalysisConfig `json:"ai_image_lite_config,omitempty"` + AiTextConfig *AITextConfig `json:"ai_text_config,omitempty"` + AiVideoConfig *AIVideoConfig `json:"ai_video_config,omitempty"` AutomodPlatformCircumventionConfig *AutomodPlatformCircumventionConfig `json:"automod_platform_circumvention_config,omitempty"` - - AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config,omitempty"` - - AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config,omitempty"` - - BlockListConfig *BlockListConfig `json:"block_list_config,omitempty"` - - GoogleVisionConfig *GoogleVisionConfig `json:"google_vision_config,omitempty"` - - LlmConfig *LLMConfig `json:"llm_config,omitempty"` - - VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config,omitempty"` - - VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config,omitempty"` + AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config,omitempty"` + AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config,omitempty"` + BlockListConfig *BlockListConfig `json:"block_list_config,omitempty"` + GoogleVisionConfig *GoogleVisionConfig `json:"google_vision_config,omitempty"` + LlmConfig *LLMConfig `json:"llm_config,omitempty"` + VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config,omitempty"` + VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config,omitempty"` } // This event is sent when a custom moderation action is executed type ModerationCustomActionEvent struct { // The ID of the custom action that was executed - ActionID string `json:"action_id"` - - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - + ActionID string `json:"action_id"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` ReviewQueueItem ReviewQueueItemResponse `json:"review_queue_item"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // Additional options passed to the custom action - ActionOptions map[string]any `json:"action_options,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` + ActionOptions map[string]any `json:"action_options,omitempty"` + Message *MessageResponse `json:"message,omitempty"` } -func (*ModerationCustomActionEvent) GetEventType() string { - return "moderation.custom_action" +func (e *ModerationCustomActionEvent) GetEventType() string { + return e.Type } type ModerationDashboardPreferences struct { - DisableFlaggingReviewedEntity *bool `json:"disable_flagging_reviewed_entity,omitempty"` - - FlagUserOnFlaggedContent *bool `json:"flag_user_on_flagged_content,omitempty"` - - MediaQueueBlurEnabled *bool `json:"media_queue_blur_enabled,omitempty"` - - AllowedModerationActionReasons []string `json:"allowed_moderation_action_reasons,omitempty"` - - OverviewDashboard *OverviewDashboardConfig `json:"overview_dashboard,omitempty"` + AsyncReviewQueueUpsert *bool `json:"async_review_queue_upsert,omitempty"` + DisableAuditLogs *bool `json:"disable_audit_logs,omitempty"` + DisableFlaggingReviewedEntity *bool `json:"disable_flagging_reviewed_entity,omitempty"` + FlagUserOnFlaggedContent *bool `json:"flag_user_on_flagged_content,omitempty"` + MediaQueueBlurEnabled *bool `json:"media_queue_blur_enabled,omitempty"` + AllowedModerationActionReasons []string `json:"allowed_moderation_action_reasons,omitempty"` + OverviewDashboard *OverviewDashboardConfig `json:"overview_dashboard,omitempty"` } type ModerationFlagResponse struct { - CreatedAt Timestamp `json:"created_at"` - - EntityID string `json:"entity_id"` - - EntityType string `json:"entity_type"` - - UpdatedAt Timestamp `json:"updated_at"` - - UserID string `json:"user_id"` - - Type string `json:"type"` - - Result []map[string]any `json:"result"` - - EntityCreatorID *string `json:"entity_creator_id,omitempty"` - - Reason *string `json:"reason,omitempty"` - - ReviewQueueItemID *string `json:"review_queue_item_id,omitempty"` - - Labels []string `json:"labels,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - ModerationPayload *ModerationPayload `json:"moderation_payload,omitempty"` - - ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` - - User *UserResponse `json:"user,omitempty"` -} - + CreatedAt Timestamp `json:"created_at"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + UpdatedAt Timestamp `json:"updated_at"` + UserID string `json:"user_id"` + Type string `json:"type"` + Result []map[string]any `json:"result"` + EntityCreatorID *string `json:"entity_creator_id,omitempty"` + Reason *string `json:"reason,omitempty"` + ReviewQueueItemID *string `json:"review_queue_item_id,omitempty"` + Labels []string `json:"labels,omitempty"` + Custom map[string]any `json:"custom,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 { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Item *string `json:"item,omitempty"` - - ObjectID *string `json:"object_id,omitempty"` - - User *User `json:"user,omitempty"` + // The type of content that was flagged + ContentType string `json:"content_type"` + CreatedAt Timestamp `json:"created_at"` + // The ID of the flagged content + ObjectID string `json:"object_id"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*ModerationFlaggedEvent) GetEventType() string { - return "moderation.flagged" +func (e *ModerationFlaggedEvent) GetEventType() string { + return e.Type } // This event is sent when a moderation item is marked as reviewed type ModerationMarkReviewedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Item ReviewQueueItemResponse `json:"item"` - - Type string `json:"type"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Item ReviewQueueItemResponse `json:"item"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Message *MessageResponse `json:"message,omitempty"` +} - ReceivedAt *Timestamp `json:"received_at,omitempty"` +func (e *ModerationMarkReviewedEvent) GetEventType() string { + return e.Type +} - Message *MessageResponse `json:"message,omitempty"` +type ModerationPayload struct { + Images []string `json:"images,omitempty"` + Texts []string `json:"texts,omitempty"` + Videos []string `json:"videos,omitempty"` + Custom map[string]any `json:"custom,omitempty"` } -func (*ModerationMarkReviewedEvent) GetEventType() string { - return "moderation.mark_reviewed" +// 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"` } -type ModerationPayload struct { +// 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"` - + Action string `json:"action"` Explicit float64 `json:"explicit"` - - Spam float64 `json:"spam"` - - Toxic float64 `json:"toxic"` + Spam float64 `json:"spam"` + Toxic float64 `json:"toxic"` } -type ModerationRuleV2Response struct { - CreatedAt Timestamp `json:"created_at"` - +type ModerationRuleInfo struct { Description string `json:"description"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` +} - Enabled bool `json:"enabled"` - - ID string `json:"id"` - - Name string `json:"name"` - - RuleType string `json:"rule_type"` - - Team string `json:"team"` - - UpdatedAt Timestamp `json:"updated_at"` - - ConfigKeys []string `json:"config_keys"` - - Action RuleBuilderAction `json:"action"` - - CooldownPeriod *string `json:"cooldown_period,omitempty"` - - Logic *string `json:"logic,omitempty"` - - Conditions []RuleBuilderCondition `json:"conditions,omitempty"` +type ModerationRuleV2Response struct { + CreatedAt Timestamp `json:"created_at"` + Description string `json:"description"` + Enabled bool `json:"enabled"` + ID string `json:"id"` + Name string `json:"name"` + RuleType string `json:"rule_type"` + Team string `json:"team"` + UpdatedAt Timestamp `json:"updated_at"` + ConfigKeys []string `json:"config_keys"` + CooldownPeriod *string `json:"cooldown_period,omitempty"` + Logic *string `json:"logic,omitempty"` + ActionSequences []CallRuleActionSequence `json:"action_sequences,omitempty"` + Conditions []RuleBuilderCondition `json:"conditions,omitempty"` + Groups []RuleBuilderConditionGroup `json:"groups,omitempty"` + Action *RuleBuilderAction `json:"action,omitempty"` +} + +// This event is sent automatically whenever a rule builder rule is triggered +type ModerationRulesTriggeredEvent struct { + CreatedAt Timestamp `json:"created_at"` + // The ID of the entity that triggered the rule + EntityID string `json:"entity_id"` + // The type of the entity (call, user, message, etc.) + EntityType string `json:"entity_type"` + // The ID of the user who triggered the rule + UserID string `json:"user_id"` + // Array of action types that were triggered + TriggeredActions []string `json:"triggered_actions"` + Custom map[string]any `json:"custom"` + Rule ModerationRuleInfo `json:"rule"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + // The review queue item ID if applicable + ReviewQueueItemID *string `json:"review_queue_item_id,omitempty"` + // The violation number for call rules (optional) + ViolationNumber *int `json:"violation_number,omitempty"` +} - Groups []RuleBuilderConditionGroup `json:"groups,omitempty"` +func (e *ModerationRulesTriggeredEvent) GetEventType() string { + return e.Type } type ModerationV2Response struct { - Action string `json:"action"` - - OriginalText string `json:"original_text"` - - BlocklistMatched *string `json:"blocklist_matched,omitempty"` - - PlatformCircumvented *bool `json:"platform_circumvented,omitempty"` - - SemanticFilterMatched *string `json:"semantic_filter_matched,omitempty"` - - ImageHarms []string `json:"image_harms,omitempty"` - - TextHarms []string `json:"text_harms,omitempty"` + Action string `json:"action"` + OriginalText string `json:"original_text"` + BlocklistMatched *string `json:"blocklist_matched,omitempty"` + PlatformCircumvented *bool `json:"platform_circumvented,omitempty"` + SemanticFilterMatched *string `json:"semantic_filter_matched,omitempty"` + BlocklistsMatched []string `json:"blocklists_matched,omitempty"` + ImageHarms []string `json:"image_harms,omitempty"` + TextHarms []string `json:"text_harms,omitempty"` } type MuteChannelResponse struct { Duration string `json:"duration"` - // Object with mutes (if multiple channels were muted) - ChannelMutes []ChannelMute `json:"channel_mutes,omitempty"` - - ChannelMute *ChannelMute `json:"channel_mute,omitempty"` - - OwnUser *OwnUser `json:"own_user,omitempty"` + ChannelMutes []ChannelMute `json:"channel_mutes,omitempty"` + ChannelMute *ChannelMute `json:"channel_mute,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"` + NonExistingUsers []string `json:"non_existing_users,omitempty"` + OwnUser *OwnUserResponse `json:"own_user,omitempty"` } // MuteUsersResponse is the response payload for the mute users endpoint. @@ -9542,12 +7291,9 @@ type MuteUsersResponse struct { } type NetworkMetricsReportResponse struct { - AverageConnectionTime *float64 `json:"average_connection_time,omitempty"` - - AverageJitter *float64 `json:"average_jitter,omitempty"` - - AverageLatency *float64 `json:"average_latency,omitempty"` - + AverageConnectionTime *float64 `json:"average_connection_time,omitempty"` + AverageJitter *float64 `json:"average_jitter,omitempty"` + AverageLatency *float64 `json:"average_latency,omitempty"` AverageTimeToReconnect *float64 `json:"average_time_to_reconnect,omitempty"` } @@ -9556,29 +7302,23 @@ type NoiseCancellationSettings struct { } type NotificationComment struct { - Comment string `json:"comment"` - - ID string `json:"id"` - - UserID string `json:"user_id"` - + Comment string `json:"comment"` + ID string `json:"id"` + UserID string `json:"user_id"` Attachments []Attachment `json:"attachments,omitempty"` } type NotificationConfig struct { // Time window for deduplicating notification activities (reactions and follows). Empty or '0' = always deduplicate (default). Examples: '1h', '24h', '7d', '1w' DeduplicationWindow *string `json:"deduplication_window,omitempty"` - // Whether to track read status TrackRead *bool `json:"track_read,omitempty"` - // Whether to track seen status TrackSeen *bool `json:"track_seen,omitempty"` } type NotificationContext struct { - Target *NotificationTarget `json:"target,omitempty"` - + Target *NotificationTarget `json:"target,omitempty"` Trigger *NotificationTrigger `json:"trigger,omitempty"` } @@ -9586,141 +7326,186 @@ type NotificationContext struct { type NotificationFeedUpdatedEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the feed - Fid string `json:"fid"` - + Fid string `json:"fid"` Custom map[string]any `json:"custom"` - // The type of event: "feeds.notification_feed.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // Aggregated activities for notification feeds AggregatedActivities []AggregatedActivityResponse `json:"aggregated_activities,omitempty"` - - NotificationStatus *NotificationStatusResponse `json:"notification_status,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + NotificationStatus *NotificationStatusResponse `json:"notification_status,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*NotificationFeedUpdatedEvent) GetEventType() string { - return "feeds.notification_feed.updated" +func (e *NotificationFeedUpdatedEvent) GetEventType() string { + return e.Type } +// 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"` - - CreatedAt Timestamp `json:"created_at"` - - FirstUnreadMessageID string `json:"first_unread_message_id"` - - LastReadAt Timestamp `json:"last_read_at"` - - TotalUnreadCount int `json:"total_unread_count"` - - UnreadChannels int `json:"unread_channels"` - - UnreadCount int `json:"unread_count"` - - UnreadMessages int `json:"unread_messages"` - - UnreadThreads int `json:"unread_threads"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "notification.mark_unread" in this case Type string `json:"type"` - - LastReadMessageID *string `json:"last_read_message_id,omitempty"` - + // The ID of the channel which was marked as unread + 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 marked as unread + ChannelType *string `json:"channel_type,omitempty"` + // The CID of the channel which was marked as unread + Cid *string `json:"cid,omitempty"` + // The ID of the first unread message + FirstUnreadMessageID *string `json:"first_unread_message_id,omitempty"` + // 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"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - User *User `json:"user,omitempty"` -} - -func (*NotificationMarkUnreadEvent) GetEventType() string { - return "notification.mark_unread" + // 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` +} + +func (e *NotificationMarkUnreadEvent) GetEventType() string { + return e.Type +} + +type NotificationParentActivity struct { + ID string `json:"id"` + Text *string `json:"text,omitempty"` + UserID *string `json:"user_id,omitempty"` + Type *string `json:"type,omitempty"` + Attachments []Attachment `json:"attachments,omitempty"` } type NotificationSettings struct { - Enabled bool `json:"enabled"` - - CallLiveStarted EventNotificationSettings `json:"call_live_started"` - - CallMissed EventNotificationSettings `json:"call_missed"` - + Enabled bool `json:"enabled"` + CallLiveStarted EventNotificationSettings `json:"call_live_started"` + CallMissed EventNotificationSettings `json:"call_missed"` CallNotification EventNotificationSettings `json:"call_notification"` + CallRing EventNotificationSettings `json:"call_ring"` + SessionStarted EventNotificationSettings `json:"session_started"` +} - CallRing EventNotificationSettings `json:"call_ring"` +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"` +} - SessionStarted EventNotificationSettings `json:"session_started"` +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"` - // Number of unseen notifications Unseen int `json:"unseen"` - + // When notifications were last read LastReadAt *Timestamp `json:"last_read_at,omitempty"` - // When notifications were last seen LastSeenAt *Timestamp `json:"last_seen_at,omitempty"` - - // IDs of activities that have been read + // Deprecated: use is_read on each activity/group instead. IDs of activities that have been read. Capped at ~101 entries for aggregated feeds. ReadActivities []string `json:"read_activities,omitempty"` - + // Deprecated: use is_seen on each activity/group instead. IDs of activities that have been seen. Capped at ~101 entries for aggregated feeds. SeenActivities []string `json:"seen_activities,omitempty"` } type NotificationTarget struct { // The ID of the target (activity ID or user ID) ID string `json:"id"` - // The name of the target user (for user targets like follows) Name *string `json:"name,omitempty"` - // The text content of the target activity (for activity targets) Text *string `json:"text,omitempty"` - // The ID of the user who created the target activity (for activity targets) UserID *string `json:"user_id,omitempty"` - // The type of the target activity (for activity targets) Type *string `json:"type,omitempty"` - // Attachments on the target activity (for activity targets) - Attachments []Attachment `json:"attachments,omitempty"` + Attachments []Attachment `json:"attachments,omitempty"` + Comment *NotificationComment `json:"comment,omitempty"` + ParentActivity *NotificationParentActivity `json:"parent_activity,omitempty"` +} - 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 (e *NotificationThreadMessageNewEvent) GetEventType() string { + return e.Type } type NotificationTrigger struct { // Human-readable text describing the notification Text string `json:"text"` - // The type of notification (mention, reaction, comment, follow, etc.) - Type string `json:"type"` - + Type string `json:"type"` Comment *NotificationComment `json:"comment,omitempty"` } type OCRRule struct { Action string `json:"action"` - - Label string `json:"label"` + Label string `json:"label"` } type OnlyUserID struct { @@ -9728,18 +7513,15 @@ type OnlyUserID struct { } type OverviewDashboardConfig struct { - DefaultDateRangeDays *int `json:"default_date_range_days,omitempty"` - - VisibleCharts []string `json:"visible_charts,omitempty"` + DefaultDateRangeDays *int `json:"default_date_range_days,omitempty"` + VisibleCharts []string `json:"visible_charts,omitempty"` } type OwnBatchResponse struct { Duration string `json:"duration"` - // Map of feed ID to own fields data Data map[string]FeedOwnData `json:"data"` } - type OwnCapability string const ( @@ -9748,200 +7530,103 @@ const ( CREATE_CALL OwnCapability = "create-call" CREATE_REACTION OwnCapability = "create-reaction" ENABLE_NOISE_CANCELLATION OwnCapability = "enable-noise-cancellation" - END_CALL OwnCapability = "end-call" - JOIN_BACKSTAGE OwnCapability = "join-backstage" - JOIN_CALL OwnCapability = "join-call" - JOIN_ENDED_CALL OwnCapability = "join-ended-call" - KICK_USER OwnCapability = "kick-user" - MUTE_USERS OwnCapability = "mute-users" - PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" - READ_CALL OwnCapability = "read-call" - REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" - SCREENSHARE OwnCapability = "screenshare" - SEND_AUDIO OwnCapability = "send-audio" - SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" - SEND_VIDEO OwnCapability = "send-video" - START_BROADCAST_CALL OwnCapability = "start-broadcast-call" - START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" - START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" - START_INDIVIDUAL_RECORD_CALL OwnCapability = "start-individual-record-call" - START_RAW_RECORD_CALL OwnCapability = "start-raw-record-call" - START_RECORD_CALL OwnCapability = "start-record-call" - START_TRANSCRIPTION_CALL OwnCapability = "start-transcription-call" - STOP_BROADCAST_CALL OwnCapability = "stop-broadcast-call" - STOP_CLOSED_CAPTIONS_CALL OwnCapability = "stop-closed-captions-call" - STOP_FRAME_RECORD_CALL OwnCapability = "stop-frame-record-call" - STOP_INDIVIDUAL_RECORD_CALL OwnCapability = "stop-individual-record-call" - STOP_RAW_RECORD_CALL OwnCapability = "stop-raw-record-call" - STOP_RECORD_CALL OwnCapability = "stop-record-call" - STOP_TRANSCRIPTION_CALL OwnCapability = "stop-transcription-call" - UPDATE_CALL OwnCapability = "update-call" - UPDATE_CALL_MEMBER OwnCapability = "update-call-member" - UPDATE_CALL_PERMISSIONS OwnCapability = "update-call-permissions" - UPDATE_CALL_SETTINGS OwnCapability = "update-call-settings" -) - -func (c OwnCapability) String() string { - 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"` - - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Invisible bool `json:"invisible"` - - 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 []DeviceResponse `json:"devices"` - - Mutes []UserMuteResponse `json:"mutes"` - - Teams []string `json:"teams"` - - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Image *string `json:"image,omitempty"` - - LastActive *Timestamp `json:"last_active,omitempty"` - - Name *string `json:"name,omitempty"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - BlockedUserIds []string `json:"blocked_user_ids,omitempty"` - - LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"` - - PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` - - PushPreferences *PushPreferencesResponse `json:"push_preferences,omitempty"` + END_CALL OwnCapability = "end-call" + JOIN_BACKSTAGE OwnCapability = "join-backstage" + JOIN_CALL OwnCapability = "join-call" + JOIN_ENDED_CALL OwnCapability = "join-ended-call" + KICK_USER OwnCapability = "kick-user" + MUTE_USERS OwnCapability = "mute-users" + PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" + READ_CALL OwnCapability = "read-call" + REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" + SCREENSHARE OwnCapability = "screenshare" + SEND_AUDIO OwnCapability = "send-audio" + SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" + SEND_VIDEO OwnCapability = "send-video" + START_BROADCAST_CALL OwnCapability = "start-broadcast-call" + START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" + START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" + START_INDIVIDUAL_RECORD_CALL OwnCapability = "start-individual-record-call" + START_RAW_RECORD_CALL OwnCapability = "start-raw-record-call" + START_RECORD_CALL OwnCapability = "start-record-call" + START_TRANSCRIPTION_CALL OwnCapability = "start-transcription-call" + STOP_BROADCAST_CALL OwnCapability = "stop-broadcast-call" + STOP_CLOSED_CAPTIONS_CALL OwnCapability = "stop-closed-captions-call" + STOP_FRAME_RECORD_CALL OwnCapability = "stop-frame-record-call" + STOP_INDIVIDUAL_RECORD_CALL OwnCapability = "stop-individual-record-call" + STOP_RAW_RECORD_CALL OwnCapability = "stop-raw-record-call" + STOP_RECORD_CALL OwnCapability = "stop-record-call" + STOP_TRANSCRIPTION_CALL OwnCapability = "stop-transcription-call" + UPDATE_CALL OwnCapability = "update-call" + UPDATE_CALL_MEMBER OwnCapability = "update-call-member" + UPDATE_CALL_PERMISSIONS OwnCapability = "update-call-permissions" + UPDATE_CALL_SETTINGS OwnCapability = "update-call-settings" +) - TeamsRole map[string]string `json:"teams_role,omitempty"` +func (c OwnCapability) String() string { + return string(c) +} - TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` +type OwnUserResponse struct { + Banned bool `json:"banned"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Invisible bool `json:"invisible"` + 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 []DeviceResponse `json:"devices"` + Mutes []UserMuteResponse `json:"mutes"` + Teams []string `json:"teams"` + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` + DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Image *string `json:"image,omitempty"` + LastActive *Timestamp `json:"last_active,omitempty"` + Name *string `json:"name,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + BlockedUserIds []string `json:"blocked_user_ids,omitempty"` + LatestHiddenChannels []string `json:"latest_hidden_channels,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` + PushPreferences *PushPreferencesResponse `json:"push_preferences,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` + TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` } type PagerRequest struct { - Limit *int `json:"limit,omitempty"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Limit *int `json:"limit,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type PagerResponse struct { Next *string `json:"next,omitempty"` - Prev *string `json:"prev,omitempty"` } type PaginationParams struct { - Limit *int `json:"limit,omitempty"` - + Limit *int `json:"limit,omitempty"` Offset *int `json:"offset,omitempty"` } type ParsedPredefinedFilterResponse struct { - Name string `json:"name"` - - Filter map[string]any `json:"filter"` - - Sort []SortParamRequest `json:"sort,omitempty"` + Name string `json:"name"` + Filter map[string]any `json:"filter"` + Sort []SortParamRequest `json:"sort,omitempty"` } type ParticipantCountByMinuteResponse struct { - First int `json:"first"` - - Last int `json:"last"` - - Max int `json:"max"` - - Min int `json:"min"` - + First int `json:"first"` + Last int `json:"last"` + Max int `json:"max"` + Min int `json:"min"` StartTs Timestamp `json:"start_ts"` } @@ -9950,189 +7635,129 @@ type ParticipantCountOverTimeResponse struct { } type ParticipantReportResponse struct { - Sum int `json:"sum"` - - Unique int `json:"unique"` - - MaxConcurrent *int `json:"max_concurrent,omitempty"` - - ByBrowser []GroupedStatsResponse `json:"by_browser,omitempty"` - - ByCountry []GroupedStatsResponse `json:"by_country,omitempty"` - - ByDevice []GroupedStatsResponse `json:"by_device,omitempty"` - - ByOperatingSystem []GroupedStatsResponse `json:"by_operating_system,omitempty"` - - CountOverTime *ParticipantCountOverTimeResponse `json:"count_over_time,omitempty"` - - Publishers *PublisherStatsResponse `json:"publishers,omitempty"` - - Subscribers *SubscriberStatsResponse `json:"subscribers,omitempty"` + Sum int `json:"sum"` + Unique int `json:"unique"` + MaxConcurrent *int `json:"max_concurrent,omitempty"` + ByBrowser []GroupedStatsResponse `json:"by_browser,omitempty"` + ByCountry []GroupedStatsResponse `json:"by_country,omitempty"` + ByDevice []GroupedStatsResponse `json:"by_device,omitempty"` + ByOperatingSystem []GroupedStatsResponse `json:"by_operating_system,omitempty"` + CountOverTime *ParticipantCountOverTimeResponse `json:"count_over_time,omitempty"` + Publishers *PublisherStatsResponse `json:"publishers,omitempty"` + Subscribers *SubscriberStatsResponse `json:"subscribers,omitempty"` } type ParticipantSeriesPublisherStats struct { - GlobalMetricsOrder []string `json:"global_metrics_order,omitempty"` - - Global map[string][][]float64 `json:"global,omitempty"` - - GlobalMeta map[string]MetricDescriptor `json:"global_meta,omitempty"` - - GlobalThresholds map[string][]MetricThreshold `json:"global_thresholds,omitempty"` - - Tracks map[string][]ParticipantSeriesTrackMetrics `json:"tracks,omitempty"` + GlobalMetricsOrder []string `json:"global_metrics_order,omitempty"` + Global map[string][][]float64 `json:"global,omitempty"` + GlobalMeta map[string]MetricDescriptor `json:"global_meta,omitempty"` + GlobalThresholds map[string][]MetricThreshold `json:"global_thresholds,omitempty"` + Tracks map[string][]ParticipantSeriesTrackMetrics `json:"tracks,omitempty"` } type ParticipantSeriesSubscriberStats struct { - GlobalMetricsOrder []string `json:"global_metrics_order,omitempty"` - - Subscriptions []ParticipantSeriesSubscriptionTrackMetrics `json:"subscriptions,omitempty"` - - Global map[string][][]float64 `json:"global,omitempty"` - - GlobalMeta map[string]MetricDescriptor `json:"global_meta,omitempty"` - - GlobalThresholds map[string][]MetricThreshold `json:"global_thresholds,omitempty"` + GlobalMetricsOrder []string `json:"global_metrics_order,omitempty"` + Subscriptions []ParticipantSeriesSubscriptionTrackMetrics `json:"subscriptions,omitempty"` + Global map[string][][]float64 `json:"global,omitempty"` + GlobalMeta map[string]MetricDescriptor `json:"global_meta,omitempty"` + GlobalThresholds map[string][]MetricThreshold `json:"global_thresholds,omitempty"` } type ParticipantSeriesSubscriptionTrackMetrics struct { - PublisherUserID string `json:"publisher_user_id"` - - PublisherName *string `json:"publisher_name,omitempty"` - - PublisherUserSessionID *string `json:"publisher_user_session_id,omitempty"` - - Tracks map[string][]ParticipantSeriesTrackMetrics `json:"tracks,omitempty"` + PublisherUserID string `json:"publisher_user_id"` + PublisherName *string `json:"publisher_name,omitempty"` + PublisherUserSessionID *string `json:"publisher_user_session_id,omitempty"` + Tracks map[string][]ParticipantSeriesTrackMetrics `json:"tracks,omitempty"` } type ParticipantSeriesTimeframe struct { - MaxPoints int `json:"max_points"` - - Since Timestamp `json:"since"` - - StepSeconds int `json:"step_seconds"` - - Until Timestamp `json:"until"` + MaxPoints int `json:"max_points"` + Since Timestamp `json:"since"` + StepSeconds int `json:"step_seconds"` + Until Timestamp `json:"until"` } type ParticipantSeriesTrackMetrics struct { - TrackID string `json:"track_id"` - - Codec *string `json:"codec,omitempty"` - - Label *string `json:"label,omitempty"` - - Rid *string `json:"rid,omitempty"` - - TrackType *string `json:"track_type,omitempty"` - - MetricsOrder []string `json:"metrics_order,omitempty"` - - Metrics map[string][][]float64 `json:"metrics,omitempty"` - - MetricsMeta map[string]MetricDescriptor `json:"metrics_meta,omitempty"` - - Thresholds map[string][]MetricThreshold `json:"thresholds,omitempty"` + TrackID string `json:"track_id"` + Codec *string `json:"codec,omitempty"` + Label *string `json:"label,omitempty"` + Rid *string `json:"rid,omitempty"` + TrackType *string `json:"track_type,omitempty"` + MetricsOrder []string `json:"metrics_order,omitempty"` + Metrics map[string][][]float64 `json:"metrics,omitempty"` + MetricsMeta map[string]MetricDescriptor `json:"metrics_meta,omitempty"` + Thresholds map[string][]MetricThreshold `json:"thresholds,omitempty"` } type ParticipantSeriesUserStats struct { - MetricsOrder []string `json:"metrics_order,omitempty"` - - Metrics map[string][][]float64 `json:"metrics,omitempty"` - - MetricsMeta map[string]MetricDescriptor `json:"metrics_meta,omitempty"` - - Thresholds map[string][]MetricThreshold `json:"thresholds,omitempty"` + MetricsOrder []string `json:"metrics_order,omitempty"` + Metrics map[string][][]float64 `json:"metrics,omitempty"` + MetricsMeta map[string]MetricDescriptor `json:"metrics_meta,omitempty"` + Thresholds map[string][]MetricThreshold `json:"thresholds,omitempty"` } type ParticipantSessionDetails struct { - PublisherType string `json:"publisher_type"` - - UserID string `json:"user_id"` - - UserSessionID string `json:"user_session_id"` - - Roles []string `json:"roles"` - - DurationInSeconds *int `json:"duration_in_seconds,omitempty"` - - JoinedAt *Timestamp `json:"joined_at,omitempty"` - - LeftAt *Timestamp `json:"left_at,omitempty"` + PublisherType string `json:"publisher_type"` + UserID string `json:"user_id"` + UserSessionID string `json:"user_session_id"` + Roles []string `json:"roles"` + DurationInSeconds *int `json:"duration_in_seconds,omitempty"` + JoinedAt *Timestamp `json:"joined_at,omitempty"` + LeftAt *Timestamp `json:"left_at,omitempty"` } // Pending message event for async moderation type PendingMessageEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The method used for the pending message - Method string `json:"method"` - + Method string `json:"method"` Custom map[string]any `json:"custom"` - // The type of event: "message.pending" in this case - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Channel *Channel `json:"channel,omitempty"` - - Message *Message `json:"message,omitempty"` - + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Channel *ChannelResponse `json:"channel,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 { - return "message.pending" +func (e *PendingMessageEvent) GetEventType() string { + return e.Type } type PendingMessageResponse struct { - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` - + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` - - User *UserResponse `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } type PerSDKUsageReport struct { - Total int `json:"total"` - + Total int `json:"total"` ByVersion map[string]int `json:"by_version"` } type Permission struct { // Action name this permission is for (e.g. SendMessage) Action string `json:"action"` - // Whether this is a custom permission or built-in Custom bool `json:"custom"` - // Description of the permission Description string `json:"description"` - // Unique permission ID ID string `json:"id"` - - // Level at which permission could be applied (app or channel) + // Level at which permission could be applied (app or channel). One of: app, channel Level string `json:"level"` - // Name of the permission Name string `json:"name"` - // Whether this permission applies to resource owner or not Owner bool `json:"owner"` - // Whether this permission applies to teammates (multi-tenancy mode only) SameTeam bool `json:"same_team"` - // List of tags of the permission Tags []string `json:"tags"` - // MongoDB style condition which decides whether or not the permission is granted Condition map[string]any `json:"condition,omitempty"` } @@ -10140,35 +7765,27 @@ type Permission struct { // This event is sent when a user requests access to a feature on a call, // clients receiving this event should display a permission request to the user type PermissionRequestEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The list of permissions requested by the user - Permissions []string `json:"permissions"` - - User UserResponse `json:"user"` - + Permissions []string `json:"permissions"` + User UserResponse `json:"user"` // The type of event: "call.permission_request" in this case Type string `json:"type"` } -func (*PermissionRequestEvent) GetEventType() string { - return "call.permission_request" +func (e *PermissionRequestEvent) GetEventType() string { + return e.Type } type PinActivityResponse struct { // When the activity was pinned CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // Fully qualified ID of the feed the activity was pinned to Feed string `json:"feed"` - // ID of the user who pinned the activity - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Activity ActivityResponse `json:"activity"` } @@ -10176,7 +7793,6 @@ type PinActivityResponse struct { type PinRequest struct { // the session ID of the user who pinned the message SessionID string `json:"session_id"` - // the user ID of the user who pinned the message UserID string `json:"user_id"` } @@ -10188,292 +7804,145 @@ type PinResponse struct { } type PlatformDataResponse struct { - Browser BrowserDataResponse `json:"browser"` - - Device DeviceDataResponse `json:"device"` - - Os ClientOSDataResponse `json:"os"` + Browser BrowserDataResponse `json:"browser"` + Device DeviceDataResponse `json:"device"` + Os ClientOSDataResponse `json:"os"` } type Policy struct { - Action int `json:"action"` - + Action int `json:"action"` CreatedAt Timestamp `json:"created_at"` - - Name string `json:"name"` - - Owner bool `json:"owner"` - - Priority int `json:"priority"` - + Name string `json:"name"` + Owner bool `json:"owner"` + Priority int `json:"priority"` UpdatedAt Timestamp `json:"updated_at"` - - Resources []string `json:"resources"` - - Roles []string `json:"roles"` + Resources []string `json:"resources"` + Roles []string `json:"roles"` } // Policy request type PolicyRequest struct { Action string `json:"action"` - // User-friendly policy name Name string `json:"name"` - // Whether policy applies to resource owner or not Owner bool `json:"owner"` - // Policy priority Priority int `json:"priority"` - // List of resources to apply policy to Resources []string `json:"resources"` - // List of roles to apply policy to 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"` - + Text *string `json:"text,omitempty"` Custom map[string]any `json:"custom,omitempty"` } type PollOptionRequest struct { - ID string `json:"id"` - - Text *string `json:"text,omitempty"` - + ID string `json:"id"` + Text *string `json:"text,omitempty"` Custom map[string]any `json:"custom,omitempty"` } -type PollOptionResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - PollOption PollOptionResponseData `json:"poll_option"` -} - -type PollOptionResponseData struct { - ID string `json:"id"` - - Text string `json:"text"` - - Custom map[string]any `json:"custom"` -} - -type PollResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - Poll PollResponseData `json:"poll"` -} - -type PollResponseData 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"` - - VotingVisibility string `json:"voting_visibility"` - - LatestAnswers []PollVoteResponseData `json:"latest_answers"` - - Options []PollOptionResponseData `json:"options"` - - OwnVotes []PollVoteResponseData `json:"own_votes"` - - Custom map[string]any `json:"custom"` - - LatestVotesByOption map[string][]PollVoteResponseData `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"` - - 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"` +type PollOptionResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + PollOption PollOptionResponseData `json:"poll_option"` +} - User *User `json:"user,omitempty"` +type PollOptionResponseData struct { + ID string `json:"id"` + Text string `json:"text"` + Custom map[string]any `json:"custom"` } -type PollVoteResponse struct { +type PollResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` + Duration string `json:"duration"` + Poll PollResponseData `json:"poll"` +} - Poll *PollResponseData `json:"poll,omitempty"` +type PollResponseData 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"` + VotingVisibility string `json:"voting_visibility"` + LatestAnswers []PollVoteResponseData `json:"latest_answers"` + Options []PollOptionResponseData `json:"options"` + OwnVotes []PollVoteResponseData `json:"own_votes"` + Custom map[string]any `json:"custom"` + LatestVotesByOption map[string][]PollVoteResponseData `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"` + CreatedBy *UserResponse `json:"created_by,omitempty"` +} - Vote *PollVoteResponseData `json:"vote,omitempty"` +type PollVoteResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + Poll *PollResponseData `json:"poll,omitempty"` + Vote *PollVoteResponseData `json:"vote,omitempty"` } type PollVoteResponseData 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 *UserResponse `json:"user,omitempty"` + 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 *UserResponse `json:"user,omitempty"` } type PollVotesResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Poll votes Votes []PollVoteResponseData `json:"votes"` - - Next *string `json:"next,omitempty"` - - 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"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type PrivacySettingsResponse struct { DeliveryReceipts *DeliveryReceiptsResponse `json:"delivery_receipts,omitempty"` - - ReadReceipts *ReadReceiptsResponse `json:"read_receipts,omitempty"` - + ReadReceipts *ReadReceiptsResponse `json:"read_receipts,omitempty"` TypingIndicators *TypingIndicatorsResponse `json:"typing_indicators,omitempty"` } type PublishedTrackFlags struct { - Audio bool `json:"audio"` - - Screenshare bool `json:"screenshare"` - + Audio bool `json:"audio"` + Screenshare bool `json:"screenshare"` ScreenshareAudio bool `json:"screenshare_audio"` - - Video bool `json:"video"` + Video bool `json:"video"` } type PublishedTrackMetrics struct { - Codec *string `json:"codec,omitempty"` - - TrackID *string `json:"track_id,omitempty"` - - TrackType *string `json:"track_type,omitempty"` - - Warnings []SessionWarningResponse `json:"warnings,omitempty"` - - Bitrate *MetricTimeSeries `json:"bitrate,omitempty"` - - Framerate *MetricTimeSeries `json:"framerate,omitempty"` - + Codec *string `json:"codec,omitempty"` + TrackID *string `json:"track_id,omitempty"` + TrackType *string `json:"track_type,omitempty"` + Warnings []SessionWarningResponse `json:"warnings,omitempty"` + Bitrate *MetricTimeSeries `json:"bitrate,omitempty"` + Framerate *MetricTimeSeries `json:"framerate,omitempty"` Resolution *ResolutionMetricsTimeSeries `json:"resolution,omitempty"` } type PublisherAllMetrics struct { - Audio *PublisherAudioMetrics `json:"audio,omitempty"` - + Audio *PublisherAudioMetrics `json:"audio,omitempty"` RttMs *ActiveCallsLatencyStats `json:"rtt_ms,omitempty"` - - Video *PublisherVideoMetrics `json:"video,omitempty"` + Video *PublisherVideoMetrics `json:"video,omitempty"` } type PublisherAudioMetrics struct { @@ -10481,23 +7950,17 @@ type PublisherAudioMetrics struct { } type PublisherStatsResponse struct { - Total int `json:"total"` - - Unique int `json:"unique"` - + Total int `json:"total"` + Unique int `json:"unique"` ByTrack []TrackStatsResponse `json:"by_track,omitempty"` } type PublisherVideoMetrics struct { - Bitrate *ActiveCallsBitrateStats `json:"bitrate,omitempty"` - - Fps30 *ActiveCallsFPSStats `json:"fps_30,omitempty"` - - FrameEncodingTimeMs *ActiveCallsLatencyStats `json:"frame_encoding_time_ms,omitempty"` - - JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` - - Resolution *ActiveCallsResolutionStats `json:"resolution,omitempty"` + Bitrate *ActiveCallsBitrateStats `json:"bitrate,omitempty"` + Fps30 *ActiveCallsFPSStats `json:"fps_30,omitempty"` + FrameEncodingTimeMs *ActiveCallsLatencyStats `json:"frame_encoding_time_ms,omitempty"` + JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` + Resolution *ActiveCallsResolutionStats `json:"resolution,omitempty"` } type PublishersMetrics struct { @@ -10505,215 +7968,167 @@ type PublishersMetrics struct { } type PushConfig struct { - Version string `json:"version"` - - OfflineOnly *bool `json:"offline_only,omitempty"` + Version string `json:"version"` + OfflineOnly *bool `json:"offline_only,omitempty"` } type PushNotificationConfig struct { // Whether push notifications are enabled for this feed group EnablePush *bool `json:"enable_push,omitempty"` - // List of notification types that should trigger push notifications (e.g., follow, comment, reaction, comment_reaction, mention) PushTypes []string `json:"push_types,omitempty"` } type PushNotificationFields struct { - OfflineOnly bool `json:"offline_only"` - - Version string `json:"version"` - - Apn APNConfigFields `json:"apn"` - - Firebase FirebaseConfigFields `json:"firebase"` - - Huawei HuaweiConfigFields `json:"huawei"` - - Xiaomi XiaomiConfigFields `json:"xiaomi"` - - Providers []PushProvider `json:"providers,omitempty"` + OfflineOnly bool `json:"offline_only"` + Version string `json:"version"` + Apn APNConfigFields `json:"apn"` + Firebase FirebaseConfigFields `json:"firebase"` + Huawei HuaweiConfigFields `json:"huawei"` + Xiaomi XiaomiConfigFields `json:"xiaomi"` + Providers []PushProvider `json:"providers,omitempty"` } type PushNotificationSettingsResponse struct { - Disabled *bool `json:"disabled,omitempty"` - + Disabled *bool `json:"disabled,omitempty"` DisabledUntil *Timestamp `json:"disabled_until,omitempty"` } type PushPreferenceInput struct { - // Set the level of call push notifications for the user. One of all, none, default + // Set the level of call push notifications for the user. One of: all, none, default CallLevel *string `json:"call_level,omitempty"` - // Set the push preferences for a specific channel. If empty it sets the default for the user ChannelCid *string `json:"channel_cid,omitempty"` - - // Set the level of chat push notifications for the user. One of all, mentions, none, default + // Set the level of chat push notifications for the user. Note: "mentions" is deprecated in favor of "direct_mentions". One of: all, mentions, direct_mentions, all_mentions, none, default ChatLevel *string `json:"chat_level,omitempty"` - // Disable push notifications till a certain time DisabledUntil *Timestamp `json:"disabled_until,omitempty"` - - // Set the level of feeds push notifications for the user. One of all, none, default + // Set the level of feeds push notifications for the user. One of: all, none, default FeedsLevel *string `json:"feeds_level,omitempty"` - // Remove the disabled until time. (IE stop snoozing notifications) RemoveDisable *bool `json:"remove_disable,omitempty"` - // The user id for which to set the push preferences. Required when using server side auths, defaults to current user with client side auth. - UserID *string `json:"user_id,omitempty"` - - 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"` - + UserID *string `json:"user_id,omitempty"` FeedsPreferences *FeedsPreferences `json:"feeds_preferences,omitempty"` } type PushPreferencesResponse 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"` - + 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 *FeedsPreferencesResponse `json:"feeds_preferences,omitempty"` } type PushProvider struct { - CreatedAt Timestamp `json:"created_at"` - - Name string `json:"name"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - ApnAuthKey *string `json:"apn_auth_key,omitempty"` - - ApnAuthType *string `json:"apn_auth_type,omitempty"` - - ApnDevelopment *bool `json:"apn_development,omitempty"` - - ApnHost *string `json:"apn_host,omitempty"` - - ApnKeyID *string `json:"apn_key_id,omitempty"` - - ApnNotificationTemplate *string `json:"apn_notification_template,omitempty"` - - ApnP12Cert *string `json:"apn_p12_cert,omitempty"` - - ApnTeamID *string `json:"apn_team_id,omitempty"` - - ApnTopic *string `json:"apn_topic,omitempty"` - - Description *string `json:"description,omitempty"` - - DisabledAt *Timestamp `json:"disabled_at,omitempty"` - - DisabledReason *string `json:"disabled_reason,omitempty"` - - FirebaseApnTemplate *string `json:"firebase_apn_template,omitempty"` - - FirebaseCredentials *string `json:"firebase_credentials,omitempty"` - - FirebaseDataTemplate *string `json:"firebase_data_template,omitempty"` - - FirebaseHost *string `json:"firebase_host,omitempty"` - - FirebaseNotificationTemplate *string `json:"firebase_notification_template,omitempty"` - - FirebaseServerKey *string `json:"firebase_server_key,omitempty"` - - HuaweiAppID *string `json:"huawei_app_id,omitempty"` - - HuaweiAppSecret *string `json:"huawei_app_secret,omitempty"` - - HuaweiHost *string `json:"huawei_host,omitempty"` - - XiaomiAppSecret *string `json:"xiaomi_app_secret,omitempty"` - - XiaomiPackageName *string `json:"xiaomi_package_name,omitempty"` - - PushTemplates []PushTemplate `json:"push_templates,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + Type string `json:"type"` + ApnAuthKey *string `json:"apn_auth_key,omitempty"` + ApnAuthType *string `json:"apn_auth_type,omitempty"` + ApnDevelopment *bool `json:"apn_development,omitempty"` + ApnHost *string `json:"apn_host,omitempty"` + ApnKeyID *string `json:"apn_key_id,omitempty"` + ApnNotificationTemplate *string `json:"apn_notification_template,omitempty"` + ApnP12Cert *string `json:"apn_p12_cert,omitempty"` + ApnTeamID *string `json:"apn_team_id,omitempty"` + ApnTopic *string `json:"apn_topic,omitempty"` + Description *string `json:"description,omitempty"` + DisabledAt *Timestamp `json:"disabled_at,omitempty"` + DisabledReason *string `json:"disabled_reason,omitempty"` + FirebaseApnTemplate *string `json:"firebase_apn_template,omitempty"` + FirebaseCredentials *string `json:"firebase_credentials,omitempty"` + FirebaseDataTemplate *string `json:"firebase_data_template,omitempty"` + FirebaseHost *string `json:"firebase_host,omitempty"` + FirebaseNotificationTemplate *string `json:"firebase_notification_template,omitempty"` + FirebaseServerKey *string `json:"firebase_server_key,omitempty"` + HuaweiAppID *string `json:"huawei_app_id,omitempty"` + HuaweiAppSecret *string `json:"huawei_app_secret,omitempty"` + HuaweiHost *string `json:"huawei_host,omitempty"` + XiaomiAppSecret *string `json:"xiaomi_app_secret,omitempty"` + XiaomiPackageName *string `json:"xiaomi_package_name,omitempty"` + PushTemplates []PushTemplate `json:"push_templates,omitempty"` +} + +type PushProviderRequest struct { + Name string `json:"name"` + ApnAuthKey *string `json:"apn_auth_key,omitempty"` + ApnAuthType *string `json:"apn_auth_type,omitempty"` + ApnDevelopment *bool `json:"apn_development,omitempty"` + ApnHost *string `json:"apn_host,omitempty"` + ApnKeyID *string `json:"apn_key_id,omitempty"` + ApnNotificationTemplate *string `json:"apn_notification_template,omitempty"` + ApnP12Cert *string `json:"apn_p12_cert,omitempty"` + ApnTeamID *string `json:"apn_team_id,omitempty"` + ApnTopic *string `json:"apn_topic,omitempty"` + Description *string `json:"description,omitempty"` + DisabledAt *Timestamp `json:"disabled_at,omitempty"` + DisabledReason *string `json:"disabled_reason,omitempty"` + FirebaseApnTemplate *string `json:"firebase_apn_template,omitempty"` + FirebaseCredentials *string `json:"firebase_credentials,omitempty"` + FirebaseDataTemplate *string `json:"firebase_data_template,omitempty"` + FirebaseHost *string `json:"firebase_host,omitempty"` + FirebaseNotificationTemplate *string `json:"firebase_notification_template,omitempty"` + FirebaseServerKey *string `json:"firebase_server_key,omitempty"` + HuaweiAppID *string `json:"huawei_app_id,omitempty"` + HuaweiAppSecret *string `json:"huawei_app_secret,omitempty"` + XiaomiAppSecret *string `json:"xiaomi_app_secret,omitempty"` + XiaomiPackageName *string `json:"xiaomi_package_name,omitempty"` + Type *string `json:"type,omitempty"` } type PushProviderResponse struct { - CreatedAt Timestamp `json:"created_at"` - - Name string `json:"name"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - ApnAuthKey *string `json:"apn_auth_key,omitempty"` - - ApnAuthType *string `json:"apn_auth_type,omitempty"` - - ApnDevelopment *bool `json:"apn_development,omitempty"` - - ApnHost *string `json:"apn_host,omitempty"` - - ApnKeyID *string `json:"apn_key_id,omitempty"` - - ApnP12Cert *string `json:"apn_p12_cert,omitempty"` - - ApnSandboxCertificate *bool `json:"apn_sandbox_certificate,omitempty"` - - ApnSupportsRemoteNotifications *bool `json:"apn_supports_remote_notifications,omitempty"` - - ApnSupportsVoipNotifications *bool `json:"apn_supports_voip_notifications,omitempty"` - - ApnTeamID *string `json:"apn_team_id,omitempty"` - - ApnTopic *string `json:"apn_topic,omitempty"` - - Description *string `json:"description,omitempty"` - - DisabledAt *Timestamp `json:"disabled_at,omitempty"` - - DisabledReason *string `json:"disabled_reason,omitempty"` - - FirebaseApnTemplate *string `json:"firebase_apn_template,omitempty"` - - FirebaseCredentials *string `json:"firebase_credentials,omitempty"` - - FirebaseDataTemplate *string `json:"firebase_data_template,omitempty"` - - FirebaseHost *string `json:"firebase_host,omitempty"` - - FirebaseNotificationTemplate *string `json:"firebase_notification_template,omitempty"` - - FirebaseServerKey *string `json:"firebase_server_key,omitempty"` - - HuaweiAppID *string `json:"huawei_app_id,omitempty"` - - HuaweiAppSecret *string `json:"huawei_app_secret,omitempty"` - - XiaomiAppSecret *string `json:"xiaomi_app_secret,omitempty"` - - XiaomiPackageName *string `json:"xiaomi_package_name,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + Type string `json:"type"` + ApnAuthKey *string `json:"apn_auth_key,omitempty"` + ApnAuthType *string `json:"apn_auth_type,omitempty"` + ApnDevelopment *bool `json:"apn_development,omitempty"` + ApnHost *string `json:"apn_host,omitempty"` + ApnKeyID *string `json:"apn_key_id,omitempty"` + ApnP12Cert *string `json:"apn_p12_cert,omitempty"` + ApnSandboxCertificate *bool `json:"apn_sandbox_certificate,omitempty"` + ApnSupportsRemoteNotifications *bool `json:"apn_supports_remote_notifications,omitempty"` + ApnSupportsVoipNotifications *bool `json:"apn_supports_voip_notifications,omitempty"` + ApnTeamID *string `json:"apn_team_id,omitempty"` + ApnTopic *string `json:"apn_topic,omitempty"` + Description *string `json:"description,omitempty"` + DisabledAt *Timestamp `json:"disabled_at,omitempty"` + DisabledReason *string `json:"disabled_reason,omitempty"` + FirebaseApnTemplate *string `json:"firebase_apn_template,omitempty"` + FirebaseCredentials *string `json:"firebase_credentials,omitempty"` + FirebaseDataTemplate *string `json:"firebase_data_template,omitempty"` + FirebaseHost *string `json:"firebase_host,omitempty"` + FirebaseNotificationTemplate *string `json:"firebase_notification_template,omitempty"` + FirebaseServerKey *string `json:"firebase_server_key,omitempty"` + HuaweiAppID *string `json:"huawei_app_id,omitempty"` + HuaweiAppSecret *string `json:"huawei_app_secret,omitempty"` + XiaomiAppSecret *string `json:"xiaomi_app_secret,omitempty"` + XiaomiPackageName *string `json:"xiaomi_package_name,omitempty"` } type PushTemplate struct { - CreatedAt Timestamp `json:"created_at"` + CreatedAt Timestamp `json:"created_at"` + EnablePush bool `json:"enable_push"` + EventType string `json:"event_type"` + UpdatedAt Timestamp `json:"updated_at"` + 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"` - + // Internal ID of the push provider + PushProviderInternalID string `json:"push_provider_internal_id"` + // Time when the template was last updated UpdatedAt Timestamp `json:"updated_at"` - + // The push notification template Template *string `json:"template,omitempty"` } @@ -10727,13 +8142,10 @@ type QualityScoreReportResponse struct { type QueryActivitiesResponse struct { Duration string `json:"duration"` - // List of activities matching the query Activities []ActivityResponse `json:"activities"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } @@ -10741,96 +8153,70 @@ type QueryActivitiesResponse struct { // Basic response information type QueryActivityReactionsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Reactions []FeedsReactionResponse `json:"reactions"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryAggregateCallStatsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - CallDurationReport *CallDurationReportResponse `json:"call_duration_report,omitempty"` - + Duration string `json:"duration"` + CallDurationReport *CallDurationReportResponse `json:"call_duration_report,omitempty"` CallParticipantCountReport *CallParticipantCountReportResponse `json:"call_participant_count_report,omitempty"` - - CallsPerDayReport *CallsPerDayReportResponse `json:"calls_per_day_report,omitempty"` - - NetworkMetricsReport *NetworkMetricsReportResponse `json:"network_metrics_report,omitempty"` - - QualityScoreReport *QualityScoreReportResponse `json:"quality_score_report,omitempty"` - - SdkUsageReport *SDKUsageReportResponse `json:"sdk_usage_report,omitempty"` - - UserFeedbackReport *UserFeedbackReportResponse `json:"user_feedback_report,omitempty"` + CallsPerDayReport *CallsPerDayReportResponse `json:"calls_per_day_report,omitempty"` + NetworkMetricsReport *NetworkMetricsReportResponse `json:"network_metrics_report,omitempty"` + QualityScoreReport *QualityScoreReportResponse `json:"quality_score_report,omitempty"` + SdkUsageReport *SDKUsageReportResponse `json:"sdk_usage_report,omitempty"` + UserFeedbackReport *UserFeedbackReportResponse `json:"user_feedback_report,omitempty"` } type QueryAppealsResponse struct { Duration string `json:"duration"` - // List of Appeal Items Items []AppealItemResponse `json:"items"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryBannedUsersPayload struct { FilterConditions map[string]any `json:"filter_conditions"` - // Whether to exclude expired bans or not ExcludeExpiredBans *bool `json:"exclude_expired_bans,omitempty"` - // Number of records to return Limit *int `json:"limit,omitempty"` - // Number of records to offset - Offset *int `json:"offset,omitempty"` - + Offset *int `json:"offset,omitempty"` UserID *string `json:"user_id,omitempty"` - // Array of sort parameters Sort []SortParamRequest `json:"sort,omitempty"` - - User *UserRequest `json:"user,omitempty"` + User *UserRequest `json:"user,omitempty"` } type QueryBannedUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // List of found bans Bans []BanResponse `json:"bans"` } type QueryBookmarkFoldersResponse struct { Duration string `json:"duration"` - // List of bookmark folders matching the query BookmarkFolders []BookmarkFolderResponse `json:"bookmark_folders"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } type QueryBookmarksResponse struct { Duration string `json:"duration"` - // List of bookmarks matching the query Bookmarks []BookmarkResponse `json:"bookmarks"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } @@ -10838,196 +8224,133 @@ type QueryBookmarksResponse struct { // Basic response information type QueryCallMembersResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Members []MemberResponse `json:"members"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Duration string `json:"duration"` + Members []MemberResponse `json:"members"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryCallParticipantSessionsResponse struct { - CallID string `json:"call_id"` - - CallSessionID string `json:"call_session_id"` - - CallType string `json:"call_type"` - - // Duration of the request in milliseconds - Duration int `json:"duration"` - - TotalParticipantDuration int `json:"total_participant_duration"` - - TotalParticipantSessions int `json:"total_participant_sessions"` - - ParticipantsSessions []ParticipantSessionDetails `json:"participants_sessions"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` - - Session *CallSessionResponse `json:"session,omitempty"` -} - -type QueryCallParticipantsResponse struct { - Duration string `json:"duration"` - - TotalParticipants int `json:"total_participants"` - - Members []MemberResponse `json:"members"` - - OwnCapabilities []OwnCapability `json:"own_capabilities"` - - // List of call participants - Participants []CallParticipantResponse `json:"participants"` - - Call CallResponse `json:"call"` -} - -// Basic response information -type QueryCallSessionParticipantStatsResponse struct { - CallID string `json:"call_id"` - - CallSessionID string `json:"call_session_id"` - - CallType string `json:"call_type"` - - // Duration of the request in milliseconds - Duration string `json:"duration"` - - Participants []CallStatsParticipant `json:"participants"` - - Counts CallStatsParticipantCounts `json:"counts"` - - CallEndedAt *Timestamp `json:"call_ended_at,omitempty"` - - CallStartedAt *Timestamp `json:"call_started_at,omitempty"` - - Next *string `json:"next,omitempty"` + CallID string `json:"call_id"` + CallSessionID string `json:"call_session_id"` + CallType string `json:"call_type"` + // Duration of the request in milliseconds + Duration int `json:"duration"` + TotalParticipantDuration int `json:"total_participant_duration"` + TotalParticipantSessions int `json:"total_participant_sessions"` + ParticipantsSessions []ParticipantSessionDetails `json:"participants_sessions"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` + Session *CallSessionResponse `json:"session,omitempty"` +} - Prev *string `json:"prev,omitempty"` +type QueryCallParticipantsResponse struct { + Duration string `json:"duration"` + TotalParticipants int `json:"total_participants"` + Members []MemberResponse `json:"members"` + OwnCapabilities []OwnCapability `json:"own_capabilities"` + // List of call participants + Participants []CallParticipantResponse `json:"participants"` + Call CallResponse `json:"call"` +} - TmpDataSource *string `json:"tmp_data_source,omitempty"` +// Basic response information +type QueryCallSessionParticipantStatsResponse struct { + CallID string `json:"call_id"` + CallSessionID string `json:"call_session_id"` + CallType string `json:"call_type"` + // Duration of the request in milliseconds + Duration string `json:"duration"` + Participants []CallStatsParticipant `json:"participants"` + Counts CallStatsParticipantCounts `json:"counts"` + CallEndedAt *Timestamp `json:"call_ended_at,omitempty"` + CallStartedAt *Timestamp `json:"call_started_at,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` + TmpDataSource *string `json:"tmp_data_source,omitempty"` } // Basic response information type QueryCallSessionParticipantStatsTimelineResponse struct { - CallID string `json:"call_id"` - + CallID string `json:"call_id"` CallSessionID string `json:"call_session_id"` - - CallType string `json:"call_type"` - + CallType string `json:"call_type"` // Duration of the request in milliseconds - Duration string `json:"duration"` - - UserID string `json:"user_id"` - - UserSessionID string `json:"user_session_id"` - - Events []CallParticipantTimeline `json:"events"` + Duration string `json:"duration"` + UserID string `json:"user_id"` + UserSessionID string `json:"user_session_id"` + Events []CallParticipantTimeline `json:"events"` } // Basic response information type QueryCallStatsMapResponse struct { - CallID string `json:"call_id"` - + CallID string `json:"call_id"` CallSessionID string `json:"call_session_id"` - - CallType string `json:"call_type"` - + CallType string `json:"call_type"` // Duration of the request in milliseconds - Duration string `json:"duration"` - - Counts CallStatsParticipantCounts `json:"counts"` - - CallEndedAt *Timestamp `json:"call_ended_at,omitempty"` - - CallStartedAt *Timestamp `json:"call_started_at,omitempty"` - - DataSource *string `json:"data_source,omitempty"` - - EndTime *Timestamp `json:"end_time,omitempty"` - - GeneratedAt *Timestamp `json:"generated_at,omitempty"` - - StartTime *Timestamp `json:"start_time,omitempty"` - - Publishers *CallStatsMapPublishers `json:"publishers,omitempty"` - - Sfus *CallStatsMapSFUs `json:"sfus,omitempty"` - - Subscribers *CallStatsMapSubscribers `json:"subscribers,omitempty"` + Duration string `json:"duration"` + Counts CallStatsParticipantCounts `json:"counts"` + CallEndedAt *Timestamp `json:"call_ended_at,omitempty"` + CallStartedAt *Timestamp `json:"call_started_at,omitempty"` + DataSource *string `json:"data_source,omitempty"` + EndTime *Timestamp `json:"end_time,omitempty"` + GeneratedAt *Timestamp `json:"generated_at,omitempty"` + StartTime *Timestamp `json:"start_time,omitempty"` + Publishers *CallStatsMapPublishers `json:"publishers,omitempty"` + Sfus *CallStatsMapSFUs `json:"sfus,omitempty"` + Subscribers *CallStatsMapSubscribers `json:"subscribers,omitempty"` } // Basic response information type QueryCallStatsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Reports []CallStatsReportSummaryResponse `json:"reports"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Duration string `json:"duration"` + Reports []CallStatsReportSummaryResponse `json:"reports"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryCallsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Calls []CallStateResponseFields `json:"calls"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Duration string `json:"duration"` + Calls []CallStateResponseFields `json:"calls"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryCampaignsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Campaigns []CampaignResponse `json:"campaigns"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryChannelsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // List of channels - Channels []ChannelStateResponseFields `json:"channels"` - + Channels []ChannelStateResponseFields `json:"channels"` PredefinedFilter *ParsedPredefinedFilterResponse `json:"predefined_filter,omitempty"` } // Basic response information type QueryCommentReactionsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Reactions []FeedsReactionResponse `json:"reactions"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryCommentsResponse struct { Duration string `json:"duration"` - // List of comments matching the query Comments []CommentResponse `json:"comments"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } @@ -11035,24 +8358,18 @@ type QueryCommentsResponse struct { type QueryDraftsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Drafts Drafts []DraftResponse `json:"drafts"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryFeedMembersResponse struct { Duration string `json:"duration"` - // List of feed members Members []FeedMemberResponse `json:"members"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } @@ -11060,57 +8377,43 @@ type QueryFeedMembersResponse struct { type QueryFeedModerationTemplate struct { // When the template was created CreatedAt Timestamp `json:"created_at"` - // Name of the moderation template Name string `json:"name"` - // When the template was last updated - UpdatedAt Timestamp `json:"updated_at"` - - Config *FeedsModerationTemplateConfig `json:"config,omitempty"` + UpdatedAt Timestamp `json:"updated_at"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type QueryFeedModerationTemplatesResponse struct { Duration string `json:"duration"` - // List of moderation templates Templates []QueryFeedModerationTemplate `json:"templates"` } type QueryFeedsResponse struct { Duration string `json:"duration"` - // List of feeds matching the query Feeds []FeedResponse `json:"feeds"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } type QueryFeedsUsageStatsResponse struct { - Duration string `json:"duration"` - - APIRequests DailyMetricStatsResponse `json:"api_requests"` - - Activities DailyMetricStatsResponse `json:"activities"` - - Follows DailyMetricStatsResponse `json:"follows"` - + Duration string `json:"duration"` + APIRequests DailyMetricStatsResponse `json:"api_requests"` + Activities DailyMetricStatsResponse `json:"activities"` + Follows DailyMetricStatsResponse `json:"follows"` OpenaiRequests DailyMetricStatsResponse `json:"openai_requests"` } type QueryFollowsResponse struct { Duration string `json:"duration"` - // List of follow relationships matching the query Follows []FollowResponse `json:"follows"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } @@ -11118,84 +8421,60 @@ type QueryFollowsResponse struct { type QueryFutureChannelBansPayload struct { // Whether to exclude expired bans or not ExcludeExpiredBans *bool `json:"exclude_expired_bans,omitempty"` - // Number of records to return Limit *int `json:"limit,omitempty"` - // Number of records to offset Offset *int `json:"offset,omitempty"` - // Filter by the target user ID. For server-side requests only. - TargetUserID *string `json:"target_user_id,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - User *UserRequest `json:"user,omitempty"` + TargetUserID *string `json:"target_user_id,omitempty"` + UserID *string `json:"user_id,omitempty"` + User *UserRequest `json:"user,omitempty"` } type QueryFutureChannelBansResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // List of found future channel bans Bans []FutureChannelBanResponse `json:"bans"` } // Client request type QueryMembersPayload struct { - Type string `json:"type"` - - FilterConditions map[string]any `json:"filter_conditions"` - - ID *string `json:"id,omitempty"` - - Limit *int `json:"limit,omitempty"` - - Offset *int `json:"offset,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - Members []ChannelMemberRequest `json:"members,omitempty"` - - Sort []SortParamRequest `json:"sort,omitempty"` - - User *UserRequest `json:"user,omitempty"` + Type string `json:"type"` + FilterConditions map[string]any `json:"filter_conditions"` + ID *string `json:"id,omitempty"` + Limit *int `json:"limit,omitempty"` + Offset *int `json:"offset,omitempty"` + UserID *string `json:"user_id,omitempty"` + Members []ChannelMemberRequest `json:"members,omitempty"` + Sort []SortParamRequest `json:"sort,omitempty"` + User *UserRequest `json:"user,omitempty"` } type QueryMembershipLevelsResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` MembershipLevels []MembershipLevelResponse `json:"membership_levels"` - // Cursor for next page Next *string `json:"next,omitempty"` - // Cursor for previous page Prev *string `json:"prev,omitempty"` } type QueryMessageFlagsPayload struct { - Limit *int `json:"limit,omitempty"` - + Limit *int `json:"limit,omitempty"` Offset *int `json:"offset,omitempty"` - // Whether to include deleted messages in the results - ShowDeletedMessages *bool `json:"show_deleted_messages,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - Sort []SortParamRequest `json:"sort,omitempty"` - - FilterConditions map[string]any `json:"filter_conditions,omitempty"` - - User *UserRequest `json:"user,omitempty"` + ShowDeletedMessages *bool `json:"show_deleted_messages,omitempty"` + UserID *string `json:"user_id,omitempty"` + Sort []SortParamRequest `json:"sort,omitempty"` + FilterConditions map[string]any `json:"filter_conditions,omitempty"` + User *UserRequest `json:"user,omitempty"` } // Query message flags response type QueryMessageFlagsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // The flags that match the query Flags []MessageFlagResponse `json:"flags"` } @@ -11203,188 +8482,162 @@ type QueryMessageFlagsResponse struct { type QueryMessageHistoryResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Message history entries MessageHistory []MessageHistoryEntryResponse `json:"message_history"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryModerationConfigsResponse struct { Duration string `json:"duration"` - // List of moderation configurations Configs []ConfigResponse `json:"configs"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryModerationFlagsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Flags []ModerationFlagResponse `json:"flags"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Duration string `json:"duration"` + Flags []ModerationFlagResponse `json:"flags"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryModerationLogsResponse struct { Duration string `json:"duration"` - // List of moderation action logs Logs []ActionLogResponse `json:"logs"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryModerationRulesResponse struct { Duration string `json:"duration"` - + // Available harm labels for closed caption rules + ClosedCaptionLabels []string `json:"closed_caption_labels"` + // Available harm labels for keyframe rules + KeyframeLabels []string `json:"keyframe_labels"` // List of moderation rules Rules []ModerationRuleV2Response `json:"rules"` - // Default LLM label descriptions DefaultLlmLabels map[string]string `json:"default_llm_labels"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` +} +type QueryPinnedActivitiesResponse struct { + Duration string `json:"duration"` + // List of pinned activities matching the query + PinnedActivities []ActivityPinResponse `json:"pinned_activities"` + // Cursor for next page Next *string `json:"next,omitempty"` - + // Cursor for previous page Prev *string `json:"prev,omitempty"` } type QueryPollsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Polls data returned by the query Polls []PollResponseData `json:"polls"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryReactionsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Reactions []ReactionResponse `json:"reactions"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryRemindersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // MessageReminders data returned by the query Reminders []ReminderResponseData `json:"reminders"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QueryReviewQueueResponse struct { Duration string `json:"duration"` - // List of review queue items 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"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` - + Stats map[string]any `json:"stats"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` FilterConfig *FilterConfigResponse `json:"filter_config,omitempty"` } type QuerySegmentTargetsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Targets Targets []SegmentTargetResponse `json:"targets"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } type QuerySegmentsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Segments Segments []SegmentResponse `json:"segments"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` +} +// Response containing team-level usage statistics +type QueryTeamUsageStatsResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + // Array of team usage statistics + Teams []TeamUsageStats `json:"teams"` + // Cursor for pagination to fetch next page Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` } type QueryThreadsResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // List of enriched thread states Threads []ThreadStateResponse `json:"threads"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } // Basic response information type QueryUserFeedbackResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` UserFeedback []UserFeedbackResponse `json:"user_feedback"` - - Next *string `json:"next,omitempty"` - - Prev *string `json:"prev,omitempty"` + Next *string `json:"next,omitempty"` + Prev *string `json:"prev,omitempty"` } +// Client request type QueryUsersPayload struct { - FilterConditions map[string]any `json:"filter_conditions"` - - IncludeDeactivatedUsers *bool `json:"include_deactivated_users,omitempty"` - - Limit *int `json:"limit,omitempty"` - - Offset *int `json:"offset,omitempty"` - - Presence *bool `json:"presence,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - Sort []SortParamRequest `json:"sort,omitempty"` - - User *UserRequest `json:"user,omitempty"` + FilterConditions map[string]any `json:"filter_conditions"` + IncludeDeactivatedUsers *bool `json:"include_deactivated_users,omitempty"` + Limit *int `json:"limit,omitempty"` + Offset *int `json:"offset,omitempty"` + Presence *bool `json:"presence,omitempty"` + UserID *string `json:"user_id,omitempty"` + Sort []SortParamRequest `json:"sort,omitempty"` + User *UserRequest `json:"user,omitempty"` } type QueryUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // Array of users as result of filters applied. Users []FullUserResponse `json:"users"` } @@ -11393,17 +8646,13 @@ type QueryUsersResponse struct { type RTMPBroadcastRequest struct { // Name identifier for RTMP broadcast, must be unique in call Name string `json:"name"` - // URL for the RTMP server to send the call to StreamUrl string `json:"stream_url"` - - // If provided, will override the call's RTMP settings quality + // If provided, will override the call's RTMP settings quality. One of: 360p, 480p, 720p, 1080p, 1440p, portrait-360x640, portrait-480x854, portrait-720x1280, portrait-1080x1920, portrait-1440x2560 Quality *string `json:"quality,omitempty"` - // If provided, will be appended at the end of stream_url - StreamKey *string `json:"stream_key,omitempty"` - - Layout *LayoutSettingsRequest `json:"layout,omitempty"` + StreamKey *string `json:"stream_key,omitempty"` + Layout *LayoutSettingsRequest `json:"layout,omitempty"` } // RTMP input settings @@ -11412,51 +8661,40 @@ type RTMPIngress struct { } type RTMPLocation struct { - Name string `json:"name"` - + Name string `json:"name"` StreamKey string `json:"stream_key"` - StreamUrl string `json:"stream_url"` } type RTMPSettings struct { - Enabled bool `json:"enabled"` - - QualityName *string `json:"quality_name,omitempty"` - - Layout *LayoutSettings `json:"layout,omitempty"` - - Location *RTMPLocation `json:"location,omitempty"` + Enabled bool `json:"enabled"` + QualityName *string `json:"quality_name,omitempty"` + Layout *LayoutSettings `json:"layout,omitempty"` + Location *RTMPLocation `json:"location,omitempty"` } type RTMPSettingsRequest struct { + // Whether RTMP broadcasting is enabled Enabled *bool `json:"enabled,omitempty"` - - // Resolution to set for the RTMP stream - Quality *string `json:"quality,omitempty"` - - Layout *LayoutSettingsRequest `json:"layout,omitempty"` + // Resolution to set for the RTMP stream. One of: 360p, 480p, 720p, 1080p, 1440p, portrait-360x640, portrait-480x854, portrait-720x1280, portrait-1080x1920, portrait-1440x2560 + Quality *string `json:"quality,omitempty"` + Layout *LayoutSettingsRequest `json:"layout,omitempty"` } // RTMPSettingsResponse is the payload for RTMP settings type RTMPSettingsResponse struct { - Enabled bool `json:"enabled"` - - Quality string `json:"quality"` - - Layout LayoutSettingsResponse `json:"layout"` + Enabled bool `json:"enabled"` + Quality string `json:"quality"` + Layout LayoutSettingsResponse `json:"layout"` } type RankingConfig struct { - // Type of ranking algorithm. Required. Must be one of: expression, interest + // Type of ranking algorithm. Required. One of: expression, interest Type string `json:"type"` - // Scoring formula. Required when type is 'expression' or 'interest' Score *string `json:"score,omitempty"` - // Default values for ranking Defaults map[string]any `json:"defaults,omitempty"` - // Decay functions configuration Functions map[string]DecayFunctionConfig `json:"functions,omitempty"` } @@ -11470,192 +8708,200 @@ type RawRecordingResponse struct { } type RawRecordingSettingsRequest struct { + // Recording mode. One of: available, disabled, auto-on Mode string `json:"mode"` } type RawRecordingSettingsResponse struct { - Mode string `json:"mode"` -} - -type Reaction struct { - CreatedAt Timestamp `json:"created_at"` - - MessageID string `json:"message_id"` - - Score int `json:"score"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - Custom map[string]any `json:"custom"` - - UserID *string `json:"user_id,omitempty"` - - User *User `json:"user,omitempty"` + Mode string `json:"mode"` } +type Reaction struct { + ActivityID string `json:"activity_id"` + CreatedAt Timestamp `json:"created_at"` + Kind string `json:"kind"` + UpdatedAt Timestamp `json:"updated_at"` + 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"` + OwnChildren map[string][]Reaction `json:"own_children,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"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + 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"` - - Message *Message `json:"message,omitempty"` - - Reaction *Reaction `json:"reaction,omitempty"` - - User *User `json:"user,omitempty"` + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ReactionDeletedEvent) GetEventType() string { - return "reaction.deleted" +func (e *ReactionDeletedEvent) GetEventType() string { + return e.Type } // ReactionGroupResponse contains all information about a reaction of the same type. type ReactionGroupResponse struct { // Count is the number of reactions of this type. Count int `json:"count"` - // FirstReactionAt is the time of the first reaction of this type. This is the same also if all reaction of this type are deleted, because if someone will react again with the same type, will be preserved the sorting. FirstReactionAt Timestamp `json:"first_reaction_at"` - // LastReactionAt is the time of the last reaction of this type. LastReactionAt Timestamp `json:"last_reaction_at"` - // SumScores is the sum of all scores of reactions of this type. Medium allows you to clap articles more than once and shows the sum of all claps from all users. For example, you can send `clap` x5 using `score: 5`. 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"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Channel ChannelResponse `json:"channel"` + 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"` - - Message *Message `json:"message,omitempty"` - - Reaction *Reaction `json:"reaction,omitempty"` - - User *User `json:"user,omitempty"` + // The participants of the thread + ThreadParticipants []UserResponseCommonFields `json:"thread_participants,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ReactionNewEvent) GetEventType() string { - return "reaction.new" +func (e *ReactionNewEvent) GetEventType() string { + return e.Type } // Represents user reaction to a message type ReactionRequest struct { // The type of reaction (e.g. 'like', 'laugh', 'wow') Type string `json:"type"` - // Date/time of creation CreatedAt *Timestamp `json:"created_at,omitempty"` - // Reaction score. If not specified reaction has score of 1 Score *int `json:"score,omitempty"` - // Date/time of the last update - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - User *UserRequest `json:"user,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + UserID *string `json:"user_id,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + User *UserRequest `json:"user,omitempty"` } type ReactionResponse struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Message ID MessageID string `json:"message_id"` - // Score of the reaction Score int `json:"score"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // User ID UserID string `json:"user_id"` - // Type of reaction Type string `json:"type"` - // Custom data for this object Custom map[string]any `json:"custom"` - - User UserResponse `json:"user"` + 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"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Message Message `json:"message"` - - Reaction Reaction `json:"reaction"` - - Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - User *User `json:"user,omitempty"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + Channel ChannelResponse `json:"channel"` + Custom map[string]any `json:"custom"` + 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*ReactionUpdatedEvent) GetEventType() string { - return "reaction.updated" +func (e *ReactionUpdatedEvent) GetEventType() string { + return e.Type } type ReactivateUserResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - User *UserResponse `json:"user,omitempty"` + Duration string `json:"duration"` + User *UserResponse `json:"user,omitempty"` } // Basic response information type ReactivateUsersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - - TaskID string `json:"task_id"` + TaskID string `json:"task_id"` } type ReadCollectionsResponse struct { Duration string `json:"duration"` - // List of collections matching the query Collections []CollectionResponse `json:"collections"` -} - -type ReadReceipts struct { - Enabled *bool `json:"enabled,omitempty"` + // Cursor for next page (when listing without collection_refs) + Next *string `json:"next,omitempty"` + // Cursor for previous page (when listing without collection_refs) + Prev *string `json:"prev,omitempty"` } type ReadReceiptsResponse struct { @@ -11663,259 +8909,201 @@ type ReadReceiptsResponse struct { } type ReadStateResponse struct { - LastRead Timestamp `json:"last_read"` - - UnreadMessages int `json:"unread_messages"` - - User UserResponse `json:"user"` - - LastDeliveredAt *Timestamp `json:"last_delivered_at,omitempty"` - - LastDeliveredMessageID *string `json:"last_delivered_message_id,omitempty"` - - LastReadMessageID *string `json:"last_read_message_id,omitempty"` + LastRead Timestamp `json:"last_read"` + UnreadMessages int `json:"unread_messages"` + User UserResponse `json:"user"` + LastDeliveredAt *Timestamp `json:"last_delivered_at,omitempty"` + LastDeliveredMessageID *string `json:"last_delivered_message_id,omitempty"` + LastReadMessageID *string `json:"last_read_message_id,omitempty"` } type RecordSettings struct { - Mode string `json:"mode"` - - AudioOnly *bool `json:"audio_only,omitempty"` - - Quality *string `json:"quality,omitempty"` - - Layout *LayoutSettings `json:"layout,omitempty"` + Mode string `json:"mode"` + AudioOnly *bool `json:"audio_only,omitempty"` + Quality *string `json:"quality,omitempty"` + Layout *LayoutSettings `json:"layout,omitempty"` } type RecordSettingsRequest struct { + // Recording mode. One of: available, disabled, auto-on Mode string `json:"mode"` - + // Whether to record audio only AudioOnly *bool `json:"audio_only,omitempty"` - - Quality *string `json:"quality,omitempty"` - - Layout *LayoutSettingsRequest `json:"layout,omitempty"` + // Recording quality. One of: 360p, 480p, 720p, 1080p, 1440p, portrait-360x640, portrait-480x854, portrait-720x1280, portrait-1080x1920, portrait-1440x2560 + Quality *string `json:"quality,omitempty"` + Layout *LayoutSettingsRequest `json:"layout,omitempty"` } // RecordSettings is the payload for recording settings type RecordSettingsResponse struct { - AudioOnly bool `json:"audio_only"` - - Mode string `json:"mode"` - - Quality string `json:"quality"` - - Layout LayoutSettingsResponse `json:"layout"` + AudioOnly bool `json:"audio_only"` + Mode string `json:"mode"` + Quality string `json:"quality"` + Layout LayoutSettingsResponse `json:"layout"` } -type RejectAppealRequest struct { +// Configuration for rejecting an appeal +type RejectAppealRequestPayload struct { + // Reason for rejecting the appeal DecisionReason string `json:"decision_reason"` } type RejectFeedMemberInviteResponse struct { - Duration string `json:"duration"` - - Member FeedMemberResponse `json:"member"` + Duration string `json:"duration"` + Member FeedMemberResponse `json:"member"` } type RejectFollowResponse struct { - Duration string `json:"duration"` - - Follow FollowResponse `json:"follow"` + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` } // Emitted when a reminder is created. type ReminderCreatedEvent struct { // The CID of the Channel for which the reminder was created Cid string `json:"cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the message for which the reminder was created MessageID string `json:"message_id"` - // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Custom map[string]any `json:"custom"` - // The type of event: "reminder.created" in this case Type string `json:"type"` - // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` } -func (*ReminderCreatedEvent) GetEventType() string { - return "reminder.created" +func (e *ReminderCreatedEvent) GetEventType() string { + return e.Type } // Emitted when a reminder is deleted. type ReminderDeletedEvent struct { // The CID of the Channel for which the reminder was created Cid string `json:"cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the message for which the reminder was created MessageID string `json:"message_id"` - // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Custom map[string]any `json:"custom"` - // The type of event: "reminder.deleted" in this case Type string `json:"type"` - // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` } -func (*ReminderDeletedEvent) GetEventType() string { - return "reminder.deleted" +func (e *ReminderDeletedEvent) GetEventType() string { + return e.Type } // Emitted when a reminder becomes due, triggering a notification for the user. type ReminderNotificationEvent struct { // The CID of the Channel for which the reminder was created Cid string `json:"cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the message for which the reminder was created MessageID string `json:"message_id"` - // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Custom map[string]any `json:"custom"` - // The type of event: "notification.reminder_due" in this case - Type string `json:"type"` - - ParentID *string `json:"parent_id,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - - Reminder *ReminderResponseData `json:"reminder,omitempty"` + Type string `json:"type"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` } -func (*ReminderNotificationEvent) GetEventType() string { - return "notification.reminder_due" +func (e *ReminderNotificationEvent) GetEventType() string { + return e.Type } type ReminderResponseData struct { - ChannelCid string `json:"channel_cid"` - - CreatedAt Timestamp `json:"created_at"` - - MessageID string `json:"message_id"` - - UpdatedAt Timestamp `json:"updated_at"` - - UserID string `json:"user_id"` - - RemindAt *Timestamp `json:"remind_at,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` - - User *UserResponse `json:"user,omitempty"` + ChannelCid string `json:"channel_cid"` + CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + UpdatedAt Timestamp `json:"updated_at"` + UserID string `json:"user_id"` + RemindAt *Timestamp `json:"remind_at,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + User *UserResponse `json:"user,omitempty"` } // Emitted when a reminder is updated. type ReminderUpdatedEvent struct { // The CID of the Channel for which the reminder was created Cid string `json:"cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the message for which the reminder was created MessageID string `json:"message_id"` - // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Custom map[string]any `json:"custom"` - // The type of event: "reminder.updated" in this case Type string `json:"type"` - // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` +} - Reminder *ReminderResponseData `json:"reminder,omitempty"` +func (e *ReminderUpdatedEvent) GetEventType() string { + return e.Type } -func (*ReminderUpdatedEvent) GetEventType() string { - return "reminder.updated" +// Response for removing members from a user group +type RemoveUserGroupMembersResponse struct { + Duration string `json:"duration"` + UserGroup *UserGroupResponse `json:"user_group,omitempty"` } // Cursor & depth information for a comment's direct replies. Mirrors Reddit's 'load more replies' semantics. type RepliesMeta struct { // True if the subtree was cut because the requested depth was reached. DepthTruncated bool `json:"depth_truncated"` - // True if more siblings exist in the database. HasMore bool `json:"has_more"` - // Number of unread siblings that match current filters. Remaining int `json:"remaining"` - // Opaque cursor to request the next page of siblings. NextCursor *string `json:"next_cursor,omitempty"` } type ReportByHistogramBucket struct { - Category string `json:"category"` - - Count int `json:"count"` - - Sum float64 `json:"sum"` - - LowerBound *Bound `json:"lower_bound,omitempty"` - - UpperBound *Bound `json:"upper_bound,omitempty"` + Category string `json:"category"` + Count int `json:"count"` + Sum float64 `json:"sum"` + LowerBound *Bound `json:"lower_bound,omitempty"` + UpperBound *Bound `json:"upper_bound,omitempty"` } type ReportResponse struct { - Call CallReportResponse `json:"call"` - + Call CallReportResponse `json:"call"` Participants ParticipantReportResponse `json:"participants"` - - UserRatings UserRatingReportResponse `json:"user_ratings"` + UserRatings UserRatingReportResponse `json:"user_ratings"` } type ResolutionMetricsTimeSeries struct { Height *MetricTimeSeries `json:"height,omitempty"` - - Width *MetricTimeSeries `json:"width,omitempty"` + Width *MetricTimeSeries `json:"width,omitempty"` } // Response containing resolved SIP inbound routing information type ResolveSipInboundResponse struct { - Duration string `json:"duration"` - - Credentials SipInboundCredentials `json:"credentials"` - + Duration string `json:"duration"` + Credentials SipInboundCredentials `json:"credentials"` SipRoutingRule *SIPInboundRoutingRuleResponse `json:"sip_routing_rule,omitempty"` - - SipTrunk *SIPTrunkResponse `json:"sip_trunk,omitempty"` + SipTrunk *SIPTrunkResponse `json:"sip_trunk,omitempty"` } // Basic response information @@ -11924,278 +9112,208 @@ type Response struct { Duration string `json:"duration"` } -type RestoreActionRequest struct { +// Configuration for restore action +type RestoreActionRequestPayload struct { + // Reason for the appeal decision DecisionReason *string `json:"decision_reason,omitempty"` } type RestoreActivityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` } +type RestoreFeedGroupResponse struct { + Duration string `json:"duration"` + FeedGroup FeedGroupResponse `json:"feed_group"` +} + // This event is sent when a new moderation review queue item is created type ReviewQueueItemNewEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // The flags associated with this review queue item - Flags []ModerationFlagResponse `json:"flags,omitempty"` - - Action *ActionLogResponse `json:"action,omitempty"` - + Flags []ModerationFlagResponse `json:"flags,omitempty"` + Action *ActionLogResponse `json:"action,omitempty"` ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` } -func (*ReviewQueueItemNewEvent) GetEventType() string { - return "review_queue_item.new" +func (e *ReviewQueueItemNewEvent) GetEventType() string { + return e.Type } type ReviewQueueItemResponse struct { // AI-determined text severity AiTextSeverity string `json:"ai_text_severity"` - // When the item was created CreatedAt Timestamp `json:"created_at"` - // ID of the entity being reviewed EntityID string `json:"entity_id"` - // Type of entity being reviewed EntityType string `json:"entity_type"` - - FlagsCount int `json:"flags_count"` - + FlagsCount int `json:"flags_count"` // Unique identifier of the review queue item - ID string `json:"id"` - + ID string `json:"id"` LatestModeratorAction string `json:"latest_moderator_action"` - // Suggested moderation action RecommendedAction string `json:"recommended_action"` - // ID of the moderator who reviewed the item ReviewedBy string `json:"reviewed_by"` - // Severity level of the content Severity int `json:"severity"` - // Current status of the review Status string `json:"status"` - // When the item was last updated UpdatedAt Timestamp `json:"updated_at"` - // Moderation actions taken Actions []ActionLogResponse `json:"actions"` - // Associated ban records - Bans []Ban `json:"bans"` - + Bans []BanInfoResponse `json:"bans"` // Associated flag records Flags []ModerationFlagResponse `json:"flags"` - // Detected languages in the content Languages []string `json:"languages"` - // When the review was completed CompletedAt *Timestamp `json:"completed_at,omitempty"` - - ConfigKey *string `json:"config_key,omitempty"` - + ConfigKey *string `json:"config_key,omitempty"` // ID of who created the entity EntityCreatorID *string `json:"entity_creator_id,omitempty"` - // When the item was reviewed ReviewedAt *Timestamp `json:"reviewed_at,omitempty"` - // Teams associated with this item - Teams []string `json:"teams,omitempty"` - - Activity *EnrichedActivity `json:"activity,omitempty"` - - Appeal *AppealItemResponse `json:"appeal,omitempty"` - - AssignedTo *UserResponse `json:"assigned_to,omitempty"` - - Call *CallResponse `json:"call,omitempty"` - - EntityCreator *EntityCreatorResponse `json:"entity_creator,omitempty"` - - FeedsV2Activity *EnrichedActivity `json:"feeds_v2_activity,omitempty"` - - FeedsV2Reaction *Reaction `json:"feeds_v2_reaction,omitempty"` - - FeedsV3Activity *ActivityResponse `json:"feeds_v3_activity,omitempty"` - - FeedsV3Comment *CommentResponse `json:"feeds_v3_comment,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` - - ModerationPayload *ModerationPayload `json:"moderation_payload,omitempty"` - - Reaction *Reaction `json:"reaction,omitempty"` + Teams []string `json:"teams,omitempty"` + Activity *EnrichedActivity `json:"activity,omitempty"` + Appeal *AppealItemResponse `json:"appeal,omitempty"` + AssignedTo *UserResponse `json:"assigned_to,omitempty"` + Call *CallResponse `json:"call,omitempty"` + EntityCreator *EntityCreatorResponse `json:"entity_creator,omitempty"` + FeedsV2Activity *EnrichedActivity `json:"feeds_v2_activity,omitempty"` + FeedsV2Reaction *Reaction `json:"feeds_v2_reaction,omitempty"` + FeedsV3Activity *ActivityResponse `json:"feeds_v3_activity,omitempty"` + FeedsV3Comment *CommentResponse `json:"feeds_v3_comment,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + ModerationPayload *ModerationPayloadResponse `json:"moderation_payload,omitempty"` + Reaction *Reaction `json:"reaction,omitempty"` } // This event is sent when a moderation review queue item is updated type ReviewQueueItemUpdatedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - Type string `json:"type"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // The flags associated with this review queue item - Flags []ModerationFlagResponse `json:"flags,omitempty"` - - Action *ActionLogResponse `json:"action,omitempty"` - + Flags []ModerationFlagResponse `json:"flags,omitempty"` + Action *ActionLogResponse `json:"action,omitempty"` ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` } -func (*ReviewQueueItemUpdatedEvent) GetEventType() string { - return "review_queue_item.updated" +func (e *ReviewQueueItemUpdatedEvent) GetEventType() string { + return e.Type } type RingCallResponse struct { Duration string `json:"duration"` - // List of members ringing notification was sent to MembersIds []string `json:"members_ids"` } type RingSettings struct { - AutoCancelTimeoutMs int `json:"auto_cancel_timeout_ms"` - + AutoCancelTimeoutMs int `json:"auto_cancel_timeout_ms"` IncomingCallTimeoutMs int `json:"incoming_call_timeout_ms"` - - MissedCallTimeoutMs int `json:"missed_call_timeout_ms"` + MissedCallTimeoutMs int `json:"missed_call_timeout_ms"` } type RingSettingsRequest struct { // When none of the callees accept a ring call in this time a rejection will be sent by the caller with reason 'timeout' by the SDKs AutoCancelTimeoutMs int `json:"auto_cancel_timeout_ms"` - // When a callee is online but doesn't answer a ring call in this time a rejection will be sent with reason 'timeout' by the SDKs IncomingCallTimeoutMs int `json:"incoming_call_timeout_ms"` - // When a callee doesn't accept or reject a ring call in this time a missed call event will be sent MissedCallTimeoutMs *int `json:"missed_call_timeout_ms,omitempty"` } type RingSettingsResponse struct { - AutoCancelTimeoutMs int `json:"auto_cancel_timeout_ms"` - + AutoCancelTimeoutMs int `json:"auto_cancel_timeout_ms"` IncomingCallTimeoutMs int `json:"incoming_call_timeout_ms"` - - MissedCallTimeoutMs int `json:"missed_call_timeout_ms"` + MissedCallTimeoutMs int `json:"missed_call_timeout_ms"` } type Role struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Whether this is a custom role or built-in Custom bool `json:"custom"` - // Unique role name Name string `json:"name"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // List of scopes where this role is currently present. `.app` means that role is present in app-level grants Scopes []string `json:"scopes"` } type RuleBuilderAction struct { - Type string `json:"type"` - - BanOptions *BanOptions `json:"ban_options,omitempty"` - - FlagUserOptions *FlagUserOptions `json:"flag_user_options,omitempty"` + Type *string `json:"type,omitempty"` + BanOptions *BanOptions `json:"ban_options,omitempty"` + CallOptions *CallActionOptions `json:"call_options,omitempty"` + FlagUserOptions *FlagUserOptions `json:"flag_user_options,omitempty"` } type RuleBuilderCondition struct { - Confidence *float64 `json:"confidence,omitempty"` - - Type *string `json:"type,omitempty"` - - ContentCountRuleParams *ContentCountRuleParameters `json:"content_count_rule_params,omitempty"` - - ContentFlagCountRuleParams *FlagCountRuleParameters `json:"content_flag_count_rule_params,omitempty"` - - ImageContentParams *ImageContentParameters `json:"image_content_params,omitempty"` - - ImageRuleParams *ImageRuleParameters `json:"image_rule_params,omitempty"` - - TextContentParams *TextContentParameters `json:"text_content_params,omitempty"` - - TextRuleParams *TextRuleParameters `json:"text_rule_params,omitempty"` - - UserCreatedWithinParams *UserCreatedWithinParameters `json:"user_created_within_params,omitempty"` - - UserCustomPropertyParams *UserCustomPropertyParameters `json:"user_custom_property_params,omitempty"` - - UserFlagCountRuleParams *FlagCountRuleParameters `json:"user_flag_count_rule_params,omitempty"` - + Confidence *float64 `json:"confidence,omitempty"` + Type *string `json:"type,omitempty"` + CallCustomPropertyParams *CallCustomPropertyParameters `json:"call_custom_property_params,omitempty"` + CallTypeRuleParams *CallTypeRuleParameters `json:"call_type_rule_params,omitempty"` + CallViolationCountParams *CallViolationCountParameters `json:"call_violation_count_params,omitempty"` + ClosedCaptionRuleParams *ClosedCaptionRuleParameters `json:"closed_caption_rule_params,omitempty"` + ContentCountRuleParams *ContentCountRuleParameters `json:"content_count_rule_params,omitempty"` + ContentFlagCountRuleParams *FlagCountRuleParameters `json:"content_flag_count_rule_params,omitempty"` + ImageContentParams *ImageContentParameters `json:"image_content_params,omitempty"` + ImageRuleParams *ImageRuleParameters `json:"image_rule_params,omitempty"` + KeyframeRuleParams *KeyframeRuleParameters `json:"keyframe_rule_params,omitempty"` + TextContentParams *TextContentParameters `json:"text_content_params,omitempty"` + TextRuleParams *TextRuleParameters `json:"text_rule_params,omitempty"` + UserCreatedWithinParams *UserCreatedWithinParameters `json:"user_created_within_params,omitempty"` + UserCustomPropertyParams *UserCustomPropertyParameters `json:"user_custom_property_params,omitempty"` + UserFlagCountRuleParams *FlagCountRuleParameters `json:"user_flag_count_rule_params,omitempty"` UserIdenticalContentCountParams *UserIdenticalContentCountParameters `json:"user_identical_content_count_params,omitempty"` - - UserRoleParams *UserRoleParameters `json:"user_role_params,omitempty"` - - UserRuleParams *UserRuleParameters `json:"user_rule_params,omitempty"` - - VideoContentParams *VideoContentParameters `json:"video_content_params,omitempty"` - - VideoRuleParams *VideoRuleParameters `json:"video_rule_params,omitempty"` + UserRoleParams *UserRoleParameters `json:"user_role_params,omitempty"` + UserRuleParams *UserRuleParameters `json:"user_rule_params,omitempty"` + VideoContentParams *VideoContentParameters `json:"video_content_params,omitempty"` + VideoRuleParams *VideoRuleParameters `json:"video_rule_params,omitempty"` } type RuleBuilderConditionGroup struct { - Logic *string `json:"logic,omitempty"` - + Logic *string `json:"logic,omitempty"` Conditions []RuleBuilderCondition `json:"conditions,omitempty"` } type RuleBuilderConfig struct { - Async *bool `json:"async,omitempty"` - + Async *bool `json:"async,omitempty"` Rules []RuleBuilderRule `json:"rules,omitempty"` } type RuleBuilderRule struct { - RuleType string `json:"rule_type"` - - Action RuleBuilderAction `json:"action"` - - CooldownPeriod *string `json:"cooldown_period,omitempty"` - - ID *string `json:"id,omitempty"` - - Logic *string `json:"logic,omitempty"` - - Conditions []RuleBuilderCondition `json:"conditions,omitempty"` - - Groups []RuleBuilderConditionGroup `json:"groups,omitempty"` + RuleType string `json:"rule_type"` + CooldownPeriod *string `json:"cooldown_period,omitempty"` + ID *string `json:"id,omitempty"` + Logic *string `json:"logic,omitempty"` + ActionSequences []CallRuleActionSequence `json:"action_sequences,omitempty"` + Conditions []RuleBuilderCondition `json:"conditions,omitempty"` + Groups []RuleBuilderConditionGroup `json:"groups,omitempty"` + Action *RuleBuilderAction `json:"action,omitempty"` } // Config for creating Amazon S3 storage. type S3Request struct { // The AWS region where the bucket is hosted S3Region string `json:"s3_region"` - // The AWS API key. To use Amazon S3 as your storage provider, you have two authentication options: IAM role or API key. If you do not specify the `s3_api_key` parameter, Stream will use IAM role authentication. In that case make sure to have the correct IAM role configured for your application. S3APIKey *string `json:"s3_api_key,omitempty"` - // The custom endpoint for S3. If you want to use a custom endpoint, you must also provide the `s3_api_key` and `s3_secret` parameters. S3CustomEndpointUrl *string `json:"s3_custom_endpoint_url,omitempty"` - // The AWS API Secret S3Secret *string `json:"s3_secret,omitempty"` } @@ -12209,15 +9327,11 @@ type SDKUsageReportResponse struct { } type SFULocationResponse struct { - Datacenter string `json:"datacenter"` - - ID string `json:"id"` - - Coordinates Coordinates `json:"coordinates"` - - Location Location `json:"location"` - - Count *int `json:"count,omitempty"` + Datacenter string `json:"datacenter"` + ID string `json:"id"` + Coordinates CoordinatesResponse `json:"coordinates"` + Location LocationResponse `json:"location"` + Count *int `json:"count,omitempty"` } // Configuration for SIP call settings @@ -12236,7 +9350,6 @@ type SIPCallConfigsResponse struct { type SIPCallerConfigsRequest struct { // Unique identifier for the caller (handlebars template) ID string `json:"id"` - // Custom data associated with the caller (values are handlebars templates) CustomData map[string]any `json:"custom_data,omitempty"` } @@ -12245,42 +9358,43 @@ type SIPCallerConfigsRequest struct { type SIPCallerConfigsResponse struct { // Unique identifier for the caller ID string `json:"id"` - // Custom data associated with the caller 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"` } @@ -12288,7 +9402,6 @@ type SIPChallenge struct { type SIPDirectRoutingRuleCallConfigsRequest struct { // ID of the call (handlebars template) CallID string `json:"call_id"` - // Type of the call CallType string `json:"call_type"` } @@ -12297,7 +9410,6 @@ type SIPDirectRoutingRuleCallConfigsRequest struct { type SIPDirectRoutingRuleCallConfigsResponse struct { // ID of the call CallID string `json:"call_id"` - // Type of the call CallType string `json:"call_type"` } @@ -12306,16 +9418,12 @@ type SIPDirectRoutingRuleCallConfigsResponse struct { type SIPInboundRoutingRulePinConfigsRequest struct { // Optional webhook URL for custom PIN handling CustomWebhookUrl *string `json:"custom_webhook_url,omitempty"` - // Prompt message for failed PIN attempts PinFailedAttemptPrompt *string `json:"pin_failed_attempt_prompt,omitempty"` - // Prompt message for hangup after PIN input PinHangupPrompt *string `json:"pin_hangup_prompt,omitempty"` - // Prompt message for PIN input PinPrompt *string `json:"pin_prompt,omitempty"` - // Prompt message for successful PIN input PinSuccessPrompt *string `json:"pin_success_prompt,omitempty"` } @@ -12324,16 +9432,12 @@ type SIPInboundRoutingRulePinConfigsRequest struct { type SIPInboundRoutingRulePinConfigsResponse struct { // Optional webhook URL for custom PIN handling CustomWebhookUrl *string `json:"custom_webhook_url,omitempty"` - // Prompt message for failed PIN attempts PinFailedAttemptPrompt *string `json:"pin_failed_attempt_prompt,omitempty"` - // Prompt message for hangup after PIN input PinHangupPrompt *string `json:"pin_hangup_prompt,omitempty"` - // Prompt message for PIN input PinPrompt *string `json:"pin_prompt,omitempty"` - // Prompt message for successful PIN input PinSuccessPrompt *string `json:"pin_success_prompt,omitempty"` } @@ -12342,74 +9446,51 @@ type SIPInboundRoutingRulePinConfigsResponse struct { type SIPInboundRoutingRuleRequest struct { // Name of the SIP Inbound Routing Rule Name string `json:"name"` - // List of SIP trunk IDs - TrunkIds []string `json:"trunk_ids"` - + TrunkIds []string `json:"trunk_ids"` CallerConfigs SIPCallerConfigsRequest `json:"caller_configs"` - // List of called numbers CalledNumbers []string `json:"called_numbers,omitempty"` - // List of caller numbers (optional) - CallerNumbers []string `json:"caller_numbers,omitempty"` - - CallConfigs *SIPCallConfigsRequest `json:"call_configs,omitempty"` - + CallerNumbers []string `json:"caller_numbers,omitempty"` + CallConfigs *SIPCallConfigsRequest `json:"call_configs,omitempty"` DirectRoutingConfigs *SIPDirectRoutingRuleCallConfigsRequest `json:"direct_routing_configs,omitempty"` - - PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs,omitempty"` - - PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs,omitempty"` + PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs,omitempty"` + PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs,omitempty"` } // SIP Inbound Routing Rule response type SIPInboundRoutingRuleResponse struct { // Creation timestamp CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // Unique identifier of the SIP Inbound Routing Rule ID string `json:"id"` - // Name of the SIP Inbound Routing Rule Name string `json:"name"` - // Last update timestamp UpdatedAt Timestamp `json:"updated_at"` - // List of called numbers CalledNumbers []string `json:"called_numbers"` - // List of SIP trunk IDs TrunkIds []string `json:"trunk_ids"` - // List of caller numbers - CallerNumbers []string `json:"caller_numbers,omitempty"` - - CallConfigs *SIPCallConfigsResponse `json:"call_configs,omitempty"` - - CallerConfigs *SIPCallerConfigsResponse `json:"caller_configs,omitempty"` - + CallerNumbers []string `json:"caller_numbers,omitempty"` + CallConfigs *SIPCallConfigsResponse `json:"call_configs,omitempty"` + CallerConfigs *SIPCallerConfigsResponse `json:"caller_configs,omitempty"` DirectRoutingConfigs *SIPDirectRoutingRuleCallConfigsResponse `json:"direct_routing_configs,omitempty"` - - PinProtectionConfigs *SIPPinProtectionConfigsResponse `json:"pin_protection_configs,omitempty"` - - PinRoutingConfigs *SIPInboundRoutingRulePinConfigsResponse `json:"pin_routing_configs,omitempty"` + PinProtectionConfigs *SIPPinProtectionConfigsResponse `json:"pin_protection_configs,omitempty"` + PinRoutingConfigs *SIPInboundRoutingRulePinConfigsResponse `json:"pin_routing_configs,omitempty"` } // Configuration for PIN protection settings type SIPPinProtectionConfigsRequest struct { // Default PIN to use if there is no PIN set on the call object DefaultPin *string `json:"default_pin,omitempty"` - // Whether PIN protection is enabled Enabled *bool `json:"enabled,omitempty"` - // Maximum number of PIN attempts allowed MaxAttempts *int `json:"max_attempts,omitempty"` - // Number of digits required for the PIN RequiredPinDigits *int `json:"required_pin_digits,omitempty"` } @@ -12418,285 +9499,195 @@ type SIPPinProtectionConfigsRequest struct { type SIPPinProtectionConfigsResponse struct { // Whether PIN protection is enabled Enabled bool `json:"enabled"` - // Default PIN to use if there is no PIN set on the call object DefaultPin *string `json:"default_pin,omitempty"` - // Maximum number of PIN attempts allowed MaxAttempts *int `json:"max_attempts,omitempty"` - // Number of digits required for the PIN RequiredPinDigits *int `json:"required_pin_digits,omitempty"` } -// SIP trunk information -type SIPTrunkResponse struct { - // Creation timestamp - CreatedAt Timestamp `json:"created_at"` - - // Unique identifier for the SIP trunk - ID string `json:"id"` - - // Name of the SIP trunk - Name string `json:"name"` - - // Password for SIP trunk authentication - Password string `json:"password"` - - // Last update timestamp - UpdatedAt Timestamp `json:"updated_at"` - - // The URI for the SIP trunk - Uri string `json:"uri"` - - // Username for SIP trunk authentication - Username string `json:"username"` - - // Phone numbers associated with this SIP trunk - Numbers []string `json:"numbers"` -} - -type SRTIngress struct { - Address string `json:"address"` -} - -type ScreensharingSettings struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - Enabled bool `json:"enabled"` - - TargetResolution *TargetResolution `json:"target_resolution,omitempty"` -} - -type ScreensharingSettingsRequest struct { - AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - TargetResolution *TargetResolution `json:"target_resolution,omitempty"` -} - -type ScreensharingSettingsResponse struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - Enabled bool `json:"enabled"` - - TargetResolution *TargetResolution `json:"target_resolution,omitempty"` -} - -type SearchPayload struct { - // Channel filter conditions - FilterConditions map[string]any `json:"filter_conditions"` - - ForceDefaultSearch *bool `json:"force_default_search,omitempty"` - - ForceSqlV2Backend *bool `json:"force_sql_v2_backend,omitempty"` - - // Number of messages to return - Limit *int `json:"limit,omitempty"` - - // Pagination parameter. Cannot be used with non-zero offset. - Next *string `json:"next,omitempty"` - - // Pagination offset. Cannot be used with sort or next. - Offset *int `json:"offset,omitempty"` - - // Search phrase - Query *string `json:"query,omitempty"` - - // Sort parameters. Cannot be used with non-zero offset - Sort []SortParamRequest `json:"sort,omitempty"` - - // Message filter conditions - MessageFilterConditions map[string]any `json:"message_filter_conditions,omitempty"` - - MessageOptions *MessageOptions `json:"message_options,omitempty"` -} - -type SearchResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - // Search results - Results []SearchResult `json:"results"` - - // Value to pass to the next search query in order to paginate - Next *string `json:"next,omitempty"` - - // Value that points to the previous page. Pass as the next value in a search query to paginate backwards - Previous *string `json:"previous,omitempty"` - - ResultsWarning *SearchWarning `json:"results_warning,omitempty"` -} - -type SearchResult struct { - Message *SearchResultMessage `json:"message,omitempty"` -} - -type SearchResultMessage 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 []ReactionResponse `json:"latest_reactions"` - - MentionedUsers []UserResponse `json:"mentioned_users"` - - OwnReactions []ReactionResponse `json:"own_reactions"` - - RestrictedVisibility []string `json:"restricted_visibility"` - - Custom map[string]any `json:"custom"` - - ReactionCounts map[string]int `json:"reaction_counts"` - - ReactionScores map[string]int `json:"reaction_scores"` - - User UserResponse `json:"user"` - - 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 []UserResponse `json:"thread_participants,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - - I18n map[string]string `json:"i18n,omitempty"` - - ImageLabels map[string][]string `json:"image_labels,omitempty"` +// SIP trunk information +type SIPTrunkResponse struct { + // Creation timestamp + CreatedAt Timestamp `json:"created_at"` + // Unique identifier for the SIP trunk + ID string `json:"id"` + // Name of the SIP trunk + Name string `json:"name"` + // Password for SIP trunk authentication + Password string `json:"password"` + // Last update timestamp + UpdatedAt Timestamp `json:"updated_at"` + // The URI for the SIP trunk + Uri string `json:"uri"` + // Username for SIP trunk authentication + Username string `json:"username"` + // Phone numbers associated with this SIP trunk + Numbers []string `json:"numbers"` +} - Member *ChannelMemberResponse `json:"member,omitempty"` +type SRTIngress struct { + Address string `json:"address"` +} - Moderation *ModerationV2Response `json:"moderation,omitempty"` +type ScreensharingSettings struct { + AccessRequestEnabled bool `json:"access_request_enabled"` + Enabled bool `json:"enabled"` + TargetResolution *TargetResolution `json:"target_resolution,omitempty"` +} - PinnedBy *UserResponse `json:"pinned_by,omitempty"` +type ScreensharingSettingsRequest struct { + AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + TargetResolution *TargetResolution `json:"target_resolution,omitempty"` +} - Poll *PollResponseData `json:"poll,omitempty"` +type ScreensharingSettingsResponse struct { + AccessRequestEnabled bool `json:"access_request_enabled"` + Enabled bool `json:"enabled"` + TargetResolution *TargetResolution `json:"target_resolution,omitempty"` +} - QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` +type SearchPayload struct { + // Channel filter conditions + FilterConditions map[string]any `json:"filter_conditions"` + ForceDefaultSearch *bool `json:"force_default_search,omitempty"` + ForceSqlV2Backend *bool `json:"force_sql_v2_backend,omitempty"` + // Number of messages to return + Limit *int `json:"limit,omitempty"` + // Pagination parameter. Cannot be used with non-zero offset. + Next *string `json:"next,omitempty"` + // Pagination offset. Cannot be used with sort or next. + Offset *int `json:"offset,omitempty"` + // Search phrase + Query *string `json:"query,omitempty"` + // Sort parameters. Cannot be used with non-zero offset + Sort []SortParamRequest `json:"sort,omitempty"` + // Message filter conditions + MessageFilterConditions map[string]any `json:"message_filter_conditions,omitempty"` + MessageOptions *MessageOptions `json:"message_options,omitempty"` +} - ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` +type SearchResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + // Search results + Results []SearchResult `json:"results"` + // Value to pass to the next search query in order to paginate + Next *string `json:"next,omitempty"` + // Value that points to the previous page. Pass as the next value in a search query to paginate backwards + Previous *string `json:"previous,omitempty"` + ResultsWarning *SearchWarning `json:"results_warning,omitempty"` +} - Reminder *ReminderResponseData `json:"reminder,omitempty"` +type SearchResult struct { + Message *SearchResultMessage `json:"message,omitempty"` +} - SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` +type SearchResultMessage struct { + Cid string `json:"cid"` + CreatedAt Timestamp `json:"created_at"` + DeletedReplyCount int `json:"deleted_reply_count"` + Html string `json:"html"` + ID string `json:"id"` + MentionedChannel bool `json:"mentioned_channel"` + MentionedHere bool `json:"mentioned_here"` + 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 []ReactionResponse `json:"latest_reactions"` + MentionedUsers []UserResponse `json:"mentioned_users"` + OwnReactions []ReactionResponse `json:"own_reactions"` + RestrictedVisibility []string `json:"restricted_visibility"` + Custom map[string]any `json:"custom"` + ReactionCounts map[string]int `json:"reaction_counts"` + ReactionScores map[string]int `json:"reaction_scores"` + User UserResponse `json:"user"` + 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"` + MentionedRoles []string `json:"mentioned_roles,omitempty"` + ThreadParticipants []UserResponse `json:"thread_participants,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Draft *DraftResponse `json:"draft,omitempty"` + I18n map[string]string `json:"i18n,omitempty"` + ImageLabels map[string][]string `json:"image_labels,omitempty"` + Member *ChannelMemberResponse `json:"member,omitempty"` + Moderation *ModerationV2Response `json:"moderation,omitempty"` + PinnedBy *UserResponse `json:"pinned_by,omitempty"` + Poll *PollResponseData `json:"poll,omitempty"` + QuotedMessage *MessageResponse `json:"quoted_message,omitempty"` + ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` + SharedLocation *SharedLocationResponseData `json:"shared_location,omitempty"` +} + +// Response for searching user groups +type SearchUserGroupsResponse struct { + Duration string `json:"duration"` + // List of matching user groups + UserGroups []UserGroupResponse `json:"user_groups"` } type SearchWarning struct { // Code corresponding to the warning WarningCode int `json:"warning_code"` - // Description of the warning WarningDescription string `json:"warning_description"` - // Number of channels searched ChannelSearchCount *int `json:"channel_search_count,omitempty"` - // Channel CIDs for the searched channels ChannelSearchCids []string `json:"channel_search_cids,omitempty"` } type Segment struct { - AllSenderChannels bool `json:"all_sender_channels"` - - AllUsers bool `json:"all_users"` - - CreatedAt Timestamp `json:"created_at"` - - ID string `json:"id"` - - Name string `json:"name"` - - Size int `json:"size"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Description *string `json:"description,omitempty"` - - TaskID *string `json:"task_id,omitempty"` - - Filter map[string]any `json:"filter,omitempty"` + AllSenderChannels bool `json:"all_sender_channels"` + AllUsers bool `json:"all_users"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Name string `json:"name"` + Size int `json:"size"` + UpdatedAt Timestamp `json:"updated_at"` + Type string `json:"type"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Description *string `json:"description,omitempty"` + TaskID *string `json:"task_id,omitempty"` + Filter map[string]any `json:"filter,omitempty"` } type SegmentResponse struct { - AllSenderChannels bool `json:"all_sender_channels"` - - AllUsers bool `json:"all_users"` - - CreatedAt Timestamp `json:"created_at"` - - DeletedAt Timestamp `json:"deleted_at"` - - Description string `json:"description"` - - ID string `json:"id"` - - Name string `json:"name"` - - Size int `json:"size"` - - UpdatedAt Timestamp `json:"updated_at"` - - Type string `json:"type"` - - Filter map[string]any `json:"filter"` + AllSenderChannels bool `json:"all_sender_channels"` + AllUsers bool `json:"all_users"` + CreatedAt Timestamp `json:"created_at"` + DeletedAt Timestamp `json:"deleted_at"` + Description string `json:"description"` + ID string `json:"id"` + Name string `json:"name"` + Size int `json:"size"` + UpdatedAt Timestamp `json:"updated_at"` + Type string `json:"type"` + Filter map[string]any `json:"filter"` } type SegmentTargetResponse struct { - AppPk int `json:"app_pk"` - + AppPk int `json:"app_pk"` CreatedAt Timestamp `json:"created_at"` - - SegmentID string `json:"segment_id"` - - TargetID string `json:"target_id"` + SegmentID string `json:"segment_id"` + TargetID string `json:"target_id"` } type SendCallEventResponse struct { @@ -12710,10 +9701,8 @@ type SendClosedCaptionResponse struct { type SendMessageResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message MessageResponse `json:"message"` - + Duration string `json:"duration"` + Message MessageResponse `json:"message"` // Pending message metadata PendingMessageMetadata map[string]string `json:"pending_message_metadata,omitempty"` } @@ -12721,23 +9710,17 @@ type SendMessageResponse struct { // Basic response information type SendReactionResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message MessageResponse `json:"message"` - + Duration string `json:"duration"` + Message MessageResponse `json:"message"` Reaction ReactionResponse `json:"reaction"` } type SessionClient struct { - Ip *string `json:"ip,omitempty"` - - Name *string `json:"name,omitempty"` - - NetworkType *string `json:"network_type,omitempty"` - - Version *string `json:"version,omitempty"` - - Location *CallStatsLocation `json:"location,omitempty"` + Ip *string `json:"ip,omitempty"` + Name *string `json:"name,omitempty"` + NetworkType *string `json:"network_type,omitempty"` + Version *string `json:"version,omitempty"` + Location *CallStatsLocation `json:"location,omitempty"` } type SessionSettings struct { @@ -12753,89 +9736,64 @@ type SessionSettingsResponse struct { } type SessionWarningResponse struct { - Code string `json:"code"` - - Warning string `json:"warning"` - - Time *Timestamp `json:"time,omitempty"` + Code string `json:"code"` + Warning string `json:"warning"` + Time *Timestamp `json:"time,omitempty"` } -type ShadowBlockActionRequest struct { +// Configuration for shadow block action +type ShadowBlockActionRequestPayload struct { + // Reason for shadow blocking Reason *string `json:"reason,omitempty"` } type SharedLocation struct { - Latitude float64 `json:"latitude"` - - Longitude float64 `json:"longitude"` - - CreatedByDeviceID *string `json:"created_by_device_id,omitempty"` - - EndAt *Timestamp `json:"end_at,omitempty"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + CreatedByDeviceID *string `json:"created_by_device_id,omitempty"` + EndAt *Timestamp `json:"end_at,omitempty"` } type SharedLocationResponse struct { // Channel CID ChannelCid string `json:"channel_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Device ID that created the live location CreatedByDeviceID string `json:"created_by_device_id"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // Latitude coordinate Latitude float64 `json:"latitude"` - // Longitude coordinate Longitude float64 `json:"longitude"` - // Message ID MessageID string `json:"message_id"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // User ID UserID string `json:"user_id"` - // Time when the live location expires - EndAt *Timestamp `json:"end_at,omitempty"` - + EndAt *Timestamp `json:"end_at,omitempty"` Channel *ChannelResponse `json:"channel,omitempty"` - Message *MessageResponse `json:"message,omitempty"` } type SharedLocationResponseData struct { - ChannelCid string `json:"channel_cid"` - - CreatedAt Timestamp `json:"created_at"` - - CreatedByDeviceID string `json:"created_by_device_id"` - - Latitude float64 `json:"latitude"` - - Longitude float64 `json:"longitude"` - - MessageID string `json:"message_id"` - - UpdatedAt Timestamp `json:"updated_at"` - - UserID string `json:"user_id"` - - EndAt *Timestamp `json:"end_at,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` + ChannelCid string `json:"channel_cid"` + CreatedAt Timestamp `json:"created_at"` + CreatedByDeviceID string `json:"created_by_device_id"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + MessageID string `json:"message_id"` + UpdatedAt Timestamp `json:"updated_at"` + UserID string `json:"user_id"` + EndAt *Timestamp `json:"end_at,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,omitempty"` } type SharedLocationsResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` ActiveLiveLocations []SharedLocationResponseData `json:"active_live_locations"` } @@ -12846,68 +9804,50 @@ type ShowChannelResponse struct { } type SingleFollowResponse struct { - Duration string `json:"duration"` - - Follow FollowResponse `json:"follow"` - + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` // Whether a notification activity was successfully created NotificationCreated *bool `json:"notification_created,omitempty"` } // Credentials for SIP inbound call authentication type SipInboundCredentials struct { + // API key for the application + APIKey string `json:"api_key"` // ID of the call CallID string `json:"call_id"` - // Type of the call CallType string `json:"call_type"` - // Authentication token for the call Token string `json:"token"` - // User ID for the call UserID string `json:"user_id"` - // Custom data associated with the call CallCustomData map[string]any `json:"call_custom_data"` - // Custom data associated with the user UserCustomData map[string]any `json:"user_custom_data"` } -type SortParam struct { - Direction *int `json:"direction,omitempty"` - - Field *string `json:"field,omitempty"` - - Type *string `json:"type,omitempty"` -} - type SortParamRequest struct { - // Direction of sorting, 1 for Ascending, -1 for Descending, default is 1 + // Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One of: -1, 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 of field to sort by. Empty string or omitted means string type (default). One of: number, boolean Type *string `json:"type,omitempty"` } type SpeechSegmentConfig struct { MaxSpeechCaptionMs *int `json:"max_speech_caption_ms,omitempty"` - - SilenceDurationMs *int `json:"silence_duration_ms,omitempty"` + SilenceDurationMs *int `json:"silence_duration_ms,omitempty"` } // Basic response information type StartCampaignResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Campaign *CampaignResponse `json:"campaign,omitempty"` - - Users *PagerResponse `json:"users,omitempty"` + Users *PagerResponse `json:"users,omitempty"` } type StartClosedCaptionsResponse struct { @@ -12923,7 +9863,6 @@ type StartFrameRecordingResponse struct { // StartHLSBroadcastingResponse is the payload for starting an HLS broadcasting. type StartHLSBroadcastingResponse struct { Duration string `json:"duration"` - // the URL of the HLS playlist PlaylistUrl string `json:"playlist_url"` } @@ -12950,8 +9889,6 @@ type StopAllRTMPBroadcastsResponse struct { Duration string `json:"duration"` } -type StopCampaignRequest struct{} - // Basic response information type StopClosedCaptionsResponse struct { // Duration of the request in milliseconds @@ -12971,13 +9908,13 @@ type StopHLSBroadcastingResponse struct { } type StopLiveResponse struct { - Duration string `json:"duration"` - - Call CallResponse `json:"call"` + Duration string `json:"duration"` + Call CallResponse `json:"call"` } // Request for stopping RTMP broadcasts -type StopRTMPBroadcastsRequest struct{} +type StopRTMPBroadcastsRequest struct { +} // Basic response information type StopRTMPBroadcastsResponse struct { @@ -13000,7 +9937,6 @@ type StopTranscriptionResponse struct { type StoriesConfig struct { // Whether to skip already watched stories SkipWatched *bool `json:"skip_watched,omitempty"` - // Whether to track watched status for stories TrackWatched *bool `json:"track_watched,omitempty"` } @@ -13009,69 +9945,51 @@ type StoriesConfig struct { type StoriesFeedUpdatedEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // The ID of the feed - Fid string `json:"fid"` - + Fid string `json:"fid"` Custom map[string]any `json:"custom"` - // The type of event: "feeds.stories_feed.updated" in this case - Type string `json:"type"` - - FeedVisibility *string `json:"feed_visibility,omitempty"` - - ReceivedAt *Timestamp `json:"received_at,omitempty"` - + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` // Individual activities for stories feeds Activities []ActivityResponse `json:"activities,omitempty"` - // Aggregated activities for stories feeds AggregatedActivities []AggregatedActivityResponse `json:"aggregated_activities,omitempty"` - - User *UserResponseCommonFields `json:"user,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } -func (*StoriesFeedUpdatedEvent) GetEventType() string { - return "feeds.stories_feed.updated" +func (e *StoriesFeedUpdatedEvent) GetEventType() string { + return e.Type } type SubmitActionResponse struct { - Duration string `json:"duration"` - - AppealItem *AppealItemResponse `json:"appeal_item,omitempty"` - - Item *ReviewQueueItemResponse `json:"item,omitempty"` + Duration string `json:"duration"` + AppealItem *AppealItemResponse `json:"appeal_item,omitempty"` + Item *ReviewQueueItemResponse `json:"item,omitempty"` } type SubscriberAllMetrics struct { - Audio *SubscriberAudioMetrics `json:"audio,omitempty"` - + Audio *SubscriberAudioMetrics `json:"audio,omitempty"` RttMs *ActiveCallsLatencyStats `json:"rtt_ms,omitempty"` - - Video *SubscriberVideoMetrics `json:"video,omitempty"` + Video *SubscriberVideoMetrics `json:"video,omitempty"` } type SubscriberAudioMetrics struct { ConcealmentPct *ActiveCallsLatencyStats `json:"concealment_pct,omitempty"` - - JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` - + JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` PacketsLostPct *ActiveCallsLatencyStats `json:"packets_lost_pct,omitempty"` } type SubscriberStatsResponse struct { - Total int `json:"total"` - + Total int `json:"total"` TotalSubscribedDurationSeconds int `json:"total_subscribed_duration_seconds"` - - Unique int `json:"unique"` + Unique int `json:"unique"` } type SubscriberVideoMetrics struct { - Fps30 *ActiveCallsFPSStats `json:"fps_30,omitempty"` - - JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` - + Fps30 *ActiveCallsFPSStats `json:"fps_30,omitempty"` + JitterMs *ActiveCallsLatencyStats `json:"jitter_ms,omitempty"` PacketsLostPct *ActiveCallsLatencyStats `json:"packets_lost_pct,omitempty"` } @@ -13081,256 +9999,190 @@ type SubscribersMetrics struct { type TargetResolution struct { Bitrate int `json:"bitrate"` - - Height int `json:"height"` - - Width int `json:"width"` + Height int `json:"height"` + Width int `json:"width"` +} + +// Usage statistics for a single team containing all 16 metrics +type TeamUsageStats struct { + // Team identifier (empty string for users not assigned to any team) + Team string `json:"team"` + ConcurrentConnections MetricStats `json:"concurrent_connections"` + ConcurrentUsers MetricStats `json:"concurrent_users"` + ImageModerationsDaily MetricStats `json:"image_moderations_daily"` + MessagesDaily MetricStats `json:"messages_daily"` + MessagesLast24Hours MetricStats `json:"messages_last_24_hours"` + MessagesLast30Days MetricStats `json:"messages_last_30_days"` + MessagesMonthToDate MetricStats `json:"messages_month_to_date"` + MessagesTotal MetricStats `json:"messages_total"` + TranslationsDaily MetricStats `json:"translations_daily"` + UsersDaily MetricStats `json:"users_daily"` + UsersEngagedLast30Days MetricStats `json:"users_engaged_last_30_days"` + UsersEngagedMonthToDate MetricStats `json:"users_engaged_month_to_date"` + UsersLast24Hours MetricStats `json:"users_last_24_hours"` + UsersLast30Days MetricStats `json:"users_last_30_days"` + UsersMonthToDate MetricStats `json:"users_month_to_date"` + UsersTotal MetricStats `json:"users_total"` } type TextContentParameters struct { - ContainsUrl *bool `json:"contains_url,omitempty"` - - Severity *string `json:"severity,omitempty"` - - BlocklistMatch []string `json:"blocklist_match,omitempty"` - - HarmLabels []string `json:"harm_labels,omitempty"` - - LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` + ContainsUrl *bool `json:"contains_url,omitempty"` + Severity *string `json:"severity,omitempty"` + BlocklistMatch []string `json:"blocklist_match,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` + LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` } type TextRuleParameters struct { - ContainsUrl *bool `json:"contains_url,omitempty"` - - SemanticFilterMinThreshold *float64 `json:"semantic_filter_min_threshold,omitempty"` - - Severity *string `json:"severity,omitempty"` - - Threshold *int `json:"threshold,omitempty"` - - TimeWindow *string `json:"time_window,omitempty"` - - BlocklistMatch []string `json:"blocklist_match,omitempty"` - - HarmLabels []string `json:"harm_labels,omitempty"` - - SemanticFilterNames []string `json:"semantic_filter_names,omitempty"` - - LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` + ContainsUrl *bool `json:"contains_url,omitempty"` + SemanticFilterMinThreshold *float64 `json:"semantic_filter_min_threshold,omitempty"` + Severity *string `json:"severity,omitempty"` + Threshold *int `json:"threshold,omitempty"` + TimeWindow *string `json:"time_window,omitempty"` + BlocklistMatch []string `json:"blocklist_match,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` + SemanticFilterNames []string `json:"semantic_filter_names,omitempty"` + LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` } // Represents a user that is participating in a thread. type ThreadParticipant struct { - AppPk int `json:"app_pk"` - + AppPk int `json:"app_pk"` ChannelCid string `json:"channel_cid"` - // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - LastReadAt Timestamp `json:"last_read_at"` - - Custom map[string]any `json:"custom"` - - LastThreadMessageAt *Timestamp `json:"last_thread_message_at,omitempty"` - + CreatedAt Timestamp `json:"created_at"` + LastReadAt Timestamp `json:"last_read_at"` + Custom map[string]any `json:"custom"` + LastThreadMessageAt *Timestamp `json:"last_thread_message_at,omitempty"` // Left Thread At is the time when the user left the thread LeftThreadAt *Timestamp `json:"left_thread_at,omitempty"` - // Thead ID is unique string identifier of the thread ThreadID *string `json:"thread_id,omitempty"` - // User ID is unique string identifier of the user - UserID *string `json:"user_id,omitempty"` - - User *UserResponse `json:"user,omitempty"` + UserID *string `json:"user_id,omitempty"` + User *UserResponse `json:"user,omitempty"` } type ThreadResponse struct { // Active Participant Count ActiveParticipantCount int `json:"active_participant_count"` - // Channel CID ChannelCid string `json:"channel_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Created By User ID CreatedByUserID string `json:"created_by_user_id"` - // Parent Message ID ParentMessageID string `json:"parent_message_id"` - // Participant Count ParticipantCount int `json:"participant_count"` - // Title Title string `json:"title"` - // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - // Custom data for this object Custom map[string]any `json:"custom"` - // Deleted At DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // Last Message At LastMessageAt *Timestamp `json:"last_message_at,omitempty"` - // Reply Count ReplyCount *int `json:"reply_count,omitempty"` - // Thread Participants ThreadParticipants []ThreadParticipant `json:"thread_participants,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - CreatedBy *UserResponse `json:"created_by,omitempty"` - - ParentMessage *MessageResponse `json:"parent_message,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + ParentMessage *MessageResponse `json:"parent_message,omitempty"` } type ThreadStateResponse struct { // Active Participant Count ActiveParticipantCount int `json:"active_participant_count"` - // Channel CID ChannelCid string `json:"channel_cid"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Created By User ID CreatedByUserID string `json:"created_by_user_id"` - // Parent Message ID ParentMessageID string `json:"parent_message_id"` - // Participant Count ParticipantCount int `json:"participant_count"` - // Title Title string `json:"title"` - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - + UpdatedAt Timestamp `json:"updated_at"` LatestReplies []MessageResponse `json:"latest_replies"` - // Custom data for this object Custom map[string]any `json:"custom"` - // Deleted At DeletedAt *Timestamp `json:"deleted_at,omitempty"` - // Last Message At LastMessageAt *Timestamp `json:"last_message_at,omitempty"` - // Reply Count - ReplyCount *int `json:"reply_count,omitempty"` - - Read []ReadStateResponse `json:"read,omitempty"` - + ReplyCount *int `json:"reply_count,omitempty"` + Read []ReadStateResponse `json:"read,omitempty"` // Thread Participants ThreadParticipants []ThreadParticipant `json:"thread_participants,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - CreatedBy *UserResponse `json:"created_by,omitempty"` - - Draft *DraftResponse `json:"draft,omitempty"` - - ParentMessage *MessageResponse `json:"parent_message,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + Draft *DraftResponse `json:"draft,omitempty"` + ParentMessage *MessageResponse `json:"parent_message,omitempty"` } type ThreadUpdatedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Thread *ThreadResponse `json:"thread,omitempty"` - - User *User `json:"user,omitempty"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ChannelID *string `json:"channel_id,omitempty"` + ChannelType *string `json:"channel_type,omitempty"` + Cid *string `json:"cid,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Thread *ThreadResponse `json:"thread,omitempty"` } -func (*ThreadUpdatedEvent) GetEventType() string { - return "thread.updated" +func (e *ThreadUpdatedEvent) GetEventType() string { + return e.Type } // A comment with an optional, depth‑limited slice of nested replies. type ThreadedCommentResponse struct { - ConfidenceScore float64 `json:"confidence_score"` - - CreatedAt Timestamp `json:"created_at"` - - DownvoteCount int `json:"downvote_count"` - - ID string `json:"id"` - - ObjectID string `json:"object_id"` - - ObjectType string `json:"object_type"` - - ReactionCount int `json:"reaction_count"` - - ReplyCount int `json:"reply_count"` - - Score int `json:"score"` - - Status string `json:"status"` - - UpdatedAt Timestamp `json:"updated_at"` - - UpvoteCount int `json:"upvote_count"` - - MentionedUsers []UserResponse `json:"mentioned_users"` - - OwnReactions []FeedsReactionResponse `json:"own_reactions"` - - User UserResponse `json:"user"` - - ControversyScore *float64 `json:"controversy_score,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - EditedAt *Timestamp `json:"edited_at,omitempty"` - - ParentID *string `json:"parent_id,omitempty"` - - Text *string `json:"text,omitempty"` - - Attachments []Attachment `json:"attachments,omitempty"` - - LatestReactions []FeedsReactionResponse `json:"latest_reactions,omitempty"` - + ConfidenceScore float64 `json:"confidence_score"` + CreatedAt Timestamp `json:"created_at"` + DownvoteCount int `json:"downvote_count"` + ID string `json:"id"` + ObjectID string `json:"object_id"` + ObjectType string `json:"object_type"` + ReactionCount int `json:"reaction_count"` + ReplyCount int `json:"reply_count"` + Score int `json:"score"` + // Status of the comment. One of: active, deleted, removed, hidden + Status string `json:"status"` + UpdatedAt Timestamp `json:"updated_at"` + UpvoteCount int `json:"upvote_count"` + MentionedUsers []UserResponse `json:"mentioned_users"` + OwnReactions []FeedsReactionResponse `json:"own_reactions"` + User UserResponse `json:"user"` + ControversyScore *float64 `json:"controversy_score,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + EditedAt *Timestamp `json:"edited_at,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + Text *string `json:"text,omitempty"` + Attachments []Attachment `json:"attachments,omitempty"` + LatestReactions []FeedsReactionResponse `json:"latest_reactions,omitempty"` // Slice of nested comments (may be empty). - Replies []ThreadedCommentResponse `json:"replies,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - Meta *RepliesMeta `json:"meta,omitempty"` - - Moderation *ModerationV2Response `json:"moderation,omitempty"` - - ReactionGroups map[string]*ReactionGroupResponse `json:"reaction_groups,omitempty"` + Replies []ThreadedCommentResponse `json:"replies,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + Meta *RepliesMeta `json:"meta,omitempty"` + Moderation *ModerationV2Response `json:"moderation,omitempty"` + ReactionGroups map[string]FeedsReactionGroupResponse `json:"reaction_groups,omitempty"` } // Sets thresholds for AI moderation type Thresholds struct { Explicit *LabelThresholds `json:"explicit,omitempty"` - - Spam *LabelThresholds `json:"spam,omitempty"` - - Toxic *LabelThresholds `json:"toxic,omitempty"` + Spam *LabelThresholds `json:"spam,omitempty"` + Toxic *LabelThresholds `json:"toxic,omitempty"` } type ThumbnailResponse struct { @@ -13349,75 +10201,61 @@ type ThumbnailsSettingsResponse struct { Enabled bool `json:"enabled"` } -type Time struct{} +type Time struct { +} type TrackStatsResponse struct { - DurationSeconds int `json:"duration_seconds"` - - TrackType string `json:"track_type"` + DurationSeconds int `json:"duration_seconds"` + TrackType string `json:"track_type"` } type TranscriptionSettings struct { + // One of: available, disabled, auto-on ClosedCaptionMode string `json:"closed_caption_mode"` - // The language used in this call as a two letter code - Language string `json:"language"` - - Mode string `json:"mode"` - + Language string `json:"language"` + Mode string `json:"mode"` SpeechSegmentConfig *SpeechSegmentConfig `json:"speech_segment_config,omitempty"` - - Translation *TranslationSettings `json:"translation,omitempty"` + Translation *TranslationSettings `json:"translation,omitempty"` } type TranscriptionSettingsRequest struct { - ClosedCaptionMode *string `json:"closed_caption_mode,omitempty"` - - Language *string `json:"language,omitempty"` - - Mode *string `json:"mode,omitempty"` - + ClosedCaptionMode *string `json:"closed_caption_mode,omitempty"` + Language *string `json:"language,omitempty"` + Mode *string `json:"mode,omitempty"` SpeechSegmentConfig *SpeechSegmentConfig `json:"speech_segment_config,omitempty"` - - Translation *TranslationSettings `json:"translation,omitempty"` + Translation *TranslationSettings `json:"translation,omitempty"` } type TranscriptionSettingsResponse struct { - ClosedCaptionMode string `json:"closed_caption_mode"` - - Language string `json:"language"` - - Mode string `json:"mode"` - + ClosedCaptionMode string `json:"closed_caption_mode"` + Language string `json:"language"` + Mode string `json:"mode"` SpeechSegmentConfig *SpeechSegmentConfig `json:"speech_segment_config,omitempty"` - - Translation *TranslationSettings `json:"translation,omitempty"` + Translation *TranslationSettings `json:"translation,omitempty"` } type TranslationSettings struct { - Enabled bool `json:"enabled"` - + Enabled bool `json:"enabled"` Languages []string `json:"languages"` } type TruncateChannelResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` -} - -type TypingIndicators struct { - Enabled *bool `json:"enabled,omitempty"` + Duration string `json:"duration"` + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,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"` + // Reason for the appeal decision DecisionReason *string `json:"decision_reason,omitempty"` } @@ -13425,7 +10263,9 @@ type UnbanResponse struct { Duration string `json:"duration"` } -type UnblockActionRequest struct { +// Configuration for unblock action +type UnblockActionRequestPayload struct { + // Reason for the appeal decision DecisionReason *string `json:"decision_reason,omitempty"` } @@ -13443,50 +10283,47 @@ type UnblockUsersResponse struct { // This event is sent when a user is unblocked on a call, // this can be useful to notify the user that they can now join the call again type UnblockedUserEvent struct { - CallCid string `json:"call_cid"` - - CreatedAt Timestamp `json:"created_at"` - - User UserResponse `json:"user"` - + CallCid string `json:"call_cid"` + CreatedAt Timestamp `json:"created_at"` + User UserResponse `json:"user"` // The type of event: "call.unblocked_user" in this case Type string `json:"type"` } -func (*UnblockedUserEvent) GetEventType() string { - return "call.unblocked_user" +func (e *UnblockedUserEvent) GetEventType() string { + return e.Type +} + +// Basic response information +type UndeleteMessageResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + Message MessageResponse `json:"message"` } type UnfollowBatchResponse struct { Duration string `json:"duration"` - // List of follow relationships that were removed Follows []FollowResponse `json:"follows"` } type UnfollowResponse struct { - Duration string `json:"duration"` - - Follow FollowResponse `json:"follow"` + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` } -// Basic response information type UnmuteResponse struct { - // Duration of the request in milliseconds Duration string `json:"duration"` - + // A list of users that can't be found. Common cause for this is deleted users NonExistingUsers []string `json:"non_existing_users,omitempty"` } type UnpinActivityResponse struct { Duration string `json:"duration"` - // Fully qualified ID of the feed the activity was unpinned from Feed string `json:"feed"` - // ID of the user who unpinned the activity - UserID string `json:"user_id"` - + UserID string `json:"user_id"` Activity ActivityResponse `json:"activity"` } @@ -13494,7 +10331,6 @@ type UnpinActivityResponse struct { type UnpinRequest struct { // the session ID of the user who pinned the message SessionID string `json:"session_id"` - // the user ID of the user who pinned the message UserID string `json:"user_id"` } @@ -13508,329 +10344,258 @@ type UnpinResponse struct { // Basic response information type UnreadCountsBatchResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` CountsByUser map[string]*UnreadCountsResponse `json:"counts_by_user"` } type UnreadCountsChannel struct { - ChannelID string `json:"channel_id"` - - LastRead Timestamp `json:"last_read"` - - UnreadCount int `json:"unread_count"` + ChannelID string `json:"channel_id"` + LastRead Timestamp `json:"last_read"` + UnreadCount int `json:"unread_count"` } type UnreadCountsChannelType struct { - ChannelCount int `json:"channel_count"` - - ChannelType string `json:"channel_type"` - - UnreadCount int `json:"unread_count"` + ChannelCount int `json:"channel_count"` + ChannelType string `json:"channel_type"` + UnreadCount int `json:"unread_count"` } type UnreadCountsResponse struct { - TotalUnreadCount int `json:"total_unread_count"` - - TotalUnreadThreadsCount int `json:"total_unread_threads_count"` - - ChannelType []UnreadCountsChannelType `json:"channel_type"` - - Channels []UnreadCountsChannel `json:"channels"` - - Threads []UnreadCountsThread `json:"threads"` - - TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` + TotalUnreadCount int `json:"total_unread_count"` + TotalUnreadThreadsCount int `json:"total_unread_threads_count"` + ChannelType []UnreadCountsChannelType `json:"channel_type"` + Channels []UnreadCountsChannel `json:"channels"` + Threads []UnreadCountsThread `json:"threads"` + TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` } type UnreadCountsThread struct { - LastRead Timestamp `json:"last_read"` - - LastReadMessageID string `json:"last_read_message_id"` + LastRead Timestamp `json:"last_read"` + LastReadMessageID string `json:"last_read_message_id"` + ParentMessageID string `json:"parent_message_id"` + UnreadCount int `json:"unread_count"` +} - ParentMessageID string `json:"parent_message_id"` +type UpdateActivitiesPartialBatchResponse struct { + Duration string `json:"duration"` + // List of successfully updated activities + Activities []ActivityResponse `json:"activities"` +} - UnreadCount int `json:"unread_count"` +type UpdateActivityPartialChangeRequest struct { + // ID of the activity to update + ActivityID string `json:"activity_id"` + // Whether to copy custom data to the notification activity (only applies when handle_mention_notifications creates notifications) + CopyCustomToNotification *bool `json:"copy_custom_to_notification,omitempty"` + // When true and 'mentioned_user_ids' is updated, automatically creates or deletes mention notifications for added/removed users. Only applicable for client-side requests (ignored for server-side requests) + HandleMentionNotifications *bool `json:"handle_mention_notifications,omitempty"` + // List of field names to remove. Supported fields: 'custom', 'location', 'expires_at', 'filter_tags', 'interest_tags', 'attachments', 'poll_id', 'mentioned_user_ids'. Use dot-notation for nested custom fields (e.g., 'custom.field_name') + Unset []string `json:"unset,omitempty"` + // Map of field names to new values. Supported fields: 'text', 'attachments', 'custom', 'visibility', 'visibility_tag', 'restrict_replies' (values: 'everyone', 'people_i_follow', 'nobody'), 'location', 'expires_at', 'filter_tags', 'interest_tags', 'poll_id', 'feeds', 'mentioned_user_ids'. For custom fields, use dot-notation (e.g., 'custom.field_name') + Set map[string]any `json:"set,omitempty"` } type UpdateActivityPartialResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` } type UpdateActivityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` } // Basic response information type UpdateBlockListResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Blocklist *BlockListResponse `json:"blocklist,omitempty"` } type UpdateBookmarkFolderResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` BookmarkFolder BookmarkFolderResponse `json:"bookmark_folder"` } type UpdateBookmarkResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` Bookmark BookmarkResponse `json:"bookmark"` } // Basic response information type UpdateCallMembersResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Members []MemberResponse `json:"members"` + Duration string `json:"duration"` + Members []MemberResponse `json:"members"` } // Response for updating a call type UpdateCallResponse struct { - Duration string `json:"duration"` - - Members []MemberResponse `json:"members"` - - OwnCapabilities []OwnCapability `json:"own_capabilities"` - - Call CallResponse `json:"call"` + Duration string `json:"duration"` + Members []MemberResponse `json:"members"` + OwnCapabilities []OwnCapability `json:"own_capabilities"` + Call CallResponse `json:"call"` } // UpdateCallTypeResponse is the payload for updating a call type. type UpdateCallTypeResponse struct { // the time the call type was created CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // the name of the call type - Name string `json:"name"` - - // the time the call type was last updated - UpdatedAt Timestamp `json:"updated_at"` - - // the permissions granted to each role - Grants map[string][]string `json:"grants"` - - NotificationSettings NotificationSettings `json:"notification_settings"` - - Settings CallSettingsResponse `json:"settings"` - - // the external storage for the call type - ExternalStorage *string `json:"external_storage,omitempty"` -} - -type UpdateChannelPartialResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - // List of updated members - Members []ChannelMemberResponse `json:"members"` - - Channel *ChannelResponse `json:"channel,omitempty"` -} - -type UpdateChannelResponse struct { - // Duration of the request in milliseconds - Duration string `json:"duration"` - - // List of channel members - Members []ChannelMemberResponse `json:"members"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` -} - -type UpdateChannelTypeResponse struct { - Automod string `json:"automod"` - - AutomodBehavior string `json:"automod_behavior"` - - ConnectEvents bool `json:"connect_events"` - - CountMessages bool `json:"count_messages"` - - CreatedAt Timestamp `json:"created_at"` - - CustomEvents bool `json:"custom_events"` - - DeliveryEvents bool `json:"delivery_events"` - - Duration string `json:"duration"` - - MarkMessagesPending bool `json:"mark_messages_pending"` - - MaxMessageLength int `json:"max_message_length"` - - Mutes bool `json:"mutes"` - - Name string `json:"name"` - - Polls bool `json:"polls"` - - PushNotifications bool `json:"push_notifications"` - - Quotes bool `json:"quotes"` - - Reactions bool `json:"reactions"` - - ReadEvents bool `json:"read_events"` - - Reminders bool `json:"reminders"` - - Replies bool `json:"replies"` - - Search bool `json:"search"` - - SharedLocations bool `json:"shared_locations"` - - SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` - - TypingEvents bool `json:"typing_events"` - - UpdatedAt Timestamp `json:"updated_at"` - - Uploads bool `json:"uploads"` - - UrlEnrichment bool `json:"url_enrichment"` - - UserMessageReminders bool `json:"user_message_reminders"` - - Commands []string `json:"commands"` - - Permissions []PolicyRequest `json:"permissions"` - - Grants map[string][]string `json:"grants"` - - Blocklist *string `json:"blocklist,omitempty"` - - BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` - - PartitionSize *int `json:"partition_size,omitempty"` - - PartitionTtl *string `json:"partition_ttl,omitempty"` + Name string `json:"name"` + // the time the call type was last updated + UpdatedAt Timestamp `json:"updated_at"` + // the permissions granted to each role + Grants map[string][]string `json:"grants"` + NotificationSettings NotificationSettingsResponse `json:"notification_settings"` + Settings CallSettingsResponse `json:"settings"` + // the external storage for the call type + ExternalStorage *string `json:"external_storage,omitempty"` +} - AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` +type UpdateChannelPartialResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + // List of updated members + Members []ChannelMemberResponse `json:"members"` + Channel *ChannelResponse `json:"channel,omitempty"` +} - Blocklists []BlockListOptions `json:"blocklists,omitempty"` +type UpdateChannelResponse struct { + // Duration of the request in milliseconds + Duration string `json:"duration"` + // List of channel members + Members []ChannelMemberResponse `json:"members"` + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,omitempty"` +} - AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` +type UpdateChannelTypeResponse struct { + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + ConnectEvents bool `json:"connect_events"` + CountMessages bool `json:"count_messages"` + CreatedAt Timestamp `json:"created_at"` + CustomEvents bool `json:"custom_events"` + DeliveryEvents bool `json:"delivery_events"` + Duration string `json:"duration"` + MarkMessagesPending bool `json:"mark_messages_pending"` + MaxMessageLength int `json:"max_message_length"` + Mutes bool `json:"mutes"` + Name string `json:"name"` + Polls bool `json:"polls"` + PushNotifications bool `json:"push_notifications"` + Quotes bool `json:"quotes"` + Reactions bool `json:"reactions"` + ReadEvents bool `json:"read_events"` + Reminders bool `json:"reminders"` + Replies bool `json:"replies"` + Search bool `json:"search"` + SharedLocations bool `json:"shared_locations"` + SkipLastMsgUpdateForSystemMsgs bool `json:"skip_last_msg_update_for_system_msgs"` + TypingEvents bool `json:"typing_events"` + UpdatedAt Timestamp `json:"updated_at"` + Uploads bool `json:"uploads"` + UrlEnrichment bool `json:"url_enrichment"` + UserMessageReminders bool `json:"user_message_reminders"` + Commands []string `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + Grants map[string][]string `json:"grants"` + Blocklist *string `json:"blocklist,omitempty"` + BlocklistBehavior *string `json:"blocklist_behavior,omitempty"` + PartitionSize *int `json:"partition_size,omitempty"` + PartitionTtl *string `json:"partition_ttl,omitempty"` + PushLevel *string `json:"push_level,omitempty"` + AllowedFlagReasons []string `json:"allowed_flag_reasons,omitempty"` + Blocklists []BlockListOptions `json:"blocklists,omitempty"` + AutomodThresholds *Thresholds `json:"automod_thresholds,omitempty"` } type UpdateCollectionRequest struct { // Unique identifier for the collection within its name ID string `json:"id"` - // Name/type of the collection Name string `json:"name"` - // Custom data for the collection (required, must contain at least one key) Custom map[string]any `json:"custom"` } type UpdateCollectionsResponse struct { Duration string `json:"duration"` - // List of updated collections Collections []CollectionResponse `json:"collections"` } type UpdateCommandResponse struct { - Duration string `json:"duration"` - - Command *Command `json:"command,omitempty"` + Duration string `json:"duration"` + Command *Command `json:"command,omitempty"` } type UpdateCommentResponse struct { - Duration string `json:"duration"` - - Comment CommentResponse `json:"comment"` + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` } // Basic response information type UpdateExternalStorageResponse struct { Bucket string `json:"bucket"` - // Duration of the request in milliseconds Duration string `json:"duration"` - - Name string `json:"name"` - - Path string `json:"path"` - - Type string `json:"type"` + Name string `json:"name"` + Path string `json:"path"` + Type string `json:"type"` } type UpdateFeedGroupResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedGroup FeedGroupResponse `json:"feed_group"` } // Basic response information type UpdateFeedMembersResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Added []FeedMemberResponse `json:"added"` - - RemovedIds []string `json:"removed_ids"` - - Updated []FeedMemberResponse `json:"updated"` + Duration string `json:"duration"` + Added []FeedMemberResponse `json:"added"` + RemovedIds []string `json:"removed_ids"` + Updated []FeedMemberResponse `json:"updated"` } type UpdateFeedResponse struct { - Duration string `json:"duration"` - - Feed FeedResponse `json:"feed"` + Duration string `json:"duration"` + Feed FeedResponse `json:"feed"` } type UpdateFeedViewResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedView FeedViewResponse `json:"feed_view"` } type UpdateFeedVisibilityResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` FeedVisibility FeedVisibilityResponse `json:"feed_visibility"` } type UpdateFollowResponse struct { - Duration string `json:"duration"` - - Follow FollowResponse `json:"follow"` + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` } type UpdateMemberPartialResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` ChannelMember *ChannelMemberResponse `json:"channel_member,omitempty"` } type UpdateMembershipLevelResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` MembershipLevel MembershipLevelResponse `json:"membership_level"` } type UpdateMessagePartialResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message *MessageResponse `json:"message,omitempty"` - + Duration string `json:"duration"` + Message *MessageResponse `json:"message,omitempty"` // Pending message metadata PendingMessageMetadata map[string]string `json:"pending_message_metadata,omitempty"` } @@ -13838,49 +10603,47 @@ type UpdateMessagePartialResponse struct { // Basic response information type UpdateMessageResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Message MessageResponse `json:"message"` - + Duration string `json:"duration"` + Message MessageResponse `json:"message"` PendingMessageMetadata map[string]string `json:"pending_message_metadata,omitempty"` } // Basic response information type UpdateReminderResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` Reminder ReminderResponseData `json:"reminder"` } // Response containing the updated SIP Inbound Routing Rule type UpdateSIPInboundRoutingRuleResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` SipInboundRoutingRule *SIPInboundRoutingRuleResponse `json:"sip_inbound_routing_rule,omitempty"` } // Response containing the updated SIP trunk type UpdateSIPTrunkResponse struct { - Duration string `json:"duration"` - + Duration string `json:"duration"` SipTrunk *SIPTrunkResponse `json:"sip_trunk,omitempty"` } type UpdateThreadPartialResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` + Duration string `json:"duration"` + Thread ThreadResponse `json:"thread"` +} - Thread ThreadResponse `json:"thread"` +// Response for updating a user group +type UpdateUserGroupResponse struct { + Duration string `json:"duration"` + UserGroup *UserGroupResponse `json:"user_group,omitempty"` } type UpdateUserPartialRequest struct { // User ID to update - ID string `json:"id"` - - Unset []string `json:"unset,omitempty"` - - Set map[string]any `json:"set,omitempty"` + ID string `json:"id"` + Unset []string `json:"unset,omitempty"` + Set map[string]any `json:"set,omitempty"` } // Basic response information @@ -13891,120 +10654,95 @@ type UpdateUserPermissionsResponse struct { type UpdateUsersResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` MembershipDeletionTaskID string `json:"membership_deletion_task_id"` - // Object containing users Users map[string]FullUserResponse `json:"users"` } // This event is sent to notify about permission changes for a user, clients receiving this event should update their UI accordingly type UpdatedCallPermissionsEvent struct { - CallCid string `json:"call_cid"` - + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` - // The capabilities of the current user OwnCapabilities []OwnCapability `json:"own_capabilities"` - - User UserResponse `json:"user"` - + User UserResponse `json:"user"` // The type of event: "call.permissions_updated" in this case Type string `json:"type"` } -func (*UpdatedCallPermissionsEvent) GetEventType() string { - return "call.permissions_updated" +func (e *UpdatedCallPermissionsEvent) GetEventType() string { + return e.Type } type UploadChannelFileResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` - // URL to the uploaded asset. Should be used to put to `asset_url` attachment field - File *string `json:"file,omitempty"` - + File *string `json:"file,omitempty"` ModerationAction *string `json:"moderation_action,omitempty"` - // URL of the file thumbnail for supported file formats. Should be put to `thumb_url` attachment field ThumbUrl *string `json:"thumb_url,omitempty"` } type UploadChannelRequest struct { File *string `json:"file,omitempty"` - // field with JSON-encoded array of image size configurations UploadSizes []ImageSize `json:"upload_sizes,omitempty"` - - User *OnlyUserID `json:"user,omitempty"` + User *OnlyUserID `json:"user,omitempty"` } type UploadChannelResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - File *string `json:"file,omitempty"` - + Duration string `json:"duration"` + File *string `json:"file,omitempty"` ModerationAction *string `json:"moderation_action,omitempty"` - - ThumbUrl *string `json:"thumb_url,omitempty"` - + ThumbUrl *string `json:"thumb_url,omitempty"` // Array of image size configurations UploadSizes []ImageSize `json:"upload_sizes,omitempty"` } type UpsertActivitiesResponse struct { Duration string `json:"duration"` - // List of created or updated activities Activities []ActivityResponse `json:"activities"` - // Total number of mention notification activities created for mentioned users across all activities MentionNotificationsCreated *int `json:"mention_notifications_created,omitempty"` } type UpsertCollectionsResponse struct { Duration string `json:"duration"` - // List of upserted collections Collections []CollectionResponse `json:"collections"` } type UpsertConfigResponse struct { - Duration string `json:"duration"` - - Config *ConfigResponse `json:"config,omitempty"` + Duration string `json:"duration"` + Config *ConfigResponse `json:"config,omitempty"` } // Basic response information type UpsertModerationRuleResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Rule *ModerationRuleV2Response `json:"rule,omitempty"` + Duration string `json:"duration"` + Rule *ModerationRuleV2Response `json:"rule,omitempty"` } type UpsertModerationTemplateRequest struct { // Name of the moderation template - Name string `json:"name"` - - Config FeedsModerationTemplateConfig `json:"config"` + Name string `json:"name"` + Config FeedsModerationTemplateConfigPayload `json:"config"` } type UpsertModerationTemplateResponse struct { // When the template was created CreatedAt Timestamp `json:"created_at"` - - Duration string `json:"duration"` - + Duration string `json:"duration"` // Name of the moderation template Name string `json:"name"` - // When the template was last updated - UpdatedAt Timestamp `json:"updated_at"` - - Config *FeedsModerationTemplateConfig `json:"config,omitempty"` + UpdatedAt Timestamp `json:"updated_at"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type UpsertPushPreferencesRequest struct { @@ -14015,80 +10753,63 @@ type UpsertPushPreferencesRequest struct { type UpsertPushPreferencesResponse struct { // Duration of the request in milliseconds 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 type UpsertPushProviderResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - + Duration string `json:"duration"` PushProvider PushProviderResponse `json:"push_provider"` } // Basic response information type UpsertPushTemplateResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - Template *PushTemplate `json:"template,omitempty"` + Duration string `json:"duration"` + 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"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - Role *string `json:"role,omitempty"` - - Teams []string `json:"teams,omitempty"` - - Custom map[string]any `json:"custom,omitempty"` - - PrivacySettings *PrivacySettings `json:"privacy_settings,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` + ID string `json:"id"` + Data map[string]any `json:"data,omitempty"` } +// This event is sent when a user gets banned. The event contains information about the user that was banned. type UserBannedEvent struct { - ChannelID string `json:"channel_id"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Shadow bool `json:"shadow"` - - CreatedBy User `json:"created_by"` - - Type string `json:"type"` - + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + User UserResponseCommonFields `json:"user"` + // The type of event: "user.banned" in this case + Type string `json:"type"` + // The ID of the channel where the target user was banned + 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 target user was banned + ChannelType *string `json:"channel_type,omitempty"` + // The CID of the channel where the target user was banned + Cid *string `json:"cid,omitempty"` + // The expiration date of the ban Expiration *Timestamp `json:"expiration,omitempty"` - - Reason *string `json:"reason,omitempty"` - - Team *string `json:"team,omitempty"` - - User *User `json:"user,omitempty"` + // The reason for the ban + Reason *string `json:"reason,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + // Whether the user was shadow banned + Shadow *bool `json:"shadow,omitempty"` + // The team of the channel where the target user was banned + Team *string `json:"team,omitempty"` + TotalBans *int `json:"total_bans,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } -func (*UserBannedEvent) GetEventType() string { - return "user.banned" +func (e *UserBannedEvent) GetEventType() string { + return e.Type } type UserCreatedWithinParameters struct { @@ -14096,53 +10817,61 @@ type UserCreatedWithinParameters struct { } type UserCustomEventRequest struct { - Type string `json:"type"` - + Type string `json:"type"` Custom map[string]any `json:"custom,omitempty"` } type UserCustomPropertyParameters struct { - Operator *string `json:"operator,omitempty"` - + Operator *string `json:"operator,omitempty"` 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 { - CreatedAt Timestamp `json:"created_at"` - - CreatedBy User `json:"created_by"` - - Type string `json:"type"` - - User *User `json:"user,omitempty"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + User UserResponseCommonFields `json:"user"` + // The type of event: "user.deactivated" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } -func (*UserDeactivatedEvent) GetEventType() string { - return "user.deactivated" +func (e *UserDeactivatedEvent) GetEventType() string { + return e.Type } +// 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. One of: hard, soft, pruning, (empty string) + 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. One of: hard, soft, pruning, (empty string) + DeleteMessages string `json:"delete_messages"` + // The type of deletion that was used for the user. One of: hard, soft, pruning, (empty string) + DeleteUser string `json:"delete_user"` + // Whether the user was hard deleted HardDelete bool `json:"hard_delete"` - - MarkMessagesDeleted bool `json:"mark_messages_deleted"` - - Type string `json:"type"` - - User *User `json:"user,omitempty"` + // 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*UserDeletedEvent) GetEventType() string { - return "user.deleted" +func (e *UserDeletedEvent) GetEventType() string { + return e.Type } type UserFeedbackReport struct { - UnreportedCount int `json:"unreported_count"` - - CountByRating map[string]int `json:"count_by_rating"` + UnreportedCount int `json:"unreported_count"` + CountByRating map[string]int `json:"count_by_rating"` } type UserFeedbackReportResponse struct { @@ -14150,174 +10879,250 @@ type UserFeedbackReportResponse struct { } type UserFeedbackResponse struct { - Cid string `json:"cid"` - - Rating int `json:"rating"` - + Cid string `json:"cid"` + Rating int `json:"rating"` + Reason string `json:"reason"` + Sdk string `json:"sdk"` + SdkVersion string `json:"sdk_version"` + SessionID string `json:"session_id"` + UserID string `json:"user_id"` + Platform PlatformDataResponse `json:"platform"` + 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + // Custom data + Custom map[string]any `json:"custom,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` +} - Sdk string `json:"sdk"` +func (e *UserFlaggedEvent) GetEventType() string { + return e.Type +} - SdkVersion string `json:"sdk_version"` +type UserGroup struct { + AppPk int `json:"app_pk"` + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + CreatedBy *string `json:"created_by,omitempty"` + Description *string `json:"description,omitempty"` + TeamID *string `json:"team_id,omitempty"` + Members []UserGroupMember `json:"members,omitempty"` +} - SessionID string `json:"session_id"` +// Emitted when a user group is created. +type UserGroupCreatedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "user_group.created" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` + UserGroup *UserGroup `json:"user_group,omitempty"` +} - UserID string `json:"user_id"` +func (e *UserGroupCreatedEvent) GetEventType() string { + return e.Type +} - Platform PlatformDataResponse `json:"platform"` +// Emitted when a user group is deleted. +type UserGroupDeletedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "user_group.deleted" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` + UserGroup *UserGroup `json:"user_group,omitempty"` +} - Custom map[string]any `json:"custom,omitempty"` +func (e *UserGroupDeletedEvent) GetEventType() string { + return e.Type } -type UserFlaggedEvent struct { +type UserGroupMember struct { + AppPk int `json:"app_pk"` CreatedAt Timestamp `json:"created_at"` + GroupID string `json:"group_id"` + IsAdmin bool `json:"is_admin"` + UserID string `json:"user_id"` +} - Type string `json:"type"` +// Emitted when members are added to a user group. +type UserGroupMemberAddedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + // The user IDs that were added + Members []string `json:"members"` + Custom map[string]any `json:"custom"` + // The type of event: "user_group.member_added" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` + UserGroup *UserGroup `json:"user_group,omitempty"` +} + +func (e *UserGroupMemberAddedEvent) GetEventType() string { + return e.Type +} + +// Emitted when members are removed from a user group. +type UserGroupMemberRemovedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + // The user IDs that were removed + Members []string `json:"members"` + Custom map[string]any `json:"custom"` + // The type of event: "user_group.member_removed" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` + UserGroup *UserGroup `json:"user_group,omitempty"` +} - TargetUser *string `json:"target_user,omitempty"` +func (e *UserGroupMemberRemovedEvent) GetEventType() string { + return e.Type +} - TargetUsers []string `json:"target_users,omitempty"` +type UserGroupResponse struct { + CreatedAt Timestamp `json:"created_at"` + ID string `json:"id"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + CreatedBy *string `json:"created_by,omitempty"` + Description *string `json:"description,omitempty"` + TeamID *string `json:"team_id,omitempty"` + Members []UserGroupMember `json:"members,omitempty"` +} - User *User `json:"user,omitempty"` +// Emitted when a user group is updated. +type UserGroupUpdatedEvent struct { + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + // The type of event: "user_group.updated" in this case + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` + UserGroup *UserGroup `json:"user_group,omitempty"` } -func (*UserFlaggedEvent) GetEventType() string { - return "user.flagged" +func (e *UserGroupUpdatedEvent) GetEventType() string { + return e.Type } type UserIdenticalContentCountParameters struct { - Threshold *int `json:"threshold,omitempty"` - + Threshold *int `json:"threshold,omitempty"` TimeWindow *string `json:"time_window,omitempty"` } // This event is sent when a user's message get deleted. The event contains information about the user whose messages got deleted. type UserMessagesDeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - User UserResponseCommonFields `json:"user"` - + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + User UserResponseCommonFields `json:"user"` // The type of event: "user.messages.deleted" in this case Type string `json:"type"` - // The ID of the channel where the target user's messages were deleted - ChannelID *string `json:"channel_id,omitempty"` - - ChannelMemberCount *int `json:"channel_member_count,omitempty"` - - ChannelMessageCount *int `json:"channel_message_count,omitempty"` - + 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 target user's messages were deleted ChannelType *string `json:"channel_type,omitempty"` - // The CID of the channel where the target user's messages were deleted Cid *string `json:"cid,omitempty"` - // Whether Messages were hard deleted - HardDelete *bool `json:"hard_delete,omitempty"` - + HardDelete *bool `json:"hard_delete,omitempty"` ReceivedAt *Timestamp `json:"received_at,omitempty"` - // The team of the channel where the target user's messages were deleted - Team *string `json:"team,omitempty"` - + Team *string `json:"team,omitempty"` ChannelCustom map[string]any `json:"channel_custom,omitempty"` } -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"` +func (e *UserMessagesDeletedEvent) GetEventType() string { + return e.Type } type UserMuteResponse struct { - CreatedAt Timestamp `json:"created_at"` - - UpdatedAt Timestamp `json:"updated_at"` - - Expires *Timestamp `json:"expires,omitempty"` - - Target *UserResponse `json:"target,omitempty"` - - User *UserResponse `json:"user,omitempty"` + CreatedAt Timestamp `json:"created_at"` + UpdatedAt Timestamp `json:"updated_at"` + Expires *Timestamp `json:"expires,omitempty"` + Target *UserResponse `json:"target,omitempty"` + 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 { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - TargetUser *string `json:"target_user,omitempty"` - - TargetUsers []string `json:"target_users,omitempty"` - - User *User `json:"user,omitempty"` + // 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + // The target users that were muted + TargetUsers []UserResponseCommonFields `json:"target_users,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } -func (*UserMutedEvent) GetEventType() string { - return "user.muted" +func (e *UserMutedEvent) GetEventType() string { + return e.Type } type UserRatingReportResponse struct { Average float64 `json:"average"` - - Count int `json:"count"` + 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 { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - User *User `json:"user,omitempty"` + // 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } -func (*UserReactivatedEvent) GetEventType() string { - return "user.reactivated" +func (e *UserReactivatedEvent) GetEventType() string { + return e.Type } // User request object type UserRequest struct { // User ID ID string `json:"id"` - // User's profile image URL - Image *string `json:"image,omitempty"` - - Invisible *bool `json:"invisible,omitempty"` - - Language *string `json:"language,omitempty"` - + Image *string `json:"image,omitempty"` + Invisible *bool `json:"invisible,omitempty"` + Language *string `json:"language,omitempty"` // Optional name of user Name *string `json:"name,omitempty"` - // User's global role Role *string `json:"role,omitempty"` - // List of teams the user belongs to Teams []string `json:"teams,omitempty"` - // Custom user data - Custom map[string]any `json:"custom,omitempty"` - + Custom map[string]any `json:"custom,omitempty"` PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` - // Map of team-specific roles for the user TeamsRole map[string]string `json:"teams_role,omitempty"` } @@ -14326,351 +11131,278 @@ type UserRequest struct { type UserResponse struct { // Whether a user is banned or not Banned bool `json:"banned"` - // Date/time of creation CreatedAt Timestamp `json:"created_at"` - // Unique user identifier - ID string `json:"id"` - - Invisible bool `json:"invisible"` - + ID string `json:"id"` + Invisible bool `json:"invisible"` // Preferred language of a user Language string `json:"language"` - // Whether a user online or not Online bool `json:"online"` - // Determines the set of user permissions Role string `json:"role"` - // Whether a user is shadow banned ShadowBanned bool `json:"shadow_banned"` - // Date/time of the last update - UpdatedAt Timestamp `json:"updated_at"` - - BlockedUserIds []string `json:"blocked_user_ids"` - + UpdatedAt Timestamp `json:"updated_at"` + BlockedUserIds []string `json:"blocked_user_ids"` // List of teams user is a part of Teams []string `json:"teams"` - // Custom data for this object - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` // Date when ban expires BanExpires *Timestamp `json:"ban_expires,omitempty"` - // Date of deactivation DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - // Date/time of deletion DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Image *string `json:"image,omitempty"` - + Image *string `json:"image,omitempty"` // Date of last activity LastActive *Timestamp `json:"last_active,omitempty"` - // Optional name of user Name *string `json:"name,omitempty"` - // Revocation date for tokens RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - // List of devices user is using - Devices []DeviceResponse `json:"devices,omitempty"` - - PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` - + Devices []DeviceResponse `json:"devices,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` PushNotifications *PushNotificationSettingsResponse `json:"push_notifications,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` } type UserResponseCommonFields 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"` - - UpdatedAt Timestamp `json:"updated_at"` - - BlockedUserIds []string `json:"blocked_user_ids"` - - Teams []string `json:"teams"` - - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Image *string `json:"image,omitempty"` - - LastActive *Timestamp `json:"last_active,omitempty"` - - Name *string `json:"name,omitempty"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` + 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"` + UpdatedAt Timestamp `json:"updated_at"` + BlockedUserIds []string `json:"blocked_user_ids"` + Teams []string `json:"teams"` + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` + DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Image *string `json:"image,omitempty"` + LastActive *Timestamp `json:"last_active,omitempty"` + Name *string `json:"name,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` } type UserResponsePrivacyFields 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"` - - UpdatedAt Timestamp `json:"updated_at"` - - BlockedUserIds []string `json:"blocked_user_ids"` - - Teams []string `json:"teams"` - - Custom map[string]any `json:"custom"` - - AvgResponseTime *int `json:"avg_response_time,omitempty"` - - DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` - - DeletedAt *Timestamp `json:"deleted_at,omitempty"` - - Image *string `json:"image,omitempty"` - - Invisible *bool `json:"invisible,omitempty"` - - LastActive *Timestamp `json:"last_active,omitempty"` - - Name *string `json:"name,omitempty"` - - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` - - PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` - - TeamsRole map[string]string `json:"teams_role,omitempty"` + 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"` + UpdatedAt Timestamp `json:"updated_at"` + BlockedUserIds []string `json:"blocked_user_ids"` + Teams []string `json:"teams"` + Custom map[string]any `json:"custom"` + AvgResponseTime *int `json:"avg_response_time,omitempty"` + DeactivatedAt *Timestamp `json:"deactivated_at,omitempty"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` + Image *string `json:"image,omitempty"` + Invisible *bool `json:"invisible,omitempty"` + LastActive *Timestamp `json:"last_active,omitempty"` + Name *string `json:"name,omitempty"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` } type UserRoleParameters struct { Operator *string `json:"operator,omitempty"` - - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` } 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"` - - ChannelType string `json:"channel_type"` - - Cid string `json:"cid"` - - CreatedAt Timestamp `json:"created_at"` - - Shadow bool `json:"shadow"` - - Type string `json:"type"` - - Team *string `json:"team,omitempty"` - - User *User `json:"user,omitempty"` + // Date/time of creation + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + User UserResponseCommonFields `json:"user"` + // The type of event: "user.unbanned" in this case + Type string `json:"type"` + // The ID of the channel where the target user was unbanned + 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 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } -func (*UserUnbannedEvent) GetEventType() string { - return "user.unbanned" +func (e *UserUnbannedEvent) GetEventType() string { + return e.Type } +// This event is sent when a user gets unmuted. The event contains information about the user that was unmuted. type UserUnmutedEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - TargetUser *string `json:"target_user,omitempty"` - - TargetUsers []string `json:"target_users,omitempty"` - - User *User `json:"user,omitempty"` + // 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + // The target users that were unmuted + TargetUsers []UserResponseCommonFields `json:"target_users,omitempty"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } -func (*UserUnmutedEvent) GetEventType() string { - return "user.unmuted" +func (e *UserUnmutedEvent) GetEventType() string { + return e.Type } +// 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"` - - Type string `json:"type"` - - User *User `json:"user,omitempty"` + // 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"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*UserUnreadReminderEvent) GetEventType() string { - return "user.unread_message_reminder" +func (e *UserUnreadReminderEvent) GetEventType() string { + return e.Type } // This event is sent when a user gets updated. The event contains information about the updated user. type UserUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - - Custom map[string]any `json:"custom"` - - User UserResponsePrivacyFields `json:"user"` - + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` + User UserResponsePrivacyFields `json:"user"` // The type of event: "user.updated" in this case - Type string `json:"type"` - + Type string `json:"type"` ReceivedAt *Timestamp `json:"received_at,omitempty"` } -func (*UserUpdatedEvent) GetEventType() string { - return "user.updated" +func (e *UserUpdatedEvent) GetEventType() string { + return e.Type } type VelocityFilterConfig struct { - AdvancedFilters *bool `json:"advanced_filters,omitempty"` - - Async *bool `json:"async,omitempty"` - - CascadingActions *bool `json:"cascading_actions,omitempty"` - - CidsPerUser *int `json:"cids_per_user,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - FirstMessageOnly *bool `json:"first_message_only,omitempty"` - - Rules []VelocityFilterConfigRule `json:"rules,omitempty"` + AdvancedFilters *bool `json:"advanced_filters,omitempty"` + Async *bool `json:"async,omitempty"` + CascadingActions *bool `json:"cascading_actions,omitempty"` + CidsPerUser *int `json:"cids_per_user,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + FirstMessageOnly *bool `json:"first_message_only,omitempty"` + Rules []VelocityFilterConfigRule `json:"rules,omitempty"` } type VelocityFilterConfigRule struct { - Action string `json:"action"` - - BanDuration *int `json:"ban_duration,omitempty"` - - CascadingAction *string `json:"cascading_action,omitempty"` - - CascadingThreshold *int `json:"cascading_threshold,omitempty"` - - CheckMessageContext *bool `json:"check_message_context,omitempty"` - - FastSpamThreshold *int `json:"fast_spam_threshold,omitempty"` - - FastSpamTtl *int `json:"fast_spam_ttl,omitempty"` - - IpBan *bool `json:"ip_ban,omitempty"` - - ProbationPeriod *int `json:"probation_period,omitempty"` - - ShadowBan *bool `json:"shadow_ban,omitempty"` - - SlowSpamBanDuration *int `json:"slow_spam_ban_duration,omitempty"` - - SlowSpamThreshold *int `json:"slow_spam_threshold,omitempty"` - - SlowSpamTtl *int `json:"slow_spam_ttl,omitempty"` - - UrlOnly *bool `json:"url_only,omitempty"` + Action string `json:"action"` + BanDuration *int `json:"ban_duration,omitempty"` + CascadingAction *string `json:"cascading_action,omitempty"` + CascadingThreshold *int `json:"cascading_threshold,omitempty"` + CheckMessageContext *bool `json:"check_message_context,omitempty"` + FastSpamThreshold *int `json:"fast_spam_threshold,omitempty"` + FastSpamTtl *int `json:"fast_spam_ttl,omitempty"` + IpBan *bool `json:"ip_ban,omitempty"` + ProbationPeriod *int `json:"probation_period,omitempty"` + ShadowBan *bool `json:"shadow_ban,omitempty"` + SlowSpamBanDuration *int `json:"slow_spam_ban_duration,omitempty"` + SlowSpamThreshold *int `json:"slow_spam_threshold,omitempty"` + SlowSpamTtl *int `json:"slow_spam_ttl,omitempty"` + UrlOnly *bool `json:"url_only,omitempty"` } type VideoCallRuleConfig struct { - FlagAllLabels *bool `json:"flag_all_labels,omitempty"` - - FlaggedLabels []string `json:"flagged_labels,omitempty"` - - Rules []HarmConfig `json:"rules,omitempty"` + FlagAllLabels *bool `json:"flag_all_labels,omitempty"` + FlaggedLabels []string `json:"flagged_labels,omitempty"` + Rules []HarmConfig `json:"rules,omitempty"` } 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"` } -type VideoReactionsResponse struct { - Reaction string `json:"reaction"` +type VideoReactionResponse struct { + Type string `json:"type"` + User UserResponse `json:"user"` + EmojiCode *string `json:"emoji_code,omitempty"` + Custom map[string]any `json:"custom,omitempty"` +} +type VideoReactionsResponse struct { + Reaction string `json:"reaction"` CountOverTime *VideoReactionOverTimeResponse `json:"count_over_time,omitempty"` } type VideoRuleParameters struct { - Threshold *int `json:"threshold,omitempty"` - - TimeWindow *string `json:"time_window,omitempty"` - + Threshold *int `json:"threshold,omitempty"` + TimeWindow *string `json:"time_window,omitempty"` HarmLabels []string `json:"harm_labels,omitempty"` } type VideoSettings struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - CameraDefaultOn bool `json:"camera_default_on"` - - CameraFacing string `json:"camera_facing"` - - Enabled bool `json:"enabled"` - - TargetResolution TargetResolution `json:"target_resolution"` + AccessRequestEnabled bool `json:"access_request_enabled"` + CameraDefaultOn bool `json:"camera_default_on"` + CameraFacing string `json:"camera_facing"` + Enabled bool `json:"enabled"` + TargetResolution TargetResolution `json:"target_resolution"` } type VideoSettingsRequest struct { - AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` - - CameraDefaultOn *bool `json:"camera_default_on,omitempty"` - - CameraFacing *string `json:"camera_facing,omitempty"` - - Enabled *bool `json:"enabled,omitempty"` - - TargetResolution *TargetResolution `json:"target_resolution,omitempty"` + AccessRequestEnabled *bool `json:"access_request_enabled,omitempty"` + CameraDefaultOn *bool `json:"camera_default_on,omitempty"` + CameraFacing *string `json:"camera_facing,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + TargetResolution *TargetResolution `json:"target_resolution,omitempty"` } type VideoSettingsResponse struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - - CameraDefaultOn bool `json:"camera_default_on"` - - CameraFacing string `json:"camera_facing"` - - Enabled bool `json:"enabled"` - - TargetResolution TargetResolution `json:"target_resolution"` + AccessRequestEnabled bool `json:"access_request_enabled"` + CameraDefaultOn bool `json:"camera_default_on"` + CameraFacing string `json:"camera_facing"` + Enabled bool `json:"enabled"` + TargetResolution TargetResolution `json:"target_resolution"` } type VoteData struct { AnswerText *string `json:"answer_text,omitempty"` + OptionID *string `json:"option_id,omitempty"` +} - OptionID *string `json:"option_id,omitempty"` +// The discriminator object for all webhook events, it maps events' payload to the final type +type WHEvent struct { + Type string `json:"type"` } type WHIPIngress struct { @@ -14680,96 +11412,55 @@ type WHIPIngress struct { // Represents an BaseEvent that happened in Stream Chat type WSEvent struct { - CreatedAt Timestamp `json:"created_at"` - - Type string `json:"type"` - - Custom map[string]any `json:"custom"` - - Automoderation *bool `json:"automoderation,omitempty"` - - ChannelID *string `json:"channel_id,omitempty"` - - ChannelLastMessageAt *Timestamp `json:"channel_last_message_at,omitempty"` - - ChannelType *string `json:"channel_type,omitempty"` - - Cid *string `json:"cid,omitempty"` - - ConnectionID *string `json:"connection_id,omitempty"` - - ParentID *string `json:"parent_id,omitempty"` - - Reason *string `json:"reason,omitempty"` - - Team *string `json:"team,omitempty"` - - ThreadID *string `json:"thread_id,omitempty"` - - UserID *string `json:"user_id,omitempty"` - - WatcherCount *int `json:"watcher_count,omitempty"` - - AutomoderationScores *ModerationResponse `json:"automoderation_scores,omitempty"` - - Channel *ChannelResponse `json:"channel,omitempty"` - - CreatedBy *UserResponse `json:"created_by,omitempty"` - - Me *OwnUserResponse `json:"me,omitempty"` - - Member *ChannelMemberResponse `json:"member,omitempty"` - - Message *MessageResponse `json:"message,omitempty"` - - MessageUpdate *MessageUpdate `json:"message_update,omitempty"` - - Poll *PollResponseData `json:"poll,omitempty"` - - PollVote *PollVoteResponseData `json:"poll_vote,omitempty"` - - Reaction *ReactionResponse `json:"reaction,omitempty"` - - Thread *ThreadResponse `json:"thread,omitempty"` - - User *UserResponse `json:"user,omitempty"` -} - -// The discriminator object for all webhook events, it maps events' payload to the final type -type WebhookEvent struct { - Type string `json:"type"` + CreatedAt Timestamp `json:"created_at"` + Type string `json:"type"` + Custom map[string]any `json:"custom"` + Automoderation *bool `json:"automoderation,omitempty"` + ChannelID *string `json:"channel_id,omitempty"` + ChannelLastMessageAt *Timestamp `json:"channel_last_message_at,omitempty"` + ChannelType *string `json:"channel_type,omitempty"` + Cid *string `json:"cid,omitempty"` + ConnectionID *string `json:"connection_id,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + Reason *string `json:"reason,omitempty"` + Team *string `json:"team,omitempty"` + ThreadID *string `json:"thread_id,omitempty"` + UserID *string `json:"user_id,omitempty"` + WatcherCount *int `json:"watcher_count,omitempty"` + AutomoderationScores *ModerationResponse `json:"automoderation_scores,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` + CreatedBy *UserResponse `json:"created_by,omitempty"` + Me *OwnUserResponse `json:"me,omitempty"` + Member *ChannelMemberResponse `json:"member,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + MessageUpdate *MessageUpdate `json:"message_update,omitempty"` + Poll *PollResponseData `json:"poll,omitempty"` + PollVote *PollVoteResponseData `json:"poll_vote,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + Thread *ThreadResponse `json:"thread,omitempty"` + User *UserResponse `json:"user,omitempty"` } // Basic response information type WrappedUnreadCountsResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - - TotalUnreadCount int `json:"total_unread_count"` - - TotalUnreadThreadsCount int `json:"total_unread_threads_count"` - - ChannelType []UnreadCountsChannelType `json:"channel_type"` - - Channels []UnreadCountsChannel `json:"channels"` - - Threads []UnreadCountsThread `json:"threads"` - - TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` + Duration string `json:"duration"` + TotalUnreadCount int `json:"total_unread_count"` + TotalUnreadThreadsCount int `json:"total_unread_threads_count"` + ChannelType []UnreadCountsChannelType `json:"channel_type"` + Channels []UnreadCountsChannel `json:"channels"` + Threads []UnreadCountsThread `json:"threads"` + TotalUnreadCountByTeam map[string]int `json:"total_unread_count_by_team,omitempty"` } type XiaomiConfig struct { - Disabled *bool `json:"Disabled,omitempty"` - + Disabled *bool `json:"Disabled,omitempty"` PackageName *string `json:"package_name,omitempty"` - - Secret *string `json:"secret,omitempty"` + Secret *string `json:"secret,omitempty"` } type XiaomiConfigFields struct { - Enabled bool `json:"enabled"` - + Enabled bool `json:"enabled"` PackageName *string `json:"package_name,omitempty"` - - Secret *string `json:"secret,omitempty"` + Secret *string `json:"secret,omitempty"` } diff --git a/requests.go b/requests.go index fbb8ef9..f330e0c 100644 --- a/requests.go +++ b/requests.go @@ -20,6 +20,7 @@ type UpdateAppRequest struct { ImageModerationEnabled *bool `json:"image_moderation_enabled"` MaxAggregatedActivitiesLength *int `json:"max_aggregated_activities_length"` MigratePermissionsToV2 *bool `json:"migrate_permissions_to_v2"` + ModerationAnalyticsEnabled *bool `json:"moderation_analytics_enabled"` ModerationEnabled *bool `json:"moderation_enabled"` ModerationWebhookUrl *string `json:"moderation_webhook_url"` MultiTenantEnabled *bool `json:"multi_tenant_enabled"` @@ -102,7 +103,7 @@ type StartCampaignRequest struct { StopAt *Timestamp `json:"stop_at"` } -type ScheduleCampaignRequest struct { +type StopCampaignRequest struct { } type QueryChannelsRequest struct { @@ -121,11 +122,10 @@ type QueryChannelsRequest struct { } type ChannelBatchUpdateRequest struct { - Operation string `json:"operation"` - Filter map[string]any `json:"filter"` - FilterTagsUpdate []string `json:"filter_tags_update"` - Members []ChannelBatchMemberRequest `json:"members"` - Data *ChannelDataUpdate `json:"data"` + Operation string `json:"operation"` + Filter map[string]any `json:"filter"` + Members []ChannelBatchMemberRequest `json:"members"` + Data *ChannelDataUpdate `json:"data"` } type DeleteChannelsRequest struct { @@ -305,6 +305,7 @@ type CreateChannelTypeRequest struct { PartitionSize *int `json:"partition_size"` PartitionTtl *string `json:"partition_ttl"` Polls *bool `json:"polls"` + PushLevel *string `json:"push_level"` PushNotifications *bool `json:"push_notifications"` Reactions *bool `json:"reactions"` ReadEvents *bool `json:"read_events"` @@ -343,6 +344,7 @@ type UpdateChannelTypeRequest struct { PartitionSize *int `json:"partition_size"` PartitionTtl *string `json:"partition_ttl"` Polls *bool `json:"polls"` + PushLevel *string `json:"push_level"` PushNotifications *bool `json:"push_notifications"` Quotes *bool `json:"quotes"` Reactions *bool `json:"reactions"` @@ -435,6 +437,7 @@ type UpdateMessageRequest struct { type UpdateMessagePartialRequest struct { SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` UserID *string `json:"user_id"` Unset []string `json:"unset"` Set map[string]any `json:"set"` @@ -452,6 +455,7 @@ type CommitMessageRequest struct { type EphemeralMessageUpdateRequest struct { SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` UserID *string `json:"user_id"` Unset []string `json:"unset"` Set map[string]any `json:"set"` @@ -488,9 +492,7 @@ type TranslateMessageRequest struct { } type UndeleteMessageRequest struct { - Message MessageRequest `json:"message"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` + UndeletedBy string `json:"undeleted_by"` } type CastPollVoteRequest struct { @@ -598,6 +600,14 @@ type QuerySegmentTargetsRequest struct { Filter map[string]any `json:"Filter"` } +type QueryTeamUsageStatsRequest struct { + EndDate *string `json:"end_date"` + Limit *int `json:"limit"` + Month *string `json:"month"` + Next *string `json:"next"` + StartDate *string `json:"start_date"` +} + type QueryThreadsRequest struct { Limit *int `json:"limit"` MemberLimit *int `json:"member_limit"` @@ -714,6 +724,7 @@ type CheckExternalStorageRequest struct { type AddActivityRequest struct { Type string `json:"type"` Feeds []string `json:"feeds"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` ExpiresAt *string `json:"expires_at"` ID *string `json:"id"` @@ -740,6 +751,10 @@ type UpsertActivitiesRequest struct { Activities []ActivityRequest `json:"activities"` } +type UpdateActivitiesPartialBatchRequest struct { + Changes []UpdateActivityPartialChangeRequest `json:"changes"` +} + type DeleteActivitiesRequest struct { Ids []string `json:"ids"` DeleteNotificationActivity *bool `json:"delete_notification_activity"` @@ -749,6 +764,7 @@ type DeleteActivitiesRequest struct { } type QueryActivitiesRequest struct { + IncludeExpiredActivities *bool `json:"include_expired_activities"` IncludePrivateActivities *bool `json:"include_private_activities"` Limit *int `json:"limit"` Next *string `json:"next"` @@ -791,6 +807,7 @@ type ActivityFeedbackRequest struct { type AddActivityReactionRequest struct { Type string `json:"type"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` EnforceUnique *bool `json:"enforce_unique"` SkipPush *bool `json:"skip_push"` @@ -821,7 +838,9 @@ type GetActivityRequest struct { } type UpdateActivityPartialRequest struct { + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` HandleMentionNotifications *bool `json:"handle_mention_notifications"` + RunActivityProcessors *bool `json:"run_activity_processors"` UserID *string `json:"user_id"` Unset []string `json:"unset"` Set map[string]any `json:"set"` @@ -829,10 +848,12 @@ type UpdateActivityPartialRequest struct { } type UpdateActivityRequest struct { + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` ExpiresAt *Timestamp `json:"expires_at"` HandleMentionNotifications *bool `json:"handle_mention_notifications"` PollID *string `json:"poll_id"` RestrictReplies *string `json:"restrict_replies"` + RunActivityProcessors *bool `json:"run_activity_processors"` SkipEnrichUrl *bool `json:"skip_enrich_url"` Text *string `json:"text"` UserID *string `json:"user_id"` @@ -846,6 +867,7 @@ type UpdateActivityRequest struct { MentionedUserIds []string `json:"mentioned_user_ids"` Custom map[string]any `json:"custom"` Location *ActivityLocation `json:"location"` + SearchData map[string]any `json:"search_data"` User *UserRequest `json:"user"` } @@ -885,8 +907,8 @@ type DeleteCollectionsRequest struct { } type ReadCollectionsRequest struct { - CollectionRefs []string `json:"-" query:"collection_refs"` UserID *string `json:"-" query:"user_id"` + CollectionRefs []string `json:"-" query:"collection_refs"` } type UpdateCollectionsRequest struct { @@ -919,6 +941,7 @@ type GetCommentsRequest struct { type AddCommentRequest struct { Comment *string `json:"comment"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` ID *string `json:"id"` ObjectID *string `json:"object_id"` @@ -938,11 +961,14 @@ type AddCommentsBatchRequest struct { } type QueryCommentsRequest struct { - Filter map[string]any `json:"filter"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort *string `json:"sort"` + Filter map[string]any `json:"filter"` + IDAround *string `json:"id_around"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort *string `json:"sort"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeleteCommentRequest struct { @@ -955,6 +981,7 @@ type GetCommentRequest struct { type UpdateCommentRequest struct { Comment *string `json:"comment"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` HandleMentionNotifications *bool `json:"handle_mention_notifications"` SkipEnrichUrl *bool `json:"skip_enrich_url"` SkipPush *bool `json:"skip_push"` @@ -967,6 +994,7 @@ type UpdateCommentRequest struct { type AddCommentReactionRequest struct { Type string `json:"type"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` EnforceUnique *bool `json:"enforce_unique"` SkipPush *bool `json:"skip_push"` @@ -1020,22 +1048,23 @@ type DeleteFeedRequest struct { } type GetOrCreateFeedRequest struct { - IDAround *string `json:"id_around"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - View *string `json:"view"` - Watch *bool `json:"watch"` - Data *FeedInput `json:"data"` - EnrichmentOptions *EnrichmentOptions `json:"enrichment_options"` - ExternalRanking map[string]any `json:"external_ranking"` - Filter map[string]any `json:"filter"` - FollowersPagination *PagerRequest `json:"followers_pagination"` - FollowingPagination *PagerRequest `json:"following_pagination"` - InterestWeights map[string]float64 `json:"interest_weights"` - MemberPagination *PagerRequest `json:"member_pagination"` - User *UserRequest `json:"user"` + IDAround *string `json:"id_around"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + View *string `json:"view"` + Watch *bool `json:"watch"` + Data *FeedInput `json:"data"` + EnrichmentOptions *EnrichmentOptions `json:"enrichment_options"` + ExternalRanking map[string]any `json:"external_ranking"` + Filter map[string]any `json:"filter"` + FollowersPagination *PagerRequest `json:"followers_pagination"` + FollowingPagination *PagerRequest `json:"following_pagination"` + FriendReactionsOptions *FriendReactionsOptions `json:"friend_reactions_options"` + InterestWeights map[string]float64 `json:"interest_weights"` + MemberPagination *PagerRequest `json:"member_pagination"` + User *UserRequest `json:"user"` } type UpdateFeedRequest struct { @@ -1091,11 +1120,22 @@ type RejectFeedMemberInviteRequest struct { User *UserRequest `json:"user"` } +type QueryPinnedActivitiesRequest struct { + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` +} + type GetFollowSuggestionsRequest struct { Limit *int `json:"-" query:"limit"` UserID *string `json:"-" query:"user_id"` } +type RestoreFeedGroupRequest struct { +} + type DeleteFeedGroupRequest struct { HardDelete *bool `json:"-" query:"hard_delete"` } @@ -1202,6 +1242,7 @@ type GetFeedsRateLimitsRequest struct { type UpdateFollowRequest struct { Source string `json:"source"` Target string `json:"target"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` FollowerRole *string `json:"follower_role"` PushPreference *string `json:"push_preference"` @@ -1213,6 +1254,7 @@ type UpdateFollowRequest struct { type FollowRequest struct { Source string `json:"source"` Target string `json:"target"` + CopyCustomToNotification *bool `json:"copy_custom_to_notification"` CreateNotificationActivity *bool `json:"create_notification_activity"` PushPreference *string `json:"push_preference"` SkipPush *bool `json:"skip_push"` @@ -1313,8 +1355,9 @@ type ListImportsRequest struct { } type CreateImportRequest struct { - Mode string `json:"mode"` - Path string `json:"path"` + Mode string `json:"mode"` + Path string `json:"path"` + MergeCustom *bool `json:"merge_custom"` } type ListImportV2TasksRequest struct { @@ -1430,13 +1473,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 { @@ -1446,8 +1489,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 { @@ -1462,11 +1505,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 { @@ -1480,17 +1523,18 @@ type QueryModerationLogsRequest struct { } type UpsertModerationRuleRequest struct { - Name string `json:"name"` - RuleType string `json:"rule_type"` - Action RuleBuilderAction `json:"action"` - CooldownPeriod *string `json:"cooldown_period"` - Description *string `json:"description"` - Enabled *bool `json:"enabled"` - Logic *string `json:"logic"` - Team *string `json:"team"` - Conditions []RuleBuilderCondition `json:"conditions"` - ConfigKeys []string `json:"config_keys"` - Groups []RuleBuilderConditionGroup `json:"groups"` + Name string `json:"name"` + RuleType string `json:"rule_type"` + CooldownPeriod *string `json:"cooldown_period"` + Description *string `json:"description"` + Enabled *bool `json:"enabled"` + Logic *string `json:"logic"` + Team *string `json:"team"` + ActionSequences []CallRuleActionSequence `json:"action_sequences"` + Conditions []RuleBuilderCondition `json:"conditions"` + ConfigKeys []string `json:"config_keys"` + Groups []RuleBuilderConditionGroup `json:"groups"` + Action *RuleBuilderAction `json:"action"` } type DeleteModerationRuleRequest struct { @@ -1534,25 +1578,26 @@ type GetReviewQueueItemRequest struct { } type SubmitActionRequest struct { - ActionType string `json:"action_type"` - AppealID *string `json:"appeal_id"` - 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"` - RejectAppeal *RejectAppealRequest `json:"reject_appeal"` - Restore *RestoreActionRequest `json:"restore"` - ShadowBlock *ShadowBlockActionRequest `json:"shadow_block"` - Unban *UnbanActionRequest `json:"unban"` - Unblock *UnblockActionRequest `json:"unblock"` - User *UserRequest `json:"user"` + ActionType string `json:"action_type"` + AppealID *string `json:"appeal_id"` + 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"` + Flag *FlagRequest `json:"flag"` + MarkReviewed *MarkReviewedRequestPayload `json:"mark_reviewed"` + RejectAppeal *RejectAppealRequestPayload `json:"reject_appeal"` + Restore *RestoreActionRequestPayload `json:"restore"` + ShadowBlock *ShadowBlockActionRequestPayload `json:"shadow_block"` + Unban *UnbanActionRequestPayload `json:"unban"` + Unblock *UnblockActionRequestPayload `json:"unblock"` + User *UserRequest `json:"user"` } type UnbanRequest struct { @@ -1675,7 +1720,7 @@ type ListPushProvidersRequest struct { } type UpsertPushProviderRequest struct { - PushProvider *PushProvider `json:"push_provider"` + PushProvider *PushProviderRequest `json:"push_provider"` } type DeletePushProviderRequest struct { @@ -1734,6 +1779,51 @@ type UploadImageRequest struct { User *OnlyUserID `json:"user"` } +type ListUserGroupsRequest struct { + Limit *int `json:"-" query:"limit"` + IDGt *string `json:"-" query:"id_gt"` + CreatedAtGt *string `json:"-" query:"created_at_gt"` + TeamID *string `json:"-" query:"team_id"` +} + +type CreateUserGroupRequest struct { + Name string `json:"name"` + Description *string `json:"description"` + ID *string `json:"id"` + TeamID *string `json:"team_id"` + MemberIds []string `json:"member_ids"` +} + +type SearchUserGroupsRequest struct { + Query string `json:"-" query:"query"` + Limit *int `json:"-" query:"limit"` + NameGt *string `json:"-" query:"name_gt"` + IDGt *string `json:"-" query:"id_gt"` + TeamID *string `json:"-" query:"team_id"` +} + +type DeleteUserGroupRequest struct { + TeamID *string `json:"-" query:"team_id"` +} + +type GetUserGroupRequest struct { + TeamID *string `json:"-" query:"team_id"` +} + +type UpdateUserGroupRequest struct { + Description *string `json:"description"` + Name *string `json:"name"` + TeamID *string `json:"team_id"` +} + +type RemoveUserGroupMembersRequest struct { +} + +type AddUserGroupMembersRequest struct { + MemberIds []string `json:"member_ids"` + TeamID *string `json:"team_id"` +} + type QueryUsersRequest struct { Payload *QueryUsersPayload `json:"-" query:"payload"` } @@ -2101,11 +2191,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 { @@ -2115,10 +2205,10 @@ 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 { @@ -2171,11 +2261,11 @@ type UpdateSIPTrunkRequest struct { } type ResolveSipInboundRequest struct { - SipCallerNumber string `json:"sip_caller_number"` - SipTrunkNumber string `json:"sip_trunk_number"` - Challenge SIPChallenge `json:"challenge"` - RoutingNumber *string `json:"routing_number"` - SipHeaders map[string]string `json:"sip_headers"` + SipCallerNumber string `json:"sip_caller_number"` + SipTrunkNumber string `json:"sip_trunk_number"` + Challenge SIPChallengeRequest `json:"challenge"` + RoutingNumber *string `json:"routing_number"` + SipHeaders map[string]string `json:"sip_headers"` } type QueryAggregateCallStatsRequest struct { diff --git a/video.go b/video.go index 704d585..01bc08c 100644 --- a/video.go +++ b/video.go @@ -334,9 +334,11 @@ func (c *VideoClient) StopRTMPBroadcast(ctx context.Context, _type string, id st return res, err } -func (c *VideoClient) GetCallParticipantSessionMetrics(ctx context.Context, session string, user string, userSession string, request *GetCallParticipantSessionMetricsRequest) (*StreamResponse[GetCallParticipantSessionMetricsResponse], error) { +func (c *VideoClient) GetCallParticipantSessionMetrics(ctx context.Context, _type string, id string, session string, user string, userSession string, request *GetCallParticipantSessionMetricsRequest) (*StreamResponse[GetCallParticipantSessionMetricsResponse], error) { var result GetCallParticipantSessionMetricsResponse pathParams := map[string]string{ + "type": _type, + "id": id, "session": session, "user": user, "user_session": userSession, diff --git a/video_test.go b/video_test.go index 7a3c7e7..431c1d6 100644 --- a/video_test.go +++ b/video_test.go @@ -202,7 +202,7 @@ func TestVideoGetCallParticipantSessionMetrics(t *testing.T) { client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) require.NoError(t, err) - _, err = client.Video().GetCallParticipantSessionMetrics(context.Background(), "", "", "", &getstream.GetCallParticipantSessionMetricsRequest{}) + _, err = client.Video().GetCallParticipantSessionMetrics(context.Background(), "", "", "", "", "", &getstream.GetCallParticipantSessionMetricsRequest{}) require.NoError(t, err) } func TestVideoQueryCallParticipantSessions(t *testing.T) {