diff --git a/call.go b/call.go index 0017421..344c270 100644 --- a/call.go +++ b/call.go @@ -7,22 +7,22 @@ import ( ) type Call struct { - callType string - callID string - client *VideoClient - data *CallResponse + callType string + callID string + client *VideoClient + data *CallResponse } func NewCall(callType string, callID string, client *VideoClient) *Call { return &Call{ - callType: callType, - callID: callID, - client: client, + callType: callType, + callID: callID, + client: client, } } -func (c *Call) Get(ctx context.Context, request *GetCallRequest) (*StreamResponse[GetCallResponse], error) { - response, err := c.client.GetCall(ctx, c.callType, c.callID, request) +func (c *Call) Get(ctx context.Context, request *GetCallRequest) (*StreamResponse[GetCallResponse],error){ + response, err := c.client.GetCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -30,8 +30,8 @@ func (c *Call) Get(ctx context.Context, request *GetCallRequest) (*StreamRespons return response, nil } -func (c *Call) Update(ctx context.Context, request *UpdateCallRequest) (*StreamResponse[UpdateCallResponse], error) { - response, err := c.client.UpdateCall(ctx, c.callType, c.callID, request) +func (c *Call) Update(ctx context.Context, request *UpdateCallRequest) (*StreamResponse[UpdateCallResponse],error){ + response, err := c.client.UpdateCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -39,8 +39,8 @@ func (c *Call) Update(ctx context.Context, request *UpdateCallRequest) (*StreamR return response, nil } -func (c *Call) GetOrCreate(ctx context.Context, request *GetOrCreateCallRequest) (*StreamResponse[GetOrCreateCallResponse], error) { - response, err := c.client.GetOrCreateCall(ctx, c.callType, c.callID, request) +func (c *Call) GetOrCreate(ctx context.Context, request *GetOrCreateCallRequest) (*StreamResponse[GetOrCreateCallResponse],error){ + response, err := c.client.GetOrCreateCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -48,8 +48,8 @@ func (c *Call) GetOrCreate(ctx context.Context, request *GetOrCreateCallRequest) return response, nil } -func (c *Call) BlockUser(ctx context.Context, request *BlockUserRequest) (*StreamResponse[BlockUserResponse], error) { - response, err := c.client.BlockUser(ctx, c.callType, c.callID, request) +func (c *Call) BlockUser(ctx context.Context, request *BlockUserRequest) (*StreamResponse[BlockUserResponse],error){ + response, err := c.client.BlockUser(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -57,8 +57,8 @@ func (c *Call) BlockUser(ctx context.Context, request *BlockUserRequest) (*Strea return response, nil } -func (c *Call) SendClosedCaption(ctx context.Context, request *SendClosedCaptionRequest) (*StreamResponse[SendClosedCaptionResponse], error) { - response, err := c.client.SendClosedCaption(ctx, c.callType, c.callID, request) +func (c *Call) SendClosedCaption(ctx context.Context, request *SendClosedCaptionRequest) (*StreamResponse[SendClosedCaptionResponse],error){ + response, err := c.client.SendClosedCaption(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -66,8 +66,8 @@ func (c *Call) SendClosedCaption(ctx context.Context, request *SendClosedCaption return response, nil } -func (c *Call) Delete(ctx context.Context, request *DeleteCallRequest) (*StreamResponse[DeleteCallResponse], error) { - response, err := c.client.DeleteCall(ctx, c.callType, c.callID, request) +func (c *Call) Delete(ctx context.Context, request *DeleteCallRequest) (*StreamResponse[DeleteCallResponse],error){ + response, err := c.client.DeleteCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -75,8 +75,8 @@ func (c *Call) Delete(ctx context.Context, request *DeleteCallRequest) (*StreamR return response, nil } -func (c *Call) SendCallEvent(ctx context.Context, request *SendCallEventRequest) (*StreamResponse[SendCallEventResponse], error) { - response, err := c.client.SendCallEvent(ctx, c.callType, c.callID, request) +func (c *Call) SendCallEvent(ctx context.Context, request *SendCallEventRequest) (*StreamResponse[SendCallEventResponse],error){ + response, err := c.client.SendCallEvent(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -84,8 +84,8 @@ func (c *Call) SendCallEvent(ctx context.Context, request *SendCallEventRequest) return response, nil } -func (c *Call) CollectUserFeedback(ctx context.Context, request *CollectUserFeedbackRequest) (*StreamResponse[CollectUserFeedbackResponse], error) { - response, err := c.client.CollectUserFeedback(ctx, c.callType, c.callID, request) +func (c *Call) CollectUserFeedback(ctx context.Context, request *CollectUserFeedbackRequest) (*StreamResponse[CollectUserFeedbackResponse],error){ + response, err := c.client.CollectUserFeedback(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -93,8 +93,8 @@ func (c *Call) CollectUserFeedback(ctx context.Context, request *CollectUserFeed return response, nil } -func (c *Call) GoLive(ctx context.Context, request *GoLiveRequest) (*StreamResponse[GoLiveResponse], error) { - response, err := c.client.GoLive(ctx, c.callType, c.callID, request) +func (c *Call) GoLive(ctx context.Context, request *GoLiveRequest) (*StreamResponse[GoLiveResponse],error){ + response, err := c.client.GoLive(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -102,8 +102,8 @@ func (c *Call) GoLive(ctx context.Context, request *GoLiveRequest) (*StreamRespo return response, nil } -func (c *Call) KickUser(ctx context.Context, request *KickUserRequest) (*StreamResponse[KickUserResponse], error) { - response, err := c.client.KickUser(ctx, c.callType, c.callID, request) +func (c *Call) KickUser(ctx context.Context, request *KickUserRequest) (*StreamResponse[KickUserResponse],error){ + response, err := c.client.KickUser(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -111,8 +111,8 @@ func (c *Call) KickUser(ctx context.Context, request *KickUserRequest) (*StreamR return response, nil } -func (c *Call) End(ctx context.Context, request *EndCallRequest) (*StreamResponse[EndCallResponse], error) { - response, err := c.client.EndCall(ctx, c.callType, c.callID, request) +func (c *Call) End(ctx context.Context, request *EndCallRequest) (*StreamResponse[EndCallResponse],error){ + response, err := c.client.EndCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -120,8 +120,8 @@ func (c *Call) End(ctx context.Context, request *EndCallRequest) (*StreamRespons return response, nil } -func (c *Call) UpdateCallMembers(ctx context.Context, request *UpdateCallMembersRequest) (*StreamResponse[UpdateCallMembersResponse], error) { - response, err := c.client.UpdateCallMembers(ctx, c.callType, c.callID, request) +func (c *Call) UpdateCallMembers(ctx context.Context, request *UpdateCallMembersRequest) (*StreamResponse[UpdateCallMembersResponse],error){ + response, err := c.client.UpdateCallMembers(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -129,8 +129,8 @@ func (c *Call) UpdateCallMembers(ctx context.Context, request *UpdateCallMembers return response, nil } -func (c *Call) MuteUsers(ctx context.Context, request *MuteUsersRequest) (*StreamResponse[MuteUsersResponse], error) { - response, err := c.client.MuteUsers(ctx, c.callType, c.callID, request) +func (c *Call) MuteUsers(ctx context.Context, request *MuteUsersRequest) (*StreamResponse[MuteUsersResponse],error){ + response, err := c.client.MuteUsers(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -138,8 +138,8 @@ func (c *Call) MuteUsers(ctx context.Context, request *MuteUsersRequest) (*Strea return response, nil } -func (c *Call) QueryCallParticipants(ctx context.Context, request *QueryCallParticipantsRequest) (*StreamResponse[QueryCallParticipantsResponse], error) { - response, err := c.client.QueryCallParticipants(ctx, c.callType, c.callID, request) +func (c *Call) QueryCallParticipants(ctx context.Context, request *QueryCallParticipantsRequest) (*StreamResponse[QueryCallParticipantsResponse],error){ + response, err := c.client.QueryCallParticipants(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -147,8 +147,8 @@ func (c *Call) QueryCallParticipants(ctx context.Context, request *QueryCallPart return response, nil } -func (c *Call) VideoPin(ctx context.Context, request *VideoPinRequest) (*StreamResponse[PinResponse], error) { - response, err := c.client.VideoPin(ctx, c.callType, c.callID, request) +func (c *Call) VideoPin(ctx context.Context, request *VideoPinRequest) (*StreamResponse[PinResponse],error){ + response, err := c.client.VideoPin(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -156,8 +156,8 @@ func (c *Call) VideoPin(ctx context.Context, request *VideoPinRequest) (*StreamR return response, nil } -func (c *Call) ListRecordings(ctx context.Context, request *ListRecordingsRequest) (*StreamResponse[ListRecordingsResponse], error) { - response, err := c.client.ListRecordings(ctx, c.callType, c.callID, request) +func (c *Call) ListRecordings(ctx context.Context, request *ListRecordingsRequest) (*StreamResponse[ListRecordingsResponse],error){ + response, err := c.client.ListRecordings(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -165,8 +165,8 @@ func (c *Call) ListRecordings(ctx context.Context, request *ListRecordingsReques return response, nil } -func (c *Call) StartRecording(ctx context.Context, recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { - response, err := c.client.StartRecording(ctx, c.callType, c.callID, recordingType, request) +func (c *Call) StartRecording(ctx context.Context,recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse],error){ + response, err := c.client.StartRecording(ctx,c.callType, c.callID,recordingType, request) if err != nil { return nil, err } @@ -174,8 +174,8 @@ func (c *Call) StartRecording(ctx context.Context, recordingType string, request return response, nil } -func (c *Call) StopRecording(ctx context.Context, recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { - response, err := c.client.StopRecording(ctx, c.callType, c.callID, recordingType, request) +func (c *Call) StopRecording(ctx context.Context,recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse],error){ + response, err := c.client.StopRecording(ctx,c.callType, c.callID,recordingType, request) if err != nil { return nil, err } @@ -183,8 +183,8 @@ func (c *Call) StopRecording(ctx context.Context, recordingType string, request return response, nil } -func (c *Call) GetCallReport(ctx context.Context, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse], error) { - response, err := c.client.GetCallReport(ctx, c.callType, c.callID, request) +func (c *Call) GetCallReport(ctx context.Context, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse],error){ + response, err := c.client.GetCallReport(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -192,8 +192,8 @@ func (c *Call) GetCallReport(ctx context.Context, request *GetCallReportRequest) return response, nil } -func (c *Call) Ring(ctx context.Context, request *RingCallRequest) (*StreamResponse[RingCallResponse], error) { - response, err := c.client.RingCall(ctx, c.callType, c.callID, request) +func (c *Call) Ring(ctx context.Context, request *RingCallRequest) (*StreamResponse[RingCallResponse],error){ + response, err := c.client.RingCall(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -201,8 +201,8 @@ func (c *Call) Ring(ctx context.Context, request *RingCallRequest) (*StreamRespo return response, nil } -func (c *Call) StartRTMPBroadcasts(ctx context.Context, request *StartRTMPBroadcastsRequest) (*StreamResponse[StartRTMPBroadcastsResponse], error) { - response, err := c.client.StartRTMPBroadcasts(ctx, c.callType, c.callID, request) +func (c *Call) StartRTMPBroadcasts(ctx context.Context, request *StartRTMPBroadcastsRequest) (*StreamResponse[StartRTMPBroadcastsResponse],error){ + response, err := c.client.StartRTMPBroadcasts(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -210,8 +210,8 @@ func (c *Call) StartRTMPBroadcasts(ctx context.Context, request *StartRTMPBroadc return response, nil } -func (c *Call) StopAllRTMPBroadcasts(ctx context.Context, request *StopAllRTMPBroadcastsRequest) (*StreamResponse[StopAllRTMPBroadcastsResponse], error) { - response, err := c.client.StopAllRTMPBroadcasts(ctx, c.callType, c.callID, request) +func (c *Call) StopAllRTMPBroadcasts(ctx context.Context, request *StopAllRTMPBroadcastsRequest) (*StreamResponse[StopAllRTMPBroadcastsResponse],error){ + response, err := c.client.StopAllRTMPBroadcasts(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -219,8 +219,8 @@ func (c *Call) StopAllRTMPBroadcasts(ctx context.Context, request *StopAllRTMPBr return response, nil } -func (c *Call) StopRTMPBroadcast(ctx context.Context, name string, request *StopRTMPBroadcastRequest) (*StreamResponse[StopRTMPBroadcastsResponse], error) { - response, err := c.client.StopRTMPBroadcast(ctx, c.callType, c.callID, name, request) +func (c *Call) StopRTMPBroadcast(ctx context.Context,name string, request *StopRTMPBroadcastRequest) (*StreamResponse[StopRTMPBroadcastsResponse],error){ + response, err := c.client.StopRTMPBroadcast(ctx,c.callType, c.callID,name, request) if err != nil { return nil, err } @@ -228,8 +228,8 @@ func (c *Call) StopRTMPBroadcast(ctx context.Context, name string, request *Stop return response, nil } -func (c *Call) GetCallParticipantSessionMetrics(ctx context.Context, session string, user string, userSession string, request *GetCallParticipantSessionMetricsRequest) (*StreamResponse[GetCallParticipantSessionMetricsResponse], error) { - response, err := c.client.GetCallParticipantSessionMetrics(ctx, c.callType, c.callID, session, user, userSession, request) +func (c *Call) GetCallParticipantSessionMetrics(ctx context.Context,session string, user string, userSession string, request *GetCallParticipantSessionMetricsRequest) (*StreamResponse[GetCallParticipantSessionMetricsResponse],error){ + response, err := c.client.GetCallParticipantSessionMetrics(ctx,c.callType, c.callID,session, user, userSession, request) if err != nil { return nil, err } @@ -237,8 +237,8 @@ func (c *Call) GetCallParticipantSessionMetrics(ctx context.Context, session str return response, nil } -func (c *Call) QueryCallParticipantSessions(ctx context.Context, session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse], error) { - response, err := c.client.QueryCallParticipantSessions(ctx, c.callType, c.callID, session, request) +func (c *Call) QueryCallParticipantSessions(ctx context.Context,session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse],error){ + response, err := c.client.QueryCallParticipantSessions(ctx,c.callType, c.callID,session, request) if err != nil { return nil, err } @@ -246,8 +246,8 @@ func (c *Call) QueryCallParticipantSessions(ctx context.Context, session string, return response, nil } -func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { - response, err := c.client.StartHLSBroadcasting(ctx, c.callType, c.callID, request) +func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse],error){ + response, err := c.client.StartHLSBroadcasting(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -255,8 +255,8 @@ func (c *Call) StartHLSBroadcasting(ctx context.Context, request *StartHLSBroadc return response, nil } -func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse], error) { - response, err := c.client.StartClosedCaptions(ctx, c.callType, c.callID, request) +func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse],error){ + response, err := c.client.StartClosedCaptions(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -264,8 +264,8 @@ func (c *Call) StartClosedCaptions(ctx context.Context, request *StartClosedCapt return response, nil } -func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse], error) { - response, err := c.client.StartFrameRecording(ctx, c.callType, c.callID, request) +func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse],error){ + response, err := c.client.StartFrameRecording(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -273,8 +273,8 @@ func (c *Call) StartFrameRecording(ctx context.Context, request *StartFrameRecor return response, nil } -func (c *Call) StartTranscription(ctx context.Context, request *StartTranscriptionRequest) (*StreamResponse[StartTranscriptionResponse], error) { - response, err := c.client.StartTranscription(ctx, c.callType, c.callID, request) +func (c *Call) StartTranscription(ctx context.Context, request *StartTranscriptionRequest) (*StreamResponse[StartTranscriptionResponse],error){ + response, err := c.client.StartTranscription(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -282,8 +282,8 @@ func (c *Call) StartTranscription(ctx context.Context, request *StartTranscripti return response, nil } -func (c *Call) StopHLSBroadcasting(ctx context.Context, request *StopHLSBroadcastingRequest) (*StreamResponse[StopHLSBroadcastingResponse], error) { - response, err := c.client.StopHLSBroadcasting(ctx, c.callType, c.callID, request) +func (c *Call) StopHLSBroadcasting(ctx context.Context, request *StopHLSBroadcastingRequest) (*StreamResponse[StopHLSBroadcastingResponse],error){ + response, err := c.client.StopHLSBroadcasting(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -291,8 +291,8 @@ func (c *Call) StopHLSBroadcasting(ctx context.Context, request *StopHLSBroadcas return response, nil } -func (c *Call) StopClosedCaptions(ctx context.Context, request *StopClosedCaptionsRequest) (*StreamResponse[StopClosedCaptionsResponse], error) { - response, err := c.client.StopClosedCaptions(ctx, c.callType, c.callID, request) +func (c *Call) StopClosedCaptions(ctx context.Context, request *StopClosedCaptionsRequest) (*StreamResponse[StopClosedCaptionsResponse],error){ + response, err := c.client.StopClosedCaptions(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -300,8 +300,8 @@ func (c *Call) StopClosedCaptions(ctx context.Context, request *StopClosedCaptio return response, nil } -func (c *Call) StopFrameRecording(ctx context.Context, request *StopFrameRecordingRequest) (*StreamResponse[StopFrameRecordingResponse], error) { - response, err := c.client.StopFrameRecording(ctx, c.callType, c.callID, request) +func (c *Call) StopFrameRecording(ctx context.Context, request *StopFrameRecordingRequest) (*StreamResponse[StopFrameRecordingResponse],error){ + response, err := c.client.StopFrameRecording(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -309,8 +309,8 @@ func (c *Call) StopFrameRecording(ctx context.Context, request *StopFrameRecordi return response, nil } -func (c *Call) StopLive(ctx context.Context, request *StopLiveRequest) (*StreamResponse[StopLiveResponse], error) { - response, err := c.client.StopLive(ctx, c.callType, c.callID, request) +func (c *Call) StopLive(ctx context.Context, request *StopLiveRequest) (*StreamResponse[StopLiveResponse],error){ + response, err := c.client.StopLive(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -318,8 +318,8 @@ func (c *Call) StopLive(ctx context.Context, request *StopLiveRequest) (*StreamR return response, nil } -func (c *Call) StopTranscription(ctx context.Context, request *StopTranscriptionRequest) (*StreamResponse[StopTranscriptionResponse], error) { - response, err := c.client.StopTranscription(ctx, c.callType, c.callID, request) +func (c *Call) StopTranscription(ctx context.Context, request *StopTranscriptionRequest) (*StreamResponse[StopTranscriptionResponse],error){ + response, err := c.client.StopTranscription(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -327,8 +327,8 @@ func (c *Call) StopTranscription(ctx context.Context, request *StopTranscription return response, nil } -func (c *Call) ListTranscriptions(ctx context.Context, request *ListTranscriptionsRequest) (*StreamResponse[ListTranscriptionsResponse], error) { - response, err := c.client.ListTranscriptions(ctx, c.callType, c.callID, request) +func (c *Call) ListTranscriptions(ctx context.Context, request *ListTranscriptionsRequest) (*StreamResponse[ListTranscriptionsResponse],error){ + response, err := c.client.ListTranscriptions(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -336,8 +336,8 @@ func (c *Call) ListTranscriptions(ctx context.Context, request *ListTranscriptio return response, nil } -func (c *Call) UnblockUser(ctx context.Context, request *UnblockUserRequest) (*StreamResponse[UnblockUserResponse], error) { - response, err := c.client.UnblockUser(ctx, c.callType, c.callID, request) +func (c *Call) UnblockUser(ctx context.Context, request *UnblockUserRequest) (*StreamResponse[UnblockUserResponse],error){ + response, err := c.client.UnblockUser(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -345,8 +345,8 @@ func (c *Call) UnblockUser(ctx context.Context, request *UnblockUserRequest) (*S return response, nil } -func (c *Call) VideoUnpin(ctx context.Context, request *VideoUnpinRequest) (*StreamResponse[UnpinResponse], error) { - response, err := c.client.VideoUnpin(ctx, c.callType, c.callID, request) +func (c *Call) VideoUnpin(ctx context.Context, request *VideoUnpinRequest) (*StreamResponse[UnpinResponse],error){ + response, err := c.client.VideoUnpin(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -354,8 +354,8 @@ func (c *Call) VideoUnpin(ctx context.Context, request *VideoUnpinRequest) (*Str return response, nil } -func (c *Call) UpdateUserPermissions(ctx context.Context, request *UpdateUserPermissionsRequest) (*StreamResponse[UpdateUserPermissionsResponse], error) { - response, err := c.client.UpdateUserPermissions(ctx, c.callType, c.callID, request) +func (c *Call) UpdateUserPermissions(ctx context.Context, request *UpdateUserPermissionsRequest) (*StreamResponse[UpdateUserPermissionsResponse],error){ + response, err := c.client.UpdateUserPermissions(ctx,c.callType, c.callID, request) if err != nil { return nil, err } @@ -363,8 +363,8 @@ func (c *Call) UpdateUserPermissions(ctx context.Context, request *UpdateUserPer return response, nil } -func (c *Call) DeleteRecording(ctx context.Context, session string, filename string, request *DeleteRecordingRequest) (*StreamResponse[DeleteRecordingResponse], error) { - response, err := c.client.DeleteRecording(ctx, c.callType, c.callID, session, filename, request) +func (c *Call) DeleteRecording(ctx context.Context,session string, filename string, request *DeleteRecordingRequest) (*StreamResponse[DeleteRecordingResponse],error){ + response, err := c.client.DeleteRecording(ctx,c.callType, c.callID,session, filename, request) if err != nil { return nil, err } @@ -372,8 +372,8 @@ func (c *Call) DeleteRecording(ctx context.Context, session string, filename str return response, nil } -func (c *Call) DeleteTranscription(ctx context.Context, session string, filename string, request *DeleteTranscriptionRequest) (*StreamResponse[DeleteTranscriptionResponse], error) { - response, err := c.client.DeleteTranscription(ctx, c.callType, c.callID, session, filename, request) +func (c *Call) DeleteTranscription(ctx context.Context,session string, filename string, request *DeleteTranscriptionRequest) (*StreamResponse[DeleteTranscriptionResponse],error){ + response, err := c.client.DeleteTranscription(ctx,c.callType, c.callID,session, filename, request) if err != nil { return nil, err } @@ -382,56 +382,56 @@ func (c *Call) DeleteTranscription(ctx context.Context, session string, filename } func (c *Call) syncFromResponse(data any) { - if data == nil || c == nil { - return - } - - v := reflect.ValueOf(data) - // Unwrap interfaces/pointers - for v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer { - if v.IsNil() { - return - } - v = v.Elem() - } - if v.Kind() != reflect.Struct { - return - } - - // Look for exported field named "Call" - f := v.FieldByName("Call") - if !f.IsValid() { - return - } - - crPtrType := reflect.TypeOf((*CallResponse)(nil)) // *CallResponse - crValType := reflect.TypeOf(CallResponse{}) // CallResponse - - switch f.Kind() { - case reflect.Pointer: - // Expect *CallResponse - if f.Type() == crPtrType && !f.IsNil() { - if cr, ok := f.Interface().(*CallResponse); ok { - c.data = cr - } - } - case reflect.Struct: - // Expect CallResponse value - if f.Type() == crValType { - // Need addressable struct field to take &f - if f.CanAddr() { - if cr, ok := f.Addr().Interface().(*CallResponse); ok { - c.data = cr - } - } else { - // Fallback: copy to a new value - cr := f.Interface().(CallResponse) - c.data = &cr - } - } - } + if data == nil || c == nil { + return + } + + v := reflect.ValueOf(data) + // Unwrap interfaces/pointers + for v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer { + if v.IsNil() { + return + } + v = v.Elem() + } + if v.Kind() != reflect.Struct { + return + } + + // Look for exported field named "Call" + f := v.FieldByName("Call") + if !f.IsValid() { + return + } + + crPtrType := reflect.TypeOf((*CallResponse)(nil)) // *CallResponse + crValType := reflect.TypeOf(CallResponse{}) // CallResponse + + switch f.Kind() { + case reflect.Pointer: + // Expect *CallResponse + if f.Type() == crPtrType && !f.IsNil() { + if cr, ok := f.Interface().(*CallResponse); ok { + c.data = cr + } + } + case reflect.Struct: + // Expect CallResponse value + if f.Type() == crValType { + // Need addressable struct field to take &f + if f.CanAddr() { + if cr, ok := f.Addr().Interface().(*CallResponse); ok { + c.data = cr + } + } else { + // Fallback: copy to a new value + cr := f.Interface().(CallResponse) + c.data = &cr + } + } + } } func (c *VideoClient) Call(callType, callID string) *Call { return NewCall(callType, callID, c) -} +} \ No newline at end of file diff --git a/channel.go b/channel.go index 0c04a1e..33aaaec 100644 --- a/channel.go +++ b/channel.go @@ -4,93 +4,93 @@ package getstream import "context" type Channels struct { - channelType string - channelD string - client *ChatClient + channelType string + channelD string + client *ChatClient } func NewChannel(channelType string, channelD string, client *ChatClient) *Channels { return &Channels{ channelType: channelType, - channelD: channelD, - client: client, + channelD: channelD, + client: client, } } -func (c *Channels) Delete(ctx context.Context, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse], error) { - return c.client.DeleteChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) Delete(ctx context.Context, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse],error){ + return c.client.DeleteChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) UpdateChannelPartial(ctx context.Context, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse], error) { - return c.client.UpdateChannelPartial(ctx, c.channelType, c.channelD, request) +func (c *Channels) UpdateChannelPartial(ctx context.Context, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse],error){ + return c.client.UpdateChannelPartial(ctx,c.channelType, c.channelD, request) } -func (c *Channels) Update(ctx context.Context, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse], error) { - return c.client.UpdateChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) Update(ctx context.Context, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse],error){ + return c.client.UpdateChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) DeleteDraft(ctx context.Context, request *DeleteDraftRequest) (*StreamResponse[Response], error) { - return c.client.DeleteDraft(ctx, c.channelType, c.channelD, request) +func (c *Channels) DeleteDraft(ctx context.Context, request *DeleteDraftRequest) (*StreamResponse[Response],error){ + return c.client.DeleteDraft(ctx,c.channelType, c.channelD, request) } -func (c *Channels) GetDraft(ctx context.Context, request *GetDraftRequest) (*StreamResponse[GetDraftResponse], error) { - return c.client.GetDraft(ctx, c.channelType, c.channelD, request) +func (c *Channels) GetDraft(ctx context.Context, request *GetDraftRequest) (*StreamResponse[GetDraftResponse],error){ + return c.client.GetDraft(ctx,c.channelType, c.channelD, request) } -func (c *Channels) SendEvent(ctx context.Context, request *SendEventRequest) (*StreamResponse[EventResponse], error) { - return c.client.SendEvent(ctx, c.channelType, c.channelD, request) +func (c *Channels) SendEvent(ctx context.Context, request *SendEventRequest) (*StreamResponse[EventResponse],error){ + return c.client.SendEvent(ctx,c.channelType, c.channelD, request) } -func (c *Channels) DeleteChannelFile(ctx context.Context, request *DeleteChannelFileRequest) (*StreamResponse[Response], error) { - return c.client.DeleteChannelFile(ctx, c.channelType, c.channelD, request) +func (c *Channels) DeleteChannelFile(ctx context.Context, request *DeleteChannelFileRequest) (*StreamResponse[Response],error){ + return c.client.DeleteChannelFile(ctx,c.channelType, c.channelD, request) } -func (c *Channels) UploadChannelFile(ctx context.Context, request *UploadChannelFileRequest) (*StreamResponse[UploadChannelFileResponse], error) { - return c.client.UploadChannelFile(ctx, c.channelType, c.channelD, request) +func (c *Channels) UploadChannelFile(ctx context.Context, request *UploadChannelFileRequest) (*StreamResponse[UploadChannelFileResponse],error){ + return c.client.UploadChannelFile(ctx,c.channelType, c.channelD, request) } -func (c *Channels) Hide(ctx context.Context, request *HideChannelRequest) (*StreamResponse[HideChannelResponse], error) { - return c.client.HideChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) Hide(ctx context.Context, request *HideChannelRequest) (*StreamResponse[HideChannelResponse],error){ + return c.client.HideChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) DeleteChannelImage(ctx context.Context, request *DeleteChannelImageRequest) (*StreamResponse[Response], error) { - return c.client.DeleteChannelImage(ctx, c.channelType, c.channelD, request) +func (c *Channels) DeleteChannelImage(ctx context.Context, request *DeleteChannelImageRequest) (*StreamResponse[Response],error){ + return c.client.DeleteChannelImage(ctx,c.channelType, c.channelD, request) } -func (c *Channels) UploadChannelImage(ctx context.Context, request *UploadChannelImageRequest) (*StreamResponse[UploadChannelResponse], error) { - return c.client.UploadChannelImage(ctx, c.channelType, c.channelD, request) +func (c *Channels) UploadChannelImage(ctx context.Context, request *UploadChannelImageRequest) (*StreamResponse[UploadChannelResponse],error){ + return c.client.UploadChannelImage(ctx,c.channelType, c.channelD, request) } -func (c *Channels) UpdateMemberPartial(ctx context.Context, request *UpdateMemberPartialRequest) (*StreamResponse[UpdateMemberPartialResponse], error) { - return c.client.UpdateMemberPartial(ctx, c.channelType, c.channelD, request) +func (c *Channels) UpdateMemberPartial(ctx context.Context, request *UpdateMemberPartialRequest) (*StreamResponse[UpdateMemberPartialResponse],error){ + return c.client.UpdateMemberPartial(ctx,c.channelType, c.channelD, request) } -func (c *Channels) SendMessage(ctx context.Context, request *SendMessageRequest) (*StreamResponse[SendMessageResponse], error) { - return c.client.SendMessage(ctx, c.channelType, c.channelD, request) +func (c *Channels) SendMessage(ctx context.Context, request *SendMessageRequest) (*StreamResponse[SendMessageResponse],error){ + return c.client.SendMessage(ctx,c.channelType, c.channelD, request) } -func (c *Channels) GetManyMessages(ctx context.Context, request *GetManyMessagesRequest) (*StreamResponse[GetManyMessagesResponse], error) { - return c.client.GetManyMessages(ctx, c.channelType, c.channelD, request) +func (c *Channels) GetManyMessages(ctx context.Context, request *GetManyMessagesRequest) (*StreamResponse[GetManyMessagesResponse],error){ + return c.client.GetManyMessages(ctx,c.channelType, c.channelD, request) } -func (c *Channels) GetOrCreate(ctx context.Context, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse], error) { - return c.client.GetOrCreateChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) GetOrCreate(ctx context.Context, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse],error){ + return c.client.GetOrCreateChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) MarkRead(ctx context.Context, request *MarkReadRequest) (*StreamResponse[MarkReadResponse], error) { - return c.client.MarkRead(ctx, c.channelType, c.channelD, request) +func (c *Channels) MarkRead(ctx context.Context, request *MarkReadRequest) (*StreamResponse[MarkReadResponse],error){ + return c.client.MarkRead(ctx,c.channelType, c.channelD, request) } -func (c *Channels) Show(ctx context.Context, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse], error) { - return c.client.ShowChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) Show(ctx context.Context, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse],error){ + return c.client.ShowChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) Truncate(ctx context.Context, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse], error) { - return c.client.TruncateChannel(ctx, c.channelType, c.channelD, request) +func (c *Channels) Truncate(ctx context.Context, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse],error){ + return c.client.TruncateChannel(ctx,c.channelType, c.channelD, request) } -func (c *Channels) MarkUnread(ctx context.Context, request *MarkUnreadRequest) (*StreamResponse[Response], error) { - return c.client.MarkUnread(ctx, c.channelType, c.channelD, request) +func (c *Channels) MarkUnread(ctx context.Context, request *MarkUnreadRequest) (*StreamResponse[Response],error){ + return c.client.MarkUnread(ctx,c.channelType, c.channelD, request) } func (c *ChatClient) Channel(channelType, channelD string) *Channels { diff --git a/chat.go b/chat.go index c61438f..3296d37 100644 --- a/chat.go +++ b/chat.go @@ -16,82 +16,90 @@ func NewChatClient(client *Client) *ChatClient { } // Query campaigns with filter query +// func (c *ChatClient) QueryCampaigns(ctx context.Context, request *QueryCampaignsRequest) (*StreamResponse[QueryCampaignsResponse], error) { var result QueryCampaignsResponse - res, err := MakeRequest[QueryCampaignsRequest, QueryCampaignsResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/query", nil, request, &result, nil) + res, err := MakeRequest[QueryCampaignsRequest, QueryCampaignsResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/query",nil,request, &result,nil) return res, err } // Get campaign by ID. -func (c *ChatClient) GetCampaign(ctx context.Context, id string, request *GetCampaignRequest) (*StreamResponse[GetCampaignResponse], error) { +// +func (c *ChatClient) GetCampaign(ctx context.Context,id string, request *GetCampaignRequest) (*StreamResponse[GetCampaignResponse], error) { var result GetCampaignResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCampaignResponse](c.client, ctx, "GET", "/api/v2/chat/campaigns/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCampaignResponse](c.client, ctx, "GET", "/api/v2/chat/campaigns/{id}",params, nil, &result,pathParams) return res, err } // Starts or schedules a campaign -func (c *ChatClient) StartCampaign(ctx context.Context, id string, request *StartCampaignRequest) (*StreamResponse[StartCampaignResponse], error) { +// +func (c *ChatClient) StartCampaign(ctx context.Context,id string, request *StartCampaignRequest) (*StreamResponse[StartCampaignResponse], error) { var result StartCampaignResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[StartCampaignRequest, StartCampaignResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/{id}/start", nil, request, &result, pathParams) + res, err := MakeRequest[StartCampaignRequest, StartCampaignResponse](c.client, ctx, "POST", "/api/v2/chat/campaigns/{id}/start",nil,request, &result,pathParams) return res, err } // 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 } // Query channels with filter query +// func (c *ChatClient) QueryChannels(ctx context.Context, request *QueryChannelsRequest) (*StreamResponse[QueryChannelsResponse], error) { var result QueryChannelsResponse - res, err := MakeRequest[QueryChannelsRequest, QueryChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/channels", nil, request, &result, nil) + res, err := MakeRequest[QueryChannelsRequest, QueryChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/channels",nil,request, &result,nil) return res, err } // Allows to delete several channels at once asynchronously -// +// // 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) + res, err := MakeRequest[DeleteChannelsRequest, DeleteChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/channels/delete",nil,request, &result,nil) return res, err } // Mark the status of a channel message delivered. +// func (c *ChatClient) MarkDelivered(ctx context.Context, request *MarkDeliveredRequest) (*StreamResponse[MarkDeliveredResponse], error) { var result MarkDeliveredResponse params := extractQueryParams(request) - res, err := MakeRequest[MarkDeliveredRequest, MarkDeliveredResponse](c.client, ctx, "POST", "/api/v2/chat/channels/delivered", params, request, &result, nil) + res, err := MakeRequest[MarkDeliveredRequest, MarkDeliveredResponse](c.client, ctx, "POST", "/api/v2/chat/channels/delivered",params,request, &result,nil) return res, err } // Marks channels as read up to the specific message. If no channels is given, mark all channel as read -// +// // 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) + res, err := MakeRequest[MarkChannelsReadRequest, MarkReadResponse](c.client, ctx, "POST", "/api/v2/chat/channels/read",nil,request, &result,nil) return res, err } // This Method creates a channel or returns an existing one with matching attributes -// +// // Sends events: // - channel.created // - member.added @@ -100,48 +108,51 @@ func (c *ChatClient) MarkChannelsRead(ctx context.Context, request *MarkChannels // - user.watching.start // - channel.created // - user.watching.start -func (c *ChatClient) GetOrCreateDistinctChannel(ctx context.Context, _type string, request *GetOrCreateDistinctChannelRequest) (*StreamResponse[ChannelStateResponse], error) { +// +func (c *ChatClient) GetOrCreateDistinctChannel(ctx context.Context,_type string, request *GetOrCreateDistinctChannelRequest) (*StreamResponse[ChannelStateResponse], error) { var result ChannelStateResponse pathParams := map[string]string{ "type": _type, } - res, err := MakeRequest[GetOrCreateDistinctChannelRequest, ChannelStateResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/query", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateDistinctChannelRequest, ChannelStateResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/query",nil,request, &result,pathParams) return res, err } // Deletes channel -// +// // Sends events: // - channel.deleted // - channel.deleted -func (c *ChatClient) DeleteChannel(ctx context.Context, _type string, id string, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse], error) { +// +func (c *ChatClient) DeleteChannel(ctx context.Context,_type string, id string, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse], error) { var result DeleteChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteChannelResponse](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteChannelResponse](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}",params, nil, &result,pathParams) return res, err } // Updates certain fields of the channel -// +// // Sends events: // - channel.updated // - channel.updated -func (c *ChatClient) UpdateChannelPartial(ctx context.Context, _type string, id string, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse], error) { +// +func (c *ChatClient) UpdateChannelPartial(ctx context.Context,_type string, id string, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse], error) { var result UpdateChannelPartialResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UpdateChannelPartialRequest, UpdateChannelPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/channels/{type}/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateChannelPartialRequest, UpdateChannelPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/channels/{type}/{id}",nil,request, &result,pathParams) return res, err } // Change channel data -// +// // Sends events: // - channel.updated // - member.added @@ -150,157 +161,170 @@ func (c *ChatClient) UpdateChannelPartial(ctx context.Context, _type string, id // - message.new // - channel.updated // - message.new -func (c *ChatClient) UpdateChannel(ctx context.Context, _type string, id string, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse], error) { +// +func (c *ChatClient) UpdateChannel(ctx context.Context,_type string, id string, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse], error) { var result UpdateChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UpdateChannelRequest, UpdateChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateChannelRequest, UpdateChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}",nil,request, &result,pathParams) return res, err } // Deletes a draft -// +// // Sends events: // - draft.deleted -func (c *ChatClient) DeleteDraft(ctx context.Context, _type string, id string, request *DeleteDraftRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteDraft(ctx context.Context,_type string, id string, request *DeleteDraftRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/draft", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/draft",params, nil, &result,pathParams) return res, err } // Get a draft -func (c *ChatClient) GetDraft(ctx context.Context, _type string, id string, request *GetDraftRequest) (*StreamResponse[GetDraftResponse], error) { +// +func (c *ChatClient) GetDraft(ctx context.Context,_type string, id string, request *GetDraftRequest) (*StreamResponse[GetDraftResponse], error) { var result GetDraftResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetDraftResponse](c.client, ctx, "GET", "/api/v2/chat/channels/{type}/{id}/draft", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetDraftResponse](c.client, ctx, "GET", "/api/v2/chat/channels/{type}/{id}/draft",params, nil, &result,pathParams) return res, err } // Sends event to the channel -func (c *ChatClient) SendEvent(ctx context.Context, _type string, id string, request *SendEventRequest) (*StreamResponse[EventResponse], error) { +// +func (c *ChatClient) SendEvent(ctx context.Context,_type string, id string, request *SendEventRequest) (*StreamResponse[EventResponse], error) { var result EventResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[SendEventRequest, EventResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/event", nil, request, &result, pathParams) + res, err := MakeRequest[SendEventRequest, EventResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/event",nil,request, &result,pathParams) return res, err } // Deletes previously uploaded file -func (c *ChatClient) DeleteChannelFile(ctx context.Context, _type string, id string, request *DeleteChannelFileRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteChannelFile(ctx context.Context,_type string, id string, request *DeleteChannelFileRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/file", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/file",params, nil, &result,pathParams) return res, err } // Uploads file -func (c *ChatClient) UploadChannelFile(ctx context.Context, _type string, id string, request *UploadChannelFileRequest) (*StreamResponse[UploadChannelFileResponse], error) { +// +func (c *ChatClient) UploadChannelFile(ctx context.Context,_type string, id string, request *UploadChannelFileRequest) (*StreamResponse[UploadChannelFileResponse], error) { var result UploadChannelFileResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UploadChannelFileRequest, UploadChannelFileResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/file", nil, request, &result, pathParams) + res, err := MakeRequest[UploadChannelFileRequest, UploadChannelFileResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/file",nil,request, &result,pathParams) return res, err } // Marks channel as hidden for current user -// +// // Sends events: // - channel.hidden // - channel.hidden -func (c *ChatClient) HideChannel(ctx context.Context, _type string, id string, request *HideChannelRequest) (*StreamResponse[HideChannelResponse], error) { +// +func (c *ChatClient) HideChannel(ctx context.Context,_type string, id string, request *HideChannelRequest) (*StreamResponse[HideChannelResponse], error) { var result HideChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[HideChannelRequest, HideChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/hide", nil, request, &result, pathParams) + res, err := MakeRequest[HideChannelRequest, HideChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/hide",nil,request, &result,pathParams) return res, err } // Deletes previously uploaded image -func (c *ChatClient) DeleteChannelImage(ctx context.Context, _type string, id string, request *DeleteChannelImageRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteChannelImage(ctx context.Context,_type string, id string, request *DeleteChannelImageRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/image", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channels/{type}/{id}/image",params, nil, &result,pathParams) return res, err } // Uploads image -func (c *ChatClient) UploadChannelImage(ctx context.Context, _type string, id string, request *UploadChannelImageRequest) (*StreamResponse[UploadChannelResponse], error) { +// +func (c *ChatClient) UploadChannelImage(ctx context.Context,_type string, id string, request *UploadChannelImageRequest) (*StreamResponse[UploadChannelResponse], error) { var result UploadChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UploadChannelImageRequest, UploadChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/image", nil, request, &result, pathParams) + res, err := MakeRequest[UploadChannelImageRequest, UploadChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/image",nil,request, &result,pathParams) return res, err } -func (c *ChatClient) UpdateMemberPartial(ctx context.Context, _type string, id string, request *UpdateMemberPartialRequest) (*StreamResponse[UpdateMemberPartialResponse], error) { +// +// +func (c *ChatClient) UpdateMemberPartial(ctx context.Context,_type string, id string, request *UpdateMemberPartialRequest) (*StreamResponse[UpdateMemberPartialResponse], error) { var result UpdateMemberPartialResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[UpdateMemberPartialRequest, UpdateMemberPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/channels/{type}/{id}/member", params, request, &result, pathParams) + res, err := MakeRequest[UpdateMemberPartialRequest, UpdateMemberPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/channels/{type}/{id}/member",params,request, &result,pathParams) return res, err } // Sends new message to the specified channel -// +// // 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) { +// +func (c *ChatClient) SendMessage(ctx context.Context,_type string, id string, request *SendMessageRequest) (*StreamResponse[SendMessageResponse], error) { var result SendMessageResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[SendMessageRequest, SendMessageResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/message", nil, request, &result, pathParams) + res, err := MakeRequest[SendMessageRequest, SendMessageResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/message",nil,request, &result,pathParams) return res, err } // Returns list messages found by IDs -func (c *ChatClient) GetManyMessages(ctx context.Context, _type string, id string, request *GetManyMessagesRequest) (*StreamResponse[GetManyMessagesResponse], error) { +// +func (c *ChatClient) GetManyMessages(ctx context.Context,_type string, id string, request *GetManyMessagesRequest) (*StreamResponse[GetManyMessagesResponse], error) { var result GetManyMessagesResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetManyMessagesResponse](c.client, ctx, "GET", "/api/v2/chat/channels/{type}/{id}/messages", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetManyMessagesResponse](c.client, ctx, "GET", "/api/v2/chat/channels/{type}/{id}/messages",params, nil, &result,pathParams) return res, err } // This Method creates a channel or returns an existing one with matching attributes -// +// // Sends events: // - channel.created // - member.added @@ -309,367 +333,399 @@ func (c *ChatClient) GetManyMessages(ctx context.Context, _type string, id strin // - user.watching.start // - channel.created // - user.watching.start -func (c *ChatClient) GetOrCreateChannel(ctx context.Context, _type string, id string, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse], error) { +// +func (c *ChatClient) GetOrCreateChannel(ctx context.Context,_type string, id string, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse], error) { var result ChannelStateResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[GetOrCreateChannelRequest, ChannelStateResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/query", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateChannelRequest, ChannelStateResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/query",nil,request, &result,pathParams) return res, err } // Marks channel as read up to the specific message -// +// // Sends events: // - message.read // - message.read -func (c *ChatClient) MarkRead(ctx context.Context, _type string, id string, request *MarkReadRequest) (*StreamResponse[MarkReadResponse], error) { +// +func (c *ChatClient) MarkRead(ctx context.Context,_type string, id string, request *MarkReadRequest) (*StreamResponse[MarkReadResponse], error) { var result MarkReadResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[MarkReadRequest, MarkReadResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/read", nil, request, &result, pathParams) + res, err := MakeRequest[MarkReadRequest, MarkReadResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/read",nil,request, &result,pathParams) return res, err } // Shows previously hidden channel -// +// // Sends events: // - channel.visible // - channel.visible -func (c *ChatClient) ShowChannel(ctx context.Context, _type string, id string, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse], error) { +// +func (c *ChatClient) ShowChannel(ctx context.Context,_type string, id string, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse], error) { var result ShowChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[ShowChannelRequest, ShowChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/show", nil, request, &result, pathParams) + res, err := MakeRequest[ShowChannelRequest, ShowChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/show",nil,request, &result,pathParams) return res, err } // Truncates messages from a channel. Can be applied to the entire channel or scoped to specific members. -// +// // Sends events: // - channel.truncated // - channel.truncated -func (c *ChatClient) TruncateChannel(ctx context.Context, _type string, id string, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse], error) { +// +func (c *ChatClient) TruncateChannel(ctx context.Context,_type string, id string, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse], error) { var result TruncateChannelResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[TruncateChannelRequest, TruncateChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/truncate", nil, request, &result, pathParams) + res, err := MakeRequest[TruncateChannelRequest, TruncateChannelResponse](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/truncate",nil,request, &result,pathParams) return res, err } // Marks channel as unread from a specific message -func (c *ChatClient) MarkUnread(ctx context.Context, _type string, id string, request *MarkUnreadRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) MarkUnread(ctx context.Context,_type string, id string, request *MarkUnreadRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[MarkUnreadRequest, Response](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/unread", nil, request, &result, pathParams) + res, err := MakeRequest[MarkUnreadRequest, Response](c.client, ctx, "POST", "/api/v2/chat/channels/{type}/{id}/unread",nil,request, &result,pathParams) return res, err } // Lists all available channel types +// func (c *ChatClient) ListChannelTypes(ctx context.Context, request *ListChannelTypesRequest) (*StreamResponse[ListChannelTypesResponse], error) { var result ListChannelTypesResponse - res, err := MakeRequest[any, ListChannelTypesResponse](c.client, ctx, "GET", "/api/v2/chat/channeltypes", nil, nil, &result, nil) + res, err := MakeRequest[any, ListChannelTypesResponse](c.client, ctx, "GET", "/api/v2/chat/channeltypes",nil, nil, &result,nil) return res, err } // Creates new channel type +// func (c *ChatClient) CreateChannelType(ctx context.Context, request *CreateChannelTypeRequest) (*StreamResponse[CreateChannelTypeResponse], error) { var result CreateChannelTypeResponse - res, err := MakeRequest[CreateChannelTypeRequest, CreateChannelTypeResponse](c.client, ctx, "POST", "/api/v2/chat/channeltypes", nil, request, &result, nil) + res, err := MakeRequest[CreateChannelTypeRequest, CreateChannelTypeResponse](c.client, ctx, "POST", "/api/v2/chat/channeltypes",nil,request, &result,nil) return res, err } // Deletes channel type -func (c *ChatClient) DeleteChannelType(ctx context.Context, name string, request *DeleteChannelTypeRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteChannelType(ctx context.Context,name string, request *DeleteChannelTypeRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channeltypes/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/channeltypes/{name}",nil, nil, &result,pathParams) return res, err } // Gets channel type -func (c *ChatClient) GetChannelType(ctx context.Context, name string, request *GetChannelTypeRequest) (*StreamResponse[GetChannelTypeResponse], error) { +// +func (c *ChatClient) GetChannelType(ctx context.Context,name string, request *GetChannelTypeRequest) (*StreamResponse[GetChannelTypeResponse], error) { var result GetChannelTypeResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, GetChannelTypeResponse](c.client, ctx, "GET", "/api/v2/chat/channeltypes/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetChannelTypeResponse](c.client, ctx, "GET", "/api/v2/chat/channeltypes/{name}",nil, nil, &result,pathParams) return res, err } // Updates channel type -func (c *ChatClient) UpdateChannelType(ctx context.Context, name string, request *UpdateChannelTypeRequest) (*StreamResponse[UpdateChannelTypeResponse], error) { +// +func (c *ChatClient) UpdateChannelType(ctx context.Context,name string, request *UpdateChannelTypeRequest) (*StreamResponse[UpdateChannelTypeResponse], error) { var result UpdateChannelTypeResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateChannelTypeRequest, UpdateChannelTypeResponse](c.client, ctx, "PUT", "/api/v2/chat/channeltypes/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateChannelTypeRequest, UpdateChannelTypeResponse](c.client, ctx, "PUT", "/api/v2/chat/channeltypes/{name}",nil,request, &result,pathParams) return res, err } // Returns all custom commands +// func (c *ChatClient) ListCommands(ctx context.Context, request *ListCommandsRequest) (*StreamResponse[ListCommandsResponse], error) { var result ListCommandsResponse - res, err := MakeRequest[any, ListCommandsResponse](c.client, ctx, "GET", "/api/v2/chat/commands", nil, nil, &result, nil) + res, err := MakeRequest[any, ListCommandsResponse](c.client, ctx, "GET", "/api/v2/chat/commands",nil, nil, &result,nil) return res, err } // Creates custom chat command +// func (c *ChatClient) CreateCommand(ctx context.Context, request *CreateCommandRequest) (*StreamResponse[CreateCommandResponse], error) { var result CreateCommandResponse - res, err := MakeRequest[CreateCommandRequest, CreateCommandResponse](c.client, ctx, "POST", "/api/v2/chat/commands", nil, request, &result, nil) + res, err := MakeRequest[CreateCommandRequest, CreateCommandResponse](c.client, ctx, "POST", "/api/v2/chat/commands",nil,request, &result,nil) return res, err } // Deletes custom chat command -func (c *ChatClient) DeleteCommand(ctx context.Context, name string, request *DeleteCommandRequest) (*StreamResponse[DeleteCommandResponse], error) { +// +func (c *ChatClient) DeleteCommand(ctx context.Context,name string, request *DeleteCommandRequest) (*StreamResponse[DeleteCommandResponse], error) { var result DeleteCommandResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, DeleteCommandResponse](c.client, ctx, "DELETE", "/api/v2/chat/commands/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteCommandResponse](c.client, ctx, "DELETE", "/api/v2/chat/commands/{name}",nil, nil, &result,pathParams) return res, err } // Returns custom command by its name -func (c *ChatClient) GetCommand(ctx context.Context, name string, request *GetCommandRequest) (*StreamResponse[GetCommandResponse], error) { +// +func (c *ChatClient) GetCommand(ctx context.Context,name string, request *GetCommandRequest) (*StreamResponse[GetCommandResponse], error) { var result GetCommandResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, GetCommandResponse](c.client, ctx, "GET", "/api/v2/chat/commands/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetCommandResponse](c.client, ctx, "GET", "/api/v2/chat/commands/{name}",nil, nil, &result,pathParams) return res, err } // Updates custom chat command -func (c *ChatClient) UpdateCommand(ctx context.Context, name string, request *UpdateCommandRequest) (*StreamResponse[UpdateCommandResponse], error) { +// +func (c *ChatClient) UpdateCommand(ctx context.Context,name string, request *UpdateCommandRequest) (*StreamResponse[UpdateCommandResponse], error) { var result UpdateCommandResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateCommandRequest, UpdateCommandResponse](c.client, ctx, "PUT", "/api/v2/chat/commands/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateCommandRequest, UpdateCommandResponse](c.client, ctx, "PUT", "/api/v2/chat/commands/{name}",nil,request, &result,pathParams) return res, err } // Queries draft messages for a user +// func (c *ChatClient) QueryDrafts(ctx context.Context, request *QueryDraftsRequest) (*StreamResponse[QueryDraftsResponse], error) { var result QueryDraftsResponse - res, err := MakeRequest[QueryDraftsRequest, QueryDraftsResponse](c.client, ctx, "POST", "/api/v2/chat/drafts/query", nil, request, &result, nil) + res, err := MakeRequest[QueryDraftsRequest, QueryDraftsResponse](c.client, ctx, "POST", "/api/v2/chat/drafts/query",nil,request, &result,nil) return res, err } // Exports channel data to JSON file +// func (c *ChatClient) ExportChannels(ctx context.Context, request *ExportChannelsRequest) (*StreamResponse[ExportChannelsResponse], error) { var result ExportChannelsResponse - res, err := MakeRequest[ExportChannelsRequest, ExportChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/export_channels", nil, request, &result, nil) + res, err := MakeRequest[ExportChannelsRequest, ExportChannelsResponse](c.client, ctx, "POST", "/api/v2/chat/export_channels",nil,request, &result,nil) return res, err } // Find and filter channel members +// func (c *ChatClient) QueryMembers(ctx context.Context, request *QueryMembersRequest) (*StreamResponse[MembersResponse], error) { var result MembersResponse params := extractQueryParams(request) - res, err := MakeRequest[any, MembersResponse](c.client, ctx, "GET", "/api/v2/chat/members", params, nil, &result, nil) + res, err := MakeRequest[any, MembersResponse](c.client, ctx, "GET", "/api/v2/chat/members",params, nil, &result,nil) return res, err } // Queries history for one message +// func (c *ChatClient) QueryMessageHistory(ctx context.Context, request *QueryMessageHistoryRequest) (*StreamResponse[QueryMessageHistoryResponse], error) { var result QueryMessageHistoryResponse - res, err := MakeRequest[QueryMessageHistoryRequest, QueryMessageHistoryResponse](c.client, ctx, "POST", "/api/v2/chat/messages/history", nil, request, &result, nil) + res, err := MakeRequest[QueryMessageHistoryRequest, QueryMessageHistoryResponse](c.client, ctx, "POST", "/api/v2/chat/messages/history",nil,request, &result,nil) return res, err } // Deletes message -// +// // Sends events: // - message.deleted // - message.deleted -func (c *ChatClient) DeleteMessage(ctx context.Context, id string, request *DeleteMessageRequest) (*StreamResponse[DeleteMessageResponse], error) { +// +func (c *ChatClient) DeleteMessage(ctx context.Context,id string, request *DeleteMessageRequest) (*StreamResponse[DeleteMessageResponse], error) { var result DeleteMessageResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteMessageResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteMessageResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{id}",params, nil, &result,pathParams) return res, err } // Returns message by ID -func (c *ChatClient) GetMessage(ctx context.Context, id string, request *GetMessageRequest) (*StreamResponse[GetMessageResponse], error) { +// +func (c *ChatClient) GetMessage(ctx context.Context,id string, request *GetMessageRequest) (*StreamResponse[GetMessageResponse], error) { var result GetMessageResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetMessageResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetMessageResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{id}",params, nil, &result,pathParams) return res, err } // Updates message with new data -// +// // Sends events: // - message.updated // - message.updated -func (c *ChatClient) UpdateMessage(ctx context.Context, id string, request *UpdateMessageRequest) (*StreamResponse[UpdateMessageResponse], error) { +// +func (c *ChatClient) UpdateMessage(ctx context.Context,id string, request *UpdateMessageRequest) (*StreamResponse[UpdateMessageResponse], error) { var result UpdateMessageResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateMessageRequest, UpdateMessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateMessageRequest, UpdateMessageResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}",nil,request, &result,pathParams) return res, err } // Updates certain fields of the message -// +// // Sends events: // - message.updated // - message.updated -func (c *ChatClient) UpdateMessagePartial(ctx context.Context, id string, request *UpdateMessagePartialRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { +// +func (c *ChatClient) UpdateMessagePartial(ctx context.Context,id string, request *UpdateMessagePartialRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { var result UpdateMessagePartialResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateMessagePartialRequest, UpdateMessagePartialResponse](c.client, ctx, "PUT", "/api/v2/chat/messages/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateMessagePartialRequest, UpdateMessagePartialResponse](c.client, ctx, "PUT", "/api/v2/chat/messages/{id}",nil,request, &result,pathParams) return res, err } // Executes message command action with given parameters -// +// // Sends events: // - message.new // - message.new -func (c *ChatClient) RunMessageAction(ctx context.Context, id string, request *RunMessageActionRequest) (*StreamResponse[MessageActionResponse], error) { +// +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, MessageActionResponse](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 } // Commits a pending message, which will make it visible in the channel -// +// // Sends events: // - message.new // - message.updated // - message.new // - message.updated -func (c *ChatClient) CommitMessage(ctx context.Context, id string, request *CommitMessageRequest) (*StreamResponse[MessageActionResponse], error) { +// +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, MessageActionResponse](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 } // Updates message fields without storing in database, only sends update event -// +// // Sends events: // - message.updated // - message.updated -func (c *ChatClient) EphemeralMessageUpdate(ctx context.Context, id string, request *EphemeralMessageUpdateRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { +// +func (c *ChatClient) EphemeralMessageUpdate(ctx context.Context,id string, request *EphemeralMessageUpdateRequest) (*StreamResponse[UpdateMessagePartialResponse], error) { var result UpdateMessagePartialResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[EphemeralMessageUpdateRequest, UpdateMessagePartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/messages/{id}/ephemeral", nil, request, &result, pathParams) + res, err := MakeRequest[EphemeralMessageUpdateRequest, UpdateMessagePartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/messages/{id}/ephemeral",nil,request, &result,pathParams) return res, err } // Sends reaction to specified message -// +// // Sends events: // - reaction.new // - reaction.updated -func (c *ChatClient) SendReaction(ctx context.Context, id string, request *SendReactionRequest) (*StreamResponse[SendReactionResponse], error) { +// +func (c *ChatClient) SendReaction(ctx context.Context,id string, request *SendReactionRequest) (*StreamResponse[SendReactionResponse], error) { var result SendReactionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[SendReactionRequest, SendReactionResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/reaction", nil, request, &result, pathParams) + res, err := MakeRequest[SendReactionRequest, SendReactionResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/reaction",nil,request, &result,pathParams) return res, err } // Removes user reaction from the message -// +// // Sends events: // - reaction.deleted -func (c *ChatClient) DeleteReaction(ctx context.Context, id string, _type string, request *DeleteReactionRequest) (*StreamResponse[DeleteReactionResponse], error) { +// +func (c *ChatClient) DeleteReaction(ctx context.Context,id string, _type string, request *DeleteReactionRequest) (*StreamResponse[DeleteReactionResponse], error) { var result DeleteReactionResponse pathParams := map[string]string{ - "id": id, + "id": id, "type": _type, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteReactionResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{id}/reaction/{type}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteReactionResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{id}/reaction/{type}",params, nil, &result,pathParams) return res, err } // Returns list of reactions of specific message -func (c *ChatClient) GetReactions(ctx context.Context, id string, request *GetReactionsRequest) (*StreamResponse[GetReactionsResponse], error) { +// +func (c *ChatClient) GetReactions(ctx context.Context,id string, request *GetReactionsRequest) (*StreamResponse[GetReactionsResponse], error) { var result GetReactionsResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetReactionsResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{id}/reactions", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetReactionsResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{id}/reactions",params, nil, &result,pathParams) return res, err } // Get reactions on a message -func (c *ChatClient) QueryReactions(ctx context.Context, id string, request *QueryReactionsRequest) (*StreamResponse[QueryReactionsResponse], error) { +// +func (c *ChatClient) QueryReactions(ctx context.Context,id string, request *QueryReactionsRequest) (*StreamResponse[QueryReactionsResponse], error) { var result QueryReactionsResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[QueryReactionsRequest, QueryReactionsResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/reactions", nil, request, &result, pathParams) + res, err := MakeRequest[QueryReactionsRequest, QueryReactionsResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{id}/reactions",nil,request, &result,pathParams) return res, err } // Translates message to a given language using automated translation software -// +// // Sends events: // - message.updated // - message.updated -func (c *ChatClient) TranslateMessage(ctx context.Context, id string, request *TranslateMessageRequest) (*StreamResponse[MessageActionResponse], error) { +// +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, MessageActionResponse](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 } // Undelete a message that was previously soft-deleted -// +// // 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 } // Cast a vote on a poll -// +// // Sends events: // - feeds.poll.vote_casted // - feeds.poll.vote_changed @@ -677,260 +733,301 @@ func (c *ChatClient) UndeleteMessage(ctx context.Context, id string, request *Un // - poll.vote_casted // - poll.vote_changed // - poll.vote_removed -func (c *ChatClient) CastPollVote(ctx context.Context, messageID string, pollID string, request *CastPollVoteRequest) (*StreamResponse[PollVoteResponse], error) { +// +func (c *ChatClient) CastPollVote(ctx context.Context,messageID string, pollID string, request *CastPollVoteRequest) (*StreamResponse[PollVoteResponse], error) { var result PollVoteResponse pathParams := map[string]string{ "message_id": messageID, - "poll_id": pollID, + "poll_id": pollID, } - res, err := MakeRequest[CastPollVoteRequest, PollVoteResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote", nil, request, &result, pathParams) + res, err := MakeRequest[CastPollVoteRequest, PollVoteResponse](c.client, ctx, "POST", "/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote",nil,request, &result,pathParams) return res, err } // Delete a vote from a poll -// +// // Sends events: // - feeds.poll.vote_removed // - poll.vote_removed -func (c *ChatClient) DeletePollVote(ctx context.Context, messageID string, pollID string, voteID string, request *DeletePollVoteRequest) (*StreamResponse[PollVoteResponse], error) { +// +func (c *ChatClient) DeletePollVote(ctx context.Context,messageID string, pollID string, voteID string, request *DeletePollVoteRequest) (*StreamResponse[PollVoteResponse], error) { var result PollVoteResponse pathParams := map[string]string{ "message_id": messageID, - "poll_id": pollID, - "vote_id": voteID, + "poll_id": pollID, + "vote_id": voteID, } params := extractQueryParams(request) - res, err := MakeRequest[any, PollVoteResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, PollVoteResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}",params, nil, &result,pathParams) return res, err } // Deletes a user's created reminder -// +// // Sends events: // - reminder.deleted -func (c *ChatClient) DeleteReminder(ctx context.Context, messageID string, request *DeleteReminderRequest) (*StreamResponse[DeleteReminderResponse], error) { +// +func (c *ChatClient) DeleteReminder(ctx context.Context,messageID string, request *DeleteReminderRequest) (*StreamResponse[DeleteReminderResponse], error) { var result DeleteReminderResponse pathParams := map[string]string{ "message_id": messageID, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteReminderResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{message_id}/reminders", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteReminderResponse](c.client, ctx, "DELETE", "/api/v2/chat/messages/{message_id}/reminders",params, nil, &result,pathParams) return res, err } // Updates an existing reminder -// +// // Sends events: // - reminder.updated -func (c *ChatClient) UpdateReminder(ctx context.Context, messageID string, request *UpdateReminderRequest) (*StreamResponse[UpdateReminderResponse], error) { +// +func (c *ChatClient) UpdateReminder(ctx context.Context,messageID string, request *UpdateReminderRequest) (*StreamResponse[UpdateReminderResponse], error) { var result UpdateReminderResponse pathParams := map[string]string{ "message_id": messageID, } - res, err := MakeRequest[UpdateReminderRequest, UpdateReminderResponse](c.client, ctx, "PATCH", "/api/v2/chat/messages/{message_id}/reminders", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateReminderRequest, UpdateReminderResponse](c.client, ctx, "PATCH", "/api/v2/chat/messages/{message_id}/reminders",nil,request, &result,pathParams) return res, err } // Creates a new reminder -// +// // Sends events: // - reminder.created -func (c *ChatClient) CreateReminder(ctx context.Context, messageID string, request *CreateReminderRequest) (*StreamResponse[ReminderResponseData], error) { +// +func (c *ChatClient) CreateReminder(ctx context.Context,messageID string, request *CreateReminderRequest) (*StreamResponse[ReminderResponseData], error) { var result ReminderResponseData pathParams := map[string]string{ "message_id": messageID, } - res, err := MakeRequest[CreateReminderRequest, ReminderResponseData](c.client, ctx, "POST", "/api/v2/chat/messages/{message_id}/reminders", nil, request, &result, pathParams) + res, err := MakeRequest[CreateReminderRequest, ReminderResponseData](c.client, ctx, "POST", "/api/v2/chat/messages/{message_id}/reminders",nil,request, &result,pathParams) return res, err } // Returns replies (thread) of the message -func (c *ChatClient) GetReplies(ctx context.Context, parentID string, request *GetRepliesRequest) (*StreamResponse[GetRepliesResponse], error) { +// +func (c *ChatClient) GetReplies(ctx context.Context,parentID string, request *GetRepliesRequest) (*StreamResponse[GetRepliesResponse], error) { var result GetRepliesResponse pathParams := map[string]string{ "parent_id": parentID, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetRepliesResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{parent_id}/replies", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetRepliesResponse](c.client, ctx, "GET", "/api/v2/chat/messages/{parent_id}/replies",params, nil, &result,pathParams) return res, err } // Find and filter message flags +// func (c *ChatClient) QueryMessageFlags(ctx context.Context, request *QueryMessageFlagsRequest) (*StreamResponse[QueryMessageFlagsResponse], error) { var result QueryMessageFlagsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, QueryMessageFlagsResponse](c.client, ctx, "GET", "/api/v2/chat/moderation/flags/message", params, nil, &result, nil) + res, err := MakeRequest[any, QueryMessageFlagsResponse](c.client, ctx, "GET", "/api/v2/chat/moderation/flags/message",params, nil, &result,nil) return res, err } // Mutes channel for user -// +// // 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) + res, err := MakeRequest[MuteChannelRequest, MuteChannelResponse](c.client, ctx, "POST", "/api/v2/chat/moderation/mute/channel",nil,request, &result,nil) return res, err } // Unmutes channel for user -// +// // 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) + res, err := MakeRequest[UnmuteChannelRequest, UnmuteResponse](c.client, ctx, "POST", "/api/v2/chat/moderation/unmute/channel",nil,request, &result,nil) return res, err } // Find and filter channel scoped or global user bans +// func (c *ChatClient) QueryBannedUsers(ctx context.Context, request *QueryBannedUsersRequest) (*StreamResponse[QueryBannedUsersResponse], error) { var result QueryBannedUsersResponse params := extractQueryParams(request) - res, err := MakeRequest[any, QueryBannedUsersResponse](c.client, ctx, "GET", "/api/v2/chat/query_banned_users", params, nil, &result, nil) + res, err := MakeRequest[any, QueryBannedUsersResponse](c.client, ctx, "GET", "/api/v2/chat/query_banned_users",params, nil, &result,nil) return res, err } // Find and filter future channel bans created by the authenticated user +// func (c *ChatClient) QueryFutureChannelBans(ctx context.Context, request *QueryFutureChannelBansRequest) (*StreamResponse[QueryFutureChannelBansResponse], error) { var result QueryFutureChannelBansResponse params := extractQueryParams(request) - res, err := MakeRequest[any, QueryFutureChannelBansResponse](c.client, ctx, "GET", "/api/v2/chat/query_future_channel_bans", params, nil, &result, nil) + res, err := MakeRequest[any, QueryFutureChannelBansResponse](c.client, ctx, "GET", "/api/v2/chat/query_future_channel_bans",params, nil, &result,nil) return res, err } // Queries reminders +// func (c *ChatClient) QueryReminders(ctx context.Context, request *QueryRemindersRequest) (*StreamResponse[QueryRemindersResponse], error) { var result QueryRemindersResponse - res, err := MakeRequest[QueryRemindersRequest, QueryRemindersResponse](c.client, ctx, "POST", "/api/v2/chat/reminders/query", nil, request, &result, nil) + res, err := MakeRequest[QueryRemindersRequest, QueryRemindersResponse](c.client, ctx, "POST", "/api/v2/chat/reminders/query",nil,request, &result,nil) return res, err } // Search messages across channels +// func (c *ChatClient) Search(ctx context.Context, request *SearchRequest) (*StreamResponse[SearchResponse], error) { var result SearchResponse params := extractQueryParams(request) - res, err := MakeRequest[any, SearchResponse](c.client, ctx, "GET", "/api/v2/chat/search", params, nil, &result, nil) + res, err := MakeRequest[any, SearchResponse](c.client, ctx, "GET", "/api/v2/chat/search",params, nil, &result,nil) return res, err } // Query segments +// func (c *ChatClient) QuerySegments(ctx context.Context, request *QuerySegmentsRequest) (*StreamResponse[QuerySegmentsResponse], error) { var result QuerySegmentsResponse - res, err := MakeRequest[QuerySegmentsRequest, QuerySegmentsResponse](c.client, ctx, "POST", "/api/v2/chat/segments/query", nil, request, &result, nil) + res, err := MakeRequest[QuerySegmentsRequest, QuerySegmentsResponse](c.client, ctx, "POST", "/api/v2/chat/segments/query",nil,request, &result,nil) return res, err } // Delete a segment -func (c *ChatClient) DeleteSegment(ctx context.Context, id string, request *DeleteSegmentRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteSegment(ctx context.Context,id string, request *DeleteSegmentRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/segments/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/chat/segments/{id}",nil, nil, &result,pathParams) return res, err } // Get segment -func (c *ChatClient) GetSegment(ctx context.Context, id string, request *GetSegmentRequest) (*StreamResponse[GetSegmentResponse], error) { +// +func (c *ChatClient) GetSegment(ctx context.Context,id string, request *GetSegmentRequest) (*StreamResponse[GetSegmentResponse], error) { var result GetSegmentResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetSegmentResponse](c.client, ctx, "GET", "/api/v2/chat/segments/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetSegmentResponse](c.client, ctx, "GET", "/api/v2/chat/segments/{id}",nil, nil, &result,pathParams) return res, err } // Delete targets from a segment -func (c *ChatClient) DeleteSegmentTargets(ctx context.Context, id string, request *DeleteSegmentTargetsRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) DeleteSegmentTargets(ctx context.Context,id string, request *DeleteSegmentTargetsRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[DeleteSegmentTargetsRequest, Response](c.client, ctx, "POST", "/api/v2/chat/segments/{id}/deletetargets", nil, request, &result, pathParams) + res, err := MakeRequest[DeleteSegmentTargetsRequest, Response](c.client, ctx, "POST", "/api/v2/chat/segments/{id}/deletetargets",nil,request, &result,pathParams) return res, err } // Check whether a target exists in a segment. Returns 200 if the target exists, 404 otherwise -func (c *ChatClient) SegmentTargetExists(ctx context.Context, id string, targetID string, request *SegmentTargetExistsRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) SegmentTargetExists(ctx context.Context,id string, targetID string, request *SegmentTargetExistsRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ - "id": id, + "id": id, "target_id": targetID, } - res, err := MakeRequest[any, Response](c.client, ctx, "GET", "/api/v2/chat/segments/{id}/target/{target_id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "GET", "/api/v2/chat/segments/{id}/target/{target_id}",nil, nil, &result,pathParams) return res, err } // Query segment targets -func (c *ChatClient) QuerySegmentTargets(ctx context.Context, id string, request *QuerySegmentTargetsRequest) (*StreamResponse[QuerySegmentTargetsResponse], error) { +// +func (c *ChatClient) QuerySegmentTargets(ctx context.Context,id string, request *QuerySegmentTargetsRequest) (*StreamResponse[QuerySegmentTargetsResponse], error) { var result QuerySegmentTargetsResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[QuerySegmentTargetsRequest, QuerySegmentTargetsResponse](c.client, ctx, "POST", "/api/v2/chat/segments/{id}/targets/query", nil, request, &result, pathParams) + res, err := MakeRequest[QuerySegmentTargetsRequest, QuerySegmentTargetsResponse](c.client, ctx, "POST", "/api/v2/chat/segments/{id}/targets/query",nil,request, &result,pathParams) + 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 - res, err := MakeRequest[QueryThreadsRequest, QueryThreadsResponse](c.client, ctx, "POST", "/api/v2/chat/threads", nil, request, &result, nil) + res, err := MakeRequest[QueryThreadsRequest, QueryThreadsResponse](c.client, ctx, "POST", "/api/v2/chat/threads",nil,request, &result,nil) return res, err } // Return a specific thread -func (c *ChatClient) GetThread(ctx context.Context, messageID string, request *GetThreadRequest) (*StreamResponse[GetThreadResponse], error) { +// +func (c *ChatClient) GetThread(ctx context.Context,messageID string, request *GetThreadRequest) (*StreamResponse[GetThreadResponse], error) { var result GetThreadResponse pathParams := map[string]string{ "message_id": messageID, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetThreadResponse](c.client, ctx, "GET", "/api/v2/chat/threads/{message_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetThreadResponse](c.client, ctx, "GET", "/api/v2/chat/threads/{message_id}",params, nil, &result,pathParams) return res, err } // Updates certain fields of the thread -// +// // Sends events: // - thread.updated // - thread.updated -func (c *ChatClient) UpdateThreadPartial(ctx context.Context, messageID string, request *UpdateThreadPartialRequest) (*StreamResponse[UpdateThreadPartialResponse], error) { +// +func (c *ChatClient) UpdateThreadPartial(ctx context.Context,messageID string, request *UpdateThreadPartialRequest) (*StreamResponse[UpdateThreadPartialResponse], error) { var result UpdateThreadPartialResponse pathParams := map[string]string{ "message_id": messageID, } - res, err := MakeRequest[UpdateThreadPartialRequest, UpdateThreadPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/threads/{message_id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateThreadPartialRequest, UpdateThreadPartialResponse](c.client, ctx, "PATCH", "/api/v2/chat/threads/{message_id}",nil,request, &result,pathParams) return res, err } // Fetch unread counts for a single user +// func (c *ChatClient) UnreadCounts(ctx context.Context, request *UnreadCountsRequest) (*StreamResponse[WrappedUnreadCountsResponse], error) { var result WrappedUnreadCountsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, WrappedUnreadCountsResponse](c.client, ctx, "GET", "/api/v2/chat/unread", params, nil, &result, nil) + res, err := MakeRequest[any, WrappedUnreadCountsResponse](c.client, ctx, "GET", "/api/v2/chat/unread",params, nil, &result,nil) return res, err } // Fetch unread counts in batch for multiple users in one call +// func (c *ChatClient) UnreadCountsBatch(ctx context.Context, request *UnreadCountsBatchRequest) (*StreamResponse[UnreadCountsBatchResponse], error) { var result UnreadCountsBatchResponse - res, err := MakeRequest[UnreadCountsBatchRequest, UnreadCountsBatchResponse](c.client, ctx, "POST", "/api/v2/chat/unread_batch", nil, request, &result, nil) + res, err := MakeRequest[UnreadCountsBatchRequest, UnreadCountsBatchResponse](c.client, ctx, "POST", "/api/v2/chat/unread_batch",nil,request, &result,nil) return res, err } // Sends a custom event to a user -// +// // Sends events: // - * // - * -func (c *ChatClient) SendUserCustomEvent(ctx context.Context, userID string, request *SendUserCustomEventRequest) (*StreamResponse[Response], error) { +// +func (c *ChatClient) SendUserCustomEvent(ctx context.Context,userID string, request *SendUserCustomEventRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[SendUserCustomEventRequest, Response](c.client, ctx, "POST", "/api/v2/chat/users/{user_id}/event", nil, request, &result, pathParams) + res, err := MakeRequest[SendUserCustomEventRequest, Response](c.client, ctx, "POST", "/api/v2/chat/users/{user_id}/event",nil,request, &result,pathParams) return res, err -} +} \ No newline at end of file diff --git a/chat_channel_integration_test.go b/chat_channel_integration_test.go new file mode 100644 index 0000000..d93d27b --- /dev/null +++ b/chat_channel_integration_test.go @@ -0,0 +1,863 @@ +package getstream_test + +import ( + "context" + "os" + "testing" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatChannelIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Create shared test users for all subtests + userIDs := createTestUsers(t, client, 4) + creatorID := userIDs[0] + memberID1 := userIDs[1] + memberID2 := userIDs[2] + memberID3 := userIDs[3] + + t.Run("CreateChannelWithID", func(t *testing.T) { + ch, channelID := createTestChannel(t, client, creatorID) + _ = ch + + // Verify channel exists by querying + resp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "id": channelID, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, resp.Data.Channels) + assert.Equal(t, channelID, resp.Data.Channels[0].Channel.ID) + assert.Equal(t, "messaging", resp.Data.Channels[0].Channel.Type) + }) + + t.Run("CreateChannelWithMembers", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1, memberID2}) + + resp, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{}) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Members), 3) + }) + + t.Run("CreateDistinctChannel", func(t *testing.T) { + members := []ChannelMemberRequest{ + {UserID: creatorID}, + {UserID: memberID1}, + } + + resp, err := client.Chat().GetOrCreateDistinctChannel(ctx, "messaging", &GetOrCreateDistinctChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + Members: members, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Channel) + + // Calling again with same members should return same channel + resp2, err := client.Chat().GetOrCreateDistinctChannel(ctx, "messaging", &GetOrCreateDistinctChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + Members: members, + }, + }) + require.NoError(t, err) + assert.Equal(t, resp.Data.Channel.Cid, resp2.Data.Channel.Cid) + + // Cleanup (hard delete) + t.Cleanup(func() { + _, _ = client.Chat().DeleteChannel(context.Background(), "messaging", resp.Data.Channel.ID, &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + }) + + t.Run("QueryChannels", func(t *testing.T) { + _, channelID := createTestChannel(t, client, creatorID) + + resp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "type": "messaging", + "id": channelID, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, resp.Data.Channels) + assert.Equal(t, channelID, resp.Data.Channels[0].Channel.ID) + }) + + t.Run("UpdateChannel", func(t *testing.T) { + ch, _ := createTestChannel(t, client, creatorID) + + resp, err := ch.Update(ctx, &UpdateChannelRequest{ + Data: &ChannelInputRequest{ + Custom: map[string]any{ + "color": "blue", + }, + }, + Message: &MessageRequest{ + Text: PtrTo("Channel updated!"), + UserID: PtrTo(creatorID), + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Channel) + assert.Equal(t, "blue", resp.Data.Channel.Custom["color"]) + }) + + t.Run("PartialUpdateChannel", func(t *testing.T) { + ch, _ := createTestChannel(t, client, creatorID) + + // Set fields + resp, err := ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Set: map[string]any{ + "color": "red", + "description": "A test channel", + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Channel) + assert.Equal(t, "red", resp.Data.Channel.Custom["color"]) + + // Unset fields + resp, err = ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Unset: []string{"color"}, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Channel) + _, hasColor := resp.Data.Channel.Custom["color"] + assert.False(t, hasColor, "color should be unset") + }) + + t.Run("DeleteChannel", func(t *testing.T) { + channelID := "test-del-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + }, + }) + require.NoError(t, err) + + // Hard delete cleanup in case soft delete test fails + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + // Soft delete + resp, err := ch.Delete(ctx, &DeleteChannelRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data.Channel) + }) + + t.Run("HardDeleteChannels", func(t *testing.T) { + ch1, channelID1 := createTestChannel(t, client, creatorID) + ch2, channelID2 := createTestChannel(t, client, creatorID) + _ = ch1 + _ = ch2 + + cid1 := "messaging:" + channelID1 + cid2 := "messaging:" + channelID2 + + resp, err := client.Chat().DeleteChannels(ctx, &DeleteChannelsRequest{ + Cids: []string{cid1, cid2}, + HardDelete: PtrTo(true), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.TaskID) + + taskResult, err := WaitForTask(ctx, client, *resp.Data.TaskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) + }) + + t.Run("AddRemoveMembers", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Add members + _, err := ch.Update(ctx, &UpdateChannelRequest{ + AddMembers: []ChannelMemberRequest{ + {UserID: memberID2}, + {UserID: memberID3}, + }, + }) + require.NoError(t, err) + + // Verify members added + resp, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{}) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Members), 4) + + // Remove a member + _, err = ch.Update(ctx, &UpdateChannelRequest{ + RemoveMembers: []string{memberID3}, + }) + require.NoError(t, err) + + // Verify member removed + resp, err = ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{}) + require.NoError(t, err) + memberFound := false + for _, m := range resp.Data.Members { + if m.UserID != nil && *m.UserID == memberID3 { + memberFound = true + } + } + assert.False(t, memberFound, "memberID3 should have been removed") + }) + + t.Run("QueryMembers", func(t *testing.T) { + _, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1, memberID2}) + + resp, err := client.Chat().QueryMembers(ctx, &QueryMembersRequest{ + Payload: &QueryMembersPayload{ + Type: "messaging", + ID: PtrTo(channelID), + FilterConditions: map[string]any{}, + }, + }) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Members), 3) + }) + + t.Run("InviteAcceptReject", func(t *testing.T) { + channelID := "test-inv-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + // Create channel with invite + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + Members: []ChannelMemberRequest{ + {UserID: creatorID}, + }, + Invites: []ChannelMemberRequest{ + {UserID: memberID1}, + {UserID: memberID2}, + }, + }, + }) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + // Accept invite + _, err = ch.Update(ctx, &UpdateChannelRequest{ + AcceptInvite: PtrTo(true), + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + + // Reject invite + _, err = ch.Update(ctx, &UpdateChannelRequest{ + RejectInvite: PtrTo(true), + UserID: PtrTo(memberID2), + }) + require.NoError(t, err) + }) + + t.Run("HideShowChannel", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Hide + _, err := ch.Hide(ctx, &HideChannelRequest{ + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + + // Show + _, err = ch.Show(ctx, &ShowChannelRequest{ + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + }) + + t.Run("TruncateChannel", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send some messages + sendTestMessage(t, ch, creatorID, "Message 1") + sendTestMessage(t, ch, creatorID, "Message 2") + sendTestMessage(t, ch, creatorID, "Message 3") + + // Truncate + _, err := ch.Truncate(ctx, &TruncateChannelRequest{}) + require.NoError(t, err) + + // Verify messages are gone + resp, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{}) + require.NoError(t, err) + assert.Empty(t, resp.Data.Messages, "Messages should be empty after truncation") + }) + + t.Run("FreezeUnfreezeChannel", func(t *testing.T) { + ch, _ := createTestChannel(t, client, creatorID) + + // Freeze + resp, err := ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Set: map[string]any{ + "frozen": true, + }, + }) + require.NoError(t, err) + assert.True(t, resp.Data.Channel.Frozen) + + // Unfreeze + resp, err = ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Set: map[string]any{ + "frozen": false, + }, + }) + require.NoError(t, err) + assert.False(t, resp.Data.Channel.Frozen) + }) + + t.Run("MarkReadUnread", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send a message + msgID := sendTestMessage(t, ch, creatorID, "Message to mark read") + + // Mark read + _, err := ch.MarkRead(ctx, &MarkReadRequest{ + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + + // Mark unread from this message + _, err = ch.MarkUnread(ctx, &MarkUnreadRequest{ + UserID: PtrTo(memberID1), + MessageID: PtrTo(msgID), + }) + require.NoError(t, err) + }) + + t.Run("MuteUnmuteChannel", func(t *testing.T) { + _, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + cid := "messaging:" + channelID + + // Mute the channel for memberID1 + muteResp, err := client.Chat().MuteChannel(ctx, &MuteChannelRequest{ + ChannelCids: []string{cid}, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.NotNil(t, muteResp.Data) + + // Verify mute response details (like stream-chat-go does) + require.NotNil(t, muteResp.Data.ChannelMute, "Mute response should contain ChannelMute") + require.NotNil(t, muteResp.Data.ChannelMute.Channel, "ChannelMute should have Channel") + require.NotNil(t, muteResp.Data.ChannelMute.User, "ChannelMute should have User") + assert.Equal(t, cid, muteResp.Data.ChannelMute.Channel.Cid) + assert.Equal(t, memberID1, muteResp.Data.ChannelMute.User.ID) + + // Verify via QueryChannels with muted=true and cid filter + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "muted": true, + "cid": cid, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Should find exactly 1 muted channel") + assert.Equal(t, cid, qResp.Data.Channels[0].Channel.Cid) + + // Unmute the channel + _, err = client.Chat().UnmuteChannel(ctx, &UnmuteChannelRequest{ + ChannelCids: []string{cid}, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + + // Verify unmute via query with muted=false (like stream-chat-go does) + qResp, err = client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "muted": false, + "cid": cid, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Unmuted channel should appear in muted=false query") + }) + + t.Run("MemberPartialUpdate", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Set custom fields on member + resp, err := ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Set: map[string]any{ + "role_label": "moderator", + "score": 42, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.ChannelMember) + assert.Equal(t, "moderator", resp.Data.ChannelMember.Custom["role_label"]) + + // Unset a custom field + resp, err = ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Unset: []string{"score"}, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.ChannelMember) + _, hasScore := resp.Data.ChannelMember.Custom["score"] + assert.False(t, hasScore, "score should be unset") + }) + + t.Run("AssignRoles", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Assign channel_moderator role to memberID1 + _, err := ch.Update(ctx, &UpdateChannelRequest{ + AssignRoles: []ChannelMemberRequest{ + {UserID: memberID1, ChannelRole: PtrTo("channel_moderator")}, + }, + }) + require.NoError(t, err) + + // Verify via QueryMembers that the role is set + qResp, err := client.Chat().QueryMembers(ctx, &QueryMembersRequest{ + Payload: &QueryMembersPayload{ + Type: "messaging", + ID: PtrTo(channelID), + FilterConditions: map[string]any{ + "id": memberID1, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Members) + assert.Equal(t, "channel_moderator", qResp.Data.Members[0].ChannelRole) + }) + + t.Run("AddDemoteModerators", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Add moderator using UpdateChannel with AddModerators + _, err := ch.Update(ctx, &UpdateChannelRequest{ + AddModerators: []string{memberID1}, + }) + require.NoError(t, err) + + // Verify role changed to moderator via QueryMembers + qResp, err := client.Chat().QueryMembers(ctx, &QueryMembersRequest{ + Payload: &QueryMembersPayload{ + Type: "messaging", + ID: PtrTo(channelID), + FilterConditions: map[string]any{ + "id": memberID1, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Members) + assert.Equal(t, "channel_moderator", qResp.Data.Members[0].ChannelRole) + + // Demote moderator back to member + _, err = ch.Update(ctx, &UpdateChannelRequest{ + DemoteModerators: []string{memberID1}, + }) + require.NoError(t, err) + + // Verify role changed back to member + qResp, err = client.Chat().QueryMembers(ctx, &QueryMembersRequest{ + Payload: &QueryMembersPayload{ + Type: "messaging", + ID: PtrTo(channelID), + FilterConditions: map[string]any{ + "id": memberID1, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Members) + assert.Equal(t, "channel_member", qResp.Data.Members[0].ChannelRole) + }) + + t.Run("MarkUnreadWithThread", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send parent message + parentID := sendTestMessage(t, ch, creatorID, "Parent for mark unread thread") + + // Send reply to create a thread + _, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Reply in thread"), + UserID: PtrTo(creatorID), + ParentID: PtrTo(parentID), + }, + }) + require.NoError(t, err) + + // Mark unread from thread + _, err = ch.MarkUnread(ctx, &MarkUnreadRequest{ + UserID: PtrTo(memberID1), + ThreadID: PtrTo(parentID), + }) + require.NoError(t, err) + }) + + t.Run("TruncateWithOptions", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send messages + sendTestMessage(t, ch, creatorID, "Truncate msg 1") + sendTestMessage(t, ch, creatorID, "Truncate msg 2") + + // Truncate with message and skip push (matching stream-chat-go TruncateWithOptions) + _, err := ch.Truncate(ctx, &TruncateChannelRequest{ + Message: &MessageRequest{ + Text: PtrTo("Channel was truncated"), + UserID: PtrTo(creatorID), + }, + SkipPush: PtrTo(true), + HardDelete: PtrTo(true), + }) + require.NoError(t, err) + }) + + t.Run("PinUnpinChannel", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Pin channel for memberID1 via UpdateMemberPartial + _, err := ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Set: map[string]any{ + "pinned": true, + }, + }) + require.NoError(t, err) + + // Verify via QueryChannels with pinned filter + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "pinned": true, + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Should find 1 pinned channel") + assert.Equal(t, "messaging:"+channelID, qResp.Data.Channels[0].Channel.Cid) + + // Unpin + _, err = ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Set: map[string]any{ + "pinned": false, + }, + }) + require.NoError(t, err) + + // Verify unpinned + qResp, err = client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "pinned": false, + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Should find channel with pinned=false") + }) + + t.Run("ArchiveUnarchiveChannel", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Archive channel for memberID1 via UpdateMemberPartial + _, err := ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Set: map[string]any{ + "archived": true, + }, + }) + require.NoError(t, err) + + // Verify via QueryChannels with archived filter + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "archived": true, + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Should find 1 archived channel") + assert.Equal(t, "messaging:"+channelID, qResp.Data.Channels[0].Channel.Cid) + + // Unarchive + _, err = ch.UpdateMemberPartial(ctx, &UpdateMemberPartialRequest{ + UserID: PtrTo(memberID1), + Set: map[string]any{ + "archived": false, + }, + }) + require.NoError(t, err) + + // Verify unarchived + qResp, err = client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "archived": false, + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(memberID1), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1, "Should find channel with archived=false") + }) + + t.Run("AddMembersWithRoles", func(t *testing.T) { + ch, channelID := createTestChannel(t, client, creatorID) + _ = channelID + + newUserIDs := createTestUsers(t, client, 2) + modUserID := newUserIDs[0] + memberUserID2 := newUserIDs[1] + + // Add members with specific channel roles + _, err := ch.Update(ctx, &UpdateChannelRequest{ + AddMembers: []ChannelMemberRequest{ + {UserID: modUserID, ChannelRole: PtrTo("channel_moderator")}, + {UserID: memberUserID2, ChannelRole: PtrTo("channel_member")}, + }, + }) + require.NoError(t, err) + + // Query members to verify roles + membersResp, err := client.Chat().QueryMembers(ctx, &QueryMembersRequest{ + Payload: &QueryMembersPayload{ + Type: "messaging", + ID: PtrTo(channelID), + FilterConditions: map[string]any{"id": map[string]any{"$in": newUserIDs}}, + }, + }) + require.NoError(t, err) + + roleMap := make(map[string]string) + for _, m := range membersResp.Data.Members { + if m.UserID != nil { + roleMap[*m.UserID] = m.ChannelRole + } + } + assert.Equal(t, "channel_moderator", roleMap[modUserID], "First user should be channel_moderator") + assert.Equal(t, "channel_member", roleMap[memberUserID2], "Second user should be channel_member") + }) + + t.Run("MessageCount", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send a message + sendTestMessage(t, ch, creatorID, "hello world") + + // Query the channel to get message count + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(creatorID), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1) + + // MessageCount should be present (default enabled for messaging type) + channel := qResp.Data.Channels[0].Channel + if channel.MessageCount != nil { + assert.GreaterOrEqual(t, *channel.MessageCount, 1, "MessageCount should be >= 1") + } + // Note: MessageCount may be nil if count_messages is disabled on the channel type + }) + + t.Run("SendChannelEvent", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + _, err := ch.SendEvent(ctx, &SendEventRequest{ + Event: EventRequest{ + Type: "typing.start", + UserID: PtrTo(creatorID), + }, + }) + require.NoError(t, err) + }) + + t.Run("FilterTags", func(t *testing.T) { + ch, _ := createTestChannel(t, client, creatorID) + + // Add filter tags + _, err := ch.Update(ctx, &UpdateChannelRequest{ + AddFilterTags: []string{"sports", "news"}, + }) + require.NoError(t, err) + + // Verify tags were added by querying + getResp, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{}) + require.NoError(t, err) + require.NotNil(t, getResp.Data.Channel) + + // Remove filter tags + _, err = ch.Update(ctx, &UpdateChannelRequest{ + RemoveFilterTags: []string{"sports"}, + }) + require.NoError(t, err) + }) + + t.Run("MessageCountDisabled", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Disable count_messages via config_overrides partial update + _, err := ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Set: map[string]any{ + "config_overrides": map[string]any{ + "count_messages": false, + }, + }, + }) + require.NoError(t, err) + + // Send a message + sendTestMessage(t, ch, creatorID, "hello world disabled count") + + // Query the channel — MessageCount should be nil when disabled + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(creatorID), + }) + require.NoError(t, err) + require.Len(t, qResp.Data.Channels, 1) + assert.Nil(t, qResp.Data.Channels[0].Channel.MessageCount, + "MessageCount should be nil when count_messages is disabled") + }) + + t.Run("MarkUnreadWithTimestamp", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, memberID1}) + + // Send a message to get a valid timestamp + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("test message for timestamp unread"), + UserID: PtrTo(creatorID), + }, + }) + require.NoError(t, err) + require.NotNil(t, sendResp.Data.Message.CreatedAt) + + // Mark unread from timestamp + ts := sendResp.Data.Message.CreatedAt + _, err = ch.MarkUnread(ctx, &MarkUnreadRequest{ + UserID: PtrTo(memberID1), + MessageTimestamp: &ts, + }) + require.NoError(t, err) + }) + + t.Run("HideForCreator", func(t *testing.T) { + channelID := "test-hide-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + HideForCreator: PtrTo(true), + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + Members: []ChannelMemberRequest{ + {UserID: creatorID}, + {UserID: memberID1}, + }, + }, + }) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + // Channel should be hidden for creator — querying without show_hidden should not find it + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "cid": "messaging:" + channelID, + }, + UserID: PtrTo(creatorID), + }) + require.NoError(t, err) + assert.Empty(t, qResp.Data.Channels, "Channel should be hidden for creator") + }) + + t.Run("UploadAndDeleteFile", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID}) + + // Create a temp file to upload + tmpFile, err := os.CreateTemp("", "chat-test-*.txt") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + _, err = tmpFile.WriteString("hello world test file content") + require.NoError(t, err) + tmpFile.Close() + + // Upload file + uploadResp, err := ch.UploadChannelFile(ctx, &UploadChannelFileRequest{ + File: PtrTo(tmpFile.Name()), + User: &OnlyUserID{ID: creatorID}, + }) + require.NoError(t, err) + require.NotNil(t, uploadResp.Data.File) + fileURL := *uploadResp.Data.File + assert.NotEmpty(t, fileURL) + assert.Contains(t, fileURL, "http") + + // Delete file + _, err = ch.DeleteChannelFile(ctx, &DeleteChannelFileRequest{ + Url: PtrTo(fileURL), + }) + require.NoError(t, err) + }) + + t.Run("UploadAndDeleteImage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, creatorID, []string{creatorID}) + + // Create a temp image file to upload (minimal valid JPEG) + tmpFile, err := os.CreateTemp("", "chat-test-*.jpg") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + _, err = tmpFile.WriteString("fake-jpg-image-data-for-testing") + require.NoError(t, err) + tmpFile.Close() + + // Upload image + uploadResp, err := ch.UploadChannelImage(ctx, &UploadChannelImageRequest{ + File: PtrTo(tmpFile.Name()), + User: &OnlyUserID{ID: creatorID}, + }) + require.NoError(t, err) + require.NotNil(t, uploadResp.Data.File) + imageURL := *uploadResp.Data.File + assert.NotEmpty(t, imageURL) + assert.Contains(t, imageURL, "http") + + // Delete image + _, err = ch.DeleteChannelImage(ctx, &DeleteChannelImageRequest{ + Url: PtrTo(imageURL), + }) + require.NoError(t, err) + }) +} diff --git a/chat_message_integration_test.go b/chat_message_integration_test.go new file mode 100644 index 0000000..8eb32af --- /dev/null +++ b/chat_message_integration_test.go @@ -0,0 +1,658 @@ +package getstream_test + +import ( + "context" + "strings" + "testing" + "time" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatMessageIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + userID2 := userIDs[1] + + t.Run("SendAndGetMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + msgText := "Hello from integration test " + randomString(8) + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo(msgText), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + msgID := sendResp.Data.Message.ID + assert.NotEmpty(t, msgID) + assert.Equal(t, msgText, sendResp.Data.Message.Text) + + // Get message by ID + getResp, err := client.Chat().GetMessage(ctx, msgID, &GetMessageRequest{}) + require.NoError(t, err) + assert.Equal(t, msgID, getResp.Data.Message.ID) + assert.Equal(t, msgText, getResp.Data.Message.Text) + }) + + t.Run("GetManyMessages", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + id1 := sendTestMessage(t, ch, userID, "Msg 1") + id2 := sendTestMessage(t, ch, userID, "Msg 2") + id3 := sendTestMessage(t, ch, userID, "Msg 3") + + resp, err := ch.GetManyMessages(ctx, &GetManyMessagesRequest{ + Ids: []string{id1, id2, id3}, + }) + require.NoError(t, err) + require.Len(t, resp.Data.Messages, 3) + }) + + t.Run("UpdateMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Original text") + + updatedText := "Updated text " + randomString(8) + resp, err := client.Chat().UpdateMessage(ctx, msgID, &UpdateMessageRequest{ + Message: MessageRequest{ + Text: PtrTo(updatedText), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + assert.Equal(t, updatedText, resp.Data.Message.Text) + }) + + t.Run("PartialUpdateMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Partial update test") + + // Set custom field + resp, err := client.Chat().UpdateMessagePartial(ctx, msgID, &UpdateMessagePartialRequest{ + Set: map[string]any{ + "priority": "high", + "status": "reviewed", + }, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Message) + + // Unset custom field + resp, err = client.Chat().UpdateMessagePartial(ctx, msgID, &UpdateMessagePartialRequest{ + Unset: []string{"status"}, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Message) + }) + + t.Run("DeleteMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Message to delete") + + // Soft delete + resp, err := client.Chat().DeleteMessage(ctx, msgID, &DeleteMessageRequest{}) + require.NoError(t, err) + assert.Equal(t, "deleted", resp.Data.Message.Type) + }) + + t.Run("HardDeleteMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Message to hard delete") + + resp, err := client.Chat().DeleteMessage(ctx, msgID, &DeleteMessageRequest{ + Hard: PtrTo(true), + }) + require.NoError(t, err) + assert.Equal(t, "deleted", resp.Data.Message.Type) + }) + + t.Run("PinUnpinMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + // Send a pinned message + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Pinned message"), + UserID: PtrTo(userID), + Pinned: PtrTo(true), + }, + }) + require.NoError(t, err) + msgID := sendResp.Data.Message.ID + assert.True(t, sendResp.Data.Message.Pinned) + + // Unpin via update + resp, err := client.Chat().UpdateMessagePartial(ctx, msgID, &UpdateMessagePartialRequest{ + Set: map[string]any{ + "pinned": false, + }, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Message) + assert.False(t, resp.Data.Message.Pinned) + }) + + t.Run("TranslateMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Hello, how are you?") + + resp, err := client.Chat().TranslateMessage(ctx, msgID, &TranslateMessageRequest{ + Language: "es", + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Message) + // The i18n field should be populated after translation + assert.NotNil(t, resp.Data.Message.I18n, "i18n field should be set after translation") + }) + + t.Run("ThreadReply", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + + // Send parent message + parentID := sendTestMessage(t, ch, userID, "Parent message for thread") + + // Send reply + replyResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Reply to parent"), + UserID: PtrTo(userID2), + ParentID: PtrTo(parentID), + }, + }) + require.NoError(t, err) + assert.NotEmpty(t, replyResp.Data.Message.ID) + + // Get replies — provide empty Sort slice to avoid nil being serialized as "null" + repliesResp, err := client.Chat().GetReplies(ctx, parentID, &GetRepliesRequest{ + Sort: []SortParamRequest{}, + }) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(repliesResp.Data.Messages), 1) + }) + + t.Run("SearchMessages", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID}) + + searchTerm := "uniquesearch" + randomString(8) + sendTestMessage(t, ch, userID, "This message contains "+searchTerm+" for testing") + + // Wait briefly for indexing + time.Sleep(2 * time.Second) + + resp, err := client.Chat().Search(ctx, &SearchRequest{ + Payload: &SearchPayload{ + Query: PtrTo(searchTerm), + FilterConditions: map[string]any{ + "cid": "messaging:" + channelID, + }, + }, + }) + require.NoError(t, err) + assert.NotEmpty(t, resp.Data.Results, "Search should return at least one result") + }) + + t.Run("SilentMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + resp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("This is a silent message"), + UserID: PtrTo(userID), + Silent: PtrTo(true), + }, + }) + require.NoError(t, err) + assert.True(t, resp.Data.Message.Silent) + }) + + t.Run("PendingMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + // Send a pending message (requires pending messages feature flag) + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Pending message text"), + UserID: PtrTo(userID), + }, + Pending: PtrTo(true), + SkipPush: PtrTo(true), + }) + if err != nil { + errStr := err.Error() + if strings.Contains(errStr, "pending messages not enabled") || strings.Contains(errStr, "feature flag") { + t.Skip("Pending messages feature not enabled for this app") + } + require.NoError(t, err) + } + msgID := sendResp.Data.Message.ID + assert.NotEmpty(t, msgID) + + // Commit the pending message + commitResp, err := client.Chat().CommitMessage(ctx, msgID, &CommitMessageRequest{}) + require.NoError(t, err) + require.NotNil(t, commitResp.Data.Message) + assert.Equal(t, msgID, commitResp.Data.Message.ID) + }) + + t.Run("QueryMessageHistory", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + + // Send initial message with custom data (matching stream-chat-go TestMessageHistory) + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("initial text"), + UserID: PtrTo(userID), + Custom: map[string]any{"custom_field": "custom value"}, + }, + }) + require.NoError(t, err) + msgID := sendResp.Data.Message.ID + + // Update by user1 with new text and custom value + _, err = client.Chat().UpdateMessage(ctx, msgID, &UpdateMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("updated text"), + UserID: PtrTo(userID), + Custom: map[string]any{"custom_field": "updated custom value"}, + }, + }) + require.NoError(t, err) + + // Update by user2 with new text + _, err = client.Chat().UpdateMessage(ctx, msgID, &UpdateMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("updated text 2"), + UserID: PtrTo(userID2), + }, + }) + require.NoError(t, err) + + // Query message history (requires feature flag) + histResp, err := client.Chat().QueryMessageHistory(ctx, &QueryMessageHistoryRequest{ + Filter: map[string]any{ + "message_id": msgID, + }, + Sort: []SortParamRequest{}, + }) + if err != nil { + errStr := err.Error() + if strings.Contains(errStr, "feature flag") || strings.Contains(errStr, "not enabled") { + t.Skip("QueryMessageHistory feature not enabled for this app") + } + require.NoError(t, err) + } + require.GreaterOrEqual(t, len(histResp.Data.MessageHistory), 2, "Should have at least 2 history entries") + + // Verify history entries reference the correct message and updaters + for _, entry := range histResp.Data.MessageHistory { + assert.Equal(t, msgID, entry.MessageID) + } + + // Verify text values in history (descending order by default) + // history[0] = most recent prior version = "updated text" + // history[1] = original = "initial text" + assert.Equal(t, "updated text", histResp.Data.MessageHistory[0].Text) + assert.Equal(t, userID, histResp.Data.MessageHistory[0].MessageUpdatedByID) + assert.Equal(t, "initial text", histResp.Data.MessageHistory[1].Text) + assert.Equal(t, userID, histResp.Data.MessageHistory[1].MessageUpdatedByID) + }) + + t.Run("QueryMessageHistorySort", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("sort initial"), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + msgID := sendResp.Data.Message.ID + + _, err = client.Chat().UpdateMessage(ctx, msgID, &UpdateMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("sort updated 1"), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + _, err = client.Chat().UpdateMessage(ctx, msgID, &UpdateMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("sort updated 2"), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + // Query with ascending sort by message_updated_at + histResp, err := client.Chat().QueryMessageHistory(ctx, &QueryMessageHistoryRequest{ + Filter: map[string]any{ + "message_id": msgID, + }, + Sort: []SortParamRequest{ + {Field: PtrTo("message_updated_at"), Direction: PtrTo(1)}, + }, + }) + if err != nil { + errStr := err.Error() + if strings.Contains(errStr, "feature flag") || strings.Contains(errStr, "not enabled") { + t.Skip("QueryMessageHistory feature not enabled for this app") + } + require.NoError(t, err) + } + require.GreaterOrEqual(t, len(histResp.Data.MessageHistory), 2) + + // Ascending: oldest first + assert.Equal(t, "sort initial", histResp.Data.MessageHistory[0].Text) + assert.Equal(t, userID, histResp.Data.MessageHistory[0].MessageUpdatedByID) + }) + + t.Run("SkipEnrichUrl", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + // Send a message with a URL but skip enrichment + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Check out https://getstream.io for more info"), + UserID: PtrTo(userID), + }, + SkipEnrichUrl: PtrTo(true), + }) + require.NoError(t, err) + assert.Empty(t, sendResp.Data.Message.Attachments, "Attachments should be empty when SkipEnrichUrl is true") + + // Verify via GetMessage that attachments remain empty + time.Sleep(3 * time.Second) + getResp, err := client.Chat().GetMessage(ctx, sendResp.Data.Message.ID, &GetMessageRequest{}) + require.NoError(t, err) + assert.Empty(t, getResp.Data.Message.Attachments, "Attachments should remain empty after enrichment window") + }) + + t.Run("KeepChannelHidden", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID}) + cid := "messaging:" + channelID + + // Hide the channel first + _, err := ch.Hide(ctx, &HideChannelRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + + // Send a message with KeepChannelHidden=true + _, err = ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Hidden message"), + UserID: PtrTo(userID), + }, + KeepChannelHidden: PtrTo(true), + }) + require.NoError(t, err) + + // Query channels — the channel should still be hidden + qResp, err := client.Chat().QueryChannels(ctx, &QueryChannelsRequest{ + FilterConditions: map[string]any{ + "cid": cid, + }, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + assert.Empty(t, qResp.Data.Channels, "Channel should remain hidden after sending with KeepChannelHidden") + }) + + t.Run("UndeleteMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Message to undelete") + + // Soft delete the message + _, err := client.Chat().DeleteMessage(ctx, msgID, &DeleteMessageRequest{}) + require.NoError(t, err) + + // Verify it's deleted + getResp, err := client.Chat().GetMessage(ctx, msgID, &GetMessageRequest{}) + require.NoError(t, err) + assert.Equal(t, "deleted", getResp.Data.Message.Type) + + // Undelete the message + // Note: The API requires "undeleted_by" field which may not be in the generated + // request struct yet. Gracefully skip if the field is missing. + undelResp, err := client.Chat().UndeleteMessage(ctx, msgID, &UndeleteMessageRequest{ + UndeletedBy: userID, + }) + if err != nil { + errStr := err.Error() + if strings.Contains(errStr, "undeleted_by") || strings.Contains(errStr, "required field") { + t.Skip("UndeleteMessage requires 'undeleted_by' field not yet in generated request struct") + } + require.NoError(t, err) + } + require.NotNil(t, undelResp.Data.Message) + assert.NotEqual(t, "deleted", undelResp.Data.Message.Type) + assert.Equal(t, "Message to undelete", undelResp.Data.Message.Text) + }) + + t.Run("RestrictedVisibility", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + + // Send a message with restricted visibility — only userID can see it + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Secret message"), + UserID: PtrTo(userID), + RestrictedVisibility: []string{userID}, + }, + }) + if err != nil { + errStr := err.Error() + if strings.Contains(errStr, "private messaging is not allowed") || strings.Contains(errStr, "not enabled") { + t.Skip("RestrictedVisibility (private messaging) is not enabled for this app") + } + require.NoError(t, err) + } + assert.Equal(t, []string{userID}, sendResp.Data.Message.RestrictedVisibility) + }) + + t.Run("DeleteMessageForMe", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "test message to delete for me") + + // Delete the message only for the sender (not for everyone) + _, err := client.Chat().DeleteMessage(ctx, msgID, &DeleteMessageRequest{ + DeleteForMe: PtrTo(true), + DeletedBy: PtrTo(userID), + }) + require.NoError(t, err) + }) + + t.Run("PinExpiration", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + + // Send message by user2 + msgID := sendTestMessage(t, ch, userID2, "Message to pin with expiry") + + // Pin with 3 second expiration + now := time.Now() + expiry := now.Add(3 * time.Second) + pinResp, err := client.Chat().UpdateMessagePartial(ctx, msgID, &UpdateMessagePartialRequest{ + Set: map[string]any{ + "pinned": true, + "pin_expires": expiry.Format(time.RFC3339), + }, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + assert.True(t, pinResp.Data.Message.Pinned) + + // Wait for pin to expire + time.Sleep(4 * time.Second) + + // Verify pin expired + getResp, err := client.Chat().GetMessage(ctx, msgID, &GetMessageRequest{}) + require.NoError(t, err) + assert.False(t, getResp.Data.Message.Pinned, "Pin should have expired") + }) + + t.Run("SystemMessage", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + resp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("User joined the channel"), + UserID: PtrTo(userID), + Type: PtrTo("system"), + }, + }) + require.NoError(t, err) + assert.Equal(t, "system", resp.Data.Message.Type) + }) + + t.Run("PendingFalse", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + // Send message with Pending explicitly set to false (non-pending) + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Non-pending message"), + UserID: PtrTo(userID), + }, + Pending: PtrTo(false), + }) + require.NoError(t, err) + + // Get the message to verify it's immediately available (no commit needed) + getResp, err := client.Chat().GetMessage(ctx, sendResp.Data.Message.ID, &GetMessageRequest{}) + require.NoError(t, err) + assert.Equal(t, "Non-pending message", getResp.Data.Message.Text) + }) + + t.Run("SearchWithMessageFilters", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID}) + + searchTerm := "filterable" + randomString(8) + sendTestMessage(t, ch, userID, "This has "+searchTerm+" text") + sendTestMessage(t, ch, userID, "This also has "+searchTerm+" text") + + // Wait briefly for indexing + time.Sleep(2 * time.Second) + + // Search using message_filter_conditions (instead of query) + resp, err := client.Chat().Search(ctx, &SearchRequest{ + Payload: &SearchPayload{ + FilterConditions: map[string]any{ + "cid": "messaging:" + channelID, + }, + MessageFilterConditions: map[string]any{ + "text": map[string]any{"$q": searchTerm}, + }, + }, + }) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Results), 2, "Should find at least 2 messages with MessageFilterConditions") + }) + + t.Run("SearchQueryAndMessageFiltersError", func(t *testing.T) { + // Using both Query and MessageFilterConditions together should error + _, err := client.Chat().Search(ctx, &SearchRequest{ + Payload: &SearchPayload{ + FilterConditions: map[string]any{ + "members": map[string]any{"$in": []string{userID}}, + }, + Query: PtrTo("test"), + MessageFilterConditions: map[string]any{ + "text": map[string]any{"$q": "test"}, + }, + }, + }) + require.Error(t, err, "Using both Query and MessageFilterConditions should error") + }) + + t.Run("SearchOffsetAndSortError", func(t *testing.T) { + // Using Offset with Sort should error + _, err := client.Chat().Search(ctx, &SearchRequest{ + Payload: &SearchPayload{ + FilterConditions: map[string]any{ + "members": map[string]any{"$in": []string{userID}}, + }, + Query: PtrTo("test"), + Offset: PtrTo(1), + Sort: []SortParamRequest{ + {Field: PtrTo("created_at"), Direction: PtrTo(-1)}, + }, + }, + }) + require.Error(t, err, "Using Offset with Sort should error") + }) + + t.Run("SearchOffsetAndNextError", func(t *testing.T) { + // Using Offset with Next should error + _, err := client.Chat().Search(ctx, &SearchRequest{ + Payload: &SearchPayload{ + FilterConditions: map[string]any{ + "members": map[string]any{"$in": []string{userID}}, + }, + Query: PtrTo("test"), + Offset: PtrTo(1), + Next: PtrTo(randomString(5)), + }, + }) + require.Error(t, err, "Using Offset with Next should error") + }) + + t.Run("ChannelRoleInMember", func(t *testing.T) { + userIDs := createTestUsers(t, client, 2) + memberUserID := userIDs[0] + customRoleUserID := userIDs[1] + + // Create channel with members assigned specific roles + channelID := "test-ch-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(memberUserID), + Members: []ChannelMemberRequest{ + {UserID: memberUserID, ChannelRole: PtrTo("channel_member")}, + {UserID: customRoleUserID, ChannelRole: PtrTo("channel_moderator")}, + }, + }, + }) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{HardDelete: PtrTo(true)}) + }) + + // Send message from channel_member + respMember, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("message from channel_member"), + UserID: PtrTo(memberUserID), + }, + }) + require.NoError(t, err) + require.NotNil(t, respMember.Data.Message.Member, "Member should be present in message response") + assert.Equal(t, "channel_member", respMember.Data.Message.Member.ChannelRole) + + // Send message from channel_moderator + respMod, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("message from channel_moderator"), + UserID: PtrTo(customRoleUserID), + }, + }) + require.NoError(t, err) + require.NotNil(t, respMod.Data.Message.Member, "Member should be present in message response") + assert.Equal(t, "channel_moderator", respMod.Data.Message.Member.ChannelRole) + }) +} diff --git a/chat_misc_integration_test.go b/chat_misc_integration_test.go new file mode 100644 index 0000000..ee25b5c --- /dev/null +++ b/chat_misc_integration_test.go @@ -0,0 +1,1794 @@ +package getstream_test + +import ( + "context" + "os" + "strings" + "testing" + "time" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatDeviceIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + t.Run("CreateListDeleteDevice", func(t *testing.T) { + deviceID := "integration-test-device-" + randomString(12) + + // Create device + _, err := client.CreateDevice(ctx, &CreateDeviceRequest{ + ID: deviceID, + PushProvider: "firebase", + UserID: PtrTo(userID), + }) + if err != nil && strings.Contains(err.Error(), "no push providers configured") { + t.Skip("Push providers not configured for this app") + } + require.NoError(t, err) + + // List devices + listResp, err := client.ListDevices(ctx, &ListDevicesRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + + found := false + for _, d := range listResp.Data.Devices { + if d.ID == deviceID { + found = true + assert.Equal(t, "firebase", d.PushProvider) + assert.Equal(t, userID, d.UserID) + } + } + assert.True(t, found, "Created device should appear in list") + + // Delete device + _, err = client.DeleteDevice(ctx, &DeleteDeviceRequest{ + ID: deviceID, + UserID: PtrTo(userID), + }) + require.NoError(t, err) + + // Verify deleted + listResp, err = client.ListDevices(ctx, &ListDevicesRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + + for _, d := range listResp.Data.Devices { + assert.NotEqual(t, deviceID, d.ID, "Device should be deleted") + } + }) +} + +func TestChatBlocklistIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + blocklistName := "test-blocklist-" + randomString(8) + + t.Cleanup(func() { + _, _ = client.DeleteBlockList(context.Background(), blocklistName, &DeleteBlockListRequest{}) + }) + + t.Run("CreateBlockList", func(t *testing.T) { + resp, err := client.CreateBlockList(ctx, &CreateBlockListRequest{ + Name: blocklistName, + Words: []string{"badword1", "badword2", "badword3"}, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data) + }) + + t.Run("GetBlockList", func(t *testing.T) { + resp, err := client.GetBlockList(ctx, blocklistName, &GetBlockListRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data.Blocklist) + assert.Equal(t, blocklistName, resp.Data.Blocklist.Name) + assert.Len(t, resp.Data.Blocklist.Words, 3) + }) + + t.Run("UpdateBlockList", func(t *testing.T) { + _, err := client.UpdateBlockList(ctx, blocklistName, &UpdateBlockListRequest{ + Words: []string{"badword1", "badword2", "badword3", "badword4"}, + }) + require.NoError(t, err) + + // Verify update + resp, err := client.GetBlockList(ctx, blocklistName, &GetBlockListRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data.Blocklist) + assert.Len(t, resp.Data.Blocklist.Words, 4) + }) + + t.Run("ListBlockLists", func(t *testing.T) { + resp, err := client.ListBlockLists(ctx, &ListBlockListsRequest{}) + require.NoError(t, err) + + found := false + for _, bl := range resp.Data.Blocklists { + if bl.Name == blocklistName { + found = true + } + } + assert.True(t, found, "Created blocklist should appear in list") + }) + + t.Run("DeleteBlockList", func(t *testing.T) { + // Create a separate one to delete + deleteName := "test-del-bl-" + randomString(8) + _, err := client.CreateBlockList(ctx, &CreateBlockListRequest{ + Name: deleteName, + Words: []string{"word1"}, + }) + require.NoError(t, err) + + _, err = client.DeleteBlockList(ctx, deleteName, &DeleteBlockListRequest{}) + require.NoError(t, err) + }) +} + +func TestChatCommandIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + cmdName := "testcmd" + randomString(6) + + t.Cleanup(func() { + _, _ = client.Chat().DeleteCommand(context.Background(), cmdName, &DeleteCommandRequest{}) + }) + + t.Run("CreateCommand", func(t *testing.T) { + resp, err := client.Chat().CreateCommand(ctx, &CreateCommandRequest{ + Name: cmdName, + Description: "A test command", + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Command) + assert.Equal(t, cmdName, resp.Data.Command.Name) + assert.Equal(t, "A test command", resp.Data.Command.Description) + }) + + t.Run("GetCommand", func(t *testing.T) { + resp, err := client.Chat().GetCommand(ctx, cmdName, &GetCommandRequest{}) + require.NoError(t, err) + assert.Equal(t, cmdName, resp.Data.Name) + assert.Equal(t, "A test command", resp.Data.Description) + }) + + t.Run("UpdateCommand", func(t *testing.T) { + _, err := client.Chat().UpdateCommand(ctx, cmdName, &UpdateCommandRequest{ + Description: "Updated test command", + }) + require.NoError(t, err) + + // Verify update + resp, err := client.Chat().GetCommand(ctx, cmdName, &GetCommandRequest{}) + require.NoError(t, err) + assert.Equal(t, "Updated test command", resp.Data.Description) + }) + + t.Run("ListCommands", func(t *testing.T) { + resp, err := client.Chat().ListCommands(ctx, &ListCommandsRequest{}) + require.NoError(t, err) + + found := false + for _, cmd := range resp.Data.Commands { + if cmd.Name == cmdName { + found = true + } + } + assert.True(t, found, "Created command should appear in list") + }) + + t.Run("DeleteCommand", func(t *testing.T) { + delName := "testdelcmd" + randomString(6) + _, err := client.Chat().CreateCommand(ctx, &CreateCommandRequest{ + Name: delName, + Description: "Command to delete", + }) + require.NoError(t, err) + + resp, err := client.Chat().DeleteCommand(ctx, delName, &DeleteCommandRequest{}) + require.NoError(t, err) + assert.Equal(t, delName, resp.Data.Name) + }) +} + +func TestChatChannelTypeIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + typeName := "testtype" + randomString(6) + + t.Cleanup(func() { + _, _ = client.Chat().DeleteChannelType(context.Background(), typeName, &DeleteChannelTypeRequest{}) + }) + + t.Run("CreateChannelType", func(t *testing.T) { + resp, err := client.Chat().CreateChannelType(ctx, &CreateChannelTypeRequest{ + Name: typeName, + Automod: "disabled", + AutomodBehavior: "flag", + MaxMessageLength: 5000, + }) + require.NoError(t, err) + assert.Equal(t, typeName, resp.Data.Name) + assert.Equal(t, 5000, resp.Data.MaxMessageLength) + + // Channel types are eventually consistent; stream-chat-go sleeps 6s after create + time.Sleep(6 * time.Second) + }) + + t.Run("GetChannelType", func(t *testing.T) { + resp, err := client.Chat().GetChannelType(ctx, typeName, &GetChannelTypeRequest{}) + require.NoError(t, err) + assert.Equal(t, typeName, resp.Data.Name) + }) + + t.Run("UpdateChannelType", func(t *testing.T) { + resp, err := client.Chat().UpdateChannelType(ctx, typeName, &UpdateChannelTypeRequest{ + Automod: "disabled", + AutomodBehavior: "flag", + MaxMessageLength: 10000, + TypingEvents: PtrTo(false), + }) + require.NoError(t, err) + assert.Equal(t, 10000, resp.Data.MaxMessageLength) + assert.False(t, resp.Data.TypingEvents) + }) + + t.Run("UpdateChannelTypeMarkMessagesPending", func(t *testing.T) { + resp, err := client.Chat().UpdateChannelType(ctx, typeName, &UpdateChannelTypeRequest{ + Automod: "disabled", + AutomodBehavior: "flag", + MaxMessageLength: 10000, + MarkMessagesPending: PtrTo(true), + }) + require.NoError(t, err) + assert.True(t, resp.Data.MarkMessagesPending) + + // Verify via get + getResp, err := client.Chat().GetChannelType(ctx, typeName, &GetChannelTypeRequest{}) + require.NoError(t, err) + assert.True(t, getResp.Data.MarkMessagesPending) + }) + + t.Run("UpdateChannelTypePushNotifications", func(t *testing.T) { + resp, err := client.Chat().UpdateChannelType(ctx, typeName, &UpdateChannelTypeRequest{ + Automod: "disabled", + AutomodBehavior: "flag", + MaxMessageLength: 10000, + PushNotifications: PtrTo(false), + }) + require.NoError(t, err) + assert.False(t, resp.Data.PushNotifications) + + // Verify via get + getResp, err := client.Chat().GetChannelType(ctx, typeName, &GetChannelTypeRequest{}) + require.NoError(t, err) + assert.False(t, getResp.Data.PushNotifications) + }) + + t.Run("ListChannelTypes", func(t *testing.T) { + resp, err := client.Chat().ListChannelTypes(ctx, &ListChannelTypesRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data.ChannelTypes) + + _, found := resp.Data.ChannelTypes[typeName] + assert.True(t, found, "Created channel type should appear in list") + }) + + t.Run("DeleteChannelType", func(t *testing.T) { + delName := "testdeltype" + randomString(6) + _, err := client.Chat().CreateChannelType(ctx, &CreateChannelTypeRequest{ + Name: delName, + Automod: "disabled", + AutomodBehavior: "flag", + MaxMessageLength: 5000, + }) + require.NoError(t, err) + + // stream-chat-go sleeps 6s after create and retries delete up to 5 times + time.Sleep(6 * time.Second) + + var deleteErr error + for i := 0; i < 5; i++ { + _, deleteErr = client.Chat().DeleteChannelType(ctx, delName, &DeleteChannelTypeRequest{}) + if deleteErr == nil { + break + } + time.Sleep(time.Second) + } + require.NoError(t, deleteErr) + }) +} + +func TestChatThreadIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + userID2 := userIDs[1] + + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + channelCID := "messaging:" + channelID + + // Create a thread by sending a parent + reply + parentID := sendTestMessage(t, ch, userID, "Thread parent message") + + _, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("First reply in thread"), + UserID: PtrTo(userID2), + ParentID: PtrTo(parentID), + }, + }) + require.NoError(t, err) + + _, err = ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Second reply in thread"), + UserID: PtrTo(userID), + ParentID: PtrTo(parentID), + }, + }) + require.NoError(t, err) + + t.Run("QueryThreads", func(t *testing.T) { + // Filter by channel_cid to only get threads from our test channel + // (same approach as stream-chat-go) + resp, err := client.Chat().QueryThreads(ctx, &QueryThreadsRequest{ + UserID: PtrTo(userID), + Filter: map[string]any{ + "channel_cid": map[string]any{ + "$eq": channelCID, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, resp.Data.Threads, "Should have at least one thread") + + found := false + for _, thread := range resp.Data.Threads { + if thread.ParentMessageID == parentID { + found = true + // CreatedByUserID is the first reply sender, not the parent sender + assert.Equal(t, userID2, thread.CreatedByUserID) + } + } + assert.True(t, found, "Thread should appear in query results for channel %s", channelCID) + }) + + t.Run("GetThread", func(t *testing.T) { + resp, err := client.Chat().GetThread(ctx, parentID, &GetThreadRequest{ + ReplyLimit: PtrTo(10), + }) + require.NoError(t, err) + assert.Equal(t, parentID, resp.Data.Thread.ParentMessageID) + assert.GreaterOrEqual(t, len(resp.Data.Thread.LatestReplies), 2) + }) + + t.Run("QueryThreadsWithPagination", func(t *testing.T) { + // Create a second thread in the same channel + parentID2 := sendTestMessage(t, ch, userID, "Parent message for thread 2") + _, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Reply in thread 2"), + UserID: PtrTo(userID), + ParentID: PtrTo(parentID2), + }, + }) + require.NoError(t, err) + + // First page: limit=1, ascending sort + resp, err := client.Chat().QueryThreads(ctx, &QueryThreadsRequest{ + UserID: PtrTo(userID), + Filter: map[string]any{ + "channel_cid": map[string]any{ + "$eq": channelCID, + }, + }, + Sort: []SortParamRequest{ + {Field: PtrTo("created_at"), Direction: PtrTo(1)}, + }, + Limit: PtrTo(1), + }) + require.NoError(t, err) + require.Len(t, resp.Data.Threads, 1, "Should return exactly 1 thread per page") + firstThreadParent := resp.Data.Threads[0].ParentMessageID + + // Second page using Next cursor + require.NotNil(t, resp.Data.Next, "Should have a Next cursor for pagination") + + resp2, err := client.Chat().QueryThreads(ctx, &QueryThreadsRequest{ + UserID: PtrTo(userID), + Filter: map[string]any{ + "channel_cid": map[string]any{ + "$eq": channelCID, + }, + }, + Sort: []SortParamRequest{ + {Field: PtrTo("created_at"), Direction: PtrTo(1)}, + }, + Limit: PtrTo(1), + Next: resp.Data.Next, + }) + require.NoError(t, err) + require.NotEmpty(t, resp2.Data.Threads, "Second page should have threads") + secondThreadParent := resp2.Data.Threads[0].ParentMessageID + + // Verify different threads on each page + assert.NotEqual(t, firstThreadParent, secondThreadParent, "Pages should return different threads") + }) +} + +func TestChatAppSettingsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + t.Run("GetApp", func(t *testing.T) { + resp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data) + // App name should not be empty + assert.NotEmpty(t, resp.Data.App.Name) + }) + + t.Run("UpdateAndVerifyApp", func(t *testing.T) { + // Get current settings to restore later + getResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + originalValue := getResp.Data.App.EnforceUniqueUsernames + + // Guarantee restore even if test fails mid-way + t.Cleanup(func() { + _, _ = client.UpdateApp(context.Background(), &UpdateAppRequest{ + EnforceUniqueUsernames: PtrTo(originalValue), + }) + }) + + // Toggle enforce_unique_usernames — safe to change on any app + newValue := "no" + if originalValue == "no" { + newValue = "app" + } + _, err = client.UpdateApp(ctx, &UpdateAppRequest{ + EnforceUniqueUsernames: PtrTo(newValue), + }) + require.NoError(t, err) + + // Verify update + getResp, err = client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + assert.Equal(t, newValue, getResp.Data.App.EnforceUniqueUsernames) + + // Restore original + _, err = client.UpdateApp(ctx, &UpdateAppRequest{ + EnforceUniqueUsernames: PtrTo(originalValue), + }) + require.NoError(t, err) + }) +} + +func TestChatUnreadCountsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + userID2 := userIDs[1] + + // Create a channel and send a message so there's something to count + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + sendTestMessage(t, ch, userID, "Message for unread counts test") + + t.Run("UnreadCounts", func(t *testing.T) { + resp, err := client.Chat().UnreadCounts(ctx, &UnreadCountsRequest{ + UserID: PtrTo(userID2), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data) + // The response should have fields — total unread count might be 0 or more + assert.GreaterOrEqual(t, resp.Data.TotalUnreadCount, 0) + }) + + t.Run("UnreadCountsBatch", func(t *testing.T) { + resp, err := client.Chat().UnreadCountsBatch(ctx, &UnreadCountsBatchRequest{ + UserIds: []string{userID, userID2}, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.CountsByUser) + assert.Contains(t, resp.Data.CountsByUser, userID) + assert.Contains(t, resp.Data.CountsByUser, userID2) + }) +} + +func TestChatBanIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 3) + adminID := userIDs[0] + targetID := userIDs[1] + targetID2 := userIDs[2] + + t.Run("BanAndQueryBannedUsers", func(t *testing.T) { + // Ban a user with reason and timeout + _, err := client.Moderation().Ban(ctx, &BanRequest{ + TargetUserID: targetID, + BannedByID: PtrTo(adminID), + Reason: PtrTo("test ban reason"), + Timeout: PtrTo(60), // 60 minutes + }) + require.NoError(t, err) + + // Query banned users (use $eq operator like stream-chat-go) + qResp, err := client.Chat().QueryBannedUsers(ctx, &QueryBannedUsersRequest{ + Payload: &QueryBannedUsersPayload{ + FilterConditions: map[string]any{ + "user_id": map[string]string{"$eq": targetID}, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Bans, "Should find the banned user") + + ban := qResp.Data.Bans[0] + require.NotNil(t, ban.Reason) + assert.Equal(t, "test ban reason", *ban.Reason) + // When timeout is set, Expires should be populated + assert.NotNil(t, ban.Expires, "Ban with timeout should have Expires set") + + // Unban the user + _, err = client.Moderation().Unban(ctx, &UnbanRequest{ + TargetUserID: targetID, + }) + require.NoError(t, err) + + // Verify ban is gone after unban + qResp, err = client.Chat().QueryBannedUsers(ctx, &QueryBannedUsersRequest{ + Payload: &QueryBannedUsersPayload{ + FilterConditions: map[string]any{ + "user_id": map[string]string{"$eq": targetID}, + }, + }, + }) + require.NoError(t, err) + assert.Empty(t, qResp.Data.Bans, "Bans should be empty after unban") + }) + + t.Run("ChannelBan", func(t *testing.T) { + _, channelID := createTestChannelWithMembers(t, client, adminID, []string{adminID, targetID2}) + cid := "messaging:" + channelID + + // Ban user in the specific channel + _, err := client.Moderation().Ban(ctx, &BanRequest{ + TargetUserID: targetID2, + BannedByID: PtrTo(adminID), + ChannelCid: PtrTo(cid), + Reason: PtrTo("channel-specific ban"), + }) + require.NoError(t, err) + + // Unban from channel + _, err = client.Moderation().Unban(ctx, &UnbanRequest{ + TargetUserID: targetID2, + ChannelCid: PtrTo(cid), + }) + require.NoError(t, err) + + // Verify ban is gone after unban (same pattern as stream-chat-go) + qResp, err := client.Chat().QueryBannedUsers(ctx, &QueryBannedUsersRequest{ + Payload: &QueryBannedUsersPayload{ + FilterConditions: map[string]any{ + "channel_cid": map[string]string{"$eq": cid}, + }, + }, + }) + require.NoError(t, err) + assert.Empty(t, qResp.Data.Bans, "Channel bans should be empty after unban") + }) +} + +func TestChatMuteIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 4) + muterID := userIDs[0] + targetID := userIDs[1] + targetID2 := userIDs[2] + targetID3 := userIDs[3] + + t.Run("MuteUnmuteUser", func(t *testing.T) { + // Mute a user (without timeout) + muteResp, err := client.Moderation().Mute(ctx, &MuteRequest{ + TargetIds: []string{targetID}, + UserID: PtrTo(muterID), + }) + require.NoError(t, err) + require.NotEmpty(t, muteResp.Data.Mutes, "Mute response should contain mutes") + + mute := muteResp.Data.Mutes[0] + assert.NotNil(t, mute.User, "Mute should have a User") + assert.NotNil(t, mute.Target, "Mute should have a Target") + assert.Nil(t, mute.Expires, "Mute without timeout should have no Expires") + + // Verify mute appears in QueryUsers (like stream-chat-go does) + qResp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]string{"$eq": muterID}, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Users) + require.NotEmpty(t, qResp.Data.Users[0].Mutes, "User should have Mutes after muting") + + // Unmute the user + _, err = client.Moderation().Unmute(ctx, &UnmuteRequest{ + TargetIds: []string{targetID}, + UserID: PtrTo(muterID), + }) + require.NoError(t, err) + }) + + t.Run("MuteWithTimeout", func(t *testing.T) { + // Mute two users with timeout — expiration should be set + muteResp, err := client.Moderation().Mute(ctx, &MuteRequest{ + TargetIds: []string{targetID2, targetID3}, + UserID: PtrTo(muterID), + Timeout: PtrTo(60), + }) + require.NoError(t, err) + require.GreaterOrEqual(t, len(muteResp.Data.Mutes), 2, "Should have at least 2 mute entries") + + // When timeout is set, Expires should be populated + for _, m := range muteResp.Data.Mutes { + assert.NotNil(t, m.Expires, "Mute with timeout should have Expires") + assert.NotNil(t, m.User, "Mute should have User") + assert.NotNil(t, m.Target, "Mute should have Target") + } + + // Cleanup: unmute both + _, err = client.Moderation().Unmute(ctx, &UnmuteRequest{ + TargetIds: []string{targetID2, targetID3}, + UserID: PtrTo(muterID), + }) + require.NoError(t, err) + }) +} + +func TestChatFlagIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + flaggerID := userIDs[1] + + t.Run("FlagMessageAndQuery", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID, flaggerID}) + msgID := sendTestMessage(t, ch, userID, "Message to be flagged") + + // Flag the message using the moderation v2 API (entity_id + entity_type format). + // Note: stream-chat-go uses the v1 FlagMessage (target_message_id format) which + // populates the v1 chat flags store. Our SDK exposes the v2 moderation API, + // so QueryMessageFlags (v1) may not see flags created via Moderation().Flag() (v2). + flagResp, err := client.Moderation().Flag(ctx, &FlagRequest{ + EntityID: msgID, + EntityType: "stream:chat:v1:message", + EntityCreatorID: PtrTo(userID), + UserID: PtrTo(flaggerID), + Reason: PtrTo("inappropriate content"), + }) + require.NoError(t, err) + assert.NotEmpty(t, flagResp.Data.ItemID, "Flag should return an item ID") + + // Verify QueryMessageFlags endpoint works with channel_cid filter + cid := "messaging:" + channelID + qResp, err := client.Chat().QueryMessageFlags(ctx, &QueryMessageFlagsRequest{ + Payload: &QueryMessageFlagsPayload{ + FilterConditions: map[string]any{ + "channel_cid": cid, + }, + }, + }) + require.NoError(t, err) + _ = qResp // flags may be empty since v2 flags don't populate v1 store + + // Also verify QueryMessageFlags works with user_id filter + qResp2, err := client.Chat().QueryMessageFlags(ctx, &QueryMessageFlagsRequest{ + Payload: &QueryMessageFlagsPayload{ + FilterConditions: map[string]any{ + "user_id": flaggerID, + }, + }, + }) + require.NoError(t, err) + _ = qResp2 + }) +} + +func TestChatPermissionsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + t.Run("CreateListDeleteRole", func(t *testing.T) { + roleName := "testrole" + randomString(6) + + // Create role + _, err := client.CreateRole(ctx, &CreateRoleRequest{ + Name: roleName, + }) + require.NoError(t, err) + + // List roles and verify + listResp, err := client.ListRoles(ctx, &ListRolesRequest{}) + require.NoError(t, err) + + found := false + for _, role := range listResp.Data.Roles { + if role.Name == roleName { + found = true + assert.True(t, role.Custom, "Created role should be custom") + } + } + assert.True(t, found, "Created role should appear in list") + + // Delete role (may need retry due to propagation delay) + time.Sleep(2 * time.Second) + var deleteErr error + for i := 0; i < 5; i++ { + _, deleteErr = client.DeleteRole(ctx, roleName, &DeleteRoleRequest{}) + if deleteErr == nil { + break + } + time.Sleep(time.Second) + } + require.NoError(t, deleteErr) + }) + + t.Run("ListAndGetPermission", func(t *testing.T) { + // List all permissions + listResp, err := client.ListPermissions(ctx, &ListPermissionsRequest{}) + require.NoError(t, err) + assert.NotEmpty(t, listResp.Data.Permissions, "Should have at least one permission") + + // Get a specific well-known permission + getResp, err := client.GetPermission(ctx, "create-channel", &GetPermissionRequest{}) + require.NoError(t, err) + assert.Equal(t, "create-channel", getResp.Data.Permission.ID) + assert.NotEmpty(t, getResp.Data.Permission.Action) + }) +} + +func TestChatExportChannelsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + ch, channelID := createTestChannelWithMembers(t, client, userID, []string{userID}) + sendTestMessage(t, ch, userID, "Message for export test") + + cid := "messaging:" + channelID + + // Export channels + exportResp, err := client.Chat().ExportChannels(ctx, &ExportChannelsRequest{ + Channels: []ChannelExport{ + {Cid: PtrTo(cid)}, + }, + }) + require.NoError(t, err) + assert.NotEmpty(t, exportResp.Data.TaskID) + + // Wait for the export task to complete + taskResult, err := WaitForTask(ctx, client, exportResp.Data.TaskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) +} + +func TestChatCustomEventIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + // Send a custom event to a user (dots not allowed in event type) + _, err := client.Chat().SendUserCustomEvent(ctx, userID, &SendUserCustomEventRequest{ + Event: UserCustomEventRequest{ + Type: "friendship_request", + Custom: map[string]any{ + "message": "Let's be friends!", + }, + }, + }) + require.NoError(t, err) +} + +func TestChatRestoreUsersIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Create a dedicated user for this test + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + // Delete the user (soft delete) — retry on rate limit + var delResp *StreamResponse[DeleteUsersResponse] + var err error + for i := 0; i < 10; i++ { + delResp, err = client.DeleteUsers(ctx, &DeleteUsersRequest{ + UserIds: []string{userID}, + User: PtrTo("soft"), + }) + if err == nil || !strings.Contains(err.Error(), "Too many requests") { + break + } + t.Logf("DeleteUsers rate limited, attempt %d/10, waiting %ds", i+1, (i+1)*3) + time.Sleep(time.Duration(i+1) * 3 * time.Second) + } + require.NoError(t, err) + assert.NotEmpty(t, delResp.Data.TaskID) + + // Wait for deletion to complete + taskResult, err := WaitForTask(ctx, client, delResp.Data.TaskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) + + // Restore the user + _, err = client.RestoreUsers(ctx, &RestoreUsersRequest{ + UserIds: []string{userID}, + }) + require.NoError(t, err) + + // Verify user exists after restore + qResp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": userID, + }, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Users, "Restored user should be queryable") + assert.Equal(t, userID, qResp.Data.Users[0].ID) +} + +func TestChatShadowBanIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 3) + adminID := userIDs[0] + targetID := userIDs[1] + targetID2 := userIDs[2] + + t.Run("GlobalShadowBan", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, adminID, []string{adminID, targetID}) + + // Shadow ban user globally + _, err := client.Moderation().Ban(ctx, &BanRequest{ + TargetUserID: targetID, + BannedByID: PtrTo(adminID), + Shadow: PtrTo(true), + }) + require.NoError(t, err) + + // Send a message from the shadow-banned user + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("shadow banned message"), + UserID: PtrTo(targetID), + }, + }) + require.NoError(t, err) + assert.True(t, sendResp.Data.Message.Shadowed, "Message from shadow-banned user should be shadowed") + + // Verify via GetMessage + getResp, err := client.Chat().GetMessage(ctx, sendResp.Data.Message.ID, &GetMessageRequest{}) + require.NoError(t, err) + assert.True(t, getResp.Data.Message.Shadowed, "GetMessage should also show Shadowed=true") + + // Unban + _, err = client.Moderation().Unban(ctx, &UnbanRequest{ + TargetUserID: targetID, + }) + require.NoError(t, err) + + // Send a message after unban — should not be shadowed + sendResp2, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("normal message after unban"), + UserID: PtrTo(targetID), + }, + }) + require.NoError(t, err) + assert.False(t, sendResp2.Data.Message.Shadowed, "Message after unban should not be shadowed") + }) + + t.Run("ChannelShadowBan", func(t *testing.T) { + ch, channelID := createTestChannelWithMembers(t, client, adminID, []string{adminID, targetID2}) + cid := "messaging:" + channelID + + // Shadow ban user in the channel + _, err := client.Moderation().Ban(ctx, &BanRequest{ + TargetUserID: targetID2, + BannedByID: PtrTo(adminID), + ChannelCid: PtrTo(cid), + Shadow: PtrTo(true), + }) + require.NoError(t, err) + + // Send a message from the shadow-banned user + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("channel shadow banned message"), + UserID: PtrTo(targetID2), + }, + }) + require.NoError(t, err) + assert.True(t, sendResp.Data.Message.Shadowed, "Channel shadow-banned message should be shadowed") + + // Unban from channel + _, err = client.Moderation().Unban(ctx, &UnbanRequest{ + TargetUserID: targetID2, + ChannelCid: PtrTo(cid), + }) + require.NoError(t, err) + + // Send a message after unban — should not be shadowed + sendResp2, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("normal message after channel unban"), + UserID: PtrTo(targetID2), + }, + }) + require.NoError(t, err) + assert.False(t, sendResp2.Data.Message.Shadowed, "Message after channel unban should not be shadowed") + }) +} + +func TestChatReminderIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + + t.Run("CreateAndDeleteReminder", func(t *testing.T) { + msgID := sendTestMessage(t, ch, userID, "Message for reminder test") + + // Create a reminder with a remind_at time + remindAt := time.Now().Add(24 * time.Hour) + createResp, err := client.Chat().CreateReminder(ctx, msgID, &CreateReminderRequest{ + UserID: PtrTo(userID), + RemindAt: &Timestamp{Time: &remindAt}, + }) + if err != nil { + if strings.Contains(err.Error(), "not enabled") { + t.Skip("Reminders are not enabled for this channel") + } + require.NoError(t, err) + } + assert.Equal(t, msgID, createResp.Data.MessageID) + assert.Equal(t, userID, createResp.Data.UserID) + assert.NotNil(t, createResp.Data.RemindAt, "RemindAt should be set") + + // Delete the reminder + _, err = client.Chat().DeleteReminder(ctx, msgID, &DeleteReminderRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + }) + + t.Run("CreateUpdateReminder", func(t *testing.T) { + msgID := sendTestMessage(t, ch, userID, "Message for reminder update test") + + // Create reminder + remindAt := time.Now().Add(24 * time.Hour) + _, err := client.Chat().CreateReminder(ctx, msgID, &CreateReminderRequest{ + UserID: PtrTo(userID), + RemindAt: &Timestamp{Time: &remindAt}, + }) + if err != nil { + if strings.Contains(err.Error(), "not enabled") { + t.Skip("Reminders are not enabled for this channel") + } + require.NoError(t, err) + } + + // Update reminder with new time + newRemindAt := time.Now().Add(48 * time.Hour) + updateResp, err := client.Chat().UpdateReminder(ctx, msgID, &UpdateReminderRequest{ + UserID: PtrTo(userID), + RemindAt: &Timestamp{Time: &newRemindAt}, + }) + require.NoError(t, err) + assert.Equal(t, msgID, updateResp.Data.Reminder.MessageID) + assert.Equal(t, userID, updateResp.Data.Reminder.UserID) + + // Cleanup + _, _ = client.Chat().DeleteReminder(ctx, msgID, &DeleteReminderRequest{ + UserID: PtrTo(userID), + }) + }) + + t.Run("QueryReminders", func(t *testing.T) { + msgID := sendTestMessage(t, ch, userID, "Message for query reminders test") + + // Create reminder + remindAt := time.Now().Add(24 * time.Hour) + _, err := client.Chat().CreateReminder(ctx, msgID, &CreateReminderRequest{ + UserID: PtrTo(userID), + RemindAt: &Timestamp{Time: &remindAt}, + }) + if err != nil { + if strings.Contains(err.Error(), "not enabled") { + t.Skip("Reminders are not enabled for this channel") + } + require.NoError(t, err) + } + + t.Cleanup(func() { + _, _ = client.Chat().DeleteReminder(context.Background(), msgID, &DeleteReminderRequest{ + UserID: PtrTo(userID), + }) + }) + + // Query reminders for the user + qResp, err := client.Chat().QueryReminders(ctx, &QueryRemindersRequest{ + UserID: PtrTo(userID), + Filter: map[string]any{ + "message_id": msgID, + }, + Sort: []SortParamRequest{}, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Reminders, "Should find the reminder") + assert.Equal(t, msgID, qResp.Data.Reminders[0].MessageID) + assert.Equal(t, userID, qResp.Data.Reminders[0].UserID) + }) +} + +func TestChatDeliveryReceiptsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Matching stream-chat-go TestChannel_MarkDelivered_Integration: + // Create channel with 3 members, send 2 messages, mark different messages + // as delivered for different users + userIDs := createTestUsers(t, client, 3) + userID1 := userIDs[0] + userID2 := userIDs[1] + userID3 := userIDs[2] + + ch, channelID := createTestChannelWithMembers(t, client, userID1, []string{userID1, userID2, userID3}) + cid := "messaging:" + channelID + + msgID1 := sendTestMessage(t, ch, userID1, "Message 1 for delivery receipt") + msgID2 := sendTestMessage(t, ch, userID1, "Message 2 for delivery receipt") + + // Mark message 1 as delivered for user 2 + resp1, err := client.Chat().MarkDelivered(ctx, &MarkDeliveredRequest{ + UserID: PtrTo(userID2), + LatestDeliveredMessages: []DeliveredMessagePayload{ + {Cid: PtrTo(cid), ID: PtrTo(msgID1)}, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp1) + + // Mark message 2 as delivered for user 2 + resp2, err := client.Chat().MarkDelivered(ctx, &MarkDeliveredRequest{ + UserID: PtrTo(userID2), + LatestDeliveredMessages: []DeliveredMessagePayload{ + {Cid: PtrTo(cid), ID: PtrTo(msgID2)}, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp2) + + // Mark message 1 as delivered for user 3 + resp3, err := client.Chat().MarkDelivered(ctx, &MarkDeliveredRequest{ + UserID: PtrTo(userID3), + LatestDeliveredMessages: []DeliveredMessagePayload{ + {Cid: PtrTo(cid), ID: PtrTo(msgID1)}, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp3) + + // Mark message 2 as delivered for user 3 + resp4, err := client.Chat().MarkDelivered(ctx, &MarkDeliveredRequest{ + UserID: PtrTo(userID3), + LatestDeliveredMessages: []DeliveredMessagePayload{ + {Cid: PtrTo(cid), ID: PtrTo(msgID2)}, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp4) +} + +func TestChatExportUsersIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + + resp, err := client.ExportUsers(ctx, &ExportUsersRequest{ + UserIds: userIDs, + }) + require.NoError(t, err) + require.NotEmpty(t, resp.Data.TaskID) + + // Poll for task completion + taskResult, err := WaitForTask(ctx, client, resp.Data.TaskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) +} + +func TestChatLiveLocationIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + // Create a channel with shared_locations enabled via config override + channelID := "test-ch-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + // Enable shared_locations on the channel via partial update config override + _, err = ch.UpdateChannelPartial(ctx, &UpdateChannelPartialRequest{ + Set: map[string]any{ + "config_overrides": map[string]any{ + "shared_locations": true, + }, + }, + }) + if err != nil { + if strings.Contains(err.Error(), "shared_locations") || strings.Contains(err.Error(), "not supported") || strings.Contains(err.Error(), "not enabled") { + t.Skip("Shared locations not supported for this app") + } + } + require.NoError(t, err) + + // Send a message with a shared location (EndAt is required for updateable live locations) + endAt := time.Now().Add(1 * time.Hour) + msgResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Live location message"), + UserID: PtrTo(userID), + SharedLocation: &SharedLocation{ + Longitude: -122.4194, + Latitude: 38.999, + CreatedByDeviceID: PtrTo("test-device"), + EndAt: &Timestamp{Time: &endAt}, + }, + }, + }) + if err != nil { + if strings.Contains(err.Error(), "shared_locations") || strings.Contains(err.Error(), "not enabled") { + t.Skip("Shared locations not enabled for this channel") + } + } + require.NoError(t, err) + msgID := msgResp.Data.Message.ID + + // Update the live location + updateResp, err := client.UpdateLiveLocation(ctx, &UpdateLiveLocationRequest{ + UserID: PtrTo(userID), + MessageID: msgID, + Latitude: PtrTo(39.0), + Longitude: PtrTo(-122.5), + }) + require.NoError(t, err) + require.NotNil(t, updateResp.Data) + assert.InDelta(t, 39.0, updateResp.Data.Latitude, 0.01) + assert.InDelta(t, -122.5, updateResp.Data.Longitude, 0.01) + + // Get active live locations + getResp, err := client.GetUserLiveLocations(ctx, &GetUserLiveLocationsRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + require.NotEmpty(t, getResp.Data.ActiveLiveLocations, "Should have active live locations") + + found := false + for _, loc := range getResp.Data.ActiveLiveLocations { + if loc.MessageID == msgID { + found = true + break + } + } + assert.True(t, found, "Should find the updated location") +} + +func TestChatCreateTokenIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + + t.Run("BasicToken", func(t *testing.T) { + token, err := client.CreateToken("test-user-123") + require.NoError(t, err) + assert.NotEmpty(t, token, "Token should not be empty") + }) + + t.Run("TokenWithExpiration", func(t *testing.T) { + token, err := client.CreateToken("test-user-456", WithExpiration(time.Hour)) + require.NoError(t, err) + assert.NotEmpty(t, token, "Token should not be empty") + }) +} + +func TestChatGetRateLimitsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + t.Run("GetAllLimits", func(t *testing.T) { + resp, err := client.GetRateLimits(ctx, &GetRateLimitsRequest{}) + require.NoError(t, err) + assert.NotEmpty(t, resp.Data.ServerSide, "ServerSide limits should be populated") + }) + + t.Run("GetSinglePlatform", func(t *testing.T) { + resp, err := client.GetRateLimits(ctx, &GetRateLimitsRequest{ + ServerSide: PtrTo(true), + }) + require.NoError(t, err) + assert.NotEmpty(t, resp.Data.ServerSide) + assert.Empty(t, resp.Data.Android) + assert.Empty(t, resp.Data.Ios) + assert.Empty(t, resp.Data.Web) + }) + + t.Run("GetSpecificEndpoints", func(t *testing.T) { + resp, err := client.GetRateLimits(ctx, &GetRateLimitsRequest{ + ServerSide: PtrTo(true), + Android: PtrTo(true), + Endpoints: PtrTo("GetRateLimits,SendMessage"), + }) + require.NoError(t, err) + assert.Len(t, resp.Data.Android, 2) + assert.Len(t, resp.Data.ServerSide, 2) + + for _, info := range resp.Data.ServerSide { + assert.Greater(t, info.Limit, 0) + assert.GreaterOrEqual(t, info.Remaining, 0) + } + }) +} + +func TestChatCheckSQSSNSPushIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + t.Run("CheckSQS", func(t *testing.T) { + resp, err := client.CheckSQS(ctx, &CheckSQSRequest{ + SqsUrl: PtrTo("https://sqs.us-east-1.amazonaws.com/123456789012/test-queue"), + SqsKey: PtrTo("key"), + SqsSecret: PtrTo("secret"), + }) + require.NoError(t, err) + assert.Equal(t, "error", resp.Data.Status) + require.NotNil(t, resp.Data.Error) + assert.NotEmpty(t, *resp.Data.Error) + }) + + t.Run("CheckSNS", func(t *testing.T) { + resp, err := client.CheckSNS(ctx, &CheckSNSRequest{ + SnsTopicArn: PtrTo("arn:aws:sns:us-east-1:123456789012:test-topic"), + SnsKey: PtrTo("key"), + SnsSecret: PtrTo("secret"), + }) + require.NoError(t, err) + assert.Equal(t, "error", resp.Data.Status) + require.NotNil(t, resp.Data.Error) + assert.NotEmpty(t, *resp.Data.Error) + }) + + t.Run("CheckPush", func(t *testing.T) { + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Push check test message") + + resp, err := client.CheckPush(ctx, &CheckPushRequest{ + MessageID: PtrTo(msgID), + SkipDevices: PtrTo(true), + UserID: PtrTo(userID), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.RenderedMessage) + assert.Equal(t, msgID, resp.Data.RenderedMessage["message_id"]) + }) +} + +func TestChatAppFileUploadConfigIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Get current settings to restore later + getResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + originalFileConfig := getResp.Data.App.FileUploadConfig + + t.Cleanup(func() { + _, _ = client.UpdateApp(context.Background(), &UpdateAppRequest{ + FileUploadConfig: &originalFileConfig, + }) + }) + + t.Run("SetAndVerifyFileUploadConfig", func(t *testing.T) { + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + FileUploadConfig: &FileUploadConfig{ + SizeLimit: 10 * 1024 * 1024, + AllowedFileExtensions: []string{".pdf", ".doc", ".txt"}, + AllowedMimeTypes: []string{"application/pdf", "text/plain"}, + }, + }) + require.NoError(t, err) + + // Verify via GetApp + verifyResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + cfg := verifyResp.Data.App.FileUploadConfig + assert.Equal(t, 10*1024*1024, cfg.SizeLimit) + assert.Equal(t, []string{".pdf", ".doc", ".txt"}, cfg.AllowedFileExtensions) + assert.Equal(t, []string{"application/pdf", "text/plain"}, cfg.AllowedMimeTypes) + }) +} + +func TestChatEventHooksIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Get current hooks to restore later + getResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + originalHooks := getResp.Data.App.EventHooks + + t.Cleanup(func() { + _, _ = client.UpdateApp(context.Background(), &UpdateAppRequest{ + EventHooks: originalHooks, + }) + }) + + t.Run("SetWebhookEventHooks", func(t *testing.T) { + hooks := []EventHook{ + { + HookType: PtrTo("webhook"), + Enabled: PtrTo(true), + EventTypes: []string{"message.new"}, + WebhookUrl: PtrTo("https://example.com/webhook"), + }, + } + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + EventHooks: hooks, + }) + require.NoError(t, err) + + // Verify hooks were set + verifyResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + require.NotEmpty(t, verifyResp.Data.App.EventHooks) + }) + + t.Run("PendingMessageAsyncModerationConfig", func(t *testing.T) { + hooks := []EventHook{ + { + HookType: PtrTo("pending_message"), + Enabled: PtrTo(true), + WebhookUrl: PtrTo("https://example.com/pending"), + TimeoutMs: PtrTo(10000), + Callback: &AsyncModerationCallbackConfig{ + Mode: PtrTo("CALLBACK_MODE_REST"), + }, + }, + } + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + EventHooks: hooks, + }) + require.NoError(t, err) + }) + + t.Run("SQSEventHooks", func(t *testing.T) { + hooks := []EventHook{ + { + HookType: PtrTo("sqs"), + Enabled: PtrTo(true), + EventTypes: []string{"message.new"}, + SqsQueueUrl: PtrTo("https://sqs.us-east-1.amazonaws.com/123456789012/my-queue"), + SqsRegion: PtrTo("us-east-1"), + SqsAuthType: PtrTo("keys"), + SqsKey: PtrTo("some key"), + SqsSecret: PtrTo("some secret"), + }, + } + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + EventHooks: hooks, + }) + require.NoError(t, err) + }) + + t.Run("SNSEventHooks", func(t *testing.T) { + hooks := []EventHook{ + { + HookType: PtrTo("sns"), + Enabled: PtrTo(true), + EventTypes: []string{"message.new"}, + SnsTopicArn: PtrTo("arn:aws:sns:us-east-1:123456789012:my-topic"), + SnsRegion: PtrTo("us-east-1"), + SnsAuthType: PtrTo("keys"), + SnsKey: PtrTo("some key"), + SnsSecret: PtrTo("some secret"), + }, + } + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + EventHooks: hooks, + }) + require.NoError(t, err) + }) + + t.Run("ClearEventHooks", func(t *testing.T) { + // Clear all hooks + _, err := client.UpdateApp(ctx, &UpdateAppRequest{ + EventHooks: []EventHook{}, + }) + require.NoError(t, err) + + verifyResp, err := client.GetApp(ctx, &GetAppRequest{}) + require.NoError(t, err) + assert.Empty(t, verifyResp.Data.App.EventHooks) + }) +} + +func TestChatQueryFutureChannelBansIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + creatorID := userIDs[0] + targetID := userIDs[1] + + // Create a channel for the ban context + _, channelID := createTestChannelWithMembers(t, client, creatorID, []string{creatorID, targetID}) + + // Ban the target from the channel (note: BanFromFutureChannels is not + // available in the generated SDK, so we use a regular channel ban with + // the channel CID to at least exercise the QueryFutureChannelBans endpoint) + channelCid := "messaging:" + channelID + _, err := client.Moderation().Ban(ctx, &BanRequest{ + TargetUserID: targetID, + BannedByID: PtrTo(creatorID), + ChannelCid: PtrTo(channelCid), + Reason: PtrTo("test future ban query"), + }) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = client.Moderation().Unban(ctx, &UnbanRequest{ + TargetUserID: targetID, + CreatedBy: PtrTo(creatorID), + ChannelCid: PtrTo(channelCid), + }) + }) + + // Query future channel bans — should return without error + // (may be empty since we can't set ban_from_future_channels via the generated SDK) + resp, err := client.Chat().QueryFutureChannelBans(ctx, &QueryFutureChannelBansRequest{ + Payload: &QueryFutureChannelBansPayload{ + UserID: PtrTo(creatorID), + }, + }) + require.NoError(t, err) + assert.NotNil(t, resp.Data.Bans) + + // Query with target user filter + resp2, err := client.Chat().QueryFutureChannelBans(ctx, &QueryFutureChannelBansRequest{ + Payload: &QueryFutureChannelBansPayload{ + UserID: PtrTo(creatorID), + TargetUserID: PtrTo(targetID), + }, + }) + require.NoError(t, err) + assert.NotNil(t, resp2.Data.Bans) +} + +// Note: TestChatDraftsIntegration removed — CreateDraft is ClientSideOnly and not +// in the server-side SDK. + +// Note: ChannelBatchUpdate is still behind Ignore+Beta in the backend spec, +// so the generated SDK doesn't include it yet. Tests will be added when it's public. + +// Note: stream-chat-go TestPermissions_PermissionEndpoints also tests CreatePermission, +// but CreatePermission is hidden from the generated spec (Ignore: true in backend). +// ListPermissions and GetPermission are tested in TestChatPermissionsIntegration above. + +func TestChatTeamUsageStatsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + // Probe whether the endpoint is available on this app. + // It may not be deployed for all test apps yet. + _, probeErr := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + if probeErr != nil && strings.Contains(probeErr.Error(), "Token signature is invalid") { + t.Skip("QueryTeamUsageStats not available on this app (token signature invalid)") + } + + t.Run("NoParametersReturnsValidResponse", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Data.Teams) + }) + + t.Run("MonthParameter", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Month: PtrTo("2026-02"), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + }) + + t.Run("DateRange", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + StartDate: PtrTo("2026-02-01"), + EndDate: PtrTo("2026-02-17"), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + }) + + t.Run("PaginationLimit", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(10), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + assert.LessOrEqual(t, len(resp.Data.Teams), 10) + }) + + t.Run("InvalidMonthReturnsError", func(t *testing.T) { + _, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Month: PtrTo("invalid"), + }) + require.Error(t, err) + }) + + t.Run("WrongLengthMonthReturnsError", func(t *testing.T) { + _, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Month: PtrTo("2026"), + }) + require.Error(t, err) + }) + + t.Run("InvalidStartDateReturnsError", func(t *testing.T) { + _, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + StartDate: PtrTo("bad"), + }) + require.Error(t, err) + }) + + t.Run("EndBeforeStartReturnsError", func(t *testing.T) { + _, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + StartDate: PtrTo("2026-02-20"), + EndDate: PtrTo("2026-02-10"), + }) + require.Error(t, err) + }) + + t.Run("OverMaxLimitReturnsError", func(t *testing.T) { + _, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(31), + }) + require.Error(t, err) + }) + + t.Run("PastMonthReturnsEmpty", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Month: PtrTo("2025-01"), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + assert.Empty(t, resp.Data.Teams) + }) +} + +func initMultiTenantClient(t *testing.T) *Stream { + t.Helper() + apiKey := os.Getenv("STREAM_MULTI_TENANT_KEY") + apiSecret := os.Getenv("STREAM_MULTI_TENANT_SECRET") + if apiKey == "" || apiSecret == "" { + return nil + } + c, err := NewClient(apiKey, apiSecret) + require.NoError(t, err) + return c +} + +func TestChatTeamUsageStatsMultiTenantIntegration(t *testing.T) { + skipIfShort(t) + client := initMultiTenantClient(t) + if client == nil { + t.Skip("Multi-tenant credentials not set (STREAM_MULTI_TENANT_KEY / STREAM_MULTI_TENANT_SECRET)") + } + ctx := context.Background() + + t.Run("NoParametersReturnsTeams", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + assert.Greater(t, len(resp.Data.Teams), 0) + }) + + t.Run("MonthParameterReturnsTeams", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Month: PtrTo("2026-02"), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + assert.Greater(t, len(resp.Data.Teams), 0) + }) + + t.Run("DateRangeReturnsTeams", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + StartDate: PtrTo("2026-02-01"), + EndDate: PtrTo("2026-02-18"), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Teams) + assert.Greater(t, len(resp.Data.Teams), 0) + }) + + t.Run("LimitReturnsCorrectCount", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(3), + }) + require.NoError(t, err) + assert.Equal(t, 3, len(resp.Data.Teams)) + }) + + t.Run("LimitReturnsNextCursor", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(2), + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Next) + assert.NotEmpty(t, *resp.Data.Next) + }) + + t.Run("PaginationReturnsDifferentTeams", func(t *testing.T) { + page1, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(2), + }) + require.NoError(t, err) + require.NotNil(t, page1.Data.Next) + + page2, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{ + Limit: PtrTo(2), + Next: page1.Data.Next, + }) + require.NoError(t, err) + + // Verify no overlap between pages + for _, t1 := range page1.Data.Teams { + for _, t2 := range page2.Data.Teams { + assert.NotEqual(t, t1.Team, t2.Team, "Pages should not have overlapping teams") + } + } + }) + + t.Run("TeamsHaveTeamField", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + require.NoError(t, err) + require.Greater(t, len(resp.Data.Teams), 0) + // Team field exists (may be empty string for default team) + _ = resp.Data.Teams[0].Team + }) + + t.Run("AllMetricsPresent", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + require.NoError(t, err) + require.Greater(t, len(resp.Data.Teams), 0) + + team := resp.Data.Teams[0] + // Verify all metric fields are accessible + _ = team.UsersDaily.Total + _ = team.MessagesDaily.Total + _ = team.TranslationsDaily.Total + _ = team.ImageModerationsDaily.Total + _ = team.ConcurrentUsers.Total + _ = team.ConcurrentConnections.Total + _ = team.UsersTotal.Total + _ = team.UsersLast24Hours.Total + _ = team.UsersLast30Days.Total + _ = team.UsersMonthToDate.Total + _ = team.UsersEngagedLast30Days.Total + _ = team.UsersEngagedMonthToDate.Total + _ = team.MessagesTotal.Total + _ = team.MessagesLast24Hours.Total + _ = team.MessagesLast30Days.Total + _ = team.MessagesMonthToDate.Total + }) + + t.Run("MetricTotalsNonNegative", func(t *testing.T) { + resp, err := client.Chat().QueryTeamUsageStats(ctx, &QueryTeamUsageStatsRequest{}) + require.NoError(t, err) + + for _, team := range resp.Data.Teams { + assert.GreaterOrEqual(t, team.MessagesTotal.Total, 0) + assert.GreaterOrEqual(t, team.UsersDaily.Total, 0) + assert.GreaterOrEqual(t, team.ConcurrentUsers.Total, 0) + } + }) +} + +func TestChatContextExceededIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + + // Create a context that's already past deadline + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond) + defer cancel() + time.Sleep(2 * time.Millisecond) + + _, err := client.GetApp(ctx, &GetAppRequest{}) + require.Error(t, err) + assert.ErrorIs(t, err, context.DeadlineExceeded) +} diff --git a/chat_polls_integration_test.go b/chat_polls_integration_test.go new file mode 100644 index 0000000..8c04d49 --- /dev/null +++ b/chat_polls_integration_test.go @@ -0,0 +1,148 @@ +package getstream_test + +import ( + "context" + "strings" + "testing" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatPollsIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + voterID := userIDs[1] + + t.Run("CreateGetUpdateDeletePoll", func(t *testing.T) { + // Create a poll + createResp, err := client.CreatePoll(ctx, &CreatePollRequest{ + Name: "Favorite color?", + Description: PtrTo("Pick your favorite color"), + EnforceUniqueVote: PtrTo(true), + UserID: PtrTo(userID), + Options: []PollOptionInput{ + {Text: PtrTo("Red")}, + {Text: PtrTo("Blue")}, + {Text: PtrTo("Green")}, + }, + }) + require.NoError(t, err) + pollID := createResp.Data.Poll.ID + assert.NotEmpty(t, pollID) + assert.Equal(t, "Favorite color?", createResp.Data.Poll.Name) + assert.True(t, createResp.Data.Poll.EnforceUniqueVote) + assert.Len(t, createResp.Data.Poll.Options, 3) + + t.Cleanup(func() { + _, _ = client.DeletePoll(context.Background(), pollID, &DeletePollRequest{UserID: PtrTo(userID)}) + }) + + // Get the poll + getResp, err := client.GetPoll(ctx, pollID, &GetPollRequest{}) + require.NoError(t, err) + assert.Equal(t, pollID, getResp.Data.Poll.ID) + assert.Equal(t, "Favorite color?", getResp.Data.Poll.Name) + + // Update the poll + updateResp, err := client.UpdatePoll(ctx, &UpdatePollRequest{ + ID: pollID, + Name: "Updated: Favorite color?", + Description: PtrTo("Updated description"), + UserID: PtrTo(userID), + }) + require.NoError(t, err) + assert.Equal(t, "Updated: Favorite color?", updateResp.Data.Poll.Name) + + // Delete the poll + _, err = client.DeletePoll(ctx, pollID, &DeletePollRequest{UserID: PtrTo(userID)}) + require.NoError(t, err) + }) + + t.Run("QueryPolls", func(t *testing.T) { + // Create a poll to query + createResp, err := client.CreatePoll(ctx, &CreatePollRequest{ + Name: "Query test poll " + randomString(8), + UserID: PtrTo(userID), + Options: []PollOptionInput{ + {Text: PtrTo("Option A")}, + {Text: PtrTo("Option B")}, + }, + }) + require.NoError(t, err) + pollID := createResp.Data.Poll.ID + + t.Cleanup(func() { + _, _ = client.DeletePoll(context.Background(), pollID, &DeletePollRequest{UserID: PtrTo(userID)}) + }) + + // Query polls (server-side auth requires user_id) + qResp, err := client.QueryPolls(ctx, &QueryPollsRequest{ + UserID: PtrTo(userID), + Filter: map[string]any{ + "id": pollID, + }, + }) + require.NoError(t, err) + require.NotEmpty(t, qResp.Data.Polls) + assert.Equal(t, pollID, qResp.Data.Polls[0].ID) + }) + + t.Run("CastPollVote", func(t *testing.T) { + // Create a poll + createResp, err := client.CreatePoll(ctx, &CreatePollRequest{ + Name: "Vote test poll", + EnforceUniqueVote: PtrTo(true), + UserID: PtrTo(userID), + Options: []PollOptionInput{ + {Text: PtrTo("Yes")}, + {Text: PtrTo("No")}, + }, + }) + require.NoError(t, err) + pollID := createResp.Data.Poll.ID + optionID := createResp.Data.Poll.Options[0].ID + + t.Cleanup(func() { + _, _ = client.DeletePoll(context.Background(), pollID, &DeletePollRequest{UserID: PtrTo(userID)}) + }) + + // Send a message with the poll attached + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, voterID}) + sendResp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo("Please vote!"), + UserID: PtrTo(userID), + PollID: PtrTo(pollID), + }, + }) + if err != nil { + if strings.Contains(err.Error(), "polls not enabled") { + t.Skip("Polls not enabled for this channel") + } + } + require.NoError(t, err) + msgID := sendResp.Data.Message.ID + + // Cast a vote + voteResp, err := client.Chat().CastPollVote(ctx, msgID, pollID, &CastPollVoteRequest{ + UserID: PtrTo(voterID), + Vote: &VoteData{ + OptionID: PtrTo(optionID), + }, + }) + require.NoError(t, err) + require.NotNil(t, voteResp.Data.Vote) + assert.Equal(t, optionID, voteResp.Data.Vote.OptionID) + + // Verify poll has votes by getting it + getResp, err := client.GetPoll(ctx, pollID, &GetPollRequest{}) + require.NoError(t, err) + assert.Equal(t, 1, getResp.Data.Poll.VoteCount) + }) +} diff --git a/chat_reaction_integration_test.go b/chat_reaction_integration_test.go new file mode 100644 index 0000000..6a48787 --- /dev/null +++ b/chat_reaction_integration_test.go @@ -0,0 +1,156 @@ +package getstream_test + +import ( + "context" + "testing" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatReactionIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + userIDs := createTestUsers(t, client, 2) + userID := userIDs[0] + userID2 := userIDs[1] + + t.Run("SendReaction", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + msgID := sendTestMessage(t, ch, userID, "React to this message") + + resp, err := client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "like", + UserID: PtrTo(userID2), + }, + }) + require.NoError(t, err) + assert.Equal(t, "like", resp.Data.Reaction.Type) + assert.Equal(t, userID2, resp.Data.Reaction.UserID) + }) + + t.Run("GetReactions", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + msgID := sendTestMessage(t, ch, userID, "Message with reactions") + + // Send a couple of reactions + _, err := client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "like", + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + _, err = client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "love", + UserID: PtrTo(userID2), + }, + }) + require.NoError(t, err) + + // Get reactions + resp, err := client.Chat().GetReactions(ctx, msgID, &GetReactionsRequest{}) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Reactions), 2) + }) + + t.Run("DeleteReaction", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Message for reaction deletion") + + // Send reaction + _, err := client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "like", + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + // Delete reaction + _, err = client.Chat().DeleteReaction(ctx, msgID, "like", &DeleteReactionRequest{ + UserID: PtrTo(userID), + }) + require.NoError(t, err) + + // Verify reaction is gone + resp, err := client.Chat().GetReactions(ctx, msgID, &GetReactionsRequest{}) + require.NoError(t, err) + + for _, r := range resp.Data.Reactions { + if r.UserID == userID { + assert.NotEqual(t, "like", r.Type, "Like reaction should have been deleted") + } + } + }) + + t.Run("QueryReactions", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID, userID2}) + msgID := sendTestMessage(t, ch, userID, "Message for query reactions") + + // Send reactions + _, err := client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "like", + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err) + + _, err = client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "wow", + UserID: PtrTo(userID2), + }, + }) + require.NoError(t, err) + + // Query reactions + resp, err := client.Chat().QueryReactions(ctx, msgID, &QueryReactionsRequest{}) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Reactions), 2) + }) + + t.Run("EnforceUniqueReaction", func(t *testing.T) { + ch, _ := createTestChannelWithMembers(t, client, userID, []string{userID}) + msgID := sendTestMessage(t, ch, userID, "Message for unique reaction test") + + // Send first like reaction + _, err := client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "like", + UserID: PtrTo(userID), + }, + EnforceUnique: PtrTo(true), + }) + require.NoError(t, err) + + // Send second like reaction with EnforceUnique — should replace, not duplicate + _, err = client.Chat().SendReaction(ctx, msgID, &SendReactionRequest{ + Reaction: ReactionRequest{ + Type: "love", + UserID: PtrTo(userID), + }, + EnforceUnique: PtrTo(true), + }) + require.NoError(t, err) + + // Query reactions — user should only have one + resp, err := client.Chat().GetReactions(ctx, msgID, &GetReactionsRequest{}) + require.NoError(t, err) + + userReactions := 0 + for _, r := range resp.Data.Reactions { + if r.UserID == userID { + userReactions++ + } + } + assert.Equal(t, 1, userReactions, "EnforceUnique should keep only one reaction per user") + }) +} diff --git a/chat_test.go b/chat_test.go index 98d1482..67c8a90 100644 --- a/chat_test.go +++ b/chat_test.go @@ -2,556 +2,562 @@ package getstream_test import ( - "context" - "testing" + "context" + "testing" - "github.com/GetStream/getstream-go/v3" - "github.com/stretchr/testify/require" + "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/require" ) - -func TestChatQueryCampaigns(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryCampaigns(context.Background(), &getstream.QueryCampaignsRequest{}) - require.NoError(t, err) -} -func TestChatGetCampaign(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetCampaign(context.Background(), "", &getstream.GetCampaignRequest{}) - require.NoError(t, err) -} -func TestChatStartCampaign(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().StartCampaign(context.Background(), "", &getstream.StartCampaignRequest{}) - require.NoError(t, err) -} -func TestChatScheduleCampaign(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().ScheduleCampaign(context.Background(), "", &getstream.ScheduleCampaignRequest{}) - require.NoError(t, err) -} -func TestChatQueryChannels(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryChannels(context.Background(), &getstream.QueryChannelsRequest{}) - require.NoError(t, err) -} -func TestChatDeleteChannels(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteChannels(context.Background(), &getstream.DeleteChannelsRequest{}) - require.NoError(t, err) -} -func TestChatMarkDelivered(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().MarkDelivered(context.Background(), &getstream.MarkDeliveredRequest{}) - require.NoError(t, err) -} -func TestChatMarkChannelsRead(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().MarkChannelsRead(context.Background(), &getstream.MarkChannelsReadRequest{}) - require.NoError(t, err) -} -func TestChatGetOrCreateDistinctChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetOrCreateDistinctChannel(context.Background(), "", &getstream.GetOrCreateDistinctChannelRequest{}) - require.NoError(t, err) -} -func TestChatDeleteChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteChannel(context.Background(), "", "", &getstream.DeleteChannelRequest{}) - require.NoError(t, err) -} -func TestChatUpdateChannelPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateChannelPartial(context.Background(), "", "", &getstream.UpdateChannelPartialRequest{}) - require.NoError(t, err) -} -func TestChatUpdateChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateChannel(context.Background(), "", "", &getstream.UpdateChannelRequest{}) - require.NoError(t, err) -} -func TestChatDeleteDraft(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteDraft(context.Background(), "", "", &getstream.DeleteDraftRequest{}) - require.NoError(t, err) -} -func TestChatGetDraft(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetDraft(context.Background(), "", "", &getstream.GetDraftRequest{}) - require.NoError(t, err) -} -func TestChatSendEvent(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().SendEvent(context.Background(), "", "", &getstream.SendEventRequest{}) - require.NoError(t, err) -} -func TestChatDeleteChannelFile(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteChannelFile(context.Background(), "", "", &getstream.DeleteChannelFileRequest{}) - require.NoError(t, err) -} -func TestChatHideChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().HideChannel(context.Background(), "", "", &getstream.HideChannelRequest{}) - require.NoError(t, err) -} -func TestChatDeleteChannelImage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteChannelImage(context.Background(), "", "", &getstream.DeleteChannelImageRequest{}) - require.NoError(t, err) -} -func TestChatUpdateMemberPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateMemberPartial(context.Background(), "", "", &getstream.UpdateMemberPartialRequest{}) - require.NoError(t, err) -} -func TestChatSendMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().SendMessage(context.Background(), "", "", &getstream.SendMessageRequest{}) - require.NoError(t, err) -} -func TestChatGetManyMessages(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetManyMessages(context.Background(), "", "", &getstream.GetManyMessagesRequest{}) - require.NoError(t, err) -} -func TestChatGetOrCreateChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetOrCreateChannel(context.Background(), "", "", &getstream.GetOrCreateChannelRequest{}) - require.NoError(t, err) -} -func TestChatMarkRead(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().MarkRead(context.Background(), "", "", &getstream.MarkReadRequest{}) - require.NoError(t, err) -} -func TestChatShowChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().ShowChannel(context.Background(), "", "", &getstream.ShowChannelRequest{}) - require.NoError(t, err) -} -func TestChatTruncateChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().TruncateChannel(context.Background(), "", "", &getstream.TruncateChannelRequest{}) - require.NoError(t, err) -} -func TestChatMarkUnread(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().MarkUnread(context.Background(), "", "", &getstream.MarkUnreadRequest{}) - require.NoError(t, err) -} -func TestChatListChannelTypes(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().ListChannelTypes(context.Background(), &getstream.ListChannelTypesRequest{}) - require.NoError(t, err) -} -func TestChatCreateChannelType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().CreateChannelType(context.Background(), &getstream.CreateChannelTypeRequest{}) - require.NoError(t, err) -} -func TestChatDeleteChannelType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteChannelType(context.Background(), "", &getstream.DeleteChannelTypeRequest{}) - require.NoError(t, err) -} -func TestChatGetChannelType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetChannelType(context.Background(), "", &getstream.GetChannelTypeRequest{}) - require.NoError(t, err) -} -func TestChatUpdateChannelType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateChannelType(context.Background(), "", &getstream.UpdateChannelTypeRequest{}) - require.NoError(t, err) -} -func TestChatListCommands(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().ListCommands(context.Background(), &getstream.ListCommandsRequest{}) - require.NoError(t, err) -} -func TestChatCreateCommand(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().CreateCommand(context.Background(), &getstream.CreateCommandRequest{}) - require.NoError(t, err) -} -func TestChatDeleteCommand(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteCommand(context.Background(), "", &getstream.DeleteCommandRequest{}) - require.NoError(t, err) -} -func TestChatGetCommand(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetCommand(context.Background(), "", &getstream.GetCommandRequest{}) - require.NoError(t, err) -} -func TestChatUpdateCommand(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateCommand(context.Background(), "", &getstream.UpdateCommandRequest{}) - require.NoError(t, err) -} -func TestChatQueryDrafts(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryDrafts(context.Background(), &getstream.QueryDraftsRequest{}) - require.NoError(t, err) -} -func TestChatExportChannels(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().ExportChannels(context.Background(), &getstream.ExportChannelsRequest{}) - require.NoError(t, err) -} -func TestChatQueryMembers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryMembers(context.Background(), &getstream.QueryMembersRequest{}) - require.NoError(t, err) -} -func TestChatQueryMessageHistory(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryMessageHistory(context.Background(), &getstream.QueryMessageHistoryRequest{}) - require.NoError(t, err) -} -func TestChatDeleteMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteMessage(context.Background(), "", &getstream.DeleteMessageRequest{}) - require.NoError(t, err) -} -func TestChatGetMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetMessage(context.Background(), "", &getstream.GetMessageRequest{}) - require.NoError(t, err) -} -func TestChatUpdateMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateMessage(context.Background(), "", &getstream.UpdateMessageRequest{}) - require.NoError(t, err) -} -func TestChatUpdateMessagePartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateMessagePartial(context.Background(), "", &getstream.UpdateMessagePartialRequest{}) - require.NoError(t, err) -} -func TestChatRunMessageAction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().RunMessageAction(context.Background(), "", &getstream.RunMessageActionRequest{}) - require.NoError(t, err) -} -func TestChatCommitMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().CommitMessage(context.Background(), "", &getstream.CommitMessageRequest{}) - require.NoError(t, err) -} -func TestChatEphemeralMessageUpdate(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().EphemeralMessageUpdate(context.Background(), "", &getstream.EphemeralMessageUpdateRequest{}) - require.NoError(t, err) -} -func TestChatSendReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().SendReaction(context.Background(), "", &getstream.SendReactionRequest{}) - require.NoError(t, err) -} -func TestChatDeleteReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteReaction(context.Background(), "", "", &getstream.DeleteReactionRequest{}) - require.NoError(t, err) -} -func TestChatGetReactions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetReactions(context.Background(), "", &getstream.GetReactionsRequest{}) - require.NoError(t, err) -} -func TestChatQueryReactions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryReactions(context.Background(), "", &getstream.QueryReactionsRequest{}) - require.NoError(t, err) -} -func TestChatTranslateMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().TranslateMessage(context.Background(), "", &getstream.TranslateMessageRequest{}) - require.NoError(t, err) -} -func TestChatUndeleteMessage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UndeleteMessage(context.Background(), "", &getstream.UndeleteMessageRequest{}) - require.NoError(t, err) -} -func TestChatCastPollVote(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().CastPollVote(context.Background(), "", "", &getstream.CastPollVoteRequest{}) - require.NoError(t, err) -} -func TestChatDeletePollVote(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeletePollVote(context.Background(), "", "", "", &getstream.DeletePollVoteRequest{}) - require.NoError(t, err) -} -func TestChatDeleteReminder(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteReminder(context.Background(), "", &getstream.DeleteReminderRequest{}) - require.NoError(t, err) -} -func TestChatUpdateReminder(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateReminder(context.Background(), "", &getstream.UpdateReminderRequest{}) - require.NoError(t, err) -} -func TestChatCreateReminder(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().CreateReminder(context.Background(), "", &getstream.CreateReminderRequest{}) - require.NoError(t, err) -} -func TestChatGetReplies(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetReplies(context.Background(), "", &getstream.GetRepliesRequest{}) - require.NoError(t, err) -} -func TestChatQueryMessageFlags(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryMessageFlags(context.Background(), &getstream.QueryMessageFlagsRequest{}) - require.NoError(t, err) -} -func TestChatMuteChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().MuteChannel(context.Background(), &getstream.MuteChannelRequest{}) - require.NoError(t, err) -} -func TestChatUnmuteChannel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UnmuteChannel(context.Background(), &getstream.UnmuteChannelRequest{}) - require.NoError(t, err) -} -func TestChatQueryBannedUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryBannedUsers(context.Background(), &getstream.QueryBannedUsersRequest{}) - require.NoError(t, err) -} -func TestChatQueryFutureChannelBans(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryFutureChannelBans(context.Background(), &getstream.QueryFutureChannelBansRequest{}) - require.NoError(t, err) -} -func TestChatQueryReminders(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryReminders(context.Background(), &getstream.QueryRemindersRequest{}) - require.NoError(t, err) -} -func TestChatSearch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().Search(context.Background(), &getstream.SearchRequest{}) - require.NoError(t, err) -} -func TestChatQuerySegments(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QuerySegments(context.Background(), &getstream.QuerySegmentsRequest{}) - require.NoError(t, err) -} -func TestChatDeleteSegment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteSegment(context.Background(), "", &getstream.DeleteSegmentRequest{}) - require.NoError(t, err) -} -func TestChatGetSegment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetSegment(context.Background(), "", &getstream.GetSegmentRequest{}) - require.NoError(t, err) -} -func TestChatDeleteSegmentTargets(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().DeleteSegmentTargets(context.Background(), "", &getstream.DeleteSegmentTargetsRequest{}) - require.NoError(t, err) -} -func TestChatSegmentTargetExists(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().SegmentTargetExists(context.Background(), "", "", &getstream.SegmentTargetExistsRequest{}) - require.NoError(t, err) -} -func TestChatQuerySegmentTargets(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QuerySegmentTargets(context.Background(), "", &getstream.QuerySegmentTargetsRequest{}) - require.NoError(t, err) -} -func TestChatQueryThreads(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().QueryThreads(context.Background(), &getstream.QueryThreadsRequest{}) - require.NoError(t, err) -} -func TestChatGetThread(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().GetThread(context.Background(), "", &getstream.GetThreadRequest{}) - require.NoError(t, err) -} -func TestChatUpdateThreadPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UpdateThreadPartial(context.Background(), "", &getstream.UpdateThreadPartialRequest{}) - require.NoError(t, err) -} -func TestChatUnreadCounts(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UnreadCounts(context.Background(), &getstream.UnreadCountsRequest{}) - require.NoError(t, err) -} -func TestChatUnreadCountsBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().UnreadCountsBatch(context.Background(), &getstream.UnreadCountsBatchRequest{}) - require.NoError(t, err) -} -func TestChatSendUserCustomEvent(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Chat().SendUserCustomEvent(context.Background(), "", &getstream.SendUserCustomEventRequest{}) - require.NoError(t, err) -} + func TestChatQueryCampaigns(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryCampaigns(context.Background(),&getstream.QueryCampaignsRequest{}) + require.NoError(t, err) + } + func TestChatGetCampaign(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetCampaign(context.Background(),"", &getstream.GetCampaignRequest{}) + require.NoError(t, err) + } + func TestChatStartCampaign(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().StartCampaign(context.Background(),"", &getstream.StartCampaignRequest{}) + require.NoError(t, err) + } + func TestChatStopCampaign(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().StopCampaign(context.Background(),"", &getstream.StopCampaignRequest{}) + require.NoError(t, err) + } + func TestChatQueryChannels(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryChannels(context.Background(),&getstream.QueryChannelsRequest{}) + require.NoError(t, err) + } + func TestChatDeleteChannels(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteChannels(context.Background(),&getstream.DeleteChannelsRequest{}) + require.NoError(t, err) + } + func TestChatMarkDelivered(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().MarkDelivered(context.Background(),&getstream.MarkDeliveredRequest{}) + require.NoError(t, err) + } + func TestChatMarkChannelsRead(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().MarkChannelsRead(context.Background(),&getstream.MarkChannelsReadRequest{}) + require.NoError(t, err) + } + func TestChatGetOrCreateDistinctChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetOrCreateDistinctChannel(context.Background(),"", &getstream.GetOrCreateDistinctChannelRequest{}) + require.NoError(t, err) + } + func TestChatDeleteChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteChannel(context.Background(),"", "", &getstream.DeleteChannelRequest{}) + require.NoError(t, err) + } + func TestChatUpdateChannelPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateChannelPartial(context.Background(),"", "", &getstream.UpdateChannelPartialRequest{}) + require.NoError(t, err) + } + func TestChatUpdateChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateChannel(context.Background(),"", "", &getstream.UpdateChannelRequest{}) + require.NoError(t, err) + } + func TestChatDeleteDraft(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteDraft(context.Background(),"", "", &getstream.DeleteDraftRequest{}) + require.NoError(t, err) + } + func TestChatGetDraft(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetDraft(context.Background(),"", "", &getstream.GetDraftRequest{}) + require.NoError(t, err) + } + func TestChatSendEvent(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().SendEvent(context.Background(),"", "", &getstream.SendEventRequest{}) + require.NoError(t, err) + } + func TestChatDeleteChannelFile(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteChannelFile(context.Background(),"", "", &getstream.DeleteChannelFileRequest{}) + require.NoError(t, err) + } + func TestChatHideChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().HideChannel(context.Background(),"", "", &getstream.HideChannelRequest{}) + require.NoError(t, err) + } + func TestChatDeleteChannelImage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteChannelImage(context.Background(),"", "", &getstream.DeleteChannelImageRequest{}) + require.NoError(t, err) + } + func TestChatUpdateMemberPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateMemberPartial(context.Background(),"", "", &getstream.UpdateMemberPartialRequest{}) + require.NoError(t, err) + } + func TestChatSendMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().SendMessage(context.Background(),"", "", &getstream.SendMessageRequest{}) + require.NoError(t, err) + } + func TestChatGetManyMessages(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetManyMessages(context.Background(),"", "", &getstream.GetManyMessagesRequest{}) + require.NoError(t, err) + } + func TestChatGetOrCreateChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetOrCreateChannel(context.Background(),"", "", &getstream.GetOrCreateChannelRequest{}) + require.NoError(t, err) + } + func TestChatMarkRead(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().MarkRead(context.Background(),"", "", &getstream.MarkReadRequest{}) + require.NoError(t, err) + } + func TestChatShowChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().ShowChannel(context.Background(),"", "", &getstream.ShowChannelRequest{}) + require.NoError(t, err) + } + func TestChatTruncateChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().TruncateChannel(context.Background(),"", "", &getstream.TruncateChannelRequest{}) + require.NoError(t, err) + } + func TestChatMarkUnread(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().MarkUnread(context.Background(),"", "", &getstream.MarkUnreadRequest{}) + require.NoError(t, err) + } + func TestChatListChannelTypes(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().ListChannelTypes(context.Background(),&getstream.ListChannelTypesRequest{}) + require.NoError(t, err) + } + func TestChatCreateChannelType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().CreateChannelType(context.Background(),&getstream.CreateChannelTypeRequest{}) + require.NoError(t, err) + } + func TestChatDeleteChannelType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteChannelType(context.Background(),"", &getstream.DeleteChannelTypeRequest{}) + require.NoError(t, err) + } + func TestChatGetChannelType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetChannelType(context.Background(),"", &getstream.GetChannelTypeRequest{}) + require.NoError(t, err) + } + func TestChatUpdateChannelType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateChannelType(context.Background(),"", &getstream.UpdateChannelTypeRequest{}) + require.NoError(t, err) + } + func TestChatListCommands(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().ListCommands(context.Background(),&getstream.ListCommandsRequest{}) + require.NoError(t, err) + } + func TestChatCreateCommand(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().CreateCommand(context.Background(),&getstream.CreateCommandRequest{}) + require.NoError(t, err) + } + func TestChatDeleteCommand(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteCommand(context.Background(),"", &getstream.DeleteCommandRequest{}) + require.NoError(t, err) + } + func TestChatGetCommand(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetCommand(context.Background(),"", &getstream.GetCommandRequest{}) + require.NoError(t, err) + } + func TestChatUpdateCommand(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateCommand(context.Background(),"", &getstream.UpdateCommandRequest{}) + require.NoError(t, err) + } + func TestChatQueryDrafts(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryDrafts(context.Background(),&getstream.QueryDraftsRequest{}) + require.NoError(t, err) + } + func TestChatExportChannels(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().ExportChannels(context.Background(),&getstream.ExportChannelsRequest{}) + require.NoError(t, err) + } + func TestChatQueryMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryMembers(context.Background(),&getstream.QueryMembersRequest{}) + require.NoError(t, err) + } + func TestChatQueryMessageHistory(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryMessageHistory(context.Background(),&getstream.QueryMessageHistoryRequest{}) + require.NoError(t, err) + } + func TestChatDeleteMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteMessage(context.Background(),"", &getstream.DeleteMessageRequest{}) + require.NoError(t, err) + } + func TestChatGetMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetMessage(context.Background(),"", &getstream.GetMessageRequest{}) + require.NoError(t, err) + } + func TestChatUpdateMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateMessage(context.Background(),"", &getstream.UpdateMessageRequest{}) + require.NoError(t, err) + } + func TestChatUpdateMessagePartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateMessagePartial(context.Background(),"", &getstream.UpdateMessagePartialRequest{}) + require.NoError(t, err) + } + func TestChatRunMessageAction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().RunMessageAction(context.Background(),"", &getstream.RunMessageActionRequest{}) + require.NoError(t, err) + } + func TestChatCommitMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().CommitMessage(context.Background(),"", &getstream.CommitMessageRequest{}) + require.NoError(t, err) + } + func TestChatEphemeralMessageUpdate(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().EphemeralMessageUpdate(context.Background(),"", &getstream.EphemeralMessageUpdateRequest{}) + require.NoError(t, err) + } + func TestChatSendReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().SendReaction(context.Background(),"", &getstream.SendReactionRequest{}) + require.NoError(t, err) + } + func TestChatDeleteReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteReaction(context.Background(),"", "", &getstream.DeleteReactionRequest{}) + require.NoError(t, err) + } + func TestChatGetReactions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetReactions(context.Background(),"", &getstream.GetReactionsRequest{}) + require.NoError(t, err) + } + func TestChatQueryReactions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryReactions(context.Background(),"", &getstream.QueryReactionsRequest{}) + require.NoError(t, err) + } + func TestChatTranslateMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().TranslateMessage(context.Background(),"", &getstream.TranslateMessageRequest{}) + require.NoError(t, err) + } + func TestChatUndeleteMessage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UndeleteMessage(context.Background(),"", &getstream.UndeleteMessageRequest{}) + require.NoError(t, err) + } + func TestChatCastPollVote(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().CastPollVote(context.Background(),"", "", &getstream.CastPollVoteRequest{}) + require.NoError(t, err) + } + func TestChatDeletePollVote(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeletePollVote(context.Background(),"", "", "", &getstream.DeletePollVoteRequest{}) + require.NoError(t, err) + } + func TestChatDeleteReminder(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteReminder(context.Background(),"", &getstream.DeleteReminderRequest{}) + require.NoError(t, err) + } + func TestChatUpdateReminder(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateReminder(context.Background(),"", &getstream.UpdateReminderRequest{}) + require.NoError(t, err) + } + func TestChatCreateReminder(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().CreateReminder(context.Background(),"", &getstream.CreateReminderRequest{}) + require.NoError(t, err) + } + func TestChatGetReplies(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetReplies(context.Background(),"", &getstream.GetRepliesRequest{}) + require.NoError(t, err) + } + func TestChatQueryMessageFlags(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryMessageFlags(context.Background(),&getstream.QueryMessageFlagsRequest{}) + require.NoError(t, err) + } + func TestChatMuteChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().MuteChannel(context.Background(),&getstream.MuteChannelRequest{}) + require.NoError(t, err) + } + func TestChatUnmuteChannel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UnmuteChannel(context.Background(),&getstream.UnmuteChannelRequest{}) + require.NoError(t, err) + } + func TestChatQueryBannedUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryBannedUsers(context.Background(),&getstream.QueryBannedUsersRequest{}) + require.NoError(t, err) + } + func TestChatQueryFutureChannelBans(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryFutureChannelBans(context.Background(),&getstream.QueryFutureChannelBansRequest{}) + require.NoError(t, err) + } + func TestChatQueryReminders(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QueryReminders(context.Background(),&getstream.QueryRemindersRequest{}) + require.NoError(t, err) + } + func TestChatSearch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().Search(context.Background(),&getstream.SearchRequest{}) + require.NoError(t, err) + } + func TestChatQuerySegments(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().QuerySegments(context.Background(),&getstream.QuerySegmentsRequest{}) + require.NoError(t, err) + } + func TestChatDeleteSegment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteSegment(context.Background(),"", &getstream.DeleteSegmentRequest{}) + require.NoError(t, err) + } + func TestChatGetSegment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetSegment(context.Background(),"", &getstream.GetSegmentRequest{}) + require.NoError(t, err) + } + func TestChatDeleteSegmentTargets(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().DeleteSegmentTargets(context.Background(),"", &getstream.DeleteSegmentTargetsRequest{}) + require.NoError(t, err) + } + func TestChatSegmentTargetExists(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().SegmentTargetExists(context.Background(),"", "", &getstream.SegmentTargetExistsRequest{}) + require.NoError(t, err) + } + func TestChatQuerySegmentTargets(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, 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) + + _, err = client.Chat().QueryThreads(context.Background(),&getstream.QueryThreadsRequest{}) + require.NoError(t, err) + } + func TestChatGetThread(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().GetThread(context.Background(),"", &getstream.GetThreadRequest{}) + require.NoError(t, err) + } + func TestChatUpdateThreadPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UpdateThreadPartial(context.Background(),"", &getstream.UpdateThreadPartialRequest{}) + require.NoError(t, err) + } + func TestChatUnreadCounts(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UnreadCounts(context.Background(),&getstream.UnreadCountsRequest{}) + require.NoError(t, err) + } + func TestChatUnreadCountsBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().UnreadCountsBatch(context.Background(),&getstream.UnreadCountsBatchRequest{}) + require.NoError(t, err) + } + func TestChatSendUserCustomEvent(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Chat().SendUserCustomEvent(context.Background(),"", &getstream.SendUserCustomEventRequest{}) + require.NoError(t, err) + } diff --git a/chat_test_helpers_test.go b/chat_test_helpers_test.go new file mode 100644 index 0000000..11807c9 --- /dev/null +++ b/chat_test_helpers_test.go @@ -0,0 +1,138 @@ +package getstream_test + +import ( + "context" + "strings" + "testing" + "time" + + . "github.com/GetStream/getstream-go/v3" + "github.com/google/uuid" + "github.com/stretchr/testify/require" +) + +// deleteUsersWithRetry calls DeleteUsers with retry logic to handle rate limiting. +// Used in t.Cleanup to avoid "Too many requests" failures. +func deleteUsersWithRetry(client *Stream, userIDs []string) { + for i := 0; i < 10; i++ { + _, err := client.DeleteUsers(context.Background(), &DeleteUsersRequest{ + UserIds: userIDs, + User: PtrTo("hard"), + Messages: PtrTo("hard"), + Conversations: PtrTo("hard"), + }) + if err == nil || !strings.Contains(err.Error(), "Too many requests") { + return + } + time.Sleep(time.Duration(i+1) * 3 * time.Second) + } +} + +// skipIfShort skips integration tests when running with -short flag. +func skipIfShort(t *testing.T) { + t.Helper() + if testing.Short() { + t.Skip("Skipping integration test in short mode") + } +} + +// createTestUsers creates n test users and returns their IDs. +// Registers t.Cleanup to hard-delete users (matching stream-chat-go's randomUser pattern). +func createTestUsers(t *testing.T, client *Stream, n int) []string { + t.Helper() + ctx := context.Background() + users := make(map[string]UserRequest, n) + ids := make([]string, n) + for i := 0; i < n; i++ { + id := "test-user-" + uuid.New().String() + ids[i] = id + users[id] = UserRequest{ + ID: id, + Name: PtrTo("Test User " + id[:8]), + Role: PtrTo("user"), + } + } + _, err := client.UpdateUsers(ctx, &UpdateUsersRequest{Users: users}) + require.NoError(t, err, "Failed to create test users") + + t.Cleanup(func() { + deleteUsersWithRetry(client, ids) + }) + + return ids +} + +// createTestChannel creates a messaging channel and registers cleanup to hard-delete it. +func createTestChannel(t *testing.T, client *Stream, creatorID string) (*Channels, string) { + t.Helper() + ctx := context.Background() + channelID := "test-ch-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + }, + }) + require.NoError(t, err, "Failed to create test channel") + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + return ch, channelID +} + +// createTestChannelWithMembers creates a messaging channel with members and registers cleanup to hard-delete it. +func createTestChannelWithMembers(t *testing.T, client *Stream, creatorID string, memberIDs []string) (*Channels, string) { + t.Helper() + ctx := context.Background() + channelID := "test-ch-" + randomString(12) + ch := client.Chat().Channel("messaging", channelID) + + members := make([]ChannelMemberRequest, len(memberIDs)) + for i, id := range memberIDs { + members[i] = ChannelMemberRequest{UserID: id} + } + + _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ + Data: &ChannelInput{ + CreatedByID: PtrTo(creatorID), + Members: members, + }, + }) + require.NoError(t, err, "Failed to create test channel with members") + + t.Cleanup(func() { + _, _ = ch.Delete(context.Background(), &DeleteChannelRequest{ + HardDelete: PtrTo(true), + }) + }) + + return ch, channelID +} + +// waitForTask polls a task until it completes. +func waitForTask(t *testing.T, client *Stream, ctx context.Context, taskID string) { + t.Helper() + taskResult, err := WaitForTask(ctx, client, taskID) + require.NoError(t, err, "Task polling failed") + require.Equal(t, "completed", taskResult.Data.Status, "Task did not complete successfully") +} + +// sendTestMessage sends a message to a channel and returns the message ID. +func sendTestMessage(t *testing.T, ch *Channels, userID string, text string) string { + t.Helper() + ctx := context.Background() + resp, err := ch.SendMessage(ctx, &SendMessageRequest{ + Message: MessageRequest{ + Text: PtrTo(text), + UserID: PtrTo(userID), + }, + }) + require.NoError(t, err, "Failed to send test message") + require.NotEmpty(t, resp.Data.Message.ID, "Message ID should not be empty") + return resp.Data.Message.ID +} diff --git a/chat_user_integration_test.go b/chat_user_integration_test.go new file mode 100644 index 0000000..b45f142 --- /dev/null +++ b/chat_user_integration_test.go @@ -0,0 +1,554 @@ +package getstream_test + +import ( + "context" + "strings" + "testing" + "time" + + . "github.com/GetStream/getstream-go/v3" + "github.com/google/uuid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChatUserIntegration(t *testing.T) { + skipIfShort(t) + client := initClient(t) + ctx := context.Background() + + t.Run("UpsertUsers", func(t *testing.T) { + userID1 := "upsert-" + uuid.New().String() + userID2 := "upsert-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{userID1, userID2}) + }) + + resp, err := client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID1: { + ID: userID1, + Name: PtrTo("User One"), + Role: PtrTo("user"), + }, + userID2: { + ID: userID2, + Name: PtrTo("User Two"), + Role: PtrTo("user"), + }, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Users) + + u1, ok := resp.Data.Users[userID1] + require.True(t, ok, "User 1 should be in response") + assert.Equal(t, userID1, u1.ID) + assert.Equal(t, "User One", *u1.Name) + + u2, ok := resp.Data.Users[userID2] + require.True(t, ok, "User 2 should be in response") + assert.Equal(t, userID2, u2.ID) + assert.Equal(t, "User Two", *u2.Name) + }) + + t.Run("QueryUsers", func(t *testing.T) { + userIDs := createTestUsers(t, client, 2) + + resp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]any{"$in": userIDs}, + }, + }, + }) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(resp.Data.Users), 2) + + foundIDs := make(map[string]bool) + for _, u := range resp.Data.Users { + foundIDs[u.ID] = true + } + for _, id := range userIDs { + assert.True(t, foundIDs[id], "User %s should be found in query results", id) + } + }) + + t.Run("QueryUsersWithOffsetLimit", func(t *testing.T) { + userIDs := createTestUsers(t, client, 3) + + resp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]any{"$in": userIDs}, + }, + Offset: PtrTo(1), + Limit: PtrTo(2), + }, + }) + require.NoError(t, err) + assert.Len(t, resp.Data.Users, 2, "Should return exactly 2 users with offset=1 limit=2") + }) + + t.Run("PartialUpdateUser", func(t *testing.T) { + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + _, err := client.UpdateUsersPartial(ctx, &UpdateUsersPartialRequest{ + Users: []UpdateUserPartialRequest{ + { + ID: userID, + Set: map[string]any{ + "country": "NL", + "role": "admin", + }, + }, + }, + }) + require.NoError(t, err) + + // Verify the update + resp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": userID, + }, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Data.Users, 1) + + // Now unset + _, err = client.UpdateUsersPartial(ctx, &UpdateUsersPartialRequest{ + Users: []UpdateUserPartialRequest{ + { + ID: userID, + Unset: []string{"country"}, + }, + }, + }) + require.NoError(t, err) + }) + + t.Run("BlockUnblockUser", func(t *testing.T) { + userIDs := createTestUsers(t, client, 2) + alice := userIDs[0] + bob := userIDs[1] + + // Block + _, err := client.BlockUsers(ctx, &BlockUsersRequest{ + BlockedUserID: bob, + UserID: &alice, + }) + require.NoError(t, err) + + // Verify blocked + resp, err := client.GetBlockedUsers(ctx, &GetBlockedUsersRequest{ + UserID: &alice, + }) + require.NoError(t, err) + require.NotEmpty(t, resp.Data.Blocks, "Should have at least one block") + + found := false + for _, b := range resp.Data.Blocks { + if b.BlockedUserID == bob { + found = true + break + } + } + assert.True(t, found, "Bob should be in Alice's blocked list") + + // Unblock + _, err = client.UnblockUsers(ctx, &UnblockUsersRequest{ + BlockedUserID: bob, + UserID: &alice, + }) + require.NoError(t, err) + + // Verify unblocked + resp, err = client.GetBlockedUsers(ctx, &GetBlockedUsersRequest{ + UserID: &alice, + }) + require.NoError(t, err) + for _, b := range resp.Data.Blocks { + assert.NotEqual(t, bob, b.BlockedUserID, "Bob should no longer be blocked") + } + }) + + t.Run("DeactivateReactivateUser", func(t *testing.T) { + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + // Deactivate + _, err := client.DeactivateUser(ctx, userID, &DeactivateUserRequest{}) + require.NoError(t, err) + + // Reactivate + _, err = client.ReactivateUser(ctx, userID, &ReactivateUserRequest{}) + require.NoError(t, err) + + // Verify user is active again by querying + resp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": userID, + }, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Data.Users, 1) + assert.Equal(t, userID, resp.Data.Users[0].ID) + }) + + t.Run("DeleteUsers", func(t *testing.T) { + userIDs := createTestUsers(t, client, 2) + + var resp *StreamResponse[DeleteUsersResponse] + var err error + for i := 0; i < 10; i++ { + resp, err = client.DeleteUsers(ctx, &DeleteUsersRequest{ + UserIds: userIDs, + }) + if err == nil || !strings.Contains(err.Error(), "Too many requests") { + break + } + t.Logf("DeleteUsers rate limited, attempt %d/10, waiting %ds", i+1, (i+1)*3) + time.Sleep(time.Duration(i+1) * 3 * time.Second) + } + require.NoError(t, err) + + taskID := resp.Data.TaskID + require.NotEmpty(t, taskID, "Task ID should not be empty") + + taskResult, err := WaitForTask(ctx, client, taskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) + }) + + t.Run("ExportUser", func(t *testing.T) { + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + resp, err := client.ExportUser(ctx, userID, &ExportUserRequest{}) + require.NoError(t, err) + require.NotNil(t, resp.Data) + }) + + t.Run("CreateGuest", func(t *testing.T) { + guestID := "guest-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{guestID}) + }) + + resp, err := client.CreateGuest(ctx, &CreateGuestRequest{ + User: UserRequest{ + ID: guestID, + Name: PtrTo("Guest User"), + }, + }) + if err != nil { + // Guest access may be disabled at the app level (e.g. multi-tenant apps) + // stream-chat-go handles this the same way + return + } + require.NotNil(t, resp.Data) + assert.NotEmpty(t, resp.Data.AccessToken, "Access token should not be empty") + + // Server may prefix the guest ID, so check with Contains + assert.Contains(t, resp.Data.User.ID, guestID, "Guest user ID should contain the requested ID") + + // Also clean up the actual server-assigned ID + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{resp.Data.User.ID}) + }) + }) + + t.Run("UpsertUsersWithRoleAndTeamsRole", func(t *testing.T) { + userID := "teams-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{userID}) + }) + + resp, err := client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: { + ID: userID, + Name: PtrTo("Teams User"), + Role: PtrTo("admin"), + Teams: []string{"blue"}, + TeamsRole: map[string]string{"blue": "admin"}, + }, + }, + }) + require.NoError(t, err) + + u, ok := resp.Data.Users[userID] + require.True(t, ok, "User should be in response") + assert.Equal(t, "admin", u.Role) + assert.Equal(t, []string{"blue"}, u.Teams) + assert.Equal(t, map[string]string{"blue": "admin"}, u.TeamsRole) + }) + + t.Run("PartialUpdateUserWithTeam", func(t *testing.T) { + userIDs := createTestUsers(t, client, 1) + userID := userIDs[0] + + // Partial update to add teams and teams_role + resp, err := client.UpdateUsersPartial(ctx, &UpdateUsersPartialRequest{ + Users: []UpdateUserPartialRequest{ + { + ID: userID, + Set: map[string]any{ + "teams": []string{"blue"}, + "teams_role": map[string]string{"blue": "admin"}, + }, + }, + }, + }) + require.NoError(t, err) + require.NotNil(t, resp.Data.Users) + + u, ok := resp.Data.Users[userID] + require.True(t, ok) + assert.Equal(t, []string{"blue"}, u.Teams) + assert.Equal(t, map[string]string{"blue": "admin"}, u.TeamsRole) + }) + + t.Run("UpdatePrivacySettings", func(t *testing.T) { + userID := "privacy-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{userID}) + }) + + // Create user without privacy settings + resp, err := client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: { + ID: userID, + Name: PtrTo("Privacy User"), + }, + }, + }) + require.NoError(t, err) + u, ok := resp.Data.Users[userID] + require.True(t, ok) + assert.Nil(t, u.PrivacySettings, "PrivacySettings should be nil initially") + + // Update with TypingIndicators disabled + resp, err = client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: { + ID: userID, + PrivacySettings: &PrivacySettingsResponse{ + TypingIndicators: &TypingIndicatorsResponse{ + Enabled: PtrTo(false), + }, + }, + }, + }, + }) + require.NoError(t, err) + u, ok = resp.Data.Users[userID] + require.True(t, ok) + require.NotNil(t, u.PrivacySettings) + require.NotNil(t, u.PrivacySettings.TypingIndicators) + assert.Equal(t, false, *u.PrivacySettings.TypingIndicators.Enabled) + assert.Nil(t, u.PrivacySettings.ReadReceipts, "ReadReceipts should still be nil") + + // Update with both TypingIndicators=true and ReadReceipts=false + resp, err = client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: { + ID: userID, + PrivacySettings: &PrivacySettingsResponse{ + TypingIndicators: &TypingIndicatorsResponse{ + Enabled: PtrTo(true), + }, + ReadReceipts: &ReadReceiptsResponse{ + Enabled: PtrTo(false), + }, + }, + }, + }, + }) + require.NoError(t, err) + u, ok = resp.Data.Users[userID] + require.True(t, ok) + require.NotNil(t, u.PrivacySettings) + require.NotNil(t, u.PrivacySettings.TypingIndicators) + assert.Equal(t, true, *u.PrivacySettings.TypingIndicators.Enabled) + require.NotNil(t, u.PrivacySettings.ReadReceipts) + assert.Equal(t, false, *u.PrivacySettings.ReadReceipts.Enabled) + }) + + t.Run("PartialUpdatePrivacySettings", func(t *testing.T) { + userID := "privacy-partial-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{userID}) + }) + + // Create user + resp, err := client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: {ID: userID, Name: PtrTo("Privacy Partial User")}, + }, + }) + require.NoError(t, err) + u := resp.Data.Users[userID] + require.Nil(t, u.PrivacySettings) + + // Partial update: set typing_indicators.enabled = true + partialResp, err := client.UpdateUsersPartial(ctx, &UpdateUsersPartialRequest{ + Users: []UpdateUserPartialRequest{ + { + ID: userID, + Set: map[string]any{ + "privacy_settings": map[string]any{ + "typing_indicators": map[string]any{ + "enabled": true, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) + u2 := partialResp.Data.Users[userID] + require.NotNil(t, u2.PrivacySettings) + require.NotNil(t, u2.PrivacySettings.TypingIndicators) + assert.True(t, *u2.PrivacySettings.TypingIndicators.Enabled) + assert.Nil(t, u2.PrivacySettings.ReadReceipts, "ReadReceipts should still be nil") + + // Partial update: set read_receipts.enabled = false + partialResp2, err := client.UpdateUsersPartial(ctx, &UpdateUsersPartialRequest{ + Users: []UpdateUserPartialRequest{ + { + ID: userID, + Set: map[string]any{ + "privacy_settings": map[string]any{ + "read_receipts": map[string]any{ + "enabled": false, + }, + }, + }, + }, + }, + }) + require.NoError(t, err) + u3 := partialResp2.Data.Users[userID] + require.NotNil(t, u3.PrivacySettings) + require.NotNil(t, u3.PrivacySettings.TypingIndicators) + assert.True(t, *u3.PrivacySettings.TypingIndicators.Enabled, "TypingIndicators should still be true") + require.NotNil(t, u3.PrivacySettings.ReadReceipts) + assert.False(t, *u3.PrivacySettings.ReadReceipts.Enabled) + }) + + t.Run("QueryUsersWithDeactivated", func(t *testing.T) { + userIDs := createTestUsers(t, client, 3) + + // Deactivate one user + _, err := client.DeactivateUser(ctx, userIDs[2], &DeactivateUserRequest{}) + require.NoError(t, err) + + t.Cleanup(func() { + _, _ = client.ReactivateUser(context.Background(), userIDs[2], &ReactivateUserRequest{}) + }) + + // Query WITHOUT including deactivated — should get 2 + resp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]any{"$in": userIDs}, + }, + }, + }) + require.NoError(t, err) + assert.Len(t, resp.Data.Users, 2, "Should exclude deactivated user by default") + + // Query WITH including deactivated — should get all 3 + resp, err = client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]any{"$in": userIDs}, + }, + IncludeDeactivatedUsers: PtrTo(true), + }, + }) + require.NoError(t, err) + assert.Len(t, resp.Data.Users, 3, "Should include deactivated user") + }) + + t.Run("DeactivateUsersPlural", func(t *testing.T) { + userIDs := createTestUsers(t, client, 2) + + // Deactivate multiple users at once + resp, err := client.DeactivateUsers(ctx, &DeactivateUsersRequest{ + UserIds: userIDs, + }) + require.NoError(t, err) + assert.NotEmpty(t, resp.Data.TaskID) + + // Wait for deactivation task + taskResult, err := WaitForTask(ctx, client, resp.Data.TaskID) + require.NoError(t, err) + assert.Equal(t, "completed", taskResult.Data.Status) + + // Verify deactivated — query without include should not find them + qResp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": map[string]any{"$in": userIDs}, + }, + }, + }) + require.NoError(t, err) + assert.Empty(t, qResp.Data.Users, "Deactivated users should not appear in default query") + }) + + t.Run("UserCustomData", func(t *testing.T) { + userID := "custom-" + uuid.New().String() + + t.Cleanup(func() { + deleteUsersWithRetry(client, []string{userID}) + }) + + custom := map[string]any{ + "favorite_color": "blue", + "age": float64(30), + "tags": []any{"vip", "early_adopter"}, + } + + resp, err := client.UpdateUsers(ctx, &UpdateUsersRequest{ + Users: map[string]UserRequest{ + userID: { + ID: userID, + Name: PtrTo("Custom User"), + Custom: custom, + }, + }, + }) + require.NoError(t, err) + + u, ok := resp.Data.Users[userID] + require.True(t, ok) + assert.Equal(t, "blue", u.Custom["favorite_color"]) + assert.Equal(t, float64(30), u.Custom["age"]) + + // Query back to verify persistence + queryResp, err := client.QueryUsers(ctx, &QueryUsersRequest{ + Payload: &QueryUsersPayload{ + FilterConditions: map[string]any{ + "id": userID, + }, + }, + }) + require.NoError(t, err) + require.Len(t, queryResp.Data.Users, 1) + assert.Equal(t, "blue", queryResp.Data.Users[0].Custom["favorite_color"]) + }) +} diff --git a/chat_webhook_test.go b/chat_webhook_test.go new file mode 100644 index 0000000..95b2d21 --- /dev/null +++ b/chat_webhook_test.go @@ -0,0 +1,251 @@ +package getstream_test + +import ( + "bytes" + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "net/http" + "net/http/httptest" + "testing" + + . "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func computeSignature(body []byte, secret string) string { + h := hmac.New(sha256.New, []byte(secret)) + h.Write(body) + return hex.EncodeToString(h.Sum(nil)) +} + +// Timestamps in this SDK use nanosecond Unix epochs (not ISO strings). +// 1704067200000000000 = 2024-01-01T00:00:00Z in nanoseconds. +const testTimestampNs = "1704067200000000000" + +func TestVerifyAndParseWebhook(t *testing.T) { + secret := "test-webhook-secret-123" + + validBody := []byte(`{"type":"message.new","message_id":"msg123","created_at":` + testTimestampNs + `,"watcher_count":0,"custom":{},"message":{"id":"msg123","text":"hello","type":"regular","created_at":` + testTimestampNs + `,"updated_at":` + testTimestampNs + `,"cid":"messaging:test","html":""}}`) + + t.Run("ValidRequest", func(t *testing.T) { + sig := computeSignature(validBody, secret) + + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(validBody)) + req.Header.Set("X-Signature", sig) + + event, err := VerifyAndParseWebhook(req, secret) + require.NoError(t, err) + require.NotNil(t, event) + assert.Equal(t, "message.new", event.GetEventType()) + }) + + t.Run("MissingSignatureHeader", func(t *testing.T) { + body := []byte(`{"type":"message.new"}`) + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + + _, err := VerifyAndParseWebhook(req, secret) + require.Error(t, err) + assert.Contains(t, err.Error(), "X-Signature") + }) + + t.Run("InvalidSignature", func(t *testing.T) { + body := []byte(`{"type":"message.new"}`) + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + req.Header.Set("X-Signature", "badsignature") + + _, err := VerifyAndParseWebhook(req, secret) + require.Error(t, err) + assert.Contains(t, err.Error(), "invalid signature") + }) + + t.Run("InvalidJSON", func(t *testing.T) { + body := []byte(`not json at all`) + sig := computeSignature(body, secret) + + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + req.Header.Set("X-Signature", sig) + + _, err := VerifyAndParseWebhook(req, secret) + require.Error(t, err) + }) + + t.Run("BodyRestoredAfterParsing", func(t *testing.T) { + sig := computeSignature(validBody, secret) + + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(validBody)) + req.Header.Set("X-Signature", sig) + + _, err := VerifyAndParseWebhook(req, secret) + require.NoError(t, err) + + // Body should still be readable + buf := new(bytes.Buffer) + _, err = buf.ReadFrom(req.Body) + require.NoError(t, err) + assert.NotEmpty(t, buf.Bytes(), "Body should be restored after VerifyAndParseWebhook") + }) +} + +func TestWebhookMiddleware(t *testing.T) { + secret := "middleware-test-secret" + + handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + event := r.Context().Value(WebhookEventKey) + if event == nil { + w.WriteHeader(http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusOK) + }) + + middleware := WebhookMiddleware(secret) + wrapped := middleware(handler) + + t.Run("RejectsGET", func(t *testing.T) { + req := httptest.NewRequest(http.MethodGet, "/webhook", nil) + rr := httptest.NewRecorder() + wrapped.ServeHTTP(rr, req) + assert.Equal(t, http.StatusMethodNotAllowed, rr.Code) + }) + + t.Run("RejectsBadSignature", func(t *testing.T) { + body := []byte(`{"type":"message.new"}`) + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + req.Header.Set("X-Signature", "invalidsig") + rr := httptest.NewRecorder() + wrapped.ServeHTTP(rr, req) + assert.Equal(t, http.StatusBadRequest, rr.Code) + }) + + t.Run("PassesValidRequest", func(t *testing.T) { + body := []byte(`{"type":"message.new","message_id":"msg1","created_at":` + testTimestampNs + `,"watcher_count":0,"custom":{},"message":{"id":"msg1","text":"hi","type":"regular","created_at":` + testTimestampNs + `,"updated_at":` + testTimestampNs + `,"cid":"messaging:test","html":""}}`) + sig := computeSignature(body, secret) + + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + req.Header.Set("X-Signature", sig) + rr := httptest.NewRecorder() + wrapped.ServeHTTP(rr, req) + assert.Equal(t, http.StatusOK, rr.Code) + }) +} + +func TestParseWebhookEventWithPayload(t *testing.T) { + t.Run("MessageNewEvent", func(t *testing.T) { + payload := []byte(`{ + "type": "message.new", + "message_id": "msg-abc-123", + "created_at": ` + testTimestampNs + `, + "watcher_count": 5, + "custom": {}, + "message": { + "id": "msg-abc-123", + "text": "Hello world!", + "type": "regular", + "created_at": ` + testTimestampNs + `, + "updated_at": ` + testTimestampNs + `, + "cid": "messaging:general", + "html": "" + } + }`) + event, err := ParseWebhookEvent(payload) + require.NoError(t, err) + assert.Equal(t, "message.new", event.GetEventType()) + + msgEvent, ok := event.(*MessageNewEvent) + require.True(t, ok, "Should be *MessageNewEvent") + assert.Equal(t, "msg-abc-123", msgEvent.MessageID) + assert.Equal(t, "msg-abc-123", msgEvent.Message.ID) + assert.Equal(t, "Hello world!", msgEvent.Message.Text) + assert.Equal(t, 5, msgEvent.WatcherCount) + }) + + t.Run("ChannelCreatedEvent", func(t *testing.T) { + payload := []byte(`{ + "type": "channel.created", + "created_at": ` + testTimestampNs + `, + "custom": {}, + "channel": { + "cid": "messaging:new-channel", + "id": "new-channel", + "type": "messaging", + "created_at": ` + testTimestampNs + `, + "updated_at": ` + testTimestampNs + `, + "frozen": false, + "disabled": false, + "member_count": 2, + "config": { + "automod": "disabled", + "automod_behavior": "flag", + "commands": [], + "connect_events": true, + "created_at": ` + testTimestampNs + `, + "max_message_length": 5000, + "message_retention": "infinite", + "mutes": true, + "name": "messaging", + "reactions": true, + "read_events": true, + "replies": true, + "search": true, + "typing_events": true, + "updated_at": ` + testTimestampNs + `, + "uploads": true, + "url_enrichment": true + } + } + }`) + event, err := ParseWebhookEvent(payload) + require.NoError(t, err) + assert.Equal(t, "channel.created", event.GetEventType()) + + chEvent, ok := event.(*ChannelCreatedEvent) + require.True(t, ok, "Should be *ChannelCreatedEvent") + assert.Equal(t, "messaging:new-channel", chEvent.Channel.Cid) + assert.Equal(t, "new-channel", chEvent.Channel.ID) + assert.Equal(t, "messaging", chEvent.Channel.Type) + require.NotNil(t, chEvent.Channel.MemberCount) + assert.Equal(t, 2, *chEvent.Channel.MemberCount) + }) + + t.Run("UnknownEventType", func(t *testing.T) { + payload := []byte(`{"type":"completely.unknown.event"}`) + _, err := ParseWebhookEvent(payload) + require.Error(t, err) + assert.Contains(t, err.Error(), "unknown webhook event type") + }) +} + +func TestWebhookEventKey(t *testing.T) { + secret := "event-key-test-secret" + + var capturedEvent WebhookEvent + + handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + val := r.Context().Value(WebhookEventKey) + if val != nil { + capturedEvent = val.(WebhookEvent) + } + w.WriteHeader(http.StatusOK) + }) + + middleware := WebhookMiddleware(secret) + wrapped := middleware(handler) + + body := []byte(`{"type":"channel.created","created_at":` + testTimestampNs + `,"custom":{},"channel":{"cid":"messaging:test","id":"test","type":"messaging","created_at":` + testTimestampNs + `,"updated_at":` + testTimestampNs + `,"frozen":false,"disabled":false,"member_count":0,"config":{"automod":"disabled","automod_behavior":"flag","commands":[],"connect_events":true,"created_at":` + testTimestampNs + `,"max_message_length":5000,"message_retention":"infinite","mutes":true,"name":"messaging","reactions":true,"read_events":true,"replies":true,"search":true,"typing_events":true,"updated_at":` + testTimestampNs + `,"uploads":true,"url_enrichment":true}}}`) + sig := computeSignature(body, secret) + + req := httptest.NewRequest(http.MethodPost, "/webhook", bytes.NewReader(body)) + req.Header.Set("X-Signature", sig) + rr := httptest.NewRecorder() + wrapped.ServeHTTP(rr, req) + + require.Equal(t, http.StatusOK, rr.Code) + require.NotNil(t, capturedEvent, "Event should be captured from context") + assert.Equal(t, "channel.created", capturedEvent.GetEventType()) + + chEvent, ok := capturedEvent.(*ChannelCreatedEvent) + require.True(t, ok) + assert.Equal(t, "messaging:test", chEvent.Channel.Cid) +} diff --git a/client_test.go b/client_test.go index eac5239..ac1ae73 100644 --- a/client_test.go +++ b/client_test.go @@ -597,10 +597,7 @@ func TestVideoExamplesAdditional(t *testing.T) { assert.NoError(t, err) taskID := response.Data.TaskID - taskCtx, cancel := context.WithTimeout(ctx, 3*time.Second) - defer cancel() - - taskStatus, err := WaitForTask(taskCtx, client, taskID) + taskStatus, err := WaitForTask(ctx, client, taskID) assert.NoError(t, err) if taskStatus.Data.Status == "completed" { @@ -937,10 +934,7 @@ func TestHardDeleteCall(t *testing.T) { require.NotNil(t, taskID) - taskCtx, cancel := context.WithTimeout(ctx, 3*time.Second) - defer cancel() - - taskStatus, err := WaitForTask(taskCtx, client, *taskID) + taskStatus, err := WaitForTask(ctx, client, *taskID) assert.NoError(t, err) if taskStatus.Data.Status == "completed" { diff --git a/common.go b/common.go index 4201499..f101253 100644 --- a/common.go +++ b/common.go @@ -6,651 +6,726 @@ import ( ) // This Method returns the application settings +// func (c *Client) GetApp(ctx context.Context, request *GetAppRequest) (*StreamResponse[GetApplicationResponse], error) { var result GetApplicationResponse - res, err := MakeRequest[any, GetApplicationResponse](c, ctx, "GET", "/api/v2/app", nil, nil, &result, nil) + res, err := MakeRequest[any, GetApplicationResponse](c, ctx, "GET", "/api/v2/app",nil, nil, &result,nil) return res, err } // This Method updates one or more application settings +// func (c *Client) UpdateApp(ctx context.Context, request *UpdateAppRequest) (*StreamResponse[Response], error) { var result Response - res, err := MakeRequest[UpdateAppRequest, Response](c, ctx, "PATCH", "/api/v2/app", nil, request, &result, nil) + res, err := MakeRequest[UpdateAppRequest, Response](c, ctx, "PATCH", "/api/v2/app",nil,request, &result,nil) return res, err } // Returns all available block lists +// func (c *Client) ListBlockLists(ctx context.Context, request *ListBlockListsRequest) (*StreamResponse[ListBlockListResponse], error) { var result ListBlockListResponse params := extractQueryParams(request) - res, err := MakeRequest[any, ListBlockListResponse](c, ctx, "GET", "/api/v2/blocklists", params, nil, &result, nil) + res, err := MakeRequest[any, ListBlockListResponse](c, ctx, "GET", "/api/v2/blocklists",params, nil, &result,nil) return res, err } // Creates a new application blocklist, once created the blocklist can be used by any channel type +// func (c *Client) CreateBlockList(ctx context.Context, request *CreateBlockListRequest) (*StreamResponse[CreateBlockListResponse], error) { var result CreateBlockListResponse - res, err := MakeRequest[CreateBlockListRequest, CreateBlockListResponse](c, ctx, "POST", "/api/v2/blocklists", nil, request, &result, nil) + res, err := MakeRequest[CreateBlockListRequest, CreateBlockListResponse](c, ctx, "POST", "/api/v2/blocklists",nil,request, &result,nil) return res, err } // Deletes previously created application blocklist -func (c *Client) DeleteBlockList(ctx context.Context, name string, request *DeleteBlockListRequest) (*StreamResponse[Response], error) { +// +func (c *Client) DeleteBlockList(ctx context.Context,name string, request *DeleteBlockListRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "name": name, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/blocklists/{name}", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/blocklists/{name}",params, nil, &result,pathParams) return res, err } // Returns block list by given name -func (c *Client) GetBlockList(ctx context.Context, name string, request *GetBlockListRequest) (*StreamResponse[GetBlockListResponse], error) { +// +func (c *Client) GetBlockList(ctx context.Context,name string, request *GetBlockListRequest) (*StreamResponse[GetBlockListResponse], error) { var result GetBlockListResponse pathParams := map[string]string{ "name": name, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetBlockListResponse](c, ctx, "GET", "/api/v2/blocklists/{name}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetBlockListResponse](c, ctx, "GET", "/api/v2/blocklists/{name}",params, nil, &result,pathParams) return res, err } // Updates contents of the block list -func (c *Client) UpdateBlockList(ctx context.Context, name string, request *UpdateBlockListRequest) (*StreamResponse[UpdateBlockListResponse], error) { +// +func (c *Client) UpdateBlockList(ctx context.Context,name string, request *UpdateBlockListRequest) (*StreamResponse[UpdateBlockListResponse], error) { var result UpdateBlockListResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateBlockListRequest, UpdateBlockListResponse](c, ctx, "PUT", "/api/v2/blocklists/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateBlockListRequest, UpdateBlockListResponse](c, ctx, "PUT", "/api/v2/blocklists/{name}",nil,request, &result,pathParams) return res, err } // Sends a test message via push, this is a test endpoint to verify your push settings +// func (c *Client) CheckPush(ctx context.Context, request *CheckPushRequest) (*StreamResponse[CheckPushResponse], error) { var result CheckPushResponse - res, err := MakeRequest[CheckPushRequest, CheckPushResponse](c, ctx, "POST", "/api/v2/check_push", nil, request, &result, nil) + res, err := MakeRequest[CheckPushRequest, CheckPushResponse](c, ctx, "POST", "/api/v2/check_push",nil,request, &result,nil) return res, err } // Validates Amazon SNS configuration +// func (c *Client) CheckSNS(ctx context.Context, request *CheckSNSRequest) (*StreamResponse[CheckSNSResponse], error) { var result CheckSNSResponse - res, err := MakeRequest[CheckSNSRequest, CheckSNSResponse](c, ctx, "POST", "/api/v2/check_sns", nil, request, &result, nil) + res, err := MakeRequest[CheckSNSRequest, CheckSNSResponse](c, ctx, "POST", "/api/v2/check_sns",nil,request, &result,nil) return res, err } // Validates Amazon SQS credentials +// func (c *Client) CheckSQS(ctx context.Context, request *CheckSQSRequest) (*StreamResponse[CheckSQSResponse], error) { var result CheckSQSResponse - res, err := MakeRequest[CheckSQSRequest, CheckSQSResponse](c, ctx, "POST", "/api/v2/check_sqs", nil, request, &result, nil) + res, err := MakeRequest[CheckSQSRequest, CheckSQSResponse](c, ctx, "POST", "/api/v2/check_sqs",nil,request, &result,nil) return res, err } // Deletes one device +// func (c *Client) DeleteDevice(ctx context.Context, request *DeleteDeviceRequest) (*StreamResponse[Response], error) { var result Response params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/devices", params, nil, &result, nil) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/devices",params, nil, &result,nil) return res, err } // Returns all available devices +// func (c *Client) ListDevices(ctx context.Context, request *ListDevicesRequest) (*StreamResponse[ListDevicesResponse], error) { var result ListDevicesResponse params := extractQueryParams(request) - res, err := MakeRequest[any, ListDevicesResponse](c, ctx, "GET", "/api/v2/devices", params, nil, &result, nil) + res, err := MakeRequest[any, ListDevicesResponse](c, ctx, "GET", "/api/v2/devices",params, nil, &result,nil) return res, err } // Adds a new device to a user, if the same device already exists the call will have no effect +// func (c *Client) CreateDevice(ctx context.Context, request *CreateDeviceRequest) (*StreamResponse[Response], error) { var result Response - res, err := MakeRequest[CreateDeviceRequest, Response](c, ctx, "POST", "/api/v2/devices", nil, request, &result, nil) + res, err := MakeRequest[CreateDeviceRequest, Response](c, ctx, "POST", "/api/v2/devices",nil,request, &result,nil) return res, err } // Exports user profile, reactions and messages for list of given users +// func (c *Client) ExportUsers(ctx context.Context, request *ExportUsersRequest) (*StreamResponse[ExportUsersResponse], error) { var result ExportUsersResponse - res, err := MakeRequest[ExportUsersRequest, ExportUsersResponse](c, ctx, "POST", "/api/v2/export/users", nil, request, &result, nil) + res, err := MakeRequest[ExportUsersRequest, ExportUsersResponse](c, ctx, "POST", "/api/v2/export/users",nil,request, &result,nil) return res, err } // Lists external storage +// func (c *Client) ListExternalStorage(ctx context.Context, request *ListExternalStorageRequest) (*StreamResponse[ListExternalStorageResponse], error) { var result ListExternalStorageResponse - res, err := MakeRequest[any, ListExternalStorageResponse](c, ctx, "GET", "/api/v2/external_storage", nil, nil, &result, nil) + res, err := MakeRequest[any, ListExternalStorageResponse](c, ctx, "GET", "/api/v2/external_storage",nil, nil, &result,nil) return res, err } // Creates new external storage +// func (c *Client) CreateExternalStorage(ctx context.Context, request *CreateExternalStorageRequest) (*StreamResponse[CreateExternalStorageResponse], error) { var result CreateExternalStorageResponse - res, err := MakeRequest[CreateExternalStorageRequest, CreateExternalStorageResponse](c, ctx, "POST", "/api/v2/external_storage", nil, request, &result, nil) + res, err := MakeRequest[CreateExternalStorageRequest, CreateExternalStorageResponse](c, ctx, "POST", "/api/v2/external_storage",nil,request, &result,nil) return res, err } // Deletes external storage -func (c *Client) DeleteExternalStorage(ctx context.Context, name string, request *DeleteExternalStorageRequest) (*StreamResponse[DeleteExternalStorageResponse], error) { +// +func (c *Client) DeleteExternalStorage(ctx context.Context,name string, request *DeleteExternalStorageRequest) (*StreamResponse[DeleteExternalStorageResponse], error) { var result DeleteExternalStorageResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, DeleteExternalStorageResponse](c, ctx, "DELETE", "/api/v2/external_storage/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteExternalStorageResponse](c, ctx, "DELETE", "/api/v2/external_storage/{name}",nil, nil, &result,pathParams) return res, err } -func (c *Client) UpdateExternalStorage(ctx context.Context, name string, request *UpdateExternalStorageRequest) (*StreamResponse[UpdateExternalStorageResponse], error) { +// +// +func (c *Client) UpdateExternalStorage(ctx context.Context,name string, request *UpdateExternalStorageRequest) (*StreamResponse[UpdateExternalStorageResponse], error) { var result UpdateExternalStorageResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateExternalStorageRequest, UpdateExternalStorageResponse](c, ctx, "PUT", "/api/v2/external_storage/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateExternalStorageRequest, UpdateExternalStorageResponse](c, ctx, "PUT", "/api/v2/external_storage/{name}",nil,request, &result,pathParams) return res, err } -func (c *Client) CheckExternalStorage(ctx context.Context, name string, request *CheckExternalStorageRequest) (*StreamResponse[CheckExternalStorageResponse], error) { +// +// +func (c *Client) CheckExternalStorage(ctx context.Context,name string, request *CheckExternalStorageRequest) (*StreamResponse[CheckExternalStorageResponse], error) { var result CheckExternalStorageResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, CheckExternalStorageResponse](c, ctx, "GET", "/api/v2/external_storage/{name}/check", nil, nil, &result, pathParams) + res, err := MakeRequest[any, CheckExternalStorageResponse](c, ctx, "GET", "/api/v2/external_storage/{name}/check",nil, nil, &result,pathParams) return res, err } +// +// func (c *Client) CreateGuest(ctx context.Context, request *CreateGuestRequest) (*StreamResponse[CreateGuestResponse], error) { var result CreateGuestResponse - res, err := MakeRequest[CreateGuestRequest, CreateGuestResponse](c, ctx, "POST", "/api/v2/guest", nil, request, &result, nil) + res, err := MakeRequest[CreateGuestRequest, CreateGuestResponse](c, ctx, "POST", "/api/v2/guest",nil,request, &result,nil) return res, err } // Creates a new import URL +// func (c *Client) CreateImportURL(ctx context.Context, request *CreateImportURLRequest) (*StreamResponse[CreateImportURLResponse], error) { var result CreateImportURLResponse - res, err := MakeRequest[CreateImportURLRequest, CreateImportURLResponse](c, ctx, "POST", "/api/v2/import_urls", nil, request, &result, nil) + res, err := MakeRequest[CreateImportURLRequest, CreateImportURLResponse](c, ctx, "POST", "/api/v2/import_urls",nil,request, &result,nil) return res, err } // Gets an import +// func (c *Client) ListImports(ctx context.Context, request *ListImportsRequest) (*StreamResponse[ListImportsResponse], error) { var result ListImportsResponse - res, err := MakeRequest[any, ListImportsResponse](c, ctx, "GET", "/api/v2/imports", nil, nil, &result, nil) + res, err := MakeRequest[any, ListImportsResponse](c, ctx, "GET", "/api/v2/imports",nil, nil, &result,nil) return res, err } // Creates a new import +// func (c *Client) CreateImport(ctx context.Context, request *CreateImportRequest) (*StreamResponse[CreateImportResponse], error) { var result CreateImportResponse - res, err := MakeRequest[CreateImportRequest, CreateImportResponse](c, ctx, "POST", "/api/v2/imports", nil, request, &result, nil) + res, err := MakeRequest[CreateImportRequest, CreateImportResponse](c, ctx, "POST", "/api/v2/imports",nil,request, &result,nil) return res, err } // Lists all import v2 tasks for the app +// func (c *Client) ListImportV2Tasks(ctx context.Context, request *ListImportV2TasksRequest) (*StreamResponse[ListImportV2TasksResponse], error) { var result ListImportV2TasksResponse params := extractQueryParams(request) - res, err := MakeRequest[any, ListImportV2TasksResponse](c, ctx, "GET", "/api/v2/imports/v2", params, nil, &result, nil) + res, err := MakeRequest[any, ListImportV2TasksResponse](c, ctx, "GET", "/api/v2/imports/v2",params, nil, &result,nil) return res, err } // Creates a new import v2 task +// func (c *Client) CreateImportV2Task(ctx context.Context, request *CreateImportV2TaskRequest) (*StreamResponse[CreateImportV2TaskResponse], error) { var result CreateImportV2TaskResponse - res, err := MakeRequest[CreateImportV2TaskRequest, CreateImportV2TaskResponse](c, ctx, "POST", "/api/v2/imports/v2", nil, request, &result, nil) + res, err := MakeRequest[CreateImportV2TaskRequest, CreateImportV2TaskResponse](c, ctx, "POST", "/api/v2/imports/v2",nil,request, &result,nil) return res, err } // Deletes an import v2 task. Can only delete tasks in queued state. -func (c *Client) DeleteImportV2Task(ctx context.Context, id string, request *DeleteImportV2TaskRequest) (*StreamResponse[DeleteImportV2TaskResponse], error) { +// +func (c *Client) DeleteImportV2Task(ctx context.Context,id string, request *DeleteImportV2TaskRequest) (*StreamResponse[DeleteImportV2TaskResponse], error) { var result DeleteImportV2TaskResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteImportV2TaskResponse](c, ctx, "DELETE", "/api/v2/imports/v2/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteImportV2TaskResponse](c, ctx, "DELETE", "/api/v2/imports/v2/{id}",nil, nil, &result,pathParams) return res, err } // Gets a single import v2 task by ID -func (c *Client) GetImportV2Task(ctx context.Context, id string, request *GetImportV2TaskRequest) (*StreamResponse[GetImportV2TaskResponse], error) { +// +func (c *Client) GetImportV2Task(ctx context.Context,id string, request *GetImportV2TaskRequest) (*StreamResponse[GetImportV2TaskResponse], error) { var result GetImportV2TaskResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetImportV2TaskResponse](c, ctx, "GET", "/api/v2/imports/v2/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetImportV2TaskResponse](c, ctx, "GET", "/api/v2/imports/v2/{id}",nil, nil, &result,pathParams) return res, err } // Gets an import -func (c *Client) GetImport(ctx context.Context, id string, request *GetImportRequest) (*StreamResponse[GetImportResponse], error) { +// +func (c *Client) GetImport(ctx context.Context,id string, request *GetImportRequest) (*StreamResponse[GetImportResponse], error) { var result GetImportResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetImportResponse](c, ctx, "GET", "/api/v2/imports/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetImportResponse](c, ctx, "GET", "/api/v2/imports/{id}",nil, nil, &result,pathParams) return res, err } // Get an OpenGraph attachment for a link +// func (c *Client) GetOG(ctx context.Context, request *GetOGRequest) (*StreamResponse[GetOGResponse], error) { var result GetOGResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetOGResponse](c, ctx, "GET", "/api/v2/og", params, nil, &result, nil) + res, err := MakeRequest[any, GetOGResponse](c, ctx, "GET", "/api/v2/og",params, nil, &result,nil) return res, err } // Lists all available permissions +// func (c *Client) ListPermissions(ctx context.Context, request *ListPermissionsRequest) (*StreamResponse[ListPermissionsResponse], error) { var result ListPermissionsResponse - res, err := MakeRequest[any, ListPermissionsResponse](c, ctx, "GET", "/api/v2/permissions", nil, nil, &result, nil) + res, err := MakeRequest[any, ListPermissionsResponse](c, ctx, "GET", "/api/v2/permissions",nil, nil, &result,nil) return res, err } // Gets custom permission -func (c *Client) GetPermission(ctx context.Context, id string, request *GetPermissionRequest) (*StreamResponse[GetCustomPermissionResponse], error) { +// +func (c *Client) GetPermission(ctx context.Context,id string, request *GetPermissionRequest) (*StreamResponse[GetCustomPermissionResponse], error) { var result GetCustomPermissionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetCustomPermissionResponse](c, ctx, "GET", "/api/v2/permissions/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetCustomPermissionResponse](c, ctx, "GET", "/api/v2/permissions/{id}",nil, nil, &result,pathParams) return res, err } // Creates a new poll +// func (c *Client) CreatePoll(ctx context.Context, request *CreatePollRequest) (*StreamResponse[PollResponse], error) { var result PollResponse - res, err := MakeRequest[CreatePollRequest, PollResponse](c, ctx, "POST", "/api/v2/polls", nil, request, &result, nil) + res, err := MakeRequest[CreatePollRequest, PollResponse](c, ctx, "POST", "/api/v2/polls",nil,request, &result,nil) return res, err } // Updates a poll -// +// // Sends events: // - feeds.poll.closed // - feeds.poll.updated // - poll.closed // - poll.updated +// func (c *Client) UpdatePoll(ctx context.Context, request *UpdatePollRequest) (*StreamResponse[PollResponse], error) { var result PollResponse - res, err := MakeRequest[UpdatePollRequest, PollResponse](c, ctx, "PUT", "/api/v2/polls", nil, request, &result, nil) + res, err := MakeRequest[UpdatePollRequest, PollResponse](c, ctx, "PUT", "/api/v2/polls",nil,request, &result,nil) return res, err } // Queries polls +// func (c *Client) QueryPolls(ctx context.Context, request *QueryPollsRequest) (*StreamResponse[QueryPollsResponse], error) { var result QueryPollsResponse params := extractQueryParams(request) - res, err := MakeRequest[QueryPollsRequest, QueryPollsResponse](c, ctx, "POST", "/api/v2/polls/query", params, request, &result, nil) + res, err := MakeRequest[QueryPollsRequest, QueryPollsResponse](c, ctx, "POST", "/api/v2/polls/query",params,request, &result,nil) return res, err } // Deletes a poll -// +// // Sends events: // - feeds.poll.deleted // - poll.deleted -func (c *Client) DeletePoll(ctx context.Context, pollID string, request *DeletePollRequest) (*StreamResponse[Response], error) { +// +func (c *Client) DeletePoll(ctx context.Context,pollID string, request *DeletePollRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "poll_id": pollID, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/polls/{poll_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/polls/{poll_id}",params, nil, &result,pathParams) return res, err } // Retrieves a poll -func (c *Client) GetPoll(ctx context.Context, pollID string, request *GetPollRequest) (*StreamResponse[PollResponse], error) { +// +func (c *Client) GetPoll(ctx context.Context,pollID string, request *GetPollRequest) (*StreamResponse[PollResponse], error) { var result PollResponse pathParams := map[string]string{ "poll_id": pollID, } params := extractQueryParams(request) - res, err := MakeRequest[any, PollResponse](c, ctx, "GET", "/api/v2/polls/{poll_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, PollResponse](c, ctx, "GET", "/api/v2/polls/{poll_id}",params, nil, &result,pathParams) return res, err } // Updates a poll partially -// +// // Sends events: // - feeds.poll.closed // - feeds.poll.updated // - poll.closed // - poll.updated -func (c *Client) UpdatePollPartial(ctx context.Context, pollID string, request *UpdatePollPartialRequest) (*StreamResponse[PollResponse], error) { +// +func (c *Client) UpdatePollPartial(ctx context.Context,pollID string, request *UpdatePollPartialRequest) (*StreamResponse[PollResponse], error) { var result PollResponse pathParams := map[string]string{ "poll_id": pollID, } - res, err := MakeRequest[UpdatePollPartialRequest, PollResponse](c, ctx, "PATCH", "/api/v2/polls/{poll_id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdatePollPartialRequest, PollResponse](c, ctx, "PATCH", "/api/v2/polls/{poll_id}",nil,request, &result,pathParams) return res, err } // Creates a poll option -// +// // Sends events: // - feeds.poll.updated // - poll.updated -func (c *Client) CreatePollOption(ctx context.Context, pollID string, request *CreatePollOptionRequest) (*StreamResponse[PollOptionResponse], error) { +// +func (c *Client) CreatePollOption(ctx context.Context,pollID string, request *CreatePollOptionRequest) (*StreamResponse[PollOptionResponse], error) { var result PollOptionResponse pathParams := map[string]string{ "poll_id": pollID, } - res, err := MakeRequest[CreatePollOptionRequest, PollOptionResponse](c, ctx, "POST", "/api/v2/polls/{poll_id}/options", nil, request, &result, pathParams) + res, err := MakeRequest[CreatePollOptionRequest, PollOptionResponse](c, ctx, "POST", "/api/v2/polls/{poll_id}/options",nil,request, &result,pathParams) return res, err } // Updates a poll option -// +// // Sends events: // - feeds.poll.updated // - poll.updated -func (c *Client) UpdatePollOption(ctx context.Context, pollID string, request *UpdatePollOptionRequest) (*StreamResponse[PollOptionResponse], error) { +// +func (c *Client) UpdatePollOption(ctx context.Context,pollID string, request *UpdatePollOptionRequest) (*StreamResponse[PollOptionResponse], error) { var result PollOptionResponse pathParams := map[string]string{ "poll_id": pollID, } - res, err := MakeRequest[UpdatePollOptionRequest, PollOptionResponse](c, ctx, "PUT", "/api/v2/polls/{poll_id}/options", nil, request, &result, pathParams) + res, err := MakeRequest[UpdatePollOptionRequest, PollOptionResponse](c, ctx, "PUT", "/api/v2/polls/{poll_id}/options",nil,request, &result,pathParams) return res, err } // Deletes a poll option -// +// // Sends events: // - feeds.poll.updated // - poll.updated -func (c *Client) DeletePollOption(ctx context.Context, pollID string, optionID string, request *DeletePollOptionRequest) (*StreamResponse[Response], error) { +// +func (c *Client) DeletePollOption(ctx context.Context,pollID string, optionID string, request *DeletePollOptionRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ - "poll_id": pollID, + "poll_id": pollID, "option_id": optionID, } params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/polls/{poll_id}/options/{option_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/polls/{poll_id}/options/{option_id}",params, nil, &result,pathParams) return res, err } // Retrieves a poll option -func (c *Client) GetPollOption(ctx context.Context, pollID string, optionID string, request *GetPollOptionRequest) (*StreamResponse[PollOptionResponse], error) { +// +func (c *Client) GetPollOption(ctx context.Context,pollID string, optionID string, request *GetPollOptionRequest) (*StreamResponse[PollOptionResponse], error) { var result PollOptionResponse pathParams := map[string]string{ - "poll_id": pollID, + "poll_id": pollID, "option_id": optionID, } params := extractQueryParams(request) - res, err := MakeRequest[any, PollOptionResponse](c, ctx, "GET", "/api/v2/polls/{poll_id}/options/{option_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, PollOptionResponse](c, ctx, "GET", "/api/v2/polls/{poll_id}/options/{option_id}",params, nil, &result,pathParams) return res, err } // Queries votes -func (c *Client) QueryPollVotes(ctx context.Context, pollID string, request *QueryPollVotesRequest) (*StreamResponse[PollVotesResponse], error) { +// +func (c *Client) QueryPollVotes(ctx context.Context,pollID string, request *QueryPollVotesRequest) (*StreamResponse[PollVotesResponse], error) { var result PollVotesResponse pathParams := map[string]string{ "poll_id": pollID, } params := extractQueryParams(request) - res, err := MakeRequest[QueryPollVotesRequest, PollVotesResponse](c, ctx, "POST", "/api/v2/polls/{poll_id}/votes", params, request, &result, pathParams) + res, err := MakeRequest[QueryPollVotesRequest, PollVotesResponse](c, ctx, "POST", "/api/v2/polls/{poll_id}/votes",params,request, &result,pathParams) return res, err } // Upserts the push preferences for a user and or channel member. Set to all, mentions or none +// func (c *Client) UpdatePushNotificationPreferences(ctx context.Context, request *UpdatePushNotificationPreferencesRequest) (*StreamResponse[UpsertPushPreferencesResponse], error) { var result UpsertPushPreferencesResponse - res, err := MakeRequest[UpdatePushNotificationPreferencesRequest, UpsertPushPreferencesResponse](c, ctx, "POST", "/api/v2/push_preferences", nil, request, &result, nil) + res, err := MakeRequest[UpdatePushNotificationPreferencesRequest, UpsertPushPreferencesResponse](c, ctx, "POST", "/api/v2/push_preferences",nil,request, &result,nil) return res, err } // List details of all push providers. +// func (c *Client) ListPushProviders(ctx context.Context, request *ListPushProvidersRequest) (*StreamResponse[ListPushProvidersResponse], error) { var result ListPushProvidersResponse - res, err := MakeRequest[any, ListPushProvidersResponse](c, ctx, "GET", "/api/v2/push_providers", nil, nil, &result, nil) + res, err := MakeRequest[any, ListPushProvidersResponse](c, ctx, "GET", "/api/v2/push_providers",nil, nil, &result,nil) return res, err } // Upsert a push provider for v2 with multi bundle/package support +// func (c *Client) UpsertPushProvider(ctx context.Context, request *UpsertPushProviderRequest) (*StreamResponse[UpsertPushProviderResponse], error) { var result UpsertPushProviderResponse - res, err := MakeRequest[UpsertPushProviderRequest, UpsertPushProviderResponse](c, ctx, "POST", "/api/v2/push_providers", nil, request, &result, nil) + res, err := MakeRequest[UpsertPushProviderRequest, UpsertPushProviderResponse](c, ctx, "POST", "/api/v2/push_providers",nil,request, &result,nil) return res, err } // Delete a push provider from v2 with multi bundle/package support. v1 isn't supported in this endpoint -func (c *Client) DeletePushProvider(ctx context.Context, _type string, name string, request *DeletePushProviderRequest) (*StreamResponse[Response], error) { +// +func (c *Client) DeletePushProvider(ctx context.Context,_type string, name string, request *DeletePushProviderRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "type": _type, "name": name, } - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/push_providers/{type}/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/push_providers/{type}/{name}",nil, nil, &result,pathParams) return res, err } // Retrieve push notification templates for Chat. +// func (c *Client) GetPushTemplates(ctx context.Context, request *GetPushTemplatesRequest) (*StreamResponse[GetPushTemplatesResponse], error) { var result GetPushTemplatesResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetPushTemplatesResponse](c, ctx, "GET", "/api/v2/push_templates", params, nil, &result, nil) + res, err := MakeRequest[any, GetPushTemplatesResponse](c, ctx, "GET", "/api/v2/push_templates",params, nil, &result,nil) return res, err } // Create or update a push notification template for a specific event type and push provider +// func (c *Client) UpsertPushTemplate(ctx context.Context, request *UpsertPushTemplateRequest) (*StreamResponse[UpsertPushTemplateResponse], error) { var result UpsertPushTemplateResponse - res, err := MakeRequest[UpsertPushTemplateRequest, UpsertPushTemplateResponse](c, ctx, "POST", "/api/v2/push_templates", nil, request, &result, nil) + res, err := MakeRequest[UpsertPushTemplateRequest, UpsertPushTemplateResponse](c, ctx, "POST", "/api/v2/push_templates",nil,request, &result,nil) return res, err } // Get rate limits usage and quotas +// func (c *Client) GetRateLimits(ctx context.Context, request *GetRateLimitsRequest) (*StreamResponse[GetRateLimitsResponse], error) { var result GetRateLimitsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetRateLimitsResponse](c, ctx, "GET", "/api/v2/rate_limits", params, nil, &result, nil) + res, err := MakeRequest[any, GetRateLimitsResponse](c, ctx, "GET", "/api/v2/rate_limits",params, nil, &result,nil) return res, err } // Lists all available roles +// func (c *Client) ListRoles(ctx context.Context, request *ListRolesRequest) (*StreamResponse[ListRolesResponse], error) { var result ListRolesResponse - res, err := MakeRequest[any, ListRolesResponse](c, ctx, "GET", "/api/v2/roles", nil, nil, &result, nil) + res, err := MakeRequest[any, ListRolesResponse](c, ctx, "GET", "/api/v2/roles",nil, nil, &result,nil) return res, err } // Creates custom role +// func (c *Client) CreateRole(ctx context.Context, request *CreateRoleRequest) (*StreamResponse[CreateRoleResponse], error) { var result CreateRoleResponse - res, err := MakeRequest[CreateRoleRequest, CreateRoleResponse](c, ctx, "POST", "/api/v2/roles", nil, request, &result, nil) + res, err := MakeRequest[CreateRoleRequest, CreateRoleResponse](c, ctx, "POST", "/api/v2/roles",nil,request, &result,nil) return res, err } // Deletes custom role -func (c *Client) DeleteRole(ctx context.Context, name string, request *DeleteRoleRequest) (*StreamResponse[Response], error) { +// +func (c *Client) DeleteRole(ctx context.Context,name string, request *DeleteRoleRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/roles/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/roles/{name}",nil, nil, &result,pathParams) return res, err } // Gets status of a task -func (c *Client) GetTask(ctx context.Context, id string, request *GetTaskRequest) (*StreamResponse[GetTaskResponse], error) { +// +func (c *Client) GetTask(ctx context.Context,id string, request *GetTaskRequest) (*StreamResponse[GetTaskResponse], error) { var result GetTaskResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetTaskResponse](c, ctx, "GET", "/api/v2/tasks/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetTaskResponse](c, ctx, "GET", "/api/v2/tasks/{id}",nil, nil, &result,pathParams) return res, err } // Deletes previously uploaded file +// func (c *Client) DeleteFile(ctx context.Context, request *DeleteFileRequest) (*StreamResponse[Response], error) { var result Response params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/uploads/file", params, nil, &result, nil) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/uploads/file",params, nil, &result,nil) return res, err } // Uploads file +// func (c *Client) UploadFile(ctx context.Context, request *UploadFileRequest) (*StreamResponse[FileUploadResponse], error) { var result FileUploadResponse - res, err := MakeRequest[UploadFileRequest, FileUploadResponse](c, ctx, "POST", "/api/v2/uploads/file", nil, request, &result, nil) + res, err := MakeRequest[UploadFileRequest, FileUploadResponse](c, ctx, "POST", "/api/v2/uploads/file",nil,request, &result,nil) return res, err } // Deletes previously uploaded image +// func (c *Client) DeleteImage(ctx context.Context, request *DeleteImageRequest) (*StreamResponse[Response], error) { var result Response params := extractQueryParams(request) - res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/uploads/image", params, nil, &result, nil) + res, err := MakeRequest[any, Response](c, ctx, "DELETE", "/api/v2/uploads/image",params, nil, &result,nil) return res, err } // Uploads image +// func (c *Client) UploadImage(ctx context.Context, request *UploadImageRequest) (*StreamResponse[ImageUploadResponse], error) { var result ImageUploadResponse - res, err := MakeRequest[UploadImageRequest, ImageUploadResponse](c, ctx, "POST", "/api/v2/uploads/image", nil, request, &result, nil) + res, err := MakeRequest[UploadImageRequest, ImageUploadResponse](c, ctx, "POST", "/api/v2/uploads/image",nil,request, &result,nil) return res, err } // Find and filter users +// func (c *Client) QueryUsers(ctx context.Context, request *QueryUsersRequest) (*StreamResponse[QueryUsersResponse], error) { var result QueryUsersResponse params := extractQueryParams(request) - res, err := MakeRequest[any, QueryUsersResponse](c, ctx, "GET", "/api/v2/users", params, nil, &result, nil) + res, err := MakeRequest[any, QueryUsersResponse](c, ctx, "GET", "/api/v2/users",params, nil, &result,nil) return res, err } // Updates certain fields of the user -// +// // 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) + res, err := MakeRequest[UpdateUsersPartialRequest, UpdateUsersResponse](c, ctx, "PATCH", "/api/v2/users",nil,request, &result,nil) return res, err } // Update or create users in bulk -// +// // Sends events: // - user.updated +// func (c *Client) UpdateUsers(ctx context.Context, request *UpdateUsersRequest) (*StreamResponse[UpdateUsersResponse], error) { var result UpdateUsersResponse - res, err := MakeRequest[UpdateUsersRequest, UpdateUsersResponse](c, ctx, "POST", "/api/v2/users", nil, request, &result, nil) + res, err := MakeRequest[UpdateUsersRequest, UpdateUsersResponse](c, ctx, "POST", "/api/v2/users",nil,request, &result,nil) return res, err } // Get list of blocked Users +// func (c *Client) GetBlockedUsers(ctx context.Context, request *GetBlockedUsersRequest) (*StreamResponse[GetBlockedUsersResponse], error) { var result GetBlockedUsersResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetBlockedUsersResponse](c, ctx, "GET", "/api/v2/users/block", params, nil, &result, nil) + res, err := MakeRequest[any, GetBlockedUsersResponse](c, ctx, "GET", "/api/v2/users/block",params, nil, &result,nil) return res, err } // Block users +// func (c *Client) BlockUsers(ctx context.Context, request *BlockUsersRequest) (*StreamResponse[BlockUsersResponse], error) { var result BlockUsersResponse - res, err := MakeRequest[BlockUsersRequest, BlockUsersResponse](c, ctx, "POST", "/api/v2/users/block", nil, request, &result, nil) + res, err := MakeRequest[BlockUsersRequest, BlockUsersResponse](c, ctx, "POST", "/api/v2/users/block",nil,request, &result,nil) return res, err } // Deactivate users in batches -// +// // Sends events: // - user.deactivated +// func (c *Client) DeactivateUsers(ctx context.Context, request *DeactivateUsersRequest) (*StreamResponse[DeactivateUsersResponse], error) { var result DeactivateUsersResponse - res, err := MakeRequest[DeactivateUsersRequest, DeactivateUsersResponse](c, ctx, "POST", "/api/v2/users/deactivate", nil, request, &result, nil) + res, err := MakeRequest[DeactivateUsersRequest, DeactivateUsersResponse](c, ctx, "POST", "/api/v2/users/deactivate",nil,request, &result,nil) return res, err } // Deletes users and optionally all their belongings asynchronously. -// +// // Sends events: // - channel.deleted // - user.deleted +// func (c *Client) DeleteUsers(ctx context.Context, request *DeleteUsersRequest) (*StreamResponse[DeleteUsersResponse], error) { var result DeleteUsersResponse - res, err := MakeRequest[DeleteUsersRequest, DeleteUsersResponse](c, ctx, "POST", "/api/v2/users/delete", nil, request, &result, nil) + res, err := MakeRequest[DeleteUsersRequest, DeleteUsersResponse](c, ctx, "POST", "/api/v2/users/delete",nil,request, &result,nil) return res, err } // Retrieves all active live locations for a user +// func (c *Client) GetUserLiveLocations(ctx context.Context, request *GetUserLiveLocationsRequest) (*StreamResponse[SharedLocationsResponse], error) { var result SharedLocationsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, SharedLocationsResponse](c, ctx, "GET", "/api/v2/users/live_locations", params, nil, &result, nil) + res, err := MakeRequest[any, SharedLocationsResponse](c, ctx, "GET", "/api/v2/users/live_locations",params, nil, &result,nil) return res, err } // Updates an existing live location with new coordinates or expiration time +// func (c *Client) UpdateLiveLocation(ctx context.Context, request *UpdateLiveLocationRequest) (*StreamResponse[SharedLocationResponse], error) { var result SharedLocationResponse params := extractQueryParams(request) - res, err := MakeRequest[UpdateLiveLocationRequest, SharedLocationResponse](c, ctx, "PUT", "/api/v2/users/live_locations", params, request, &result, nil) + res, err := MakeRequest[UpdateLiveLocationRequest, SharedLocationResponse](c, ctx, "PUT", "/api/v2/users/live_locations",params,request, &result,nil) return res, err } // Reactivate users in batches -// +// // 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) + res, err := MakeRequest[ReactivateUsersRequest, ReactivateUsersResponse](c, ctx, "POST", "/api/v2/users/reactivate",nil,request, &result,nil) return res, err } // Restore soft deleted users +// func (c *Client) RestoreUsers(ctx context.Context, request *RestoreUsersRequest) (*StreamResponse[Response], error) { var result Response - res, err := MakeRequest[RestoreUsersRequest, Response](c, ctx, "POST", "/api/v2/users/restore", nil, request, &result, nil) + res, err := MakeRequest[RestoreUsersRequest, Response](c, ctx, "POST", "/api/v2/users/restore",nil,request, &result,nil) return res, err } // Unblock users +// func (c *Client) UnblockUsers(ctx context.Context, request *UnblockUsersRequest) (*StreamResponse[UnblockUsersResponse], error) { var result UnblockUsersResponse - res, err := MakeRequest[UnblockUsersRequest, UnblockUsersResponse](c, ctx, "POST", "/api/v2/users/unblock", nil, request, &result, nil) + res, err := MakeRequest[UnblockUsersRequest, UnblockUsersResponse](c, ctx, "POST", "/api/v2/users/unblock",nil,request, &result,nil) return res, err } // Deactivates user with possibility to activate it back -// +// // Sends events: // - user.deactivated -func (c *Client) DeactivateUser(ctx context.Context, userID string, request *DeactivateUserRequest) (*StreamResponse[DeactivateUserResponse], error) { +// +func (c *Client) DeactivateUser(ctx context.Context,userID string, request *DeactivateUserRequest) (*StreamResponse[DeactivateUserResponse], error) { var result DeactivateUserResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[DeactivateUserRequest, DeactivateUserResponse](c, ctx, "POST", "/api/v2/users/{user_id}/deactivate", nil, request, &result, pathParams) + res, err := MakeRequest[DeactivateUserRequest, DeactivateUserResponse](c, ctx, "POST", "/api/v2/users/{user_id}/deactivate",nil,request, &result,pathParams) return res, err } // Exports the user's profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions -func (c *Client) ExportUser(ctx context.Context, userID string, request *ExportUserRequest) (*StreamResponse[ExportUserResponse], error) { +// +func (c *Client) ExportUser(ctx context.Context,userID string, request *ExportUserRequest) (*StreamResponse[ExportUserResponse], error) { var result ExportUserResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[any, ExportUserResponse](c, ctx, "GET", "/api/v2/users/{user_id}/export", nil, nil, &result, pathParams) + res, err := MakeRequest[any, ExportUserResponse](c, ctx, "GET", "/api/v2/users/{user_id}/export",nil, nil, &result,pathParams) return res, err } // Activates user who's been deactivated previously -// +// // Sends events: // - user.reactivated -func (c *Client) ReactivateUser(ctx context.Context, userID string, request *ReactivateUserRequest) (*StreamResponse[ReactivateUserResponse], error) { +// +func (c *Client) ReactivateUser(ctx context.Context,userID string, request *ReactivateUserRequest) (*StreamResponse[ReactivateUserResponse], error) { var result ReactivateUserResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[ReactivateUserRequest, ReactivateUserResponse](c, ctx, "POST", "/api/v2/users/{user_id}/reactivate", nil, request, &result, pathParams) + res, err := MakeRequest[ReactivateUserRequest, ReactivateUserResponse](c, ctx, "POST", "/api/v2/users/{user_id}/reactivate",nil,request, &result,pathParams) return res, err } diff --git a/common_test.go b/common_test.go index 855b794..ca0381e 100644 --- a/common_test.go +++ b/common_test.go @@ -2,500 +2,499 @@ package getstream_test import ( - "context" - "testing" + "context" + "testing" - "github.com/GetStream/getstream-go/v3" - "github.com/stretchr/testify/require" + "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/require" ) - -func TestCommonGetApp(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetApp(context.Background(), &getstream.GetAppRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateApp(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateApp(context.Background(), &getstream.UpdateAppRequest{}) - require.NoError(t, err) -} -func TestCommonListBlockLists(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListBlockLists(context.Background(), &getstream.ListBlockListsRequest{}) - require.NoError(t, err) -} -func TestCommonCreateBlockList(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateBlockList(context.Background(), &getstream.CreateBlockListRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteBlockList(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteBlockList(context.Background(), "", &getstream.DeleteBlockListRequest{}) - require.NoError(t, err) -} -func TestCommonGetBlockList(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetBlockList(context.Background(), "", &getstream.GetBlockListRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateBlockList(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateBlockList(context.Background(), "", &getstream.UpdateBlockListRequest{}) - require.NoError(t, err) -} -func TestCommonCheckPush(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CheckPush(context.Background(), &getstream.CheckPushRequest{}) - require.NoError(t, err) -} -func TestCommonCheckSNS(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CheckSNS(context.Background(), &getstream.CheckSNSRequest{}) - require.NoError(t, err) -} -func TestCommonCheckSQS(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CheckSQS(context.Background(), &getstream.CheckSQSRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteDevice(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteDevice(context.Background(), &getstream.DeleteDeviceRequest{}) - require.NoError(t, err) -} -func TestCommonListDevices(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListDevices(context.Background(), &getstream.ListDevicesRequest{}) - require.NoError(t, err) -} -func TestCommonCreateDevice(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateDevice(context.Background(), &getstream.CreateDeviceRequest{}) - require.NoError(t, err) -} -func TestCommonExportUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ExportUsers(context.Background(), &getstream.ExportUsersRequest{}) - require.NoError(t, err) -} -func TestCommonListExternalStorage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListExternalStorage(context.Background(), &getstream.ListExternalStorageRequest{}) - require.NoError(t, err) -} -func TestCommonCreateExternalStorage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateExternalStorage(context.Background(), &getstream.CreateExternalStorageRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteExternalStorage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteExternalStorage(context.Background(), "", &getstream.DeleteExternalStorageRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateExternalStorage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateExternalStorage(context.Background(), "", &getstream.UpdateExternalStorageRequest{}) - require.NoError(t, err) -} -func TestCommonCheckExternalStorage(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CheckExternalStorage(context.Background(), "", &getstream.CheckExternalStorageRequest{}) - require.NoError(t, err) -} -func TestCommonCreateGuest(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateGuest(context.Background(), &getstream.CreateGuestRequest{}) - require.NoError(t, err) -} -func TestCommonCreateImportURL(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateImportURL(context.Background(), &getstream.CreateImportURLRequest{}) - require.NoError(t, err) -} -func TestCommonListImports(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListImports(context.Background(), &getstream.ListImportsRequest{}) - require.NoError(t, err) -} -func TestCommonCreateImport(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateImport(context.Background(), &getstream.CreateImportRequest{}) - require.NoError(t, err) -} -func TestCommonListImportV2Tasks(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListImportV2Tasks(context.Background(), &getstream.ListImportV2TasksRequest{}) - require.NoError(t, err) -} -func TestCommonCreateImportV2Task(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateImportV2Task(context.Background(), &getstream.CreateImportV2TaskRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteImportV2Task(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteImportV2Task(context.Background(), "", &getstream.DeleteImportV2TaskRequest{}) - require.NoError(t, err) -} -func TestCommonGetImportV2Task(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetImportV2Task(context.Background(), "", &getstream.GetImportV2TaskRequest{}) - require.NoError(t, err) -} -func TestCommonGetImport(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetImport(context.Background(), "", &getstream.GetImportRequest{}) - require.NoError(t, err) -} -func TestCommonGetOG(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetOG(context.Background(), &getstream.GetOGRequest{}) - require.NoError(t, err) -} -func TestCommonListPermissions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListPermissions(context.Background(), &getstream.ListPermissionsRequest{}) - require.NoError(t, err) -} -func TestCommonGetPermission(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetPermission(context.Background(), "", &getstream.GetPermissionRequest{}) - require.NoError(t, err) -} -func TestCommonCreatePoll(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreatePoll(context.Background(), &getstream.CreatePollRequest{}) - require.NoError(t, err) -} -func TestCommonUpdatePoll(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdatePoll(context.Background(), &getstream.UpdatePollRequest{}) - require.NoError(t, err) -} -func TestCommonQueryPolls(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.QueryPolls(context.Background(), &getstream.QueryPollsRequest{}) - require.NoError(t, err) -} -func TestCommonDeletePoll(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeletePoll(context.Background(), "", &getstream.DeletePollRequest{}) - require.NoError(t, err) -} -func TestCommonGetPoll(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetPoll(context.Background(), "", &getstream.GetPollRequest{}) - require.NoError(t, err) -} -func TestCommonUpdatePollPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdatePollPartial(context.Background(), "", &getstream.UpdatePollPartialRequest{}) - require.NoError(t, err) -} -func TestCommonCreatePollOption(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreatePollOption(context.Background(), "", &getstream.CreatePollOptionRequest{}) - require.NoError(t, err) -} -func TestCommonUpdatePollOption(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdatePollOption(context.Background(), "", &getstream.UpdatePollOptionRequest{}) - require.NoError(t, err) -} -func TestCommonDeletePollOption(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeletePollOption(context.Background(), "", "", &getstream.DeletePollOptionRequest{}) - require.NoError(t, err) -} -func TestCommonGetPollOption(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetPollOption(context.Background(), "", "", &getstream.GetPollOptionRequest{}) - require.NoError(t, err) -} -func TestCommonQueryPollVotes(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.QueryPollVotes(context.Background(), "", &getstream.QueryPollVotesRequest{}) - require.NoError(t, err) -} -func TestCommonUpdatePushNotificationPreferences(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdatePushNotificationPreferences(context.Background(), &getstream.UpdatePushNotificationPreferencesRequest{}) - require.NoError(t, err) -} -func TestCommonListPushProviders(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListPushProviders(context.Background(), &getstream.ListPushProvidersRequest{}) - require.NoError(t, err) -} -func TestCommonUpsertPushProvider(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpsertPushProvider(context.Background(), &getstream.UpsertPushProviderRequest{}) - require.NoError(t, err) -} -func TestCommonDeletePushProvider(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeletePushProvider(context.Background(), "", "", &getstream.DeletePushProviderRequest{}) - require.NoError(t, err) -} -func TestCommonGetPushTemplates(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetPushTemplates(context.Background(), &getstream.GetPushTemplatesRequest{}) - require.NoError(t, err) -} -func TestCommonUpsertPushTemplate(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpsertPushTemplate(context.Background(), &getstream.UpsertPushTemplateRequest{}) - require.NoError(t, err) -} -func TestCommonGetRateLimits(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetRateLimits(context.Background(), &getstream.GetRateLimitsRequest{}) - require.NoError(t, err) -} -func TestCommonListRoles(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ListRoles(context.Background(), &getstream.ListRolesRequest{}) - require.NoError(t, err) -} -func TestCommonCreateRole(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.CreateRole(context.Background(), &getstream.CreateRoleRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteRole(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteRole(context.Background(), "", &getstream.DeleteRoleRequest{}) - require.NoError(t, err) -} -func TestCommonGetTask(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetTask(context.Background(), "", &getstream.GetTaskRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteFile(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteFile(context.Background(), &getstream.DeleteFileRequest{}) - require.NoError(t, err) -} -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 TestCommonQueryUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.QueryUsers(context.Background(), &getstream.QueryUsersRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateUsersPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateUsersPartial(context.Background(), &getstream.UpdateUsersPartialRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateUsers(context.Background(), &getstream.UpdateUsersRequest{}) - require.NoError(t, err) -} -func TestCommonGetBlockedUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetBlockedUsers(context.Background(), &getstream.GetBlockedUsersRequest{}) - require.NoError(t, err) -} -func TestCommonBlockUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.BlockUsers(context.Background(), &getstream.BlockUsersRequest{}) - require.NoError(t, err) -} -func TestCommonDeactivateUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeactivateUsers(context.Background(), &getstream.DeactivateUsersRequest{}) - require.NoError(t, err) -} -func TestCommonDeleteUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeleteUsers(context.Background(), &getstream.DeleteUsersRequest{}) - require.NoError(t, err) -} -func TestCommonGetUserLiveLocations(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.GetUserLiveLocations(context.Background(), &getstream.GetUserLiveLocationsRequest{}) - require.NoError(t, err) -} -func TestCommonUpdateLiveLocation(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UpdateLiveLocation(context.Background(), &getstream.UpdateLiveLocationRequest{}) - require.NoError(t, err) -} -func TestCommonReactivateUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ReactivateUsers(context.Background(), &getstream.ReactivateUsersRequest{}) - require.NoError(t, err) -} -func TestCommonRestoreUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.RestoreUsers(context.Background(), &getstream.RestoreUsersRequest{}) - require.NoError(t, err) -} -func TestCommonUnblockUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.UnblockUsers(context.Background(), &getstream.UnblockUsersRequest{}) - require.NoError(t, err) -} -func TestCommonDeactivateUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.DeactivateUser(context.Background(), "", &getstream.DeactivateUserRequest{}) - require.NoError(t, err) -} -func TestCommonExportUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ExportUser(context.Background(), "", &getstream.ExportUserRequest{}) - require.NoError(t, err) -} -func TestCommonReactivateUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.ReactivateUser(context.Background(), "", &getstream.ReactivateUserRequest{}) - require.NoError(t, err) -} + func TestCommonGetApp(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetApp(context.Background(),&getstream.GetAppRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateApp(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateApp(context.Background(),&getstream.UpdateAppRequest{}) + require.NoError(t, err) + } + func TestCommonListBlockLists(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListBlockLists(context.Background(),&getstream.ListBlockListsRequest{}) + require.NoError(t, err) + } + func TestCommonCreateBlockList(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateBlockList(context.Background(),&getstream.CreateBlockListRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteBlockList(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteBlockList(context.Background(),"", &getstream.DeleteBlockListRequest{}) + require.NoError(t, err) + } + func TestCommonGetBlockList(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetBlockList(context.Background(),"", &getstream.GetBlockListRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateBlockList(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateBlockList(context.Background(),"", &getstream.UpdateBlockListRequest{}) + require.NoError(t, err) + } + func TestCommonCheckPush(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CheckPush(context.Background(),&getstream.CheckPushRequest{}) + require.NoError(t, err) + } + func TestCommonCheckSNS(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CheckSNS(context.Background(),&getstream.CheckSNSRequest{}) + require.NoError(t, err) + } + func TestCommonCheckSQS(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CheckSQS(context.Background(),&getstream.CheckSQSRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteDevice(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteDevice(context.Background(),&getstream.DeleteDeviceRequest{}) + require.NoError(t, err) + } + func TestCommonListDevices(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListDevices(context.Background(),&getstream.ListDevicesRequest{}) + require.NoError(t, err) + } + func TestCommonCreateDevice(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateDevice(context.Background(),&getstream.CreateDeviceRequest{}) + require.NoError(t, err) + } + func TestCommonExportUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ExportUsers(context.Background(),&getstream.ExportUsersRequest{}) + require.NoError(t, err) + } + func TestCommonListExternalStorage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListExternalStorage(context.Background(),&getstream.ListExternalStorageRequest{}) + require.NoError(t, err) + } + func TestCommonCreateExternalStorage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateExternalStorage(context.Background(),&getstream.CreateExternalStorageRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteExternalStorage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteExternalStorage(context.Background(),"", &getstream.DeleteExternalStorageRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateExternalStorage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateExternalStorage(context.Background(),"", &getstream.UpdateExternalStorageRequest{}) + require.NoError(t, err) + } + func TestCommonCheckExternalStorage(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CheckExternalStorage(context.Background(),"", &getstream.CheckExternalStorageRequest{}) + require.NoError(t, err) + } + func TestCommonCreateGuest(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateGuest(context.Background(),&getstream.CreateGuestRequest{}) + require.NoError(t, err) + } + func TestCommonCreateImportURL(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateImportURL(context.Background(),&getstream.CreateImportURLRequest{}) + require.NoError(t, err) + } + func TestCommonListImports(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListImports(context.Background(),&getstream.ListImportsRequest{}) + require.NoError(t, err) + } + func TestCommonCreateImport(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateImport(context.Background(),&getstream.CreateImportRequest{}) + require.NoError(t, err) + } + func TestCommonListImportV2Tasks(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListImportV2Tasks(context.Background(),&getstream.ListImportV2TasksRequest{}) + require.NoError(t, err) + } + func TestCommonCreateImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateImportV2Task(context.Background(),&getstream.CreateImportV2TaskRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteImportV2Task(context.Background(),"", &getstream.DeleteImportV2TaskRequest{}) + require.NoError(t, err) + } + func TestCommonGetImportV2Task(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetImportV2Task(context.Background(),"", &getstream.GetImportV2TaskRequest{}) + require.NoError(t, err) + } + func TestCommonGetImport(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetImport(context.Background(),"", &getstream.GetImportRequest{}) + require.NoError(t, err) + } + func TestCommonGetOG(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetOG(context.Background(),&getstream.GetOGRequest{}) + require.NoError(t, err) + } + func TestCommonListPermissions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListPermissions(context.Background(),&getstream.ListPermissionsRequest{}) + require.NoError(t, err) + } + func TestCommonGetPermission(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetPermission(context.Background(),"", &getstream.GetPermissionRequest{}) + require.NoError(t, err) + } + func TestCommonCreatePoll(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreatePoll(context.Background(),&getstream.CreatePollRequest{}) + require.NoError(t, err) + } + func TestCommonUpdatePoll(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdatePoll(context.Background(),&getstream.UpdatePollRequest{}) + require.NoError(t, err) + } + func TestCommonQueryPolls(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.QueryPolls(context.Background(),&getstream.QueryPollsRequest{}) + require.NoError(t, err) + } + func TestCommonDeletePoll(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeletePoll(context.Background(),"", &getstream.DeletePollRequest{}) + require.NoError(t, err) + } + func TestCommonGetPoll(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetPoll(context.Background(),"", &getstream.GetPollRequest{}) + require.NoError(t, err) + } + func TestCommonUpdatePollPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdatePollPartial(context.Background(),"", &getstream.UpdatePollPartialRequest{}) + require.NoError(t, err) + } + func TestCommonCreatePollOption(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreatePollOption(context.Background(),"", &getstream.CreatePollOptionRequest{}) + require.NoError(t, err) + } + func TestCommonUpdatePollOption(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdatePollOption(context.Background(),"", &getstream.UpdatePollOptionRequest{}) + require.NoError(t, err) + } + func TestCommonDeletePollOption(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeletePollOption(context.Background(),"", "", &getstream.DeletePollOptionRequest{}) + require.NoError(t, err) + } + func TestCommonGetPollOption(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetPollOption(context.Background(),"", "", &getstream.GetPollOptionRequest{}) + require.NoError(t, err) + } + func TestCommonQueryPollVotes(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.QueryPollVotes(context.Background(),"", &getstream.QueryPollVotesRequest{}) + require.NoError(t, err) + } + func TestCommonUpdatePushNotificationPreferences(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdatePushNotificationPreferences(context.Background(),&getstream.UpdatePushNotificationPreferencesRequest{}) + require.NoError(t, err) + } + func TestCommonListPushProviders(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListPushProviders(context.Background(),&getstream.ListPushProvidersRequest{}) + require.NoError(t, err) + } + func TestCommonUpsertPushProvider(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpsertPushProvider(context.Background(),&getstream.UpsertPushProviderRequest{}) + require.NoError(t, err) + } + func TestCommonDeletePushProvider(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeletePushProvider(context.Background(),"", "", &getstream.DeletePushProviderRequest{}) + require.NoError(t, err) + } + func TestCommonGetPushTemplates(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetPushTemplates(context.Background(),&getstream.GetPushTemplatesRequest{}) + require.NoError(t, err) + } + func TestCommonUpsertPushTemplate(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpsertPushTemplate(context.Background(),&getstream.UpsertPushTemplateRequest{}) + require.NoError(t, err) + } + func TestCommonGetRateLimits(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetRateLimits(context.Background(),&getstream.GetRateLimitsRequest{}) + require.NoError(t, err) + } + func TestCommonListRoles(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ListRoles(context.Background(),&getstream.ListRolesRequest{}) + require.NoError(t, err) + } + func TestCommonCreateRole(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.CreateRole(context.Background(),&getstream.CreateRoleRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteRole(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteRole(context.Background(),"", &getstream.DeleteRoleRequest{}) + require.NoError(t, err) + } + func TestCommonGetTask(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetTask(context.Background(),"", &getstream.GetTaskRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteFile(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteFile(context.Background(),&getstream.DeleteFileRequest{}) + require.NoError(t, err) + } + 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 TestCommonQueryUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.QueryUsers(context.Background(),&getstream.QueryUsersRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateUsersPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateUsersPartial(context.Background(),&getstream.UpdateUsersPartialRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateUsers(context.Background(),&getstream.UpdateUsersRequest{}) + require.NoError(t, err) + } + func TestCommonGetBlockedUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetBlockedUsers(context.Background(),&getstream.GetBlockedUsersRequest{}) + require.NoError(t, err) + } + func TestCommonBlockUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.BlockUsers(context.Background(),&getstream.BlockUsersRequest{}) + require.NoError(t, err) + } + func TestCommonDeactivateUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeactivateUsers(context.Background(),&getstream.DeactivateUsersRequest{}) + require.NoError(t, err) + } + func TestCommonDeleteUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeleteUsers(context.Background(),&getstream.DeleteUsersRequest{}) + require.NoError(t, err) + } + func TestCommonGetUserLiveLocations(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.GetUserLiveLocations(context.Background(),&getstream.GetUserLiveLocationsRequest{}) + require.NoError(t, err) + } + func TestCommonUpdateLiveLocation(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UpdateLiveLocation(context.Background(),&getstream.UpdateLiveLocationRequest{}) + require.NoError(t, err) + } + func TestCommonReactivateUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ReactivateUsers(context.Background(),&getstream.ReactivateUsersRequest{}) + require.NoError(t, err) + } + func TestCommonRestoreUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.RestoreUsers(context.Background(),&getstream.RestoreUsersRequest{}) + require.NoError(t, err) + } + func TestCommonUnblockUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.UnblockUsers(context.Background(),&getstream.UnblockUsersRequest{}) + require.NoError(t, err) + } + func TestCommonDeactivateUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.DeactivateUser(context.Background(),"", &getstream.DeactivateUserRequest{}) + require.NoError(t, err) + } + func TestCommonExportUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ExportUser(context.Background(),"", &getstream.ExportUserRequest{}) + require.NoError(t, err) + } + func TestCommonReactivateUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.ReactivateUser(context.Background(),"", &getstream.ReactivateUserRequest{}) + require.NoError(t, err) + } diff --git a/feeds-v3.go b/feeds-v3.go index 430d270..d7e6246 100644 --- a/feeds-v3.go +++ b/feeds-v3.go @@ -16,86 +16,95 @@ func NewFeedsClient(client *Client) *FeedsClient { } // Create a new activity or update an existing one +// func (c *FeedsClient) AddActivity(ctx context.Context, request *AddActivityRequest) (*StreamResponse[AddActivityResponse], error) { var result AddActivityResponse - res, err := MakeRequest[AddActivityRequest, AddActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/activities", nil, request, &result, nil) + res, err := MakeRequest[AddActivityRequest, AddActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/activities",nil,request, &result,nil) return res, err } // Create new activities or update existing ones in a batch operation +// func (c *FeedsClient) UpsertActivities(ctx context.Context, request *UpsertActivitiesRequest) (*StreamResponse[UpsertActivitiesResponse], error) { var result UpsertActivitiesResponse - res, err := MakeRequest[UpsertActivitiesRequest, UpsertActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/batch", nil, request, &result, nil) + res, err := MakeRequest[UpsertActivitiesRequest, UpsertActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/batch",nil,request, &result,nil) 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) + 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 - res, err := MakeRequest[DeleteActivitiesRequest, DeleteActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/delete", nil, request, &result, nil) + res, err := MakeRequest[DeleteActivitiesRequest, DeleteActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/delete",nil,request, &result,nil) return res, err } // Query activities based on filters with pagination and sorting options +// func (c *FeedsClient) QueryActivities(ctx context.Context, request *QueryActivitiesRequest) (*StreamResponse[QueryActivitiesResponse], error) { var result QueryActivitiesResponse - res, err := MakeRequest[QueryActivitiesRequest, QueryActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/query", nil, request, &result, nil) + res, err := MakeRequest[QueryActivitiesRequest, QueryActivitiesResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/query",nil,request, &result,nil) return res, err } // Deletes a bookmark from an activity -func (c *FeedsClient) DeleteBookmark(ctx context.Context, activityID string, request *DeleteBookmarkRequest) (*StreamResponse[DeleteBookmarkResponse], error) { +// +func (c *FeedsClient) DeleteBookmark(ctx context.Context,activityID string, request *DeleteBookmarkRequest) (*StreamResponse[DeleteBookmarkResponse], error) { var result DeleteBookmarkResponse pathParams := map[string]string{ "activity_id": activityID, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteBookmarkResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/bookmarks", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteBookmarkResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/bookmarks",params, nil, &result,pathParams) return res, err } // Updates a bookmark for an activity -func (c *FeedsClient) UpdateBookmark(ctx context.Context, activityID string, request *UpdateBookmarkRequest) (*StreamResponse[UpdateBookmarkResponse], error) { +// +func (c *FeedsClient) UpdateBookmark(ctx context.Context,activityID string, request *UpdateBookmarkRequest) (*StreamResponse[UpdateBookmarkResponse], error) { var result UpdateBookmarkResponse pathParams := map[string]string{ "activity_id": activityID, } - res, err := MakeRequest[UpdateBookmarkRequest, UpdateBookmarkResponse](c.client, ctx, "PATCH", "/api/v2/feeds/activities/{activity_id}/bookmarks", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateBookmarkRequest, UpdateBookmarkResponse](c.client, ctx, "PATCH", "/api/v2/feeds/activities/{activity_id}/bookmarks",nil,request, &result,pathParams) return res, err } // Adds a bookmark to an activity -func (c *FeedsClient) AddBookmark(ctx context.Context, activityID string, request *AddBookmarkRequest) (*StreamResponse[AddBookmarkResponse], error) { +// +func (c *FeedsClient) AddBookmark(ctx context.Context,activityID string, request *AddBookmarkRequest) (*StreamResponse[AddBookmarkResponse], error) { var result AddBookmarkResponse pathParams := map[string]string{ "activity_id": activityID, } - res, err := MakeRequest[AddBookmarkRequest, AddBookmarkResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/bookmarks", nil, request, &result, pathParams) + res, err := MakeRequest[AddBookmarkRequest, AddBookmarkResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/bookmarks",nil,request, &result,pathParams) return res, err } // Submit feedback for an activity including options to show less, hide, report, or mute the user -func (c *FeedsClient) ActivityFeedback(ctx context.Context, activityID string, request *ActivityFeedbackRequest) (*StreamResponse[ActivityFeedbackResponse], error) { +// +func (c *FeedsClient) ActivityFeedback(ctx context.Context,activityID string, request *ActivityFeedbackRequest) (*StreamResponse[ActivityFeedbackResponse], error) { var result ActivityFeedbackResponse pathParams := map[string]string{ "activity_id": activityID, } - res, err := MakeRequest[ActivityFeedbackRequest, ActivityFeedbackResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/feedback", nil, request, &result, pathParams) + res, err := MakeRequest[ActivityFeedbackRequest, ActivityFeedbackResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/feedback",nil,request, &result,pathParams) return res, err } // Cast a vote on a poll -// +// // Sends events: // - feeds.poll.vote_casted // - feeds.poll.vote_changed @@ -103,730 +112,820 @@ func (c *FeedsClient) ActivityFeedback(ctx context.Context, activityID string, r // - poll.vote_casted // - poll.vote_changed // - poll.vote_removed -func (c *FeedsClient) CastPollVote(ctx context.Context, activityID string, pollID string, request *CastPollVoteRequest) (*StreamResponse[PollVoteResponse], error) { +// +func (c *FeedsClient) CastPollVote(ctx context.Context,activityID string, pollID string, request *CastPollVoteRequest) (*StreamResponse[PollVoteResponse], error) { var result PollVoteResponse pathParams := map[string]string{ "activity_id": activityID, - "poll_id": pollID, + "poll_id": pollID, } - res, err := MakeRequest[CastPollVoteRequest, PollVoteResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote", nil, request, &result, pathParams) + res, err := MakeRequest[CastPollVoteRequest, PollVoteResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote",nil,request, &result,pathParams) return res, err } // Delete a vote from a poll -// +// // Sends events: // - feeds.poll.vote_removed // - poll.vote_removed -func (c *FeedsClient) DeletePollVote(ctx context.Context, activityID string, pollID string, voteID string, request *DeletePollVoteRequest) (*StreamResponse[PollVoteResponse], error) { +// +func (c *FeedsClient) DeletePollVote(ctx context.Context,activityID string, pollID string, voteID string, request *DeletePollVoteRequest) (*StreamResponse[PollVoteResponse], error) { var result PollVoteResponse pathParams := map[string]string{ "activity_id": activityID, - "poll_id": pollID, - "vote_id": voteID, + "poll_id": pollID, + "vote_id": voteID, } params := extractQueryParams(request) - res, err := MakeRequest[any, PollVoteResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote/{vote_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, PollVoteResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote/{vote_id}",params, nil, &result,pathParams) return res, err } // Adds a reaction to an activity -func (c *FeedsClient) AddActivityReaction(ctx context.Context, activityID string, request *AddActivityReactionRequest) (*StreamResponse[AddReactionResponse], error) { +// +func (c *FeedsClient) AddActivityReaction(ctx context.Context,activityID string, request *AddActivityReactionRequest) (*StreamResponse[AddReactionResponse], error) { var result AddReactionResponse pathParams := map[string]string{ "activity_id": activityID, } - res, err := MakeRequest[AddActivityReactionRequest, AddReactionResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/reactions", nil, request, &result, pathParams) + res, err := MakeRequest[AddActivityReactionRequest, AddReactionResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/reactions",nil,request, &result,pathParams) return res, err } // Query activity reactions -func (c *FeedsClient) QueryActivityReactions(ctx context.Context, activityID string, request *QueryActivityReactionsRequest) (*StreamResponse[QueryActivityReactionsResponse], error) { +// +func (c *FeedsClient) QueryActivityReactions(ctx context.Context,activityID string, request *QueryActivityReactionsRequest) (*StreamResponse[QueryActivityReactionsResponse], error) { var result QueryActivityReactionsResponse pathParams := map[string]string{ "activity_id": activityID, } - res, err := MakeRequest[QueryActivityReactionsRequest, QueryActivityReactionsResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/reactions/query", nil, request, &result, pathParams) + res, err := MakeRequest[QueryActivityReactionsRequest, QueryActivityReactionsResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{activity_id}/reactions/query",nil,request, &result,pathParams) return res, err } // Removes a reaction from an activity -func (c *FeedsClient) DeleteActivityReaction(ctx context.Context, activityID string, _type string, request *DeleteActivityReactionRequest) (*StreamResponse[DeleteActivityReactionResponse], error) { +// +func (c *FeedsClient) DeleteActivityReaction(ctx context.Context,activityID string, _type string, request *DeleteActivityReactionRequest) (*StreamResponse[DeleteActivityReactionResponse], error) { var result DeleteActivityReactionResponse pathParams := map[string]string{ "activity_id": activityID, - "type": _type, + "type": _type, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteActivityReactionResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/reactions/{type}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteActivityReactionResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{activity_id}/reactions/{type}",params, nil, &result,pathParams) return res, err } // Delete a single activity by its ID -func (c *FeedsClient) DeleteActivity(ctx context.Context, id string, request *DeleteActivityRequest) (*StreamResponse[DeleteActivityResponse], error) { +// +func (c *FeedsClient) DeleteActivity(ctx context.Context,id string, request *DeleteActivityRequest) (*StreamResponse[DeleteActivityResponse], error) { var result DeleteActivityResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteActivityResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteActivityResponse](c.client, ctx, "DELETE", "/api/v2/feeds/activities/{id}",params, nil, &result,pathParams) return res, err } // Returns activity by ID -func (c *FeedsClient) GetActivity(ctx context.Context, id string, request *GetActivityRequest) (*StreamResponse[GetActivityResponse], error) { +// +func (c *FeedsClient) GetActivity(ctx context.Context,id string, request *GetActivityRequest) (*StreamResponse[GetActivityResponse], error) { var result GetActivityResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetActivityResponse](c.client, ctx, "GET", "/api/v2/feeds/activities/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetActivityResponse](c.client, ctx, "GET", "/api/v2/feeds/activities/{id}",nil, nil, &result,pathParams) return res, err } // Updates certain fields of the activity. Use 'set' to update specific fields and 'unset' to remove fields. This allows you to update only the fields you need without replacing the entire activity. Useful for updating reply restrictions ('restrict_replies'), mentioned users, or custom data. -// +// // Sends events: // - feeds.activity.updated -func (c *FeedsClient) UpdateActivityPartial(ctx context.Context, id string, request *UpdateActivityPartialRequest) (*StreamResponse[UpdateActivityPartialResponse], error) { +// +func (c *FeedsClient) UpdateActivityPartial(ctx context.Context,id string, request *UpdateActivityPartialRequest) (*StreamResponse[UpdateActivityPartialResponse], error) { var result UpdateActivityPartialResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateActivityPartialRequest, UpdateActivityPartialResponse](c.client, ctx, "PATCH", "/api/v2/feeds/activities/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateActivityPartialRequest, UpdateActivityPartialResponse](c.client, ctx, "PATCH", "/api/v2/feeds/activities/{id}",nil,request, &result,pathParams) return res, err } // Replaces an activity with the provided data. Use this to update text, attachments, reply restrictions ('restrict_replies'), mentioned users, and other activity fields. Note: This is a full update - any fields not provided will be cleared. -// +// // Sends events: // - feeds.activity.updated -func (c *FeedsClient) UpdateActivity(ctx context.Context, id string, request *UpdateActivityRequest) (*StreamResponse[UpdateActivityResponse], error) { +// +func (c *FeedsClient) UpdateActivity(ctx context.Context,id string, request *UpdateActivityRequest) (*StreamResponse[UpdateActivityResponse], error) { var result UpdateActivityResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateActivityRequest, UpdateActivityResponse](c.client, ctx, "PUT", "/api/v2/feeds/activities/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateActivityRequest, UpdateActivityResponse](c.client, ctx, "PUT", "/api/v2/feeds/activities/{id}",nil,request, &result,pathParams) return res, err } // Restores a soft-deleted activity by its ID. Only the activity owner can restore their own activities. -func (c *FeedsClient) RestoreActivity(ctx context.Context, id string, request *RestoreActivityRequest) (*StreamResponse[RestoreActivityResponse], error) { +// +func (c *FeedsClient) RestoreActivity(ctx context.Context,id string, request *RestoreActivityRequest) (*StreamResponse[RestoreActivityResponse], error) { var result RestoreActivityResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[RestoreActivityRequest, RestoreActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{id}/restore", nil, request, &result, pathParams) + res, err := MakeRequest[RestoreActivityRequest, RestoreActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/activities/{id}/restore",nil,request, &result,pathParams) return res, err } // Query bookmark folders with filter query +// func (c *FeedsClient) QueryBookmarkFolders(ctx context.Context, request *QueryBookmarkFoldersRequest) (*StreamResponse[QueryBookmarkFoldersResponse], error) { var result QueryBookmarkFoldersResponse - res, err := MakeRequest[QueryBookmarkFoldersRequest, QueryBookmarkFoldersResponse](c.client, ctx, "POST", "/api/v2/feeds/bookmark_folders/query", nil, request, &result, nil) + res, err := MakeRequest[QueryBookmarkFoldersRequest, QueryBookmarkFoldersResponse](c.client, ctx, "POST", "/api/v2/feeds/bookmark_folders/query",nil,request, &result,nil) return res, err } // Delete a bookmark folder by its ID -func (c *FeedsClient) DeleteBookmarkFolder(ctx context.Context, folderID string, request *DeleteBookmarkFolderRequest) (*StreamResponse[DeleteBookmarkFolderResponse], error) { +// +func (c *FeedsClient) DeleteBookmarkFolder(ctx context.Context,folderID string, request *DeleteBookmarkFolderRequest) (*StreamResponse[DeleteBookmarkFolderResponse], error) { var result DeleteBookmarkFolderResponse pathParams := map[string]string{ "folder_id": folderID, } - res, err := MakeRequest[any, DeleteBookmarkFolderResponse](c.client, ctx, "DELETE", "/api/v2/feeds/bookmark_folders/{folder_id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteBookmarkFolderResponse](c.client, ctx, "DELETE", "/api/v2/feeds/bookmark_folders/{folder_id}",nil, nil, &result,pathParams) return res, err } // Update a bookmark folder by its ID -func (c *FeedsClient) UpdateBookmarkFolder(ctx context.Context, folderID string, request *UpdateBookmarkFolderRequest) (*StreamResponse[UpdateBookmarkFolderResponse], error) { +// +func (c *FeedsClient) UpdateBookmarkFolder(ctx context.Context,folderID string, request *UpdateBookmarkFolderRequest) (*StreamResponse[UpdateBookmarkFolderResponse], error) { var result UpdateBookmarkFolderResponse pathParams := map[string]string{ "folder_id": folderID, } - res, err := MakeRequest[UpdateBookmarkFolderRequest, UpdateBookmarkFolderResponse](c.client, ctx, "PATCH", "/api/v2/feeds/bookmark_folders/{folder_id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateBookmarkFolderRequest, UpdateBookmarkFolderResponse](c.client, ctx, "PATCH", "/api/v2/feeds/bookmark_folders/{folder_id}",nil,request, &result,pathParams) return res, err } // Query bookmarks with filter query +// func (c *FeedsClient) QueryBookmarks(ctx context.Context, request *QueryBookmarksRequest) (*StreamResponse[QueryBookmarksResponse], error) { var result QueryBookmarksResponse - res, err := MakeRequest[QueryBookmarksRequest, QueryBookmarksResponse](c.client, ctx, "POST", "/api/v2/feeds/bookmarks/query", nil, request, &result, nil) + res, err := MakeRequest[QueryBookmarksRequest, QueryBookmarksResponse](c.client, ctx, "POST", "/api/v2/feeds/bookmarks/query",nil,request, &result,nil) return res, err } // Delete collections in a batch operation. Users can only delete their own collections. +// func (c *FeedsClient) DeleteCollections(ctx context.Context, request *DeleteCollectionsRequest) (*StreamResponse[DeleteCollectionsResponse], error) { var result DeleteCollectionsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteCollectionsResponse](c.client, ctx, "DELETE", "/api/v2/feeds/collections", params, nil, &result, nil) + res, err := MakeRequest[any, DeleteCollectionsResponse](c.client, ctx, "DELETE", "/api/v2/feeds/collections",params, nil, &result,nil) return res, err } // Read collections with optional filtering by user ID and collection name. By default, users can only read their own collections. +// func (c *FeedsClient) ReadCollections(ctx context.Context, request *ReadCollectionsRequest) (*StreamResponse[ReadCollectionsResponse], error) { var result ReadCollectionsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, ReadCollectionsResponse](c.client, ctx, "GET", "/api/v2/feeds/collections", params, nil, &result, nil) + res, err := MakeRequest[any, ReadCollectionsResponse](c.client, ctx, "GET", "/api/v2/feeds/collections",params, nil, &result,nil) return res, err } // Update existing collections in a batch operation. Only the custom data field is updatable. Users can only update their own collections. +// func (c *FeedsClient) UpdateCollections(ctx context.Context, request *UpdateCollectionsRequest) (*StreamResponse[UpdateCollectionsResponse], error) { var result UpdateCollectionsResponse - res, err := MakeRequest[UpdateCollectionsRequest, UpdateCollectionsResponse](c.client, ctx, "PATCH", "/api/v2/feeds/collections", nil, request, &result, nil) + res, err := MakeRequest[UpdateCollectionsRequest, UpdateCollectionsResponse](c.client, ctx, "PATCH", "/api/v2/feeds/collections",nil,request, &result,nil) return res, err } // Create new collections in a batch operation. Collections are data objects that can be attached to activities for managing shared data across multiple activities. +// func (c *FeedsClient) CreateCollections(ctx context.Context, request *CreateCollectionsRequest) (*StreamResponse[CreateCollectionsResponse], error) { var result CreateCollectionsResponse - res, err := MakeRequest[CreateCollectionsRequest, CreateCollectionsResponse](c.client, ctx, "POST", "/api/v2/feeds/collections", nil, request, &result, nil) + res, err := MakeRequest[CreateCollectionsRequest, CreateCollectionsResponse](c.client, ctx, "POST", "/api/v2/feeds/collections",nil,request, &result,nil) return res, err } // Insert new collections or update existing ones in a batch operation. Only the custom data field is updatable for existing collections. +// func (c *FeedsClient) UpsertCollections(ctx context.Context, request *UpsertCollectionsRequest) (*StreamResponse[UpsertCollectionsResponse], error) { var result UpsertCollectionsResponse - res, err := MakeRequest[UpsertCollectionsRequest, UpsertCollectionsResponse](c.client, ctx, "PUT", "/api/v2/feeds/collections", nil, request, &result, nil) + res, err := MakeRequest[UpsertCollectionsRequest, UpsertCollectionsResponse](c.client, ctx, "PUT", "/api/v2/feeds/collections",nil,request, &result,nil) return res, err } // Retrieve a threaded list of comments for a specific object (e.g., activity), with configurable depth, sorting, and pagination +// func (c *FeedsClient) GetComments(ctx context.Context, request *GetCommentsRequest) (*StreamResponse[GetCommentsResponse], error) { var result GetCommentsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetCommentsResponse](c.client, ctx, "GET", "/api/v2/feeds/comments", params, nil, &result, nil) + res, err := MakeRequest[any, GetCommentsResponse](c.client, ctx, "GET", "/api/v2/feeds/comments",params, nil, &result,nil) return res, err } // Adds a comment to an object (e.g., activity) or a reply to an existing comment, and broadcasts appropriate events +// func (c *FeedsClient) AddComment(ctx context.Context, request *AddCommentRequest) (*StreamResponse[AddCommentResponse], error) { var result AddCommentResponse - res, err := MakeRequest[AddCommentRequest, AddCommentResponse](c.client, ctx, "POST", "/api/v2/feeds/comments", nil, request, &result, nil) + res, err := MakeRequest[AddCommentRequest, AddCommentResponse](c.client, ctx, "POST", "/api/v2/feeds/comments",nil,request, &result,nil) return res, err } // Adds multiple comments in a single request. Each comment must specify the object type and ID. +// func (c *FeedsClient) AddCommentsBatch(ctx context.Context, request *AddCommentsBatchRequest) (*StreamResponse[AddCommentsBatchResponse], error) { var result AddCommentsBatchResponse - res, err := MakeRequest[AddCommentsBatchRequest, AddCommentsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/batch", nil, request, &result, nil) + res, err := MakeRequest[AddCommentsBatchRequest, AddCommentsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/batch",nil,request, &result,nil) return res, err } // Query comments using MongoDB-style filters with pagination and sorting options +// func (c *FeedsClient) QueryComments(ctx context.Context, request *QueryCommentsRequest) (*StreamResponse[QueryCommentsResponse], error) { var result QueryCommentsResponse - res, err := MakeRequest[QueryCommentsRequest, QueryCommentsResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/query", nil, request, &result, nil) + res, err := MakeRequest[QueryCommentsRequest, QueryCommentsResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/query",nil,request, &result,nil) return res, err } // Deletes a comment from an object (e.g., activity) and broadcasts appropriate events -func (c *FeedsClient) DeleteComment(ctx context.Context, id string, request *DeleteCommentRequest) (*StreamResponse[DeleteCommentResponse], error) { +// +func (c *FeedsClient) DeleteComment(ctx context.Context,id string, request *DeleteCommentRequest) (*StreamResponse[DeleteCommentResponse], error) { var result DeleteCommentResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteCommentResponse](c.client, ctx, "DELETE", "/api/v2/feeds/comments/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteCommentResponse](c.client, ctx, "DELETE", "/api/v2/feeds/comments/{id}",params, nil, &result,pathParams) return res, err } // Get a comment by ID -func (c *FeedsClient) GetComment(ctx context.Context, id string, request *GetCommentRequest) (*StreamResponse[GetCommentResponse], error) { +// +func (c *FeedsClient) GetComment(ctx context.Context,id string, request *GetCommentRequest) (*StreamResponse[GetCommentResponse], error) { var result GetCommentResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetCommentResponse](c.client, ctx, "GET", "/api/v2/feeds/comments/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetCommentResponse](c.client, ctx, "GET", "/api/v2/feeds/comments/{id}",nil, nil, &result,pathParams) return res, err } // Updates a comment on an object (e.g., activity) and broadcasts appropriate events -func (c *FeedsClient) UpdateComment(ctx context.Context, id string, request *UpdateCommentRequest) (*StreamResponse[UpdateCommentResponse], error) { +// +func (c *FeedsClient) UpdateComment(ctx context.Context,id string, request *UpdateCommentRequest) (*StreamResponse[UpdateCommentResponse], error) { var result UpdateCommentResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateCommentRequest, UpdateCommentResponse](c.client, ctx, "PATCH", "/api/v2/feeds/comments/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateCommentRequest, UpdateCommentResponse](c.client, ctx, "PATCH", "/api/v2/feeds/comments/{id}",nil,request, &result,pathParams) return res, err } // Adds a reaction to a comment -func (c *FeedsClient) AddCommentReaction(ctx context.Context, id string, request *AddCommentReactionRequest) (*StreamResponse[AddCommentReactionResponse], error) { +// +func (c *FeedsClient) AddCommentReaction(ctx context.Context,id string, request *AddCommentReactionRequest) (*StreamResponse[AddCommentReactionResponse], error) { var result AddCommentReactionResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[AddCommentReactionRequest, AddCommentReactionResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/{id}/reactions", nil, request, &result, pathParams) + res, err := MakeRequest[AddCommentReactionRequest, AddCommentReactionResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/{id}/reactions",nil,request, &result,pathParams) return res, err } // Query comment reactions -func (c *FeedsClient) QueryCommentReactions(ctx context.Context, id string, request *QueryCommentReactionsRequest) (*StreamResponse[QueryCommentReactionsResponse], error) { +// +func (c *FeedsClient) QueryCommentReactions(ctx context.Context,id string, request *QueryCommentReactionsRequest) (*StreamResponse[QueryCommentReactionsResponse], error) { var result QueryCommentReactionsResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[QueryCommentReactionsRequest, QueryCommentReactionsResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/{id}/reactions/query", nil, request, &result, pathParams) + res, err := MakeRequest[QueryCommentReactionsRequest, QueryCommentReactionsResponse](c.client, ctx, "POST", "/api/v2/feeds/comments/{id}/reactions/query",nil,request, &result,pathParams) return res, err } // Deletes a reaction from a comment -func (c *FeedsClient) DeleteCommentReaction(ctx context.Context, id string, _type string, request *DeleteCommentReactionRequest) (*StreamResponse[DeleteCommentReactionResponse], error) { +// +func (c *FeedsClient) DeleteCommentReaction(ctx context.Context,id string, _type string, request *DeleteCommentReactionRequest) (*StreamResponse[DeleteCommentReactionResponse], error) { var result DeleteCommentReactionResponse pathParams := map[string]string{ - "id": id, + "id": id, "type": _type, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteCommentReactionResponse](c.client, ctx, "DELETE", "/api/v2/feeds/comments/{id}/reactions/{type}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteCommentReactionResponse](c.client, ctx, "DELETE", "/api/v2/feeds/comments/{id}/reactions/{type}",params, nil, &result,pathParams) return res, err } // Retrieve a threaded list of replies for a single comment, with configurable depth, sorting, and pagination -func (c *FeedsClient) GetCommentReplies(ctx context.Context, id string, request *GetCommentRepliesRequest) (*StreamResponse[GetCommentRepliesResponse], error) { +// +func (c *FeedsClient) GetCommentReplies(ctx context.Context,id string, request *GetCommentRepliesRequest) (*StreamResponse[GetCommentRepliesResponse], error) { var result GetCommentRepliesResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCommentRepliesResponse](c.client, ctx, "GET", "/api/v2/feeds/comments/{id}/replies", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCommentRepliesResponse](c.client, ctx, "GET", "/api/v2/feeds/comments/{id}/replies",params, nil, &result,pathParams) return res, err } // List all feed groups for the application +// func (c *FeedsClient) ListFeedGroups(ctx context.Context, request *ListFeedGroupsRequest) (*StreamResponse[ListFeedGroupsResponse], error) { var result ListFeedGroupsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, ListFeedGroupsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups", params, nil, &result, nil) + res, err := MakeRequest[any, ListFeedGroupsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups",params, nil, &result,nil) return res, err } // Creates a new feed group with the specified configuration +// func (c *FeedsClient) CreateFeedGroup(ctx context.Context, request *CreateFeedGroupRequest) (*StreamResponse[CreateFeedGroupResponse], error) { var result CreateFeedGroupResponse - res, err := MakeRequest[CreateFeedGroupRequest, CreateFeedGroupResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups", nil, request, &result, nil) + res, err := MakeRequest[CreateFeedGroupRequest, CreateFeedGroupResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups",nil,request, &result,nil) return res, err } // Delete a single feed by its ID -func (c *FeedsClient) DeleteFeed(ctx context.Context, feedGroupID string, feedID string, request *DeleteFeedRequest) (*StreamResponse[DeleteFeedResponse], error) { +// +func (c *FeedsClient) DeleteFeed(ctx context.Context,feedGroupID string, feedID string, request *DeleteFeedRequest) (*StreamResponse[DeleteFeedResponse], error) { var result DeleteFeedResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteFeedResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteFeedResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",params, nil, &result,pathParams) return res, err } // Create a single feed for a given feed group -func (c *FeedsClient) GetOrCreateFeed(ctx context.Context, feedGroupID string, feedID string, request *GetOrCreateFeedRequest) (*StreamResponse[GetOrCreateFeedResponse], error) { +// +func (c *FeedsClient) GetOrCreateFeed(ctx context.Context,feedGroupID string, feedID string, request *GetOrCreateFeedRequest) (*StreamResponse[GetOrCreateFeedResponse], error) { var result GetOrCreateFeedResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[GetOrCreateFeedRequest, GetOrCreateFeedResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateFeedRequest, GetOrCreateFeedResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",nil,request, &result,pathParams) return res, err } // Update an existing feed -func (c *FeedsClient) UpdateFeed(ctx context.Context, feedGroupID string, feedID string, request *UpdateFeedRequest) (*StreamResponse[UpdateFeedResponse], error) { +// +func (c *FeedsClient) UpdateFeed(ctx context.Context,feedGroupID string, feedID string, request *UpdateFeedRequest) (*StreamResponse[UpdateFeedResponse], error) { var result UpdateFeedResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[UpdateFeedRequest, UpdateFeedResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateFeedRequest, UpdateFeedResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",nil,request, &result,pathParams) return res, err } // Mark activities as read/seen/watched. Can mark by timestamp (seen), activity IDs (read), or all as read. -func (c *FeedsClient) MarkActivity(ctx context.Context, feedGroupID string, feedID string, request *MarkActivityRequest) (*StreamResponse[Response], error) { +// +func (c *FeedsClient) MarkActivity(ctx context.Context,feedGroupID string, feedID string, request *MarkActivityRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[MarkActivityRequest, Response](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/mark/batch", nil, request, &result, pathParams) + res, err := MakeRequest[MarkActivityRequest, Response](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/mark/batch",nil,request, &result,pathParams) return res, err } // Unpin an activity from a feed. This removes the pin, so the activity will no longer be displayed at the top of the feed. -func (c *FeedsClient) UnpinActivity(ctx context.Context, feedGroupID string, feedID string, activityID string, request *UnpinActivityRequest) (*StreamResponse[UnpinActivityResponse], error) { +// +func (c *FeedsClient) UnpinActivity(ctx context.Context,feedGroupID string, feedID string, activityID string, request *UnpinActivityRequest) (*StreamResponse[UnpinActivityResponse], error) { var result UnpinActivityResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, - "activity_id": activityID, + "feed_id": feedID, + "activity_id": activityID, } params := extractQueryParams(request) - res, err := MakeRequest[any, UnpinActivityResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin", params, nil, &result, pathParams) + res, err := MakeRequest[any, UnpinActivityResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin",params, nil, &result,pathParams) return res, err } // Pin an activity to a feed. Pinned activities are typically displayed at the top of a feed. -func (c *FeedsClient) PinActivity(ctx context.Context, feedGroupID string, feedID string, activityID string, request *PinActivityRequest) (*StreamResponse[PinActivityResponse], error) { +// +func (c *FeedsClient) PinActivity(ctx context.Context,feedGroupID string, feedID string, activityID string, request *PinActivityRequest) (*StreamResponse[PinActivityResponse], error) { var result PinActivityResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, - "activity_id": activityID, + "feed_id": feedID, + "activity_id": activityID, } - res, err := MakeRequest[PinActivityRequest, PinActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin", nil, request, &result, pathParams) + res, err := MakeRequest[PinActivityRequest, PinActivityResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin",nil,request, &result,pathParams) return res, err } // Add, remove, or set members for a feed -func (c *FeedsClient) UpdateFeedMembers(ctx context.Context, feedGroupID string, feedID string, request *UpdateFeedMembersRequest) (*StreamResponse[UpdateFeedMembersResponse], error) { +// +func (c *FeedsClient) UpdateFeedMembers(ctx context.Context,feedGroupID string, feedID string, request *UpdateFeedMembersRequest) (*StreamResponse[UpdateFeedMembersResponse], error) { var result UpdateFeedMembersResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[UpdateFeedMembersRequest, UpdateFeedMembersResponse](c.client, ctx, "PATCH", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateFeedMembersRequest, UpdateFeedMembersResponse](c.client, ctx, "PATCH", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members",nil,request, &result,pathParams) return res, err } // Accepts a pending feed member request -func (c *FeedsClient) AcceptFeedMemberInvite(ctx context.Context, feedID string, feedGroupID string, request *AcceptFeedMemberInviteRequest) (*StreamResponse[AcceptFeedMemberInviteResponse], error) { +// +func (c *FeedsClient) AcceptFeedMemberInvite(ctx context.Context,feedID string, feedGroupID string, request *AcceptFeedMemberInviteRequest) (*StreamResponse[AcceptFeedMemberInviteResponse], error) { var result AcceptFeedMemberInviteResponse pathParams := map[string]string{ - "feed_id": feedID, + "feed_id": feedID, "feed_group_id": feedGroupID, } - res, err := MakeRequest[AcceptFeedMemberInviteRequest, AcceptFeedMemberInviteResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/accept", nil, request, &result, pathParams) + res, err := MakeRequest[AcceptFeedMemberInviteRequest, AcceptFeedMemberInviteResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/accept",nil,request, &result,pathParams) return res, err } // Query feed members based on filters with pagination and sorting options -func (c *FeedsClient) QueryFeedMembers(ctx context.Context, feedGroupID string, feedID string, request *QueryFeedMembersRequest) (*StreamResponse[QueryFeedMembersResponse], error) { +// +func (c *FeedsClient) QueryFeedMembers(ctx context.Context,feedGroupID string, feedID string, request *QueryFeedMembersRequest) (*StreamResponse[QueryFeedMembersResponse], error) { var result QueryFeedMembersResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[QueryFeedMembersRequest, QueryFeedMembersResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/query", nil, request, &result, pathParams) + res, err := MakeRequest[QueryFeedMembersRequest, QueryFeedMembersResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/query",nil,request, &result,pathParams) return res, err } // Rejects a pending feed member request -func (c *FeedsClient) RejectFeedMemberInvite(ctx context.Context, feedGroupID string, feedID string, request *RejectFeedMemberInviteRequest) (*StreamResponse[RejectFeedMemberInviteResponse], error) { +// +func (c *FeedsClient) RejectFeedMemberInvite(ctx context.Context,feedGroupID string, feedID string, request *RejectFeedMemberInviteRequest) (*StreamResponse[RejectFeedMemberInviteResponse], error) { var result RejectFeedMemberInviteResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, - "feed_id": feedID, + "feed_id": feedID, } - res, err := MakeRequest[RejectFeedMemberInviteRequest, RejectFeedMemberInviteResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/reject", nil, request, &result, pathParams) + res, err := MakeRequest[RejectFeedMemberInviteRequest, RejectFeedMemberInviteResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/reject",nil,request, &result,pathParams) + 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) { +// +func (c *FeedsClient) GetFollowSuggestions(ctx context.Context,feedGroupID string, request *GetFollowSuggestionsRequest) (*StreamResponse[GetFollowSuggestionsResponse], error) { var result GetFollowSuggestionsResponse pathParams := map[string]string{ "feed_group_id": feedGroupID, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetFollowSuggestionsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups/{feed_group_id}/follow_suggestions", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetFollowSuggestionsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups/{feed_group_id}/follow_suggestions",params, 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) { +// +func (c *FeedsClient) DeleteFeedGroup(ctx context.Context,id string, request *DeleteFeedGroupRequest) (*StreamResponse[DeleteFeedGroupResponse], error) { var result DeleteFeedGroupResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteFeedGroupResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteFeedGroupResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_groups/{id}",params, nil, &result,pathParams) return res, err } // Get a feed group by ID -func (c *FeedsClient) GetFeedGroup(ctx context.Context, id string, request *GetFeedGroupRequest) (*StreamResponse[GetFeedGroupResponse], error) { +// +func (c *FeedsClient) GetFeedGroup(ctx context.Context,id string, request *GetFeedGroupRequest) (*StreamResponse[GetFeedGroupResponse], error) { var result GetFeedGroupResponse pathParams := map[string]string{ "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetFeedGroupResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetFeedGroupResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_groups/{id}",params, nil, &result,pathParams) return res, err } // Get an existing feed group or create a new one if it doesn't exist -func (c *FeedsClient) GetOrCreateFeedGroup(ctx context.Context, id string, request *GetOrCreateFeedGroupRequest) (*StreamResponse[GetOrCreateFeedGroupResponse], error) { +// +func (c *FeedsClient) GetOrCreateFeedGroup(ctx context.Context,id string, request *GetOrCreateFeedGroupRequest) (*StreamResponse[GetOrCreateFeedGroupResponse], error) { var result GetOrCreateFeedGroupResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[GetOrCreateFeedGroupRequest, GetOrCreateFeedGroupResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateFeedGroupRequest, GetOrCreateFeedGroupResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_groups/{id}",nil,request, &result,pathParams) return res, err } // Update a feed group by ID -func (c *FeedsClient) UpdateFeedGroup(ctx context.Context, id string, request *UpdateFeedGroupRequest) (*StreamResponse[UpdateFeedGroupResponse], error) { +// +func (c *FeedsClient) UpdateFeedGroup(ctx context.Context,id string, request *UpdateFeedGroupRequest) (*StreamResponse[UpdateFeedGroupResponse], error) { var result UpdateFeedGroupResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateFeedGroupRequest, UpdateFeedGroupResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_groups/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateFeedGroupRequest, UpdateFeedGroupResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_groups/{id}",nil,request, &result,pathParams) return res, err } // List all feed views for a feed group +// func (c *FeedsClient) ListFeedViews(ctx context.Context, request *ListFeedViewsRequest) (*StreamResponse[ListFeedViewsResponse], error) { var result ListFeedViewsResponse - res, err := MakeRequest[any, ListFeedViewsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_views", nil, nil, &result, nil) + res, err := MakeRequest[any, ListFeedViewsResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_views",nil, nil, &result,nil) return res, err } // Create a custom view for a feed group with specific selectors, ranking, or aggregation options +// func (c *FeedsClient) CreateFeedView(ctx context.Context, request *CreateFeedViewRequest) (*StreamResponse[CreateFeedViewResponse], error) { var result CreateFeedViewResponse - res, err := MakeRequest[CreateFeedViewRequest, CreateFeedViewResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_views", nil, request, &result, nil) + res, err := MakeRequest[CreateFeedViewRequest, CreateFeedViewResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_views",nil,request, &result,nil) return res, err } // Delete an existing custom feed view -func (c *FeedsClient) DeleteFeedView(ctx context.Context, id string, request *DeleteFeedViewRequest) (*StreamResponse[DeleteFeedViewResponse], error) { +// +func (c *FeedsClient) DeleteFeedView(ctx context.Context,id string, request *DeleteFeedViewRequest) (*StreamResponse[DeleteFeedViewResponse], error) { var result DeleteFeedViewResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteFeedViewResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_views/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteFeedViewResponse](c.client, ctx, "DELETE", "/api/v2/feeds/feed_views/{id}",nil, nil, &result,pathParams) return res, err } // Get a feed view by its ID -func (c *FeedsClient) GetFeedView(ctx context.Context, id string, request *GetFeedViewRequest) (*StreamResponse[GetFeedViewResponse], error) { +// +func (c *FeedsClient) GetFeedView(ctx context.Context,id string, request *GetFeedViewRequest) (*StreamResponse[GetFeedViewResponse], error) { var result GetFeedViewResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetFeedViewResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_views/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetFeedViewResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_views/{id}",nil, nil, &result,pathParams) return res, err } // Get an existing feed view or create a new one if it doesn't exist -func (c *FeedsClient) GetOrCreateFeedView(ctx context.Context, id string, request *GetOrCreateFeedViewRequest) (*StreamResponse[GetOrCreateFeedViewResponse], error) { +// +func (c *FeedsClient) GetOrCreateFeedView(ctx context.Context,id string, request *GetOrCreateFeedViewRequest) (*StreamResponse[GetOrCreateFeedViewResponse], error) { var result GetOrCreateFeedViewResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[GetOrCreateFeedViewRequest, GetOrCreateFeedViewResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_views/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateFeedViewRequest, GetOrCreateFeedViewResponse](c.client, ctx, "POST", "/api/v2/feeds/feed_views/{id}",nil,request, &result,pathParams) return res, err } // Update an existing custom feed view with new selectors, ranking, or aggregation options -func (c *FeedsClient) UpdateFeedView(ctx context.Context, id string, request *UpdateFeedViewRequest) (*StreamResponse[UpdateFeedViewResponse], error) { +// +func (c *FeedsClient) UpdateFeedView(ctx context.Context,id string, request *UpdateFeedViewRequest) (*StreamResponse[UpdateFeedViewResponse], error) { var result UpdateFeedViewResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateFeedViewRequest, UpdateFeedViewResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_views/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateFeedViewRequest, UpdateFeedViewResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_views/{id}",nil,request, &result,pathParams) return res, err } // Gets all available feed visibility configurations and their permissions +// func (c *FeedsClient) ListFeedVisibilities(ctx context.Context, request *ListFeedVisibilitiesRequest) (*StreamResponse[ListFeedVisibilitiesResponse], error) { var result ListFeedVisibilitiesResponse - res, err := MakeRequest[any, ListFeedVisibilitiesResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_visibilities", nil, nil, &result, nil) + res, err := MakeRequest[any, ListFeedVisibilitiesResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_visibilities",nil, nil, &result,nil) return res, err } // Gets feed visibility configuration and permissions -func (c *FeedsClient) GetFeedVisibility(ctx context.Context, name string, request *GetFeedVisibilityRequest) (*StreamResponse[GetFeedVisibilityResponse], error) { +// +func (c *FeedsClient) GetFeedVisibility(ctx context.Context,name string, request *GetFeedVisibilityRequest) (*StreamResponse[GetFeedVisibilityResponse], error) { var result GetFeedVisibilityResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, GetFeedVisibilityResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_visibilities/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetFeedVisibilityResponse](c.client, ctx, "GET", "/api/v2/feeds/feed_visibilities/{name}",nil, nil, &result,pathParams) return res, err } // Updates an existing predefined feed visibility configuration -func (c *FeedsClient) UpdateFeedVisibility(ctx context.Context, name string, request *UpdateFeedVisibilityRequest) (*StreamResponse[UpdateFeedVisibilityResponse], error) { +// +func (c *FeedsClient) UpdateFeedVisibility(ctx context.Context,name string, request *UpdateFeedVisibilityRequest) (*StreamResponse[UpdateFeedVisibilityResponse], error) { var result UpdateFeedVisibilityResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateFeedVisibilityRequest, UpdateFeedVisibilityResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_visibilities/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateFeedVisibilityRequest, UpdateFeedVisibilityResponse](c.client, ctx, "PUT", "/api/v2/feeds/feed_visibilities/{name}",nil,request, &result,pathParams) return res, err } // Create multiple feeds at once for a given feed group +// func (c *FeedsClient) CreateFeedsBatch(ctx context.Context, request *CreateFeedsBatchRequest) (*StreamResponse[CreateFeedsBatchResponse], error) { var result CreateFeedsBatchResponse - res, err := MakeRequest[CreateFeedsBatchRequest, CreateFeedsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/batch", nil, request, &result, nil) + res, err := MakeRequest[CreateFeedsBatchRequest, CreateFeedsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/batch",nil,request, &result,nil) return res, err } // Delete multiple feeds by their IDs. All feeds must exist. This endpoint is server-side only. +// func (c *FeedsClient) DeleteFeedsBatch(ctx context.Context, request *DeleteFeedsBatchRequest) (*StreamResponse[DeleteFeedsBatchResponse], error) { var result DeleteFeedsBatchResponse - res, err := MakeRequest[DeleteFeedsBatchRequest, DeleteFeedsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/delete", nil, request, &result, nil) + res, err := MakeRequest[DeleteFeedsBatchRequest, DeleteFeedsBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/delete",nil,request, &result,nil) return res, err } // Retrieves own_follows, own_capabilities, and/or own_membership for multiple feeds in a single request. If fields are not specified, all three fields are returned. +// func (c *FeedsClient) OwnBatch(ctx context.Context, request *OwnBatchRequest) (*StreamResponse[OwnBatchResponse], error) { var result OwnBatchResponse - res, err := MakeRequest[OwnBatchRequest, OwnBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/own/batch", nil, request, &result, nil) + res, err := MakeRequest[OwnBatchRequest, OwnBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/own/batch",nil,request, &result,nil) return res, err } // Query feeds with filter query +// func (c *FeedsClient) QueryFeeds(ctx context.Context, request *QueryFeedsRequest) (*StreamResponse[QueryFeedsResponse], error) { var result QueryFeedsResponse - res, err := MakeRequest[QueryFeedsRequest, QueryFeedsResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/query", nil, request, &result, nil) + res, err := MakeRequest[QueryFeedsRequest, QueryFeedsResponse](c.client, ctx, "POST", "/api/v2/feeds/feeds/query",nil,request, &result,nil) return res, err } // Retrieve current rate limit status for feeds operations. // Returns information about limits, usage, and remaining quota for various feed operations. +// func (c *FeedsClient) GetFeedsRateLimits(ctx context.Context, request *GetFeedsRateLimitsRequest) (*StreamResponse[GetFeedsRateLimitsResponse], error) { var result GetFeedsRateLimitsResponse params := extractQueryParams(request) - res, err := MakeRequest[any, GetFeedsRateLimitsResponse](c.client, ctx, "GET", "/api/v2/feeds/feeds/rate_limits", params, nil, &result, nil) + res, err := MakeRequest[any, GetFeedsRateLimitsResponse](c.client, ctx, "GET", "/api/v2/feeds/feeds/rate_limits",params, nil, &result,nil) return res, err } // Updates a follow's custom data, push preference, and follower role. Source owner can update custom data and push preference. Follower role can only be updated via server-side requests. +// func (c *FeedsClient) UpdateFollow(ctx context.Context, request *UpdateFollowRequest) (*StreamResponse[UpdateFollowResponse], error) { var result UpdateFollowResponse - res, err := MakeRequest[UpdateFollowRequest, UpdateFollowResponse](c.client, ctx, "PATCH", "/api/v2/feeds/follows", nil, request, &result, nil) + res, err := MakeRequest[UpdateFollowRequest, UpdateFollowResponse](c.client, ctx, "PATCH", "/api/v2/feeds/follows",nil,request, &result,nil) return res, err } // Creates a follow and broadcasts FollowAddedEvent +// func (c *FeedsClient) Follow(ctx context.Context, request *FollowRequest) (*StreamResponse[SingleFollowResponse], error) { var result SingleFollowResponse - res, err := MakeRequest[FollowRequest, SingleFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows", nil, request, &result, nil) + res, err := MakeRequest[FollowRequest, SingleFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows",nil,request, &result,nil) return res, err } // Accepts a pending follow request +// func (c *FeedsClient) AcceptFollow(ctx context.Context, request *AcceptFollowRequest) (*StreamResponse[AcceptFollowResponse], error) { var result AcceptFollowResponse - res, err := MakeRequest[AcceptFollowRequest, AcceptFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/accept", nil, request, &result, nil) + res, err := MakeRequest[AcceptFollowRequest, AcceptFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/accept",nil,request, &result,nil) return res, err } // Creates multiple follows at once and broadcasts FollowAddedEvent for each follow +// func (c *FeedsClient) FollowBatch(ctx context.Context, request *FollowBatchRequest) (*StreamResponse[FollowBatchResponse], error) { var result FollowBatchResponse - res, err := MakeRequest[FollowBatchRequest, FollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/batch", nil, request, &result, nil) + res, err := MakeRequest[FollowBatchRequest, FollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/batch",nil,request, &result,nil) return res, err } // Creates or updates multiple follows at once. Does not return an error if follows already exist. Broadcasts FollowAddedEvent only for newly created follows. +// func (c *FeedsClient) GetOrCreateFollows(ctx context.Context, request *GetOrCreateFollowsRequest) (*StreamResponse[FollowBatchResponse], error) { var result FollowBatchResponse - res, err := MakeRequest[GetOrCreateFollowsRequest, FollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/batch/upsert", nil, request, &result, nil) + res, err := MakeRequest[GetOrCreateFollowsRequest, FollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/batch/upsert",nil,request, &result,nil) return res, err } // Query follows based on filters with pagination and sorting options +// func (c *FeedsClient) QueryFollows(ctx context.Context, request *QueryFollowsRequest) (*StreamResponse[QueryFollowsResponse], error) { var result QueryFollowsResponse - res, err := MakeRequest[QueryFollowsRequest, QueryFollowsResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/query", nil, request, &result, nil) + res, err := MakeRequest[QueryFollowsRequest, QueryFollowsResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/query",nil,request, &result,nil) return res, err } // Rejects a pending follow request +// func (c *FeedsClient) RejectFollow(ctx context.Context, request *RejectFollowRequest) (*StreamResponse[RejectFollowResponse], error) { var result RejectFollowResponse - res, err := MakeRequest[RejectFollowRequest, RejectFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/reject", nil, request, &result, nil) + res, err := MakeRequest[RejectFollowRequest, RejectFollowResponse](c.client, ctx, "POST", "/api/v2/feeds/follows/reject",nil,request, &result,nil) return res, err } // Removes a follow and broadcasts FollowRemovedEvent -func (c *FeedsClient) Unfollow(ctx context.Context, source string, target string, request *UnfollowRequest) (*StreamResponse[UnfollowResponse], error) { +// +func (c *FeedsClient) Unfollow(ctx context.Context,source string, target string, request *UnfollowRequest) (*StreamResponse[UnfollowResponse], error) { var result UnfollowResponse pathParams := map[string]string{ "source": source, "target": target, } params := extractQueryParams(request) - res, err := MakeRequest[any, UnfollowResponse](c.client, ctx, "DELETE", "/api/v2/feeds/follows/{source}/{target}", params, nil, &result, pathParams) + res, err := MakeRequest[any, UnfollowResponse](c.client, ctx, "DELETE", "/api/v2/feeds/follows/{source}/{target}",params, nil, &result,pathParams) return res, err } // Create a new membership level with tag-based access controls +// func (c *FeedsClient) CreateMembershipLevel(ctx context.Context, request *CreateMembershipLevelRequest) (*StreamResponse[CreateMembershipLevelResponse], error) { var result CreateMembershipLevelResponse - res, err := MakeRequest[CreateMembershipLevelRequest, CreateMembershipLevelResponse](c.client, ctx, "POST", "/api/v2/feeds/membership_levels", nil, request, &result, nil) + res, err := MakeRequest[CreateMembershipLevelRequest, CreateMembershipLevelResponse](c.client, ctx, "POST", "/api/v2/feeds/membership_levels",nil,request, &result,nil) return res, err } // Query membership levels with filter query +// func (c *FeedsClient) QueryMembershipLevels(ctx context.Context, request *QueryMembershipLevelsRequest) (*StreamResponse[QueryMembershipLevelsResponse], error) { var result QueryMembershipLevelsResponse - res, err := MakeRequest[QueryMembershipLevelsRequest, QueryMembershipLevelsResponse](c.client, ctx, "POST", "/api/v2/feeds/membership_levels/query", nil, request, &result, nil) + res, err := MakeRequest[QueryMembershipLevelsRequest, QueryMembershipLevelsResponse](c.client, ctx, "POST", "/api/v2/feeds/membership_levels/query",nil,request, &result,nil) return res, err } // Delete a membership level by its UUID. This operation is irreversible. -func (c *FeedsClient) DeleteMembershipLevel(ctx context.Context, id string, request *DeleteMembershipLevelRequest) (*StreamResponse[Response], error) { +// +func (c *FeedsClient) DeleteMembershipLevel(ctx context.Context,id string, request *DeleteMembershipLevelRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/feeds/membership_levels/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/feeds/membership_levels/{id}",nil, nil, &result,pathParams) return res, err } // Update a membership level with partial updates. Only specified fields will be updated. -func (c *FeedsClient) UpdateMembershipLevel(ctx context.Context, id string, request *UpdateMembershipLevelRequest) (*StreamResponse[UpdateMembershipLevelResponse], error) { +// +func (c *FeedsClient) UpdateMembershipLevel(ctx context.Context,id string, request *UpdateMembershipLevelRequest) (*StreamResponse[UpdateMembershipLevelResponse], error) { var result UpdateMembershipLevelResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateMembershipLevelRequest, UpdateMembershipLevelResponse](c.client, ctx, "PATCH", "/api/v2/feeds/membership_levels/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateMembershipLevelRequest, UpdateMembershipLevelResponse](c.client, ctx, "PATCH", "/api/v2/feeds/membership_levels/{id}",nil,request, &result,pathParams) return res, err } // Retrieve usage statistics for feeds including activity count, follow count, and API request count. // Returns data aggregated by day with pagination support via from/to date parameters. // This endpoint is server-side only. +// func (c *FeedsClient) QueryFeedsUsageStats(ctx context.Context, request *QueryFeedsUsageStatsRequest) (*StreamResponse[QueryFeedsUsageStatsResponse], error) { var result QueryFeedsUsageStatsResponse - res, err := MakeRequest[QueryFeedsUsageStatsRequest, QueryFeedsUsageStatsResponse](c.client, ctx, "POST", "/api/v2/feeds/stats/usage", nil, request, &result, nil) + res, err := MakeRequest[QueryFeedsUsageStatsRequest, QueryFeedsUsageStatsResponse](c.client, ctx, "POST", "/api/v2/feeds/stats/usage",nil,request, &result,nil) return res, err } // Removes multiple follows at once and broadcasts FollowRemovedEvent for each one +// func (c *FeedsClient) UnfollowBatch(ctx context.Context, request *UnfollowBatchRequest) (*StreamResponse[UnfollowBatchResponse], error) { var result UnfollowBatchResponse - res, err := MakeRequest[UnfollowBatchRequest, UnfollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/unfollow/batch", nil, request, &result, nil) + res, err := MakeRequest[UnfollowBatchRequest, UnfollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/unfollow/batch",nil,request, &result,nil) return res, err } // Removes multiple follows and broadcasts FollowRemovedEvent for each. Does not return an error if follows don't exist. +// func (c *FeedsClient) GetOrCreateUnfollows(ctx context.Context, request *GetOrCreateUnfollowsRequest) (*StreamResponse[UnfollowBatchResponse], error) { var result UnfollowBatchResponse - res, err := MakeRequest[GetOrCreateUnfollowsRequest, UnfollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/unfollow/batch/upsert", nil, request, &result, nil) + res, err := MakeRequest[GetOrCreateUnfollowsRequest, UnfollowBatchResponse](c.client, ctx, "POST", "/api/v2/feeds/unfollow/batch/upsert",nil,request, &result,nil) return res, err } // Delete all feed data for a user including: feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user -func (c *FeedsClient) DeleteFeedUserData(ctx context.Context, userID string, request *DeleteFeedUserDataRequest) (*StreamResponse[DeleteFeedUserDataResponse], error) { +// +func (c *FeedsClient) DeleteFeedUserData(ctx context.Context,userID string, request *DeleteFeedUserDataRequest) (*StreamResponse[DeleteFeedUserDataResponse], error) { var result DeleteFeedUserDataResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[DeleteFeedUserDataRequest, DeleteFeedUserDataResponse](c.client, ctx, "POST", "/api/v2/feeds/users/{user_id}/delete", nil, request, &result, pathParams) + res, err := MakeRequest[DeleteFeedUserDataRequest, DeleteFeedUserDataResponse](c.client, ctx, "POST", "/api/v2/feeds/users/{user_id}/delete",nil,request, &result,pathParams) return res, err } // Export all feed data for a user including: user profile, feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user -func (c *FeedsClient) ExportFeedUserData(ctx context.Context, userID string, request *ExportFeedUserDataRequest) (*StreamResponse[ExportFeedUserDataResponse], error) { +// +func (c *FeedsClient) ExportFeedUserData(ctx context.Context,userID string, request *ExportFeedUserDataRequest) (*StreamResponse[ExportFeedUserDataResponse], error) { var result ExportFeedUserDataResponse pathParams := map[string]string{ "user_id": userID, } - res, err := MakeRequest[any, ExportFeedUserDataResponse](c.client, ctx, "POST", "/api/v2/feeds/users/{user_id}/export", nil, nil, &result, pathParams) + res, err := MakeRequest[any, ExportFeedUserDataResponse](c.client, ctx, "POST", "/api/v2/feeds/users/{user_id}/export",nil, nil, &result,pathParams) return res, err -} +} \ No newline at end of file diff --git a/feeds.go b/feeds.go index aa4eb59..dd8461b 100644 --- a/feeds.go +++ b/feeds.go @@ -4,16 +4,16 @@ package getstream import "context" type Feeds struct { - feedType string - feedID string - client *FeedsClient + feedType string + feedID string + client *FeedsClient } func NewFeed(feedType string, feedID string, client *FeedsClient) *Feeds { return &Feeds{ feedType: feedType, - feedID: feedID, - client: client, + feedID: feedID, + client: client, } } @@ -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 a3e4001..0d58a5e 100644 --- a/feeds_test.go +++ b/feeds_test.go @@ -2,619 +2,625 @@ package getstream_test import ( - "context" - "testing" + "context" + "testing" - "github.com/GetStream/getstream-go/v3" - "github.com/stretchr/testify/require" + "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/require" ) - -func TestFeedsAddActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddActivity(context.Background(), &getstream.AddActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsUpsertActivities(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, 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) - - _, err = client.Feeds().DeleteActivities(context.Background(), &getstream.DeleteActivitiesRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryActivities(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryActivities(context.Background(), &getstream.QueryActivitiesRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteBookmark(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteBookmark(context.Background(), "", &getstream.DeleteBookmarkRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateBookmark(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateBookmark(context.Background(), "", &getstream.UpdateBookmarkRequest{}) - require.NoError(t, err) -} -func TestFeedsAddBookmark(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddBookmark(context.Background(), "", &getstream.AddBookmarkRequest{}) - require.NoError(t, err) -} -func TestFeedsActivityFeedback(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ActivityFeedback(context.Background(), "", &getstream.ActivityFeedbackRequest{}) - require.NoError(t, err) -} -func TestFeedsCastPollVote(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CastPollVote(context.Background(), "", "", &getstream.CastPollVoteRequest{}) - require.NoError(t, err) -} -func TestFeedsDeletePollVote(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeletePollVote(context.Background(), "", "", "", &getstream.DeletePollVoteRequest{}) - require.NoError(t, err) -} -func TestFeedsAddActivityReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddActivityReaction(context.Background(), "", &getstream.AddActivityReactionRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryActivityReactions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryActivityReactions(context.Background(), "", &getstream.QueryActivityReactionsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteActivityReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteActivityReaction(context.Background(), "", "", &getstream.DeleteActivityReactionRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteActivity(context.Background(), "", &getstream.DeleteActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsGetActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetActivity(context.Background(), "", &getstream.GetActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateActivityPartial(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateActivityPartial(context.Background(), "", &getstream.UpdateActivityPartialRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateActivity(context.Background(), "", &getstream.UpdateActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsRestoreActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().RestoreActivity(context.Background(), "", &getstream.RestoreActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryBookmarkFolders(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryBookmarkFolders(context.Background(), &getstream.QueryBookmarkFoldersRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteBookmarkFolder(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteBookmarkFolder(context.Background(), "", &getstream.DeleteBookmarkFolderRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateBookmarkFolder(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateBookmarkFolder(context.Background(), "", &getstream.UpdateBookmarkFolderRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryBookmarks(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryBookmarks(context.Background(), &getstream.QueryBookmarksRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteCollections(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteCollections(context.Background(), &getstream.DeleteCollectionsRequest{}) - require.NoError(t, err) -} -func TestFeedsReadCollections(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ReadCollections(context.Background(), &getstream.ReadCollectionsRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateCollections(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateCollections(context.Background(), &getstream.UpdateCollectionsRequest{}) - require.NoError(t, err) -} -func TestFeedsCreateCollections(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CreateCollections(context.Background(), &getstream.CreateCollectionsRequest{}) - require.NoError(t, err) -} -func TestFeedsUpsertCollections(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpsertCollections(context.Background(), &getstream.UpsertCollectionsRequest{}) - require.NoError(t, err) -} -func TestFeedsGetComments(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetComments(context.Background(), &getstream.GetCommentsRequest{}) - require.NoError(t, err) -} -func TestFeedsAddComment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddComment(context.Background(), &getstream.AddCommentRequest{}) - require.NoError(t, err) -} -func TestFeedsAddCommentsBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddCommentsBatch(context.Background(), &getstream.AddCommentsBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryComments(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryComments(context.Background(), &getstream.QueryCommentsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteComment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteComment(context.Background(), "", &getstream.DeleteCommentRequest{}) - require.NoError(t, err) -} -func TestFeedsGetComment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetComment(context.Background(), "", &getstream.GetCommentRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateComment(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateComment(context.Background(), "", &getstream.UpdateCommentRequest{}) - require.NoError(t, err) -} -func TestFeedsAddCommentReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AddCommentReaction(context.Background(), "", &getstream.AddCommentReactionRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryCommentReactions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryCommentReactions(context.Background(), "", &getstream.QueryCommentReactionsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteCommentReaction(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteCommentReaction(context.Background(), "", "", &getstream.DeleteCommentReactionRequest{}) - require.NoError(t, err) -} -func TestFeedsGetCommentReplies(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetCommentReplies(context.Background(), "", &getstream.GetCommentRepliesRequest{}) - require.NoError(t, err) -} -func TestFeedsListFeedGroups(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ListFeedGroups(context.Background(), &getstream.ListFeedGroupsRequest{}) - require.NoError(t, err) -} -func TestFeedsCreateFeedGroup(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CreateFeedGroup(context.Background(), &getstream.CreateFeedGroupRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteFeed(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteFeed(context.Background(), "", "", &getstream.DeleteFeedRequest{}) - require.NoError(t, err) -} -func TestFeedsGetOrCreateFeed(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetOrCreateFeed(context.Background(), "", "", &getstream.GetOrCreateFeedRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFeed(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFeed(context.Background(), "", "", &getstream.UpdateFeedRequest{}) - require.NoError(t, err) -} -func TestFeedsMarkActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().MarkActivity(context.Background(), "", "", &getstream.MarkActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsUnpinActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UnpinActivity(context.Background(), "", "", "", &getstream.UnpinActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsPinActivity(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().PinActivity(context.Background(), "", "", "", &getstream.PinActivityRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFeedMembers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFeedMembers(context.Background(), "", "", &getstream.UpdateFeedMembersRequest{}) - require.NoError(t, err) -} -func TestFeedsAcceptFeedMemberInvite(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AcceptFeedMemberInvite(context.Background(), "", "", &getstream.AcceptFeedMemberInviteRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryFeedMembers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryFeedMembers(context.Background(), "", "", &getstream.QueryFeedMembersRequest{}) - require.NoError(t, err) -} -func TestFeedsRejectFeedMemberInvite(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().RejectFeedMemberInvite(context.Background(), "", "", &getstream.RejectFeedMemberInviteRequest{}) - require.NoError(t, err) -} -func TestFeedsGetFollowSuggestions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetFollowSuggestions(context.Background(), "", &getstream.GetFollowSuggestionsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteFeedGroup(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteFeedGroup(context.Background(), "", &getstream.DeleteFeedGroupRequest{}) - require.NoError(t, err) -} -func TestFeedsGetFeedGroup(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetFeedGroup(context.Background(), "", &getstream.GetFeedGroupRequest{}) - require.NoError(t, err) -} -func TestFeedsGetOrCreateFeedGroup(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetOrCreateFeedGroup(context.Background(), "", &getstream.GetOrCreateFeedGroupRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFeedGroup(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFeedGroup(context.Background(), "", &getstream.UpdateFeedGroupRequest{}) - require.NoError(t, err) -} -func TestFeedsListFeedViews(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ListFeedViews(context.Background(), &getstream.ListFeedViewsRequest{}) - require.NoError(t, err) -} -func TestFeedsCreateFeedView(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CreateFeedView(context.Background(), &getstream.CreateFeedViewRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteFeedView(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteFeedView(context.Background(), "", &getstream.DeleteFeedViewRequest{}) - require.NoError(t, err) -} -func TestFeedsGetFeedView(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetFeedView(context.Background(), "", &getstream.GetFeedViewRequest{}) - require.NoError(t, err) -} -func TestFeedsGetOrCreateFeedView(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetOrCreateFeedView(context.Background(), "", &getstream.GetOrCreateFeedViewRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFeedView(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFeedView(context.Background(), "", &getstream.UpdateFeedViewRequest{}) - require.NoError(t, err) -} -func TestFeedsListFeedVisibilities(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ListFeedVisibilities(context.Background(), &getstream.ListFeedVisibilitiesRequest{}) - require.NoError(t, err) -} -func TestFeedsGetFeedVisibility(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetFeedVisibility(context.Background(), "", &getstream.GetFeedVisibilityRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFeedVisibility(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFeedVisibility(context.Background(), "", &getstream.UpdateFeedVisibilityRequest{}) - require.NoError(t, err) -} -func TestFeedsCreateFeedsBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CreateFeedsBatch(context.Background(), &getstream.CreateFeedsBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteFeedsBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteFeedsBatch(context.Background(), &getstream.DeleteFeedsBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsOwnBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().OwnBatch(context.Background(), &getstream.OwnBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryFeeds(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryFeeds(context.Background(), &getstream.QueryFeedsRequest{}) - require.NoError(t, err) -} -func TestFeedsGetFeedsRateLimits(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetFeedsRateLimits(context.Background(), &getstream.GetFeedsRateLimitsRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateFollow(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateFollow(context.Background(), &getstream.UpdateFollowRequest{}) - require.NoError(t, err) -} -func TestFeedsFollow(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().Follow(context.Background(), &getstream.FollowRequest{}) - require.NoError(t, err) -} -func TestFeedsAcceptFollow(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().AcceptFollow(context.Background(), &getstream.AcceptFollowRequest{}) - require.NoError(t, err) -} -func TestFeedsFollowBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().FollowBatch(context.Background(), &getstream.FollowBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsGetOrCreateFollows(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetOrCreateFollows(context.Background(), &getstream.GetOrCreateFollowsRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryFollows(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryFollows(context.Background(), &getstream.QueryFollowsRequest{}) - require.NoError(t, err) -} -func TestFeedsRejectFollow(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().RejectFollow(context.Background(), &getstream.RejectFollowRequest{}) - require.NoError(t, err) -} -func TestFeedsUnfollow(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().Unfollow(context.Background(), "", "", &getstream.UnfollowRequest{}) - require.NoError(t, err) -} -func TestFeedsCreateMembershipLevel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().CreateMembershipLevel(context.Background(), &getstream.CreateMembershipLevelRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryMembershipLevels(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryMembershipLevels(context.Background(), &getstream.QueryMembershipLevelsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteMembershipLevel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteMembershipLevel(context.Background(), "", &getstream.DeleteMembershipLevelRequest{}) - require.NoError(t, err) -} -func TestFeedsUpdateMembershipLevel(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UpdateMembershipLevel(context.Background(), "", &getstream.UpdateMembershipLevelRequest{}) - require.NoError(t, err) -} -func TestFeedsQueryFeedsUsageStats(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().QueryFeedsUsageStats(context.Background(), &getstream.QueryFeedsUsageStatsRequest{}) - require.NoError(t, err) -} -func TestFeedsUnfollowBatch(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().UnfollowBatch(context.Background(), &getstream.UnfollowBatchRequest{}) - require.NoError(t, err) -} -func TestFeedsGetOrCreateUnfollows(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().GetOrCreateUnfollows(context.Background(), &getstream.GetOrCreateUnfollowsRequest{}) - require.NoError(t, err) -} -func TestFeedsDeleteFeedUserData(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().DeleteFeedUserData(context.Background(), "", &getstream.DeleteFeedUserDataRequest{}) - require.NoError(t, err) -} -func TestFeedsExportFeedUserData(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Feeds().ExportFeedUserData(context.Background(), "", &getstream.ExportFeedUserDataRequest{}) - require.NoError(t, err) -} + func TestFeedsAddActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddActivity(context.Background(),&getstream.AddActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsUpsertActivities(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, 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) + + _, err = client.Feeds().DeleteActivities(context.Background(),&getstream.DeleteActivitiesRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryActivities(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryActivities(context.Background(),&getstream.QueryActivitiesRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteBookmark(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteBookmark(context.Background(),"", &getstream.DeleteBookmarkRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateBookmark(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateBookmark(context.Background(),"", &getstream.UpdateBookmarkRequest{}) + require.NoError(t, err) + } + func TestFeedsAddBookmark(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddBookmark(context.Background(),"", &getstream.AddBookmarkRequest{}) + require.NoError(t, err) + } + func TestFeedsActivityFeedback(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ActivityFeedback(context.Background(),"", &getstream.ActivityFeedbackRequest{}) + require.NoError(t, err) + } + func TestFeedsCastPollVote(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CastPollVote(context.Background(),"", "", &getstream.CastPollVoteRequest{}) + require.NoError(t, err) + } + func TestFeedsDeletePollVote(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeletePollVote(context.Background(),"", "", "", &getstream.DeletePollVoteRequest{}) + require.NoError(t, err) + } + func TestFeedsAddActivityReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddActivityReaction(context.Background(),"", &getstream.AddActivityReactionRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryActivityReactions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryActivityReactions(context.Background(),"", &getstream.QueryActivityReactionsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteActivityReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteActivityReaction(context.Background(),"", "", &getstream.DeleteActivityReactionRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteActivity(context.Background(),"", &getstream.DeleteActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsGetActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetActivity(context.Background(),"", &getstream.GetActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateActivityPartial(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateActivityPartial(context.Background(),"", &getstream.UpdateActivityPartialRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateActivity(context.Background(),"", &getstream.UpdateActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsRestoreActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().RestoreActivity(context.Background(),"", &getstream.RestoreActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryBookmarkFolders(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryBookmarkFolders(context.Background(),&getstream.QueryBookmarkFoldersRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteBookmarkFolder(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteBookmarkFolder(context.Background(),"", &getstream.DeleteBookmarkFolderRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateBookmarkFolder(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateBookmarkFolder(context.Background(),"", &getstream.UpdateBookmarkFolderRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryBookmarks(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryBookmarks(context.Background(),&getstream.QueryBookmarksRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteCollections(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteCollections(context.Background(),&getstream.DeleteCollectionsRequest{}) + require.NoError(t, err) + } + func TestFeedsReadCollections(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ReadCollections(context.Background(),&getstream.ReadCollectionsRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateCollections(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateCollections(context.Background(),&getstream.UpdateCollectionsRequest{}) + require.NoError(t, err) + } + func TestFeedsCreateCollections(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CreateCollections(context.Background(),&getstream.CreateCollectionsRequest{}) + require.NoError(t, err) + } + func TestFeedsUpsertCollections(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpsertCollections(context.Background(),&getstream.UpsertCollectionsRequest{}) + require.NoError(t, err) + } + func TestFeedsGetComments(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetComments(context.Background(),&getstream.GetCommentsRequest{}) + require.NoError(t, err) + } + func TestFeedsAddComment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddComment(context.Background(),&getstream.AddCommentRequest{}) + require.NoError(t, err) + } + func TestFeedsAddCommentsBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddCommentsBatch(context.Background(),&getstream.AddCommentsBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryComments(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryComments(context.Background(),&getstream.QueryCommentsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteComment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteComment(context.Background(),"", &getstream.DeleteCommentRequest{}) + require.NoError(t, err) + } + func TestFeedsGetComment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetComment(context.Background(),"", &getstream.GetCommentRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateComment(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateComment(context.Background(),"", &getstream.UpdateCommentRequest{}) + require.NoError(t, err) + } + func TestFeedsAddCommentReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AddCommentReaction(context.Background(),"", &getstream.AddCommentReactionRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryCommentReactions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryCommentReactions(context.Background(),"", &getstream.QueryCommentReactionsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteCommentReaction(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteCommentReaction(context.Background(),"", "", &getstream.DeleteCommentReactionRequest{}) + require.NoError(t, err) + } + func TestFeedsGetCommentReplies(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetCommentReplies(context.Background(),"", &getstream.GetCommentRepliesRequest{}) + require.NoError(t, err) + } + func TestFeedsListFeedGroups(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ListFeedGroups(context.Background(),&getstream.ListFeedGroupsRequest{}) + require.NoError(t, err) + } + func TestFeedsCreateFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CreateFeedGroup(context.Background(),&getstream.CreateFeedGroupRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteFeed(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteFeed(context.Background(),"", "", &getstream.DeleteFeedRequest{}) + require.NoError(t, err) + } + func TestFeedsGetOrCreateFeed(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetOrCreateFeed(context.Background(),"", "", &getstream.GetOrCreateFeedRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFeed(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFeed(context.Background(),"", "", &getstream.UpdateFeedRequest{}) + require.NoError(t, err) + } + func TestFeedsMarkActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().MarkActivity(context.Background(),"", "", &getstream.MarkActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsUnpinActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UnpinActivity(context.Background(),"", "", "", &getstream.UnpinActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsPinActivity(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().PinActivity(context.Background(),"", "", "", &getstream.PinActivityRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFeedMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFeedMembers(context.Background(),"", "", &getstream.UpdateFeedMembersRequest{}) + require.NoError(t, err) + } + func TestFeedsAcceptFeedMemberInvite(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AcceptFeedMemberInvite(context.Background(),"", "", &getstream.AcceptFeedMemberInviteRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryFeedMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryFeedMembers(context.Background(),"", "", &getstream.QueryFeedMembersRequest{}) + require.NoError(t, err) + } + func TestFeedsRejectFeedMemberInvite(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, 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) + + _, err = client.Feeds().GetFollowSuggestions(context.Background(),"", &getstream.GetFollowSuggestionsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteFeedGroup(context.Background(),"", &getstream.DeleteFeedGroupRequest{}) + require.NoError(t, err) + } + func TestFeedsGetFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetFeedGroup(context.Background(),"", &getstream.GetFeedGroupRequest{}) + require.NoError(t, err) + } + func TestFeedsGetOrCreateFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetOrCreateFeedGroup(context.Background(),"", &getstream.GetOrCreateFeedGroupRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFeedGroup(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFeedGroup(context.Background(),"", &getstream.UpdateFeedGroupRequest{}) + require.NoError(t, err) + } + func TestFeedsListFeedViews(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ListFeedViews(context.Background(),&getstream.ListFeedViewsRequest{}) + require.NoError(t, err) + } + func TestFeedsCreateFeedView(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CreateFeedView(context.Background(),&getstream.CreateFeedViewRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteFeedView(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteFeedView(context.Background(),"", &getstream.DeleteFeedViewRequest{}) + require.NoError(t, err) + } + func TestFeedsGetFeedView(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetFeedView(context.Background(),"", &getstream.GetFeedViewRequest{}) + require.NoError(t, err) + } + func TestFeedsGetOrCreateFeedView(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetOrCreateFeedView(context.Background(),"", &getstream.GetOrCreateFeedViewRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFeedView(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFeedView(context.Background(),"", &getstream.UpdateFeedViewRequest{}) + require.NoError(t, err) + } + func TestFeedsListFeedVisibilities(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ListFeedVisibilities(context.Background(),&getstream.ListFeedVisibilitiesRequest{}) + require.NoError(t, err) + } + func TestFeedsGetFeedVisibility(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetFeedVisibility(context.Background(),"", &getstream.GetFeedVisibilityRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFeedVisibility(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFeedVisibility(context.Background(),"", &getstream.UpdateFeedVisibilityRequest{}) + require.NoError(t, err) + } + func TestFeedsCreateFeedsBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CreateFeedsBatch(context.Background(),&getstream.CreateFeedsBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteFeedsBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteFeedsBatch(context.Background(),&getstream.DeleteFeedsBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsOwnBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().OwnBatch(context.Background(),&getstream.OwnBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryFeeds(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryFeeds(context.Background(),&getstream.QueryFeedsRequest{}) + require.NoError(t, err) + } + func TestFeedsGetFeedsRateLimits(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetFeedsRateLimits(context.Background(),&getstream.GetFeedsRateLimitsRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateFollow(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateFollow(context.Background(),&getstream.UpdateFollowRequest{}) + require.NoError(t, err) + } + func TestFeedsFollow(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().Follow(context.Background(),&getstream.FollowRequest{}) + require.NoError(t, err) + } + func TestFeedsAcceptFollow(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().AcceptFollow(context.Background(),&getstream.AcceptFollowRequest{}) + require.NoError(t, err) + } + func TestFeedsFollowBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().FollowBatch(context.Background(),&getstream.FollowBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsGetOrCreateFollows(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetOrCreateFollows(context.Background(),&getstream.GetOrCreateFollowsRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryFollows(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryFollows(context.Background(),&getstream.QueryFollowsRequest{}) + require.NoError(t, err) + } + func TestFeedsRejectFollow(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().RejectFollow(context.Background(),&getstream.RejectFollowRequest{}) + require.NoError(t, err) + } + func TestFeedsUnfollow(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().Unfollow(context.Background(),"", "", &getstream.UnfollowRequest{}) + require.NoError(t, err) + } + func TestFeedsCreateMembershipLevel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().CreateMembershipLevel(context.Background(),&getstream.CreateMembershipLevelRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryMembershipLevels(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryMembershipLevels(context.Background(),&getstream.QueryMembershipLevelsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteMembershipLevel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteMembershipLevel(context.Background(),"", &getstream.DeleteMembershipLevelRequest{}) + require.NoError(t, err) + } + func TestFeedsUpdateMembershipLevel(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UpdateMembershipLevel(context.Background(),"", &getstream.UpdateMembershipLevelRequest{}) + require.NoError(t, err) + } + func TestFeedsQueryFeedsUsageStats(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().QueryFeedsUsageStats(context.Background(),&getstream.QueryFeedsUsageStatsRequest{}) + require.NoError(t, err) + } + func TestFeedsUnfollowBatch(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().UnfollowBatch(context.Background(),&getstream.UnfollowBatchRequest{}) + require.NoError(t, err) + } + func TestFeedsGetOrCreateUnfollows(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().GetOrCreateUnfollows(context.Background(),&getstream.GetOrCreateUnfollowsRequest{}) + require.NoError(t, err) + } + func TestFeedsDeleteFeedUserData(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().DeleteFeedUserData(context.Background(),"", &getstream.DeleteFeedUserDataRequest{}) + require.NoError(t, err) + } + func TestFeedsExportFeedUserData(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Feeds().ExportFeedUserData(context.Background(),"", &getstream.ExportFeedUserDataRequest{}) + require.NoError(t, err) + } diff --git a/http.go b/http.go index edd3c19..3f07719 100644 --- a/http.go +++ b/http.go @@ -163,7 +163,7 @@ func newRequest[T any](c *Client, ctx context.Context, method, path string, para case io.Reader: c.logger.Debug("Data is io.Reader") r.Body = io.NopCloser(t) - case *UploadFileRequest, *UploadImageRequest: + case *UploadFileRequest, *UploadImageRequest, *UploadChannelFileRequest, *UploadChannelImageRequest: return c.createMultipartRequest(r, t) default: c.logger.Debug("Data is of type %T, attempting to marshal to JSON", t) @@ -260,6 +260,62 @@ func (c *Client) createMultipartRequest(r *http.Request, data any) (*http.Reques } } + case *UploadChannelFileRequest: + if req.File == nil { + return nil, fmt.Errorf("file name must be provided") + } + fileName = *req.File + fileContent, err = getFileContent(*req.File, nil) + if err != nil { + return nil, fmt.Errorf("failed to open file: %w", err) + } + + // Add user field if present + if req.User != nil { + userJSON, err := json.Marshal(req.User) + if err != nil { + return nil, fmt.Errorf("failed to marshal user: %w", err) + } + err = writer.WriteField("user", string(userJSON)) + if err != nil { + return nil, fmt.Errorf("failed to write user field: %w", err) + } + } + + case *UploadChannelImageRequest: + if req.File == nil { + return nil, fmt.Errorf("file name must be provided") + } + fileName = *req.File + fileContent, err = getFileContent(*req.File, nil) + if err != nil { + return nil, fmt.Errorf("failed to open file: %w", err) + } + + // Add upload_sizes field if present + if req.UploadSizes != nil && len(req.UploadSizes) > 0 { + uploadSizesJSON, err := json.Marshal(req.UploadSizes) + if err != nil { + return nil, fmt.Errorf("failed to marshal upload_sizes: %w", err) + } + err = writer.WriteField("upload_sizes", string(uploadSizesJSON)) + if err != nil { + return nil, fmt.Errorf("failed to write upload_sizes field: %w", err) + } + } + + // Add user field if present + if req.User != nil { + userJSON, err := json.Marshal(req.User) + if err != nil { + return nil, fmt.Errorf("failed to marshal user: %w", err) + } + err = writer.WriteField("user", string(userJSON)) + if err != nil { + return nil, fmt.Errorf("failed to write user field: %w", err) + } + } + default: return nil, fmt.Errorf("unsupported request type for multipart: %T", data) } @@ -363,7 +419,14 @@ func EncodeValueToQueryParam(value any) string { return strconv.FormatFloat(val.Float(), 'f', -1, 64) case reflect.Bool: return strconv.FormatBool(val.Bool()) - case reflect.Map, reflect.Struct, reflect.Slice: + case reflect.Slice: + // For query params, slices of primitives should be comma-separated (e.g. ids=a,b,c) + parts := make([]string, val.Len()) + for i := 0; i < val.Len(); i++ { + parts[i] = EncodeValueToQueryParam(val.Index(i).Interface()) + } + return strings.Join(parts, ",") + case reflect.Map, reflect.Struct: b, err := json.Marshal(value) if err != nil { panic(err) diff --git a/models.go b/models.go index 25361d2..ff9f90a 100644 --- a/models.go +++ b/models.go @@ -2,24 +2,24 @@ 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 { @@ -42,69 +42,69 @@ type APIError struct { } 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"` - Data map[string]any `json:"data,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"` } 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"` + 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"` + Action string `json:"action"` + Label string `json:"label"` MinConfidence float64 `json:"min_confidence"` } 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"` } @@ -121,23 +121,23 @@ type ActionLogResponse struct { // 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 { @@ -159,7 +159,7 @@ type ActiveCallsLatencyStats struct { 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"` } @@ -169,24 +169,24 @@ type ActiveCallsResolutionStats struct { } 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 (e *ActivityAddedEvent) GetEventType() string { @@ -196,15 +196,15 @@ func (e *ActivityAddedEvent) GetEventType() string { // 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 (e *ActivityDeletedEvent) GetEventType() string { @@ -214,13 +214,13 @@ func (e *ActivityDeletedEvent) GetEventType() string { // 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 (e *ActivityFeedbackEvent) GetEventType() string { @@ -237,15 +237,15 @@ type ActivityFeedbackEventPayload struct { // 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 { @@ -258,24 +258,24 @@ 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"` + MarkWatched []string `json:"mark_watched,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ActivityMarkEvent) GetEventType() string { @@ -288,9 +288,9 @@ type ActivityPinResponse struct { // 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. @@ -298,14 +298,14 @@ 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 (e *ActivityPinnedEvent) GetEventType() string { @@ -320,16 +320,16 @@ 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 (e *ActivityReactionAddedEvent) GetEventType() string { @@ -339,16 +339,16 @@ func (e *ActivityReactionAddedEvent) GetEventType() string { // 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 (e *ActivityReactionDeletedEvent) GetEventType() string { @@ -358,16 +358,16 @@ func (e *ActivityReactionDeletedEvent) GetEventType() string { // 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 (e *ActivityReactionUpdatedEvent) GetEventType() string { @@ -377,15 +377,15 @@ func (e *ActivityReactionUpdatedEvent) GetEventType() string { // 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 (e *ActivityRemovedFromFeedEvent) GetEventType() string { @@ -434,7 +434,7 @@ type ActivityRequest struct { // 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"` @@ -495,7 +495,7 @@ type ActivityResponse struct { 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 @@ -503,9 +503,9 @@ type ActivityResponse struct { // When the activity will expire ExpiresAt *Timestamp `json:"expires_at,omitempty"` // Total count of reactions from friends on this activity - FriendReactionCount *int `json:"friend_reaction_count,omitempty"` - IsWatched *bool `json:"is_watched,omitempty"` - ModerationAction *string `json:"moderation_action,omitempty"` + FriendReactionCount *int `json:"friend_reaction_count,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 @@ -513,27 +513,27 @@ type ActivityResponse struct { // If visibility is 'tag', this is the tag name VisibilityTag *string `json:"visibility_tag,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"` + 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 (e *ActivityRestoredEvent) GetEventType() string { @@ -578,14 +578,14 @@ 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 (e *ActivityUnpinnedEvent) GetEventType() string { @@ -595,15 +595,15 @@ func (e *ActivityUnpinnedEvent) GetEventType() string { // 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 (e *ActivityUpdatedEvent) GetEventType() string { @@ -611,29 +611,29 @@ func (e *ActivityUpdatedEvent) GetEventType() string { } 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 @@ -661,17 +661,17 @@ type AddReactionRequest struct { // 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"` @@ -694,7 +694,7 @@ type AggregatedActivityResponse struct { UserCountTruncated bool `json:"user_count_truncated"` // List of activities in this aggregation Activities []ActivityResponse `json:"activities"` - IsWatched *bool `json:"is_watched,omitempty"` + IsWatched *bool `json:"is_watched,omitempty"` } type AggregationConfig struct { @@ -703,66 +703,68 @@ type AggregationConfig struct { } 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"` - 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 (e *AppealAcceptedEvent) GetEventType() string { @@ -771,11 +773,11 @@ func (e *AppealAcceptedEvent) GetEventType() string { // 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 (e *AppealCreatedEvent) GetEventType() string { @@ -791,7 +793,7 @@ type AppealItemResponse struct { 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 @@ -799,18 +801,18 @@ type AppealItemResponse struct { // 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 (e *AppealRejectedEvent) GetEventType() string { @@ -824,14 +826,14 @@ type AppealResponse struct { } type AsyncBulkImageModerationEvent 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"` + 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 (e *AsyncBulkImageModerationEvent) GetEventType() string { @@ -839,14 +841,14 @@ func (e *AsyncBulkImageModerationEvent) GetEventType() string { } 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"` + 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 (e *AsyncExportChannelsEvent) GetEventType() string { @@ -854,14 +856,14 @@ func (e *AsyncExportChannelsEvent) GetEventType() string { } 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"` + 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 (e *AsyncExportErrorEvent) GetEventType() string { @@ -869,14 +871,14 @@ func (e *AsyncExportErrorEvent) GetEventType() string { } 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"` + 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 (e *AsyncExportModerationLogsEvent) GetEventType() string { @@ -884,14 +886,14 @@ func (e *AsyncExportModerationLogsEvent) GetEventType() string { } 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"` + 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 (e *AsyncExportUsersEvent) GetEventType() string { @@ -899,111 +901,111 @@ func (e *AsyncExportUsersEvent) GetEventType() string { } 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 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"` + 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 @@ -1019,17 +1021,17 @@ type AzureRequest struct { } 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"` } @@ -1060,27 +1062,27 @@ type BanInfoResponse struct { // Reason for the ban Reason *string `json:"reason,omitempty"` // Whether this is a shadow ban - Shadow *bool `json:"shadow,omitempty"` + Shadow *bool `json:"shadow,omitempty"` CreatedBy *UserResponse `json:"created_by,omitempty"` - User *UserResponse `json:"user,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"` + 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 { - 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"` + 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 @@ -1090,9 +1092,9 @@ type BlockActionRequestPayload struct { } 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 { @@ -1104,7 +1106,7 @@ type BlockListOptions struct { // 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"` @@ -1114,16 +1116,16 @@ type BlockListResponse struct { 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. @@ -1146,11 +1148,11 @@ 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"` } @@ -1160,12 +1162,12 @@ func (e *BlockedUserEvent) GetEventType() string { 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 { @@ -1173,26 +1175,26 @@ 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 (e *BookmarkAddedEvent) GetEventType() string { @@ -1202,13 +1204,13 @@ func (e *BookmarkAddedEvent) GetEventType() string { // Emitted when a user deletes a bookmark from an activity. type BookmarkDeletedEvent 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.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 (e *BookmarkDeletedEvent) GetEventType() string { @@ -1218,13 +1220,13 @@ func (e *BookmarkDeletedEvent) GetEventType() string { // 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 (e *BookmarkFolderDeletedEvent) GetEventType() string { @@ -1239,8 +1241,8 @@ type BookmarkFolderResponse struct { // 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"` } @@ -1248,13 +1250,13 @@ 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 (e *BookmarkFolderUpdatedEvent) GetEventType() string { @@ -1265,24 +1267,24 @@ 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 (e *BookmarkUpdatedEvent) GetEventType() string { @@ -1290,31 +1292,31 @@ func (e *BookmarkUpdatedEvent) GetEventType() string { } 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"` } @@ -1326,10 +1328,10 @@ type BulkImageModerationResponse struct { // 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"` } @@ -1339,31 +1341,31 @@ func (e *CallAcceptedEvent) GetEventType() string { } 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"` + 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"` @@ -1375,7 +1377,7 @@ func (e *CallClosedCaptionsFailedEvent) GetEventType() string { // 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"` @@ -1387,7 +1389,7 @@ func (e *CallClosedCaptionsStartedEvent) GetEventType() string { // 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"` @@ -1400,11 +1402,11 @@ func (e *CallClosedCaptionsStoppedEvent) GetEventType() string { // 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"` } @@ -1414,13 +1416,13 @@ func (e *CallCreatedEvent) GetEventType() string { } type CallCustomPropertyParameters struct { - Operator *string `json:"operator,omitempty"` + 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"` + CallCid string `json:"call_cid"` CreatedAt Timestamp `json:"created_at"` // The DTMF digit (0-9, *, #, A-D) Digit string `json:"digit"` @@ -1429,8 +1431,8 @@ type CallDTMFEvent struct { // 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"` + Timestamp Timestamp `json:"timestamp"` + User UserResponse `json:"user"` // The type of event: "call.dtmf" in this case Type string `json:"type"` } @@ -1441,9 +1443,9 @@ func (e *CallDTMFEvent) GetEventType() string { // 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"` + 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"` } @@ -1462,14 +1464,14 @@ 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 (e *CallEndedEvent) GetEventType() string { @@ -1478,11 +1480,11 @@ func (e *CallEndedEvent) GetEventType() string { // 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"` - // The type of event: "call.frame_recording_failed" in this case + 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"` } @@ -1495,8 +1497,8 @@ 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) @@ -1515,10 +1517,10 @@ func (e *CallFrameRecordingFrameReadyEvent) GetEventType() string { // 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"` } @@ -1529,10 +1531,10 @@ func (e *CallFrameRecordingStartedEvent) GetEventType() string { // 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"` } @@ -1543,7 +1545,7 @@ func (e *CallFrameRecordingStoppedEvent) GetEventType() string { // 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"` @@ -1555,10 +1557,10 @@ func (e *CallHLSBroadcastingFailedEvent) GetEventType() string { // 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"` } @@ -1569,7 +1571,7 @@ func (e *CallHLSBroadcastingStartedEvent) GetEventType() string { // 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"` @@ -1582,15 +1584,15 @@ func (e *CallHLSBroadcastingStoppedEvent) GetEventType() string { // 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"` } @@ -1601,11 +1603,11 @@ func (e *CallLiveStartedEvent) GetEventType() string { // 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"` } @@ -1616,11 +1618,11 @@ func (e *CallMemberAddedEvent) GetEventType() string { // 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"` } @@ -1631,11 +1633,11 @@ func (e *CallMemberRemovedEvent) GetEventType() string { // 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"` } @@ -1646,11 +1648,11 @@ func (e *CallMemberUpdatedEvent) GetEventType() string { // 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 @@ -1663,15 +1665,15 @@ func (e *CallMemberUpdatedPermissionEvent) GetEventType() string { // 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"` } @@ -1682,7 +1684,7 @@ func (e *CallMissedEvent) GetEventType() string { // 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"` @@ -1698,7 +1700,7 @@ func (e *CallModerationBlurEvent) GetEventType() string { // 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"` @@ -1716,14 +1718,14 @@ func (e *CallModerationWarningEvent) GetEventType() string { // 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"` } @@ -1741,24 +1743,24 @@ 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 VideoReactionResponse `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"` } @@ -1769,19 +1771,19 @@ func (e *CallReactionEvent) GetEventType() string { // 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 @@ -1794,11 +1796,11 @@ func (e *CallRecordingFailedEvent) GetEventType() string { // 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"` @@ -1810,9 +1812,9 @@ func (e *CallRecordingReadyEvent) GetEventType() string { // 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 @@ -1825,9 +1827,9 @@ func (e *CallRecordingStartedEvent) GetEventType() string { // 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 @@ -1840,10 +1842,10 @@ func (e *CallRecordingStoppedEvent) GetEventType() string { // 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 @@ -1855,73 +1857,73 @@ func (e *CallRejectedEvent) GetEventType() string { } 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"` } @@ -1979,18 +1981,18 @@ func (e *CallRtmpBroadcastStoppedEvent) GetEventType() string { } type CallRuleActionSequence struct { - ViolationNumber *int `json:"violation_number,omitempty"` - Actions []string `json:"actions,omitempty"` - CallOptions *CallActionOptions `json:"call_options,omitempty"` + 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"` } @@ -2001,11 +2003,11 @@ func (e *CallSessionEndedEvent) GetEventType() string { // 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"` @@ -2017,10 +2019,10 @@ func (e *CallSessionParticipantCountsUpdatedEvent) GetEventType() string { // 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"` @@ -2032,12 +2034,12 @@ func (e *CallSessionParticipantJoinedEvent) GetEventType() string { // 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"` @@ -2050,27 +2052,27 @@ func (e *CallSessionParticipantLeftEvent) GetEventType() string { } 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"` } @@ -2080,95 +2082,95 @@ func (e *CallSessionStartedEvent) GetEventType() string { } 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 { @@ -2180,60 +2182,60 @@ 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"` @@ -2246,30 +2248,30 @@ func (e *CallStatsReportReadyEvent) GetEventType() string { } 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. @@ -2282,9 +2284,9 @@ func (e *CallTranscriptionFailedEvent) GetEventType() string { // 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"` @@ -2296,9 +2298,9 @@ func (e *CallTranscriptionReadyEvent) GetEventType() string { // 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"` } @@ -2309,9 +2311,9 @@ func (e *CallTranscriptionStartedEvent) GetEventType() string { // 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"` } @@ -2321,14 +2323,14 @@ func (e *CallTranscriptionStoppedEvent) GetEventType() string { } 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. @@ -2340,9 +2342,9 @@ type CallTypeResponse struct { // 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"` + Grants map[string][]string `json:"grants"` NotificationSettings NotificationSettingsResponse `json:"notification_settings"` - Settings CallSettingsResponse `json:"settings"` + Settings CallSettingsResponse `json:"settings"` // the external storage for the call type ExternalStorage *string `json:"external_storage,omitempty"` } @@ -2354,9 +2356,9 @@ type CallTypeRuleParameters struct { // 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 @@ -2369,18 +2371,18 @@ func (e *CallUpdatedEvent) GetEventType() string { // 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"` @@ -2392,11 +2394,11 @@ func (e *CallUserFeedbackSubmittedEvent) GetEventType() string { // 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"` } @@ -2405,6 +2407,11 @@ 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 { Count int `json:"count"` } @@ -2414,26 +2421,26 @@ 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 (e *CampaignCompletedEvent) GetEventType() string { @@ -2441,45 +2448,45 @@ func (e *CampaignCompletedEvent) GetEventType() string { } 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"` - 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"` + 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"` } 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"` + 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 (e *CampaignStartedEvent) GetEventType() string { @@ -2487,27 +2494,27 @@ func (e *CampaignStartedEvent) GetEventType() string { } 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"` + 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"` } 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"` + 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 (e *ChannelBatchCompletedEvent) GetEventType() string { @@ -2515,17 +2522,17 @@ func (e *ChannelBatchCompletedEvent) GetEventType() string { } 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"` + 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 (e *ChannelBatchStartedEvent) GetEventType() string { @@ -2533,105 +2540,105 @@ func (e *ChannelBatchStartedEvent) GetEventType() string { } 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"` + 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"` + 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"` } 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"` + 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"` + 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelCreatedEvent) GetEventType() string { @@ -2641,25 +2648,25 @@ func (e *ChannelCreatedEvent) GetEventType() string { // 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"` + 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelDeletedEvent) GetEventType() string { @@ -2681,8 +2688,8 @@ type ChannelExport struct { // 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"` + 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 @@ -2690,7 +2697,7 @@ type ChannelFrozenEvent struct { // 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"` + Cid *string `json:"cid,omitempty"` ReceivedAt *Timestamp `json:"received_at,omitempty"` } @@ -2702,12 +2709,12 @@ 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"` + 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"` } // Emitted when a channel is successfully hidden. @@ -2715,25 +2722,25 @@ 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"` + 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelHiddenEvent) GetEventType() string { @@ -2745,40 +2752,40 @@ type ChannelInput struct { 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"` + 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"` + 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 []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"` + 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 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"` + ChannelRole *string `json:"channel_role,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + User *UserResponse `json:"user,omitempty"` } type ChannelMemberResponse struct { @@ -2787,17 +2794,17 @@ type ChannelMemberResponse struct { // 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"` + 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"` + 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"` + DeletedAt *Timestamp `json:"deleted_at,omitempty"` // Date when invite was accepted InviteAcceptedAt *Timestamp `json:"invite_accepted_at,omitempty"` // Date when invite was rejected @@ -2805,21 +2812,21 @@ type ChannelMemberResponse struct { // 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"` + 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"` + 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"` + Channel ChannelResponse `json:"channel"` } type ChannelMute struct { @@ -2828,69 +2835,68 @@ type ChannelMute struct { // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` // Date/time of mute expiration - Expires *Timestamp `json:"expires,omitempty"` + Expires *Timestamp `json:"expires,omitempty"` Channel *ChannelResponse `json:"channel,omitempty"` - User *UserResponse `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } // Emitted when a channel is successfully muted. type ChannelMutedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` // The type of event: "channel.muted" in this case - Type string `json:"type"` + 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"` + Mutes []ChannelMute `json:"mutes,omitempty"` + Mute *ChannelMute `json:"mute,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelMutedEvent) GetEventType() string { return e.Type } - type ChannelOwnCapability string const ( - BAN_CHANNEL_MEMBERS ChannelOwnCapability = "ban-channel-members" - CAST_POLL_VOTE ChannelOwnCapability = "cast-poll-vote" - CONNECT_EVENTS ChannelOwnCapability = "connect-events" - CREATE_ATTACHMENT ChannelOwnCapability = "create-attachment" - DELETE_ANY_MESSAGE ChannelOwnCapability = "delete-any-message" - DELETE_CHANNEL ChannelOwnCapability = "delete-channel" - DELETE_OWN_MESSAGE ChannelOwnCapability = "delete-own-message" - DELIVERY_EVENTS ChannelOwnCapability = "delivery-events" - FLAG_MESSAGE ChannelOwnCapability = "flag-message" - FREEZE_CHANNEL ChannelOwnCapability = "freeze-channel" - JOIN_CHANNEL ChannelOwnCapability = "join-channel" - LEAVE_CHANNEL ChannelOwnCapability = "leave-channel" - MUTE_CHANNEL ChannelOwnCapability = "mute-channel" - PIN_MESSAGE ChannelOwnCapability = "pin-message" - QUERY_POLL_VOTES ChannelOwnCapability = "query-poll-votes" - QUOTE_MESSAGE ChannelOwnCapability = "quote-message" - READ_EVENTS ChannelOwnCapability = "read-events" - SEARCH_MESSAGES ChannelOwnCapability = "search-messages" - SEND_CUSTOM_EVENTS ChannelOwnCapability = "send-custom-events" - SEND_LINKS ChannelOwnCapability = "send-links" - SEND_MESSAGE ChannelOwnCapability = "send-message" - SEND_POLL ChannelOwnCapability = "send-poll" - SEND_REACTION ChannelOwnCapability = "send-reaction" - SEND_REPLY ChannelOwnCapability = "send-reply" + BAN_CHANNEL_MEMBERS ChannelOwnCapability = "ban-channel-members" + CAST_POLL_VOTE ChannelOwnCapability = "cast-poll-vote" + CONNECT_EVENTS ChannelOwnCapability = "connect-events" + CREATE_ATTACHMENT ChannelOwnCapability = "create-attachment" + DELETE_ANY_MESSAGE ChannelOwnCapability = "delete-any-message" + DELETE_CHANNEL ChannelOwnCapability = "delete-channel" + DELETE_OWN_MESSAGE ChannelOwnCapability = "delete-own-message" + DELIVERY_EVENTS ChannelOwnCapability = "delivery-events" + FLAG_MESSAGE ChannelOwnCapability = "flag-message" + FREEZE_CHANNEL ChannelOwnCapability = "freeze-channel" + JOIN_CHANNEL ChannelOwnCapability = "join-channel" + LEAVE_CHANNEL ChannelOwnCapability = "leave-channel" + MUTE_CHANNEL ChannelOwnCapability = "mute-channel" + PIN_MESSAGE ChannelOwnCapability = "pin-message" + QUERY_POLL_VOTES ChannelOwnCapability = "query-poll-votes" + QUOTE_MESSAGE ChannelOwnCapability = "quote-message" + READ_EVENTS ChannelOwnCapability = "read-events" + SEARCH_MESSAGES ChannelOwnCapability = "search-messages" + SEND_CUSTOM_EVENTS ChannelOwnCapability = "send-custom-events" + SEND_LINKS ChannelOwnCapability = "send-links" + SEND_MESSAGE ChannelOwnCapability = "send-message" + SEND_POLL ChannelOwnCapability = "send-poll" + SEND_REACTION ChannelOwnCapability = "send-reaction" + SEND_REPLY ChannelOwnCapability = "send-reply" SEND_RESTRICTED_VISIBILITY_MESSAGE ChannelOwnCapability = "send-restricted-visibility-message" - SEND_TYPING_EVENTS ChannelOwnCapability = "send-typing-events" - SET_CHANNEL_COOLDOWN ChannelOwnCapability = "set-channel-cooldown" - SHARE_LOCATION ChannelOwnCapability = "share-location" - SKIP_SLOW_MODE ChannelOwnCapability = "skip-slow-mode" - SLOW_MODE ChannelOwnCapability = "slow-mode" - TYPING_EVENTS ChannelOwnCapability = "typing-events" - UPDATE_ANY_MESSAGE ChannelOwnCapability = "update-any-message" - UPDATE_CHANNEL ChannelOwnCapability = "update-channel" - UPDATE_CHANNEL_MEMBERS ChannelOwnCapability = "update-channel-members" - UPDATE_OWN_MESSAGE ChannelOwnCapability = "update-own-message" - UPDATE_THREAD ChannelOwnCapability = "update-thread" - UPLOAD_FILE ChannelOwnCapability = "upload-file" + SEND_TYPING_EVENTS ChannelOwnCapability = "send-typing-events" + SET_CHANNEL_COOLDOWN ChannelOwnCapability = "set-channel-cooldown" + SHARE_LOCATION ChannelOwnCapability = "share-location" + SKIP_SLOW_MODE ChannelOwnCapability = "skip-slow-mode" + SLOW_MODE ChannelOwnCapability = "slow-mode" + TYPING_EVENTS ChannelOwnCapability = "typing-events" + UPDATE_ANY_MESSAGE ChannelOwnCapability = "update-any-message" + UPDATE_CHANNEL ChannelOwnCapability = "update-channel" + UPDATE_CHANNEL_MEMBERS ChannelOwnCapability = "update-channel-members" + UPDATE_OWN_MESSAGE ChannelOwnCapability = "update-own-message" + UPDATE_THREAD ChannelOwnCapability = "update-thread" + UPLOAD_FILE ChannelOwnCapability = "upload-file" ) func (c ChannelOwnCapability) String() string { @@ -2898,7 +2904,7 @@ func (c ChannelOwnCapability) String() string { } type ChannelPushPreferencesResponse struct { - ChatLevel *string `json:"chat_level,omitempty"` + ChatLevel *string `json:"chat_level,omitempty"` DisabledUntil *Timestamp `json:"disabled_until,omitempty"` } @@ -2908,7 +2914,7 @@ type ChannelResponse struct { 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 @@ -2953,28 +2959,28 @@ type ChannelResponse struct { 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 { @@ -2983,8 +2989,8 @@ type ChannelStateResponseFields struct { // 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 @@ -2998,37 +3004,37 @@ type ChannelStateResponseFields struct { // 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 { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Channel ChannelResponse `json:"channel"` - Custom map[string]any `json:"custom"` + 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"` // 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelTruncatedEvent) GetEventType() string { @@ -3036,50 +3042,50 @@ func (e *ChannelTruncatedEvent) GetEventType() string { } 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"` - PushLevel *string `json:"push_level,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 { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` + 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 @@ -3087,7 +3093,7 @@ type ChannelUnFrozenEvent struct { // 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"` + Cid *string `json:"cid,omitempty"` ReceivedAt *Timestamp `json:"received_at,omitempty"` } @@ -3098,15 +3104,15 @@ func (e *ChannelUnFrozenEvent) GetEventType() string { // Emitted when a channel is successfully unmuted. type ChannelUnmutedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` // The type of event: "channel.unmuted" in this case - Type string `json:"type"` + 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"` + Mutes []ChannelMute `json:"mutes,omitempty"` + Mute *ChannelMute `json:"mute,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelUnmutedEvent) GetEventType() string { @@ -3116,27 +3122,27 @@ func (e *ChannelUnmutedEvent) GetEventType() string { // Emitted when a channel is successfully updated. type ChannelUpdatedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Channel ChannelResponse `json:"channel"` - Custom map[string]any `json:"custom"` + 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"` // 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelUpdatedEvent) GetEventType() string { @@ -3146,25 +3152,25 @@ func (e *ChannelUpdatedEvent) GetEventType() string { // Emitted when a channel is successfully shown. type ChannelVisibleEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Channel ChannelResponse `json:"channel"` - Custom map[string]any `json:"custom"` + 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"` // 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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ChannelVisibleEvent) GetEventType() string { @@ -3179,22 +3185,22 @@ 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 { @@ -3204,8 +3210,8 @@ type CheckResponse struct { // 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 { @@ -3230,14 +3236,14 @@ type CheckSQSResponse struct { 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"` @@ -3248,8 +3254,8 @@ func (e *ClosedCaptionEvent) GetEventType() string { } type ClosedCaptionRuleParameters struct { - Threshold *int `json:"threshold,omitempty"` - HarmLabels []string `json:"harm_labels,omitempty"` + Threshold *int `json:"threshold,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` LlmHarmLabels map[string]string `json:"llm_harm_labels,omitempty"` } @@ -3304,16 +3310,16 @@ 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 (e *CommentAddedEvent) GetEventType() string { @@ -3323,15 +3329,15 @@ func (e *CommentAddedEvent) GetEventType() string { // 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 (e *CommentDeletedEvent) GetEventType() string { @@ -3341,17 +3347,17 @@ func (e *CommentDeletedEvent) GetEventType() string { // 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"` + 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 string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *CommentReactionAddedEvent) GetEventType() string { @@ -3361,15 +3367,15 @@ func (e *CommentReactionAddedEvent) GetEventType() string { // 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 (e *CommentReactionDeletedEvent) GetEventType() string { @@ -3379,17 +3385,17 @@ func (e *CommentReactionDeletedEvent) GetEventType() string { // 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 (e *CommentReactionUpdatedEvent) GetEventType() string { @@ -3425,7 +3431,7 @@ type CommentResponse struct { 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 @@ -3441,7 +3447,7 @@ type CommentResponse struct { // 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]FeedsReactionGroupResponse `json:"reaction_groups,omitempty"` @@ -3450,15 +3456,15 @@ type CommentResponse struct { // 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 (e *CommentUpdatedEvent) GetEventType() string { @@ -3511,22 +3517,22 @@ type ConfigResponse struct { // 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"` + 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"` } @@ -3539,14 +3545,14 @@ type CoordinatesResponse struct { } 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"` } @@ -3554,58 +3560,58 @@ 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"` + Grants map[string][]string `json:"grants"` NotificationSettings NotificationSettingsResponse `json:"notification_settings"` - Settings CallSettingsResponse `json:"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"` - PushLevel *string `json:"push_level,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 { @@ -3615,8 +3621,8 @@ type CreateCollectionsResponse struct { } type CreateCommandResponse struct { - Duration string `json:"duration"` - Command *Command `json:"command,omitempty"` + Duration string `json:"duration"` + Command *Command `json:"command,omitempty"` } // Basic response information @@ -3626,12 +3632,12 @@ 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"` } @@ -3645,40 +3651,40 @@ 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"` } @@ -3686,12 +3692,12 @@ 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"` } @@ -3719,15 +3725,15 @@ type CustomCheckResponse struct { // Unique identifier of the custom check ID string `json:"id"` // Status of the custom check - Status string `json:"status"` - Item *ReviewQueueItemResponse `json:"item,omitempty"` + Status string `json:"status"` + 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"` + 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 { @@ -3736,11 +3742,11 @@ func (e *CustomEvent) GetEventType() string { // 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"` } @@ -3750,32 +3756,32 @@ func (e *CustomVideoEvent) GetEventType() string { } 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"` } @@ -3793,27 +3799,35 @@ type DailyMetricStatsResponse struct { 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 { @@ -3838,8 +3852,8 @@ type DeleteActivitiesResponse struct { } type DeleteActivityReactionResponse struct { - Duration string `json:"duration"` - Activity ActivityResponse `json:"activity"` + Duration string `json:"duration"` + Activity ActivityResponse `json:"activity"` Reaction FeedsReactionResponse `json:"reaction"` } @@ -3860,35 +3874,35 @@ type DeleteBookmarkFolderResponse struct { } type DeleteBookmarkResponse struct { - Duration string `json:"duration"` + 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 { @@ -3902,8 +3916,8 @@ type DeleteCommandResponse struct { } type DeleteCommentReactionResponse struct { - Duration string `json:"duration"` - Comment CommentResponse `json:"comment"` + Duration string `json:"duration"` + Comment CommentResponse `json:"comment"` Reaction FeedsReactionResponse `json:"reaction"` } @@ -3916,9 +3930,9 @@ type DeleteCommentRequestPayload struct { } type DeleteCommentResponse struct { - Duration string `json:"duration"` + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` - Comment CommentResponse `json:"comment"` + Comment CommentResponse `json:"comment"` } // Basic response information @@ -3973,8 +3987,8 @@ type DeleteMessageRequestPayload struct { // 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 { @@ -4002,8 +4016,8 @@ type DeleteReactionRequestPayload struct { // 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"` } @@ -4058,7 +4072,7 @@ type DeleteUsersResponse struct { type DeliveredMessagePayload struct { Cid *string `json:"cid,omitempty"` - ID *string `json:"id,omitempty"` + ID *string `json:"id,omitempty"` } type DeliveryReceiptsResponse struct { @@ -4066,13 +4080,13 @@ type DeliveryReceiptsResponse struct { } 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"` } @@ -4101,7 +4115,7 @@ type DraftPayloadResponse struct { // Message ID is unique string identifier of the message ID string `json:"id"` // Text of the message - Text string `json:"text"` + Text string `json:"text"` Custom map[string]any `json:"custom"` // Contains HTML markup of the message Html *string `json:"html,omitempty"` @@ -4110,7 +4124,7 @@ type DraftPayloadResponse struct { // ID of parent message (thread) ParentID *string `json:"parent_id,omitempty"` // Identifier of the poll to include in the message - PollID *string `json:"poll_id,omitempty"` + 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"` @@ -4125,48 +4139,48 @@ type DraftPayloadResponse struct { } 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 @@ -4176,18 +4190,18 @@ 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 { @@ -4208,19 +4222,19 @@ type EnrichedCollectionResponse struct { } 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. @@ -4265,101 +4279,101 @@ type EnrichmentOptions struct { type EntityCreatorResponse struct { // Number of minor actions performed on the user - BanCount int `json:"ban_count"` - Banned bool `json:"banned"` + 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"` + 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"` + Fcm FCM `json:"fcm"` } type EventNotificationSettingsRequest struct { - Enabled *bool `json:"enabled,omitempty"` - APNS *APNSPayload `json:"apns,omitempty"` - Fcm *FCMPayload `json:"fcm,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + APNS *APNSPayload `json:"apns,omitempty"` + Fcm *FCMPayload `json:"fcm,omitempty"` } type EventNotificationSettingsResponse struct { - Enabled bool `json:"enabled"` - APNS APNSPayload `json:"apns"` - Fcm FCMPayload `json:"fcm"` + 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 { @@ -4383,21 +4397,21 @@ type ExportUserResponse struct { 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 { @@ -4409,23 +4423,23 @@ type FCMPayload struct { } type FailedChannelUpdates struct { - Reason string `json:"reason"` - Cids []string `json:"cids"` + 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 (e *FeedCreatedEvent) GetEventType() string { @@ -4435,14 +4449,14 @@ func (e *FeedCreatedEvent) GetEventType() string { // 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 (e *FeedDeletedEvent) GetEventType() string { @@ -4450,36 +4464,36 @@ func (e *FeedDeletedEvent) GetEventType() string { } 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 (e *FeedGroupChangedEvent) GetEventType() string { @@ -4490,14 +4504,14 @@ func (e *FeedGroupChangedEvent) GetEventType() string { 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 (e *FeedGroupDeletedEvent) GetEventType() string { @@ -4512,42 +4526,42 @@ type FeedGroupResponse struct { // When the feed group was last updated UpdatedAt Timestamp `json:"updated_at"` // Default visibility for activities. One of: public, visible, followers, members, private - DefaultVisibility *string `json:"default_visibility,omitempty"` - DeletedAt *Timestamp `json:"deleted_at,omitempty"` + 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"` + Stories *StoriesConfig `json:"stories,omitempty"` } 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 (e *FeedMemberAddedEvent) GetEventType() string { @@ -4557,15 +4571,15 @@ func (e *FeedMemberAddedEvent) GetEventType() string { // 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 (e *FeedMemberRemovedEvent) GetEventType() string { @@ -4593,67 +4607,66 @@ type FeedMemberResponse struct { // 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 (e *FeedMemberUpdatedEvent) GetEventType() string { return e.Type } - type FeedOwnCapability string const ( - ADD_ACTIVITY FeedOwnCapability = "add-activity" - ADD_ACTIVITY_BOOKMARK FeedOwnCapability = "add-activity-bookmark" - ADD_ACTIVITY_REACTION FeedOwnCapability = "add-activity-reaction" - ADD_COMMENT FeedOwnCapability = "add-comment" - ADD_COMMENT_REACTION FeedOwnCapability = "add-comment-reaction" - CREATE_FEED FeedOwnCapability = "create-feed" - DELETE_ANY_ACTIVITY FeedOwnCapability = "delete-any-activity" - DELETE_ANY_COMMENT FeedOwnCapability = "delete-any-comment" - DELETE_FEED FeedOwnCapability = "delete-feed" - DELETE_OWN_ACTIVITY FeedOwnCapability = "delete-own-activity" + ADD_ACTIVITY FeedOwnCapability = "add-activity" + ADD_ACTIVITY_BOOKMARK FeedOwnCapability = "add-activity-bookmark" + ADD_ACTIVITY_REACTION FeedOwnCapability = "add-activity-reaction" + ADD_COMMENT FeedOwnCapability = "add-comment" + ADD_COMMENT_REACTION FeedOwnCapability = "add-comment-reaction" + CREATE_FEED FeedOwnCapability = "create-feed" + DELETE_ANY_ACTIVITY FeedOwnCapability = "delete-any-activity" + DELETE_ANY_COMMENT FeedOwnCapability = "delete-any-comment" + DELETE_FEED FeedOwnCapability = "delete-feed" + DELETE_OWN_ACTIVITY FeedOwnCapability = "delete-own-activity" DELETE_OWN_ACTIVITY_BOOKMARK FeedOwnCapability = "delete-own-activity-bookmark" DELETE_OWN_ACTIVITY_REACTION FeedOwnCapability = "delete-own-activity-reaction" - DELETE_OWN_COMMENT FeedOwnCapability = "delete-own-comment" - DELETE_OWN_COMMENT_REACTION FeedOwnCapability = "delete-own-comment-reaction" - FOLLOW FeedOwnCapability = "follow" - PIN_ACTIVITY FeedOwnCapability = "pin-activity" - QUERY_FEED_MEMBERS FeedOwnCapability = "query-feed-members" - QUERY_FOLLOWS FeedOwnCapability = "query-follows" - READ_ACTIVITIES FeedOwnCapability = "read-activities" - READ_FEED FeedOwnCapability = "read-feed" - UNFOLLOW FeedOwnCapability = "unfollow" - UPDATE_ANY_ACTIVITY FeedOwnCapability = "update-any-activity" - UPDATE_ANY_COMMENT FeedOwnCapability = "update-any-comment" - UPDATE_FEED FeedOwnCapability = "update-feed" - UPDATE_FEED_FOLLOWERS FeedOwnCapability = "update-feed-followers" - UPDATE_FEED_MEMBERS FeedOwnCapability = "update-feed-members" - UPDATE_OWN_ACTIVITY FeedOwnCapability = "update-own-activity" + DELETE_OWN_COMMENT FeedOwnCapability = "delete-own-comment" + DELETE_OWN_COMMENT_REACTION FeedOwnCapability = "delete-own-comment-reaction" + FOLLOW FeedOwnCapability = "follow" + PIN_ACTIVITY FeedOwnCapability = "pin-activity" + QUERY_FEED_MEMBERS FeedOwnCapability = "query-feed-members" + QUERY_FOLLOWS FeedOwnCapability = "query-follows" + READ_ACTIVITIES FeedOwnCapability = "read-activities" + READ_FEED FeedOwnCapability = "read-feed" + UNFOLLOW FeedOwnCapability = "unfollow" + UPDATE_ANY_ACTIVITY FeedOwnCapability = "update-any-activity" + UPDATE_ANY_COMMENT FeedOwnCapability = "update-any-comment" + UPDATE_FEED FeedOwnCapability = "update-feed" + UPDATE_FEED_FOLLOWERS FeedOwnCapability = "update-feed-followers" + UPDATE_FEED_MEMBERS FeedOwnCapability = "update-feed-members" + UPDATE_OWN_ACTIVITY FeedOwnCapability = "update-own-activity" UPDATE_OWN_ACTIVITY_BOOKMARK FeedOwnCapability = "update-own-activity-bookmark" - UPDATE_OWN_COMMENT FeedOwnCapability = "update-own-comment" + UPDATE_OWN_COMMENT FeedOwnCapability = "update-own-comment" ) func (c FeedOwnCapability) String() string { @@ -4666,7 +4679,7 @@ type FeedOwnData struct { // 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"` } @@ -4714,7 +4727,7 @@ type FeedResponse struct { // 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"` @@ -4729,7 +4742,7 @@ type FeedResponse struct { // 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"` } @@ -4756,12 +4769,12 @@ type FeedSuggestionResponse struct { // 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 @@ -4771,24 +4784,24 @@ type FeedSuggestionResponse struct { // 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. 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 (e *FeedUpdatedEvent) GetEventType() string { @@ -4802,8 +4815,8 @@ type FeedViewResponse struct { 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 { @@ -4841,12 +4854,12 @@ type FeedsPreferences struct { } type FeedsPreferencesResponse struct { - 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"` + 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"` } @@ -4867,7 +4880,7 @@ type FeedsReactionResponse struct { // 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"` @@ -4876,22 +4889,22 @@ type FeedsReactionResponse struct { } 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"` } @@ -4905,26 +4918,26 @@ type FileUploadResponse struct { } 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"` + ServerKey *string `json:"server_key,omitempty"` } type FlagCountRuleParameters struct { @@ -4932,22 +4945,22 @@ type FlagCountRuleParameters struct { } type FlagDetailsResponse struct { - OriginalText string `json:"original_text"` - Automod *AutomodDetailsResponse `json:"automod,omitempty"` - Extra map[string]any `json:"extra,omitempty"` + OriginalText string `json:"original_text"` + Automod *AutomodDetailsResponse `json:"automod,omitempty"` + Extra map[string]any `json:"extra,omitempty"` } type FlagFeedbackResponse struct { - CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` - Labels []LabelResponse `json:"labels"` + CreatedAt Timestamp `json:"created_at"` + MessageID string `json:"message_id"` + Labels []LabelResponse `json:"labels"` } 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"` + 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 { @@ -4957,13 +4970,13 @@ type FlagResponse struct { } 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 (e *FlagUpdatedEvent) GetEventType() string { @@ -4985,14 +4998,14 @@ 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 (e *FollowCreatedEvent) GetEventType() string { @@ -5002,14 +5015,14 @@ func (e *FollowCreatedEvent) GetEventType() string { // 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 (e *FollowDeletedEvent) GetEventType() string { @@ -5033,7 +5046,7 @@ type FollowResponse struct { // 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 @@ -5047,14 +5060,14 @@ type FollowResponse struct { // 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"` + 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"` + Type string `json:"type"` + FeedVisibility *string `json:"feed_visibility,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *FollowUpdatedEvent) GetEventType() string { @@ -5062,9 +5075,9 @@ func (e *FollowUpdatedEvent) GetEventType() string { } type FrameRecordSettings struct { - CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` - Mode string `json:"mode"` - Quality *string `json:"quality,omitempty"` + CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` + Mode string `json:"mode"` + Quality *string `json:"quality,omitempty"` } type FrameRecordingResponse struct { @@ -5072,15 +5085,15 @@ type FrameRecordingResponse struct { } type FrameRecordingSettingsRequest struct { - CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` - Mode string `json:"mode"` - Quality *string `json:"quality,omitempty"` + 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"` + CaptureIntervalInSeconds int `json:"capture_interval_in_seconds"` + Mode string `json:"mode"` + Quality *string `json:"quality,omitempty"` } // Options to control fetching reactions from friends (users you follow or have mutual follows with). @@ -5094,51 +5107,51 @@ type FriendReactionsOptions struct { } 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"` + 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"` } @@ -5160,31 +5173,31 @@ type GetActiveCallsStatusResponse struct { // 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"` } @@ -5198,181 +5211,185 @@ 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"` + 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"` + 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"` - PushLevel *string `json:"push_level,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"` } @@ -5391,28 +5408,28 @@ type GetFeedsRateLimitsResponse struct { 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 { @@ -5424,39 +5441,39 @@ 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 @@ -5466,58 +5483,58 @@ type GetOGResponse struct { // 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"` + Duration string `json:"duration"` Templates []PushTemplateResponse `json:"templates"` } @@ -5542,44 +5559,44 @@ 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"` - Thread ThreadStateResponse `json:"thread"` + Duration string `json:"duration"` + Thread ThreadStateResponse `json:"thread"` } // 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 { @@ -5587,15 +5604,15 @@ 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 { @@ -5604,24 +5621,24 @@ type HLSSettingsRequest struct { // Whether HLS broadcasting should start automatically AutoOn *bool `json:"auto_on,omitempty"` // Whether HLS broadcasting is enabled - Enabled *bool `json:"enabled,omitempty"` - Layout *LayoutSettingsRequest `json:"layout,omitempty"` + 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 @@ -5631,15 +5648,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 { @@ -5649,14 +5666,14 @@ 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"` } @@ -5675,65 +5692,65 @@ 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"` + 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"` } @@ -5755,26 +5772,26 @@ type IndividualRecordingSettingsResponse struct { } 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"` @@ -5793,44 +5810,44 @@ func (e *IngressErrorEvent) GetEventType() string { } 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"` @@ -5854,7 +5871,7 @@ func (e *IngressStartedEvent) GetEventType() string { // 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"` @@ -5870,53 +5887,53 @@ func (e *IngressStoppedEvent) GetEventType() string { 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"` - Latency *ActiveCallsLatencyStats `json:"latency,omitempty"` + Failures float64 `json:"failures"` + Total float64 `json:"total"` + 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"` + Threshold *int `json:"threshold,omitempty"` + HarmLabels []string `json:"harm_labels,omitempty"` } // KickUserResponse is the payload for kicking a user from a call. @@ -5927,11 +5944,11 @@ 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"` } @@ -5940,24 +5957,24 @@ func (e *KickedUserEvent) GetEventType() string { } 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 LabelResponse struct { - Name string `json:"name"` - HarmLabels []string `json:"harm_labels,omitempty"` - PhraseListIds []int `json:"phrase_list_ids,omitempty"` + Name string `json:"name"` + HarmLabels []string `json:"harm_labels,omitempty"` + PhraseListIds []int `json:"phrase_list_ids,omitempty"` } type LabelThresholds struct { @@ -5968,27 +5985,27 @@ type LabelThresholds struct { } 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 LimitInfoResponse struct { @@ -6002,35 +6019,35 @@ type LimitInfoResponse struct { 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"` } @@ -6056,15 +6073,15 @@ 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 { @@ -6082,36 +6099,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"` } @@ -6119,7 +6136,7 @@ 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 @@ -6160,22 +6177,22 @@ type MarkDeliveredResponse struct { type MarkReadResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - Event *MarkReadResponseEvent `json:"event,omitempty"` + Duration string `json:"duration"` + Event *MarkReadResponseEvent `json:"event,omitempty"` } 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"` + 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"` } // Configuration for mark reviewed action @@ -6189,10 +6206,10 @@ type MarkReviewedRequestPayload struct { } type MaxStreakChangedEvent 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"` } func (e *MaxStreakChangedEvent) GetEventType() string { @@ -6202,10 +6219,10 @@ func (e *MaxStreakChangedEvent) GetEventType() string { // 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"` + 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 @@ -6217,12 +6234,12 @@ type MemberAddedEvent struct { // 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MemberAddedEvent) GetEventType() string { @@ -6232,10 +6249,10 @@ func (e *MemberAddedEvent) GetEventType() string { // 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"` + 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 @@ -6247,12 +6264,12 @@ type MemberRemovedEvent struct { // 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MemberRemovedEvent) GetEventType() string { @@ -6261,8 +6278,8 @@ func (e *MemberRemovedEvent) GetEventType() string { // MemberRequest is the payload for adding a member to a call. type MemberRequest struct { - UserID string `json:"user_id"` - Role *string `json:"role,omitempty"` + UserID string `json:"user_id"` + Role *string `json:"role,omitempty"` // Custom data for this object Custom map[string]any `json:"custom,omitempty"` } @@ -6273,22 +6290,22 @@ type MemberResponse struct { CreatedAt Timestamp `json:"created_at"` // Date/time of the last update UpdatedAt Timestamp `json:"updated_at"` - UserID string `json:"user_id"` + UserID string `json:"user_id"` // Custom member response data Custom map[string]any `json:"custom"` - User UserResponse `json:"user"` + User UserResponse `json:"user"` // Date/time of deletion DeletedAt *Timestamp `json:"deleted_at,omitempty"` - Role *string `json:"role,omitempty"` + Role *string `json:"role,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"` + 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 @@ -6300,12 +6317,12 @@ type MemberUpdatedEvent struct { // 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MemberUpdatedEvent) GetEventType() string { @@ -6341,27 +6358,27 @@ type MembershipLevelResponse struct { 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"` + UserID *string `json:"user_id,omitempty"` + User *UserRequest `json:"user,omitempty"` } // Basic response information type MessageActionResponse 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"` } type MessageChangeSet struct { - Attachments bool `json:"attachments"` - Custom bool `json:"custom"` - Html bool `json:"html"` + 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"` + 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. @@ -6369,10 +6386,10 @@ 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"` + 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 @@ -6386,12 +6403,12 @@ type MessageDeletedEvent struct { // 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MessageDeletedEvent) GetEventType() string { @@ -6399,28 +6416,28 @@ func (e *MessageDeletedEvent) GetEventType() string { } 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"` + 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"` + 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 @@ -6434,18 +6451,18 @@ type MessageFlaggedEvent struct { // 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"` + 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"` + 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"` + Custom map[string]any `json:"custom,omitempty"` + Details *MessageModerationResult `json:"details,omitempty"` + Flag *FlagResponse `json:"flag,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MessageFlaggedEvent) GetEventType() string { @@ -6453,13 +6470,13 @@ func (e *MessageFlaggedEvent) GetEventType() string { } 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 @@ -6481,20 +6498,20 @@ type MessageModerationResult struct { // 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 { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` + MessageID string `json:"message_id"` // The number of watchers - WatcherCount int `json:"watcher_count"` - Custom map[string]any `json:"custom"` - Message MessageResponse `json:"message"` + 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"` // The ID of the channel where the message was sent @@ -6508,19 +6525,19 @@ type MessageNewEvent struct { // 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"` + 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"` + 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"` + Channel *ChannelResponse `json:"channel,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MessageNewEvent) GetEventType() string { @@ -6552,15 +6569,15 @@ type MessagePaginationParams struct { 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 + // 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 { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` + CreatedAt Timestamp `json:"created_at"` + Custom map[string]any `json:"custom"` // The type of event: "message.read" in this case Type string `json:"type"` // The ID of the channel where the message was read @@ -6574,14 +6591,14 @@ type MessageReadEvent struct { // 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"` + 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"` + 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"` } func (e *MessageReadEvent) GetEventType() string { @@ -6593,8 +6610,9 @@ type MessageRequest struct { // Contains HTML markup of the message. Can only be set when using server-side API Html *string `json:"html,omitempty"` // Message ID is unique string identifier of the message - ID *string `json:"id,omitempty"` - MentionedChannel *bool `json:"mentioned_channel,omitempty"` + 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) @@ -6606,26 +6624,27 @@ type MessageRequest struct { // 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"` // Whether message is silent or not Silent *bool `json:"silent,omitempty"` // Text of the message. Should be empty if `mml` is provided - Text *string `json:"text,omitempty"` + 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"` // 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"` // 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"` + 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 @@ -6633,14 +6652,16 @@ 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 @@ -6664,18 +6685,18 @@ type MessageResponse struct { // 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"` @@ -6686,25 +6707,27 @@ type MessageResponse struct { // 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 { @@ -6714,16 +6737,16 @@ type MessageStatsResponse struct { // Emitted when a message is unblocked. type MessageUnblockedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` - Custom map[string]any `json:"custom"` - Message MessageResponse `json:"message"` + 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"` // 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"` + Cid *string `json:"cid,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *MessageUnblockedEvent) GetEventType() string { @@ -6733,10 +6756,10 @@ func (e *MessageUnblockedEvent) GetEventType() string { // Emitted when a message is undeleted. type MessageUndeletedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` - Custom map[string]any `json:"custom"` - Message MessageResponse `json:"message"` + 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"` // The ID of the channel where the message was sent @@ -6748,10 +6771,10 @@ type MessageUndeletedEvent struct { // 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"` + Cid *string `json:"cid,omitempty"` ReceivedAt *Timestamp `json:"received_at,omitempty"` // The team ID - Team *string `json:"team,omitempty"` + Team *string `json:"team,omitempty"` ChannelCustom map[string]any `json:"channel_custom,omitempty"` } @@ -6760,17 +6783,17 @@ func (e *MessageUndeletedEvent) GetEventType() string { } 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 { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` - Custom map[string]any `json:"custom"` - Message MessageResponse `json:"message"` + 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"` // The ID of the channel where the message was sent @@ -6782,13 +6805,13 @@ type MessageUpdatedEvent struct { // 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"` + 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"` + 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 (e *MessageUpdatedEvent) GetEventType() string { @@ -6800,14 +6823,16 @@ 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 @@ -6831,19 +6856,19 @@ type MessageWithChannelResponse struct { // 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"` @@ -6854,39 +6879,49 @@ type MessageWithChannelResponse struct { // 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 { @@ -6919,10 +6954,10 @@ type ModerationCheckCompletedEvent struct { // 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 (e *ModerationCheckCompletedEvent) GetEventType() string { @@ -6930,38 +6965,38 @@ func (e *ModerationCheckCompletedEvent) GetEventType() string { } 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 (e *ModerationCustomActionEvent) GetEventType() string { @@ -6969,43 +7004,43 @@ func (e *ModerationCustomActionEvent) GetEventType() string { } type ModerationDashboardPreferences struct { - 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"` + 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"` + 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"` + ReviewQueueItem *ReviewQueueItemResponse `json:"review_queue_item,omitempty"` + User *UserResponse `json:"user,omitempty"` } // This event is sent when content is flagged for moderation type ModerationFlaggedEvent struct { // The type of content that was flagged - ContentType string `json:"content_type"` - CreatedAt Timestamp `json:"created_at"` + 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"` + ObjectID string `json:"object_id"` + Custom map[string]any `json:"custom"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *ModerationFlaggedEvent) GetEventType() string { @@ -7014,12 +7049,12 @@ func (e *ModerationFlaggedEvent) GetEventType() string { // 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"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - Message *MessageResponse `json:"message,omitempty"` + 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"` } func (e *ModerationMarkReviewedEvent) GetEventType() string { @@ -7027,9 +7062,9 @@ func (e *ModerationMarkReviewedEvent) GetEventType() string { } type ModerationPayload struct { - Images []string `json:"images,omitempty"` - Texts []string `json:"texts,omitempty"` - Videos []string `json:"videos,omitempty"` + Images []string `json:"images,omitempty"` + Texts []string `json:"texts,omitempty"` + Videos []string `json:"videos,omitempty"` Custom map[string]any `json:"custom,omitempty"` } @@ -7058,35 +7093,35 @@ type ModerationPayloadResponse struct { } 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 ModerationRuleInfo struct { Description string `json:"description"` - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` } 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"` + 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 @@ -7099,11 +7134,11 @@ type ModerationRulesTriggeredEvent struct { // 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"` + 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) @@ -7115,22 +7150,22 @@ func (e *ModerationRulesTriggeredEvent) GetEventType() string { } 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"` - BlocklistsMatched []string `json:"blocklists_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 *OwnUserResponse `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 { @@ -7138,8 +7173,8 @@ type MuteResponse struct { // Object with mutes (if multiple users were muted) 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 *OwnUserResponse `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. @@ -7149,9 +7184,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"` } @@ -7160,9 +7195,9 @@ 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"` } @@ -7176,7 +7211,7 @@ type NotificationConfig struct { } type NotificationContext struct { - Target *NotificationTarget `json:"target,omitempty"` + Target *NotificationTarget `json:"target,omitempty"` Trigger *NotificationTrigger `json:"trigger,omitempty"` } @@ -7185,16 +7220,16 @@ 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 (e *NotificationFeedUpdatedEvent) GetEventType() string { @@ -7204,14 +7239,14 @@ func (e *NotificationFeedUpdatedEvent) GetEventType() string { // Emitted when a channel/thread is marked as unread. type NotificationMarkUnreadEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` + 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"` // 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"` + 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"` @@ -7222,8 +7257,8 @@ type NotificationMarkUnreadEvent struct { // 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"` + 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 @@ -7239,10 +7274,10 @@ type NotificationMarkUnreadEvent struct { // 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"` + 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 { @@ -7250,45 +7285,45 @@ func (e *NotificationMarkUnreadEvent) GetEventType() string { } type NotificationParentActivity struct { - ID string `json:"id"` - Text *string `json:"text,omitempty"` - UserID *string `json:"user_id,omitempty"` - Type *string `json:"type,omitempty"` + 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"` + SessionStarted EventNotificationSettings `json:"session_started"` } type NotificationSettingsRequest struct { - Enabled *bool `json:"enabled,omitempty"` - CallLiveStarted *EventNotificationSettingsRequest `json:"call_live_started,omitempty"` - CallMissed *EventNotificationSettingsRequest `json:"call_missed,omitempty"` + 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"` + CallRing *EventNotificationSettingsRequest `json:"call_ring,omitempty"` + SessionStarted *EventNotificationSettingsRequest `json:"session_started,omitempty"` } type NotificationSettingsResponse struct { - Enabled bool `json:"enabled"` - CallLiveStarted EventNotificationSettingsResponse `json:"call_live_started"` - CallMissed EventNotificationSettingsResponse `json:"call_missed"` + 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"` + 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"` + Unseen int `json:"unseen"` LastReadAt *Timestamp `json:"last_read_at,omitempty"` // When notifications were last seen LastSeenAt *Timestamp `json:"last_seen_at,omitempty"` @@ -7309,8 +7344,8 @@ type NotificationTarget struct { // 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"` - Comment *NotificationComment `json:"comment,omitempty"` + Attachments []Attachment `json:"attachments,omitempty"` + Comment *NotificationComment `json:"comment,omitempty"` ParentActivity *NotificationParentActivity `json:"parent_activity,omitempty"` } @@ -7318,33 +7353,33 @@ type NotificationTarget struct { type NotificationThreadMessageNewEvent struct { // Date/time of creation CreatedAt Timestamp `json:"created_at"` - MessageID string `json:"message_id"` + 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"` + 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"` + 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"` + 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"` + 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` } func (e *NotificationThreadMessageNewEvent) GetEventType() string { @@ -7355,13 +7390,13 @@ 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 { @@ -7369,8 +7404,8 @@ 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 { @@ -7381,42 +7416,42 @@ type OwnBatchResponse struct { type OwnCapability string const ( - BLOCK_USERS OwnCapability = "block-users" - CHANGE_MAX_DURATION OwnCapability = "change-max-duration" - CREATE_CALL OwnCapability = "create-call" - CREATE_REACTION OwnCapability = "create-reaction" - ENABLE_NOISE_CANCELLATION OwnCapability = "enable-noise-cancellation" - END_CALL OwnCapability = "end-call" - JOIN_BACKSTAGE OwnCapability = "join-backstage" - JOIN_CALL OwnCapability = "join-call" - JOIN_ENDED_CALL OwnCapability = "join-ended-call" - KICK_USER OwnCapability = "kick-user" - MUTE_USERS OwnCapability = "mute-users" - PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" - READ_CALL OwnCapability = "read-call" - REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" - SCREENSHARE OwnCapability = "screenshare" - SEND_AUDIO OwnCapability = "send-audio" - SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" - SEND_VIDEO OwnCapability = "send-video" - START_BROADCAST_CALL OwnCapability = "start-broadcast-call" - START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" - START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" + BLOCK_USERS OwnCapability = "block-users" + CHANGE_MAX_DURATION OwnCapability = "change-max-duration" + CREATE_CALL OwnCapability = "create-call" + CREATE_REACTION OwnCapability = "create-reaction" + ENABLE_NOISE_CANCELLATION OwnCapability = "enable-noise-cancellation" + END_CALL OwnCapability = "end-call" + JOIN_BACKSTAGE OwnCapability = "join-backstage" + JOIN_CALL OwnCapability = "join-call" + JOIN_ENDED_CALL OwnCapability = "join-ended-call" + KICK_USER OwnCapability = "kick-user" + MUTE_USERS OwnCapability = "mute-users" + PIN_FOR_EVERYONE OwnCapability = "pin-for-everyone" + READ_CALL OwnCapability = "read-call" + REMOVE_CALL_MEMBER OwnCapability = "remove-call-member" + SCREENSHARE OwnCapability = "screenshare" + SEND_AUDIO OwnCapability = "send-audio" + SEND_CLOSED_CAPTIONS_CALL OwnCapability = "send-closed-captions-call" + SEND_VIDEO OwnCapability = "send-video" + START_BROADCAST_CALL OwnCapability = "start-broadcast-call" + START_CLOSED_CAPTIONS_CALL OwnCapability = "start-closed-captions-call" + START_FRAME_RECORD_CALL OwnCapability = "start-frame-record-call" START_INDIVIDUAL_RECORD_CALL OwnCapability = "start-individual-record-call" - START_RAW_RECORD_CALL OwnCapability = "start-raw-record-call" - START_RECORD_CALL OwnCapability = "start-record-call" - START_TRANSCRIPTION_CALL OwnCapability = "start-transcription-call" - STOP_BROADCAST_CALL OwnCapability = "stop-broadcast-call" - STOP_CLOSED_CAPTIONS_CALL OwnCapability = "stop-closed-captions-call" - STOP_FRAME_RECORD_CALL OwnCapability = "stop-frame-record-call" - STOP_INDIVIDUAL_RECORD_CALL OwnCapability = "stop-individual-record-call" - STOP_RAW_RECORD_CALL OwnCapability = "stop-raw-record-call" - STOP_RECORD_CALL OwnCapability = "stop-record-call" - STOP_TRANSCRIPTION_CALL OwnCapability = "stop-transcription-call" - UPDATE_CALL OwnCapability = "update-call" - UPDATE_CALL_MEMBER OwnCapability = "update-call-member" - UPDATE_CALL_PERMISSIONS OwnCapability = "update-call-permissions" - UPDATE_CALL_SETTINGS OwnCapability = "update-call-settings" + 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 { @@ -7424,42 +7459,42 @@ func (c OwnCapability) String() string { } 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"` + 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 { @@ -7468,21 +7503,21 @@ type PagerResponse struct { } 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"` } @@ -7491,75 +7526,75 @@ 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 @@ -7567,16 +7602,16 @@ 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 *ChannelResponse `json:"channel,omitempty"` - Message *MessageResponse `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 *UserResponse `json:"user,omitempty"` + User *UserResponse `json:"user,omitempty"` } func (e *PendingMessageEvent) GetEventType() string { @@ -7584,14 +7619,14 @@ func (e *PendingMessageEvent) GetEventType() string { } 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"` } @@ -7621,11 +7656,11 @@ 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"` } @@ -7637,11 +7672,11 @@ func (e *PermissionRequestEvent) GetEventType() string { 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"` } @@ -7660,20 +7695,20 @@ 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 @@ -7692,75 +7727,75 @@ type PolicyRequest struct { } 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"` + Duration string `json:"duration"` PollOption PollOptionResponseData `json:"poll_option"` } type PollOptionResponseData struct { - ID string `json:"id"` - Text string `json:"text"` + 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"` + 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"` + 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 PollVoteResponse struct { // Duration of the request in milliseconds - Duration string `json:"duration"` - Poll *PollResponseData `json:"poll,omitempty"` - Vote *PollVoteResponseData `json:"vote,omitempty"` + 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 { @@ -7768,37 +7803,37 @@ type PollVotesResponse struct { Duration string `json:"duration"` // Poll votes Votes []PollVoteResponseData `json:"votes"` - Next *string `json:"next,omitempty"` - Prev *string `json:"prev,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 { @@ -7806,17 +7841,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 { @@ -7824,8 +7859,8 @@ 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 { @@ -7836,17 +7871,17 @@ type PushNotificationConfig struct { } 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"` } @@ -7864,113 +7899,113 @@ type PushPreferenceInput struct { // 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"` + 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"` + 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"` - EnablePush bool `json:"enable_push"` - EventType string `json:"event_type"` - UpdatedAt Timestamp `json:"updated_at"` - Template *string `json:"template,omitempty"` + 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 { @@ -8009,31 +8044,31 @@ 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 { @@ -8043,11 +8078,11 @@ type QueryBannedUsersPayload struct { // 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 { @@ -8080,125 +8115,125 @@ 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"` + 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 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"` + 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"` + 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"` + Call CallResponse `json:"call"` } // Basic response information type QueryCallSessionParticipantStatsResponse 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"` - 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"` + 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 { @@ -8216,8 +8251,8 @@ type QueryDraftsResponse struct { 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 { @@ -8236,8 +8271,8 @@ type QueryFeedModerationTemplate struct { // Name of the moderation template Name string `json:"name"` // When the template was last updated - UpdatedAt Timestamp `json:"updated_at"` - Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` + UpdatedAt Timestamp `json:"updated_at"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type QueryFeedModerationTemplatesResponse struct { @@ -8257,10 +8292,10 @@ type QueryFeedsResponse struct { } 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"` } @@ -8282,9 +8317,9 @@ type QueryFutureChannelBansPayload struct { // 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 { @@ -8296,19 +8331,19 @@ type QueryFutureChannelBansResponse struct { // 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"` @@ -8317,14 +8352,14 @@ type QueryMembershipLevelsResponse struct { } 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 @@ -8340,33 +8375,33 @@ type QueryMessageHistoryResponse struct { 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 { @@ -8379,8 +8414,18 @@ type QueryModerationRulesResponse struct { 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"` + 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 { @@ -8388,17 +8433,17 @@ type QueryPollsResponse struct { 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 { @@ -8406,8 +8451,8 @@ type QueryRemindersResponse struct { 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 { @@ -8417,9 +8462,9 @@ type QueryReviewQueueResponse struct { // Configuration for moderation actions 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"` } @@ -8428,8 +8473,8 @@ type QuerySegmentTargetsResponse struct { 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 { @@ -8437,8 +8482,18 @@ type QuerySegmentsResponse struct { Duration string `json:"duration"` // Segments Segments []SegmentResponse `json:"segments"` - Next *string `json:"next,omitempty"` - Prev *string `json:"prev,omitempty"` + 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"` } type QueryThreadsResponse struct { @@ -8446,29 +8501,29 @@ type QueryThreadsResponse struct { 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 { @@ -8487,8 +8542,8 @@ type RTMPBroadcastRequest struct { // 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 @@ -8497,31 +8552,31 @@ 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. 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"` + 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 { @@ -8553,31 +8608,31 @@ type RawRecordingSettingsResponse struct { } 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"` + 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 { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Channel ChannelResponse `json:"channel"` - Custom map[string]any `json:"custom"` + 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 @@ -8589,17 +8644,17 @@ type ReactionDeletedEvent struct { // 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"` + 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"` // 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ReactionDeletedEvent) GetEventType() string { @@ -8621,9 +8676,9 @@ type ReactionGroupResponse struct { // Emitted when a new reaction is added to a message. type ReactionNewEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Channel ChannelResponse `json:"channel"` - Custom map[string]any `json:"custom"` + 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 @@ -8635,17 +8690,17 @@ type ReactionNewEvent struct { // 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"` + 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"` // 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"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Message *MessageResponse `json:"message,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ReactionNewEvent) GetEventType() string { @@ -8661,10 +8716,10 @@ type ReactionRequest struct { // 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 { @@ -8682,17 +8737,17 @@ type ReactionResponse struct { 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 { // 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"` + 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 @@ -8704,13 +8759,13 @@ type ReactionUpdatedEvent struct { // 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + Reaction *ReactionResponse `json:"reaction,omitempty"` + User *UserResponseCommonFields `json:"user,omitempty"` } func (e *ReactionUpdatedEvent) GetEventType() string { @@ -8719,15 +8774,15 @@ func (e *ReactionUpdatedEvent) GetEventType() string { 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 { @@ -8741,19 +8796,19 @@ 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 { @@ -8762,16 +8817,16 @@ type RecordSettingsRequest struct { // Whether to record audio only AudioOnly *bool `json:"audio_only,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"` + 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"` } // Configuration for rejecting an appeal @@ -8781,13 +8836,13 @@ type RejectAppealRequestPayload struct { } 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. @@ -8799,14 +8854,14 @@ type ReminderCreatedEvent struct { // 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 (e *ReminderCreatedEvent) GetEventType() string { @@ -8822,14 +8877,14 @@ type ReminderDeletedEvent struct { // 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 (e *ReminderDeletedEvent) GetEventType() string { @@ -8845,13 +8900,13 @@ type ReminderNotificationEvent struct { // 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 (e *ReminderNotificationEvent) GetEventType() string { @@ -8859,15 +8914,15 @@ func (e *ReminderNotificationEvent) GetEventType() string { } 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. @@ -8879,14 +8934,14 @@ type ReminderUpdatedEvent struct { // 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"` - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + Reminder *ReminderResponseData `json:"reminder,omitempty"` } func (e *ReminderUpdatedEvent) GetEventType() string { @@ -8906,30 +8961,30 @@ type RepliesMeta struct { } 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 @@ -8945,19 +9000,19 @@ type RestoreActionRequestPayload struct { } type RestoreActivityResponse struct { - Duration string `json:"duration"` + Duration string `json:"duration"` Activity ActivityResponse `json:"activity"` } // 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"` } @@ -8974,9 +9029,9 @@ type ReviewQueueItemResponse struct { 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"` @@ -8998,36 +9053,36 @@ type ReviewQueueItemResponse struct { 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"` + 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"` + 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"` } @@ -9042,9 +9097,9 @@ type RingCallResponse struct { } 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 { @@ -9057,9 +9112,9 @@ type RingSettingsRequest struct { } 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 { @@ -9076,54 +9131,55 @@ type Role struct { } type RuleBuilderAction struct { - 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 *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"` - CallCustomPropertyParams *CallCustomPropertyParameters `json:"call_custom_property_params,omitempty"` - CallTypeRuleParams *CallTypeRuleParameters `json:"call_type_rule_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"` + 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"` - 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"` + 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. @@ -9147,11 +9203,11 @@ type SDKUsageReportResponse struct { } type SFULocationResponse struct { - Datacenter string `json:"datacenter"` - ID string `json:"id"` + Datacenter string `json:"datacenter"` + ID string `json:"id"` Coordinates CoordinatesResponse `json:"coordinates"` - Location LocationResponse `json:"location"` - Count *int `json:"count,omitempty"` + Location LocationResponse `json:"location"` + Count *int `json:"count,omitempty"` } // Configuration for SIP call settings @@ -9267,23 +9323,23 @@ 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 @@ -9295,12 +9351,12 @@ type SIPInboundRoutingRuleResponse struct { // 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 @@ -9352,28 +9408,28 @@ type SRTIngress struct { } type ScreensharingSettings struct { - AccessRequestEnabled bool `json:"access_request_enabled"` - Enabled bool `json:"enabled"` - TargetResolution *TargetResolution `json:"target_resolution,omitempty"` + 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"` + 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"` + 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"` + 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. @@ -9385,8 +9441,8 @@ type SearchPayload struct { // 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"` + MessageFilterConditions map[string]any `json:"message_filter_conditions,omitempty"` + MessageOptions *MessageOptions `json:"message_options,omitempty"` } type SearchResponse struct { @@ -9397,7 +9453,7 @@ type SearchResponse struct { // 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"` + Previous *string `json:"previous,omitempty"` ResultsWarning *SearchWarning `json:"results_warning,omitempty"` } @@ -9406,52 +9462,54 @@ type SearchResult struct { } 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"` - 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"` - 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"` + 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"` } type SearchWarning struct { @@ -9466,39 +9524,39 @@ type SearchWarning struct { } 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 { @@ -9512,8 +9570,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"` } @@ -9521,17 +9579,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 { @@ -9547,9 +9605,9 @@ 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"` } // Configuration for shadow block action @@ -9559,10 +9617,10 @@ type ShadowBlockActionRequestPayload struct { } 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 { @@ -9572,7 +9630,7 @@ type SharedLocationResponse struct { 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 @@ -9584,27 +9642,27 @@ type SharedLocationResponse struct { // 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"` } @@ -9615,8 +9673,8 @@ 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"` } @@ -9650,15 +9708,15 @@ type SortParamRequest struct { 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 { @@ -9700,9 +9758,6 @@ type StopAllRTMPBroadcastsResponse struct { Duration string `json:"duration"` } -type StopCampaignRequest struct { -} - // Basic response information type StopClosedCaptionsResponse struct { // Duration of the request in milliseconds @@ -9722,8 +9777,8 @@ 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 @@ -9760,17 +9815,17 @@ 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 (e *StoriesFeedUpdatedEvent) GetEventType() string { @@ -9778,32 +9833,32 @@ func (e *StoriesFeedUpdatedEvent) GetEventType() string { } 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"` } @@ -9813,46 +9868,68 @@ 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 { @@ -9882,9 +9959,9 @@ type ThreadResponse struct { 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 { @@ -9903,7 +9980,7 @@ type ThreadStateResponse struct { // 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"` @@ -9912,25 +9989,25 @@ type ThreadStateResponse struct { // 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 { - 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"` + 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 (e *ThreadUpdatedEvent) GetEventType() string { @@ -9939,42 +10016,42 @@ func (e *ThreadUpdatedEvent) GetEventType() string { // 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"` + 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"` + 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"` + 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 { @@ -9997,46 +10074,46 @@ 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"` + Duration string `json:"duration"` + Channel *ChannelResponse `json:"channel,omitempty"` + Message *MessageResponse `json:"message,omitempty"` } type TypingIndicatorsResponse struct { @@ -10075,9 +10152,9 @@ 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"` } @@ -10086,6 +10163,13 @@ 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 @@ -10093,8 +10177,8 @@ type UnfollowBatchResponse struct { } type UnfollowResponse struct { - Duration string `json:"duration"` - Follow FollowResponse `json:"follow"` + Duration string `json:"duration"` + Follow FollowResponse `json:"follow"` } type UnmuteResponse struct { @@ -10108,7 +10192,7 @@ type UnpinActivityResponse struct { // 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"` } @@ -10129,36 +10213,36 @@ 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"` - ParentMessageID string `json:"parent_message_id"` - UnreadCount int `json:"unread_count"` + LastRead Timestamp `json:"last_read"` + LastReadMessageID string `json:"last_read_message_id"` + ParentMessageID string `json:"parent_message_id"` + UnreadCount int `json:"unread_count"` } type UpdateActivitiesPartialBatchResponse struct { @@ -10181,60 +10265,60 @@ type UpdateActivityPartialChangeRequest struct { } 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"` + Grants map[string][]string `json:"grants"` NotificationSettings NotificationSettingsResponse `json:"notification_settings"` - Settings CallSettingsResponse `json:"settings"` + Settings CallSettingsResponse `json:"settings"` // the external storage for the call type ExternalStorage *string `json:"external_storage,omitempty"` } @@ -10244,7 +10328,7 @@ type UpdateChannelPartialResponse struct { Duration string `json:"duration"` // List of updated members Members []ChannelMemberResponse `json:"members"` - Channel *ChannelResponse `json:"channel,omitempty"` + Channel *ChannelResponse `json:"channel,omitempty"` } type UpdateChannelResponse struct { @@ -10252,49 +10336,49 @@ type UpdateChannelResponse struct { Duration string `json:"duration"` // List of channel members Members []ChannelMemberResponse `json:"members"` - Channel *ChannelResponse `json:"channel,omitempty"` - Message *MessageResponse `json:"message,omitempty"` + 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"` - PushLevel *string `json:"push_level,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 UpdateCollectionRequest struct { @@ -10313,13 +10397,13 @@ type UpdateCollectionsResponse struct { } 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 @@ -10327,60 +10411,60 @@ 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"` } @@ -10388,41 +10472,41 @@ 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"` - Thread ThreadResponse `json:"thread"` + Duration string `json:"duration"` + Thread ThreadResponse `json:"thread"` } 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 @@ -10433,7 +10517,7 @@ 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"` @@ -10441,11 +10525,11 @@ type UpdateUsersResponse struct { // 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"` } @@ -10458,7 +10542,7 @@ 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"` @@ -10468,15 +10552,15 @@ 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"` } @@ -10496,32 +10580,32 @@ type UpsertCollectionsResponse struct { } 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"` + 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 *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` + UpdatedAt Timestamp `json:"updated_at"` + Config *FeedsModerationTemplateConfigPayload `json:"config,omitempty"` } type UpsertPushPreferencesRequest struct { @@ -10541,34 +10625,34 @@ type UpsertPushPreferencesResponse struct { // 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"` + Duration string `json:"duration"` Template *PushTemplateResponse `json:"template,omitempty"` } type User struct { - ID string `json:"id"` + 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 { // 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.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"` + 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 @@ -10576,15 +10660,15 @@ type UserBannedEvent struct { // The expiration date of the ban Expiration *Timestamp `json:"expiration,omitempty"` // The reason for the ban - Reason *string `json:"reason,omitempty"` + 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"` + 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 (e *UserBannedEvent) GetEventType() string { @@ -10596,25 +10680,25 @@ 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 { // 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.deactivated" in this case - Type string `json:"type"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (e *UserDeactivatedEvent) GetEventType() string { @@ -10636,11 +10720,11 @@ type UserDeletedEvent struct { // Whether the user was hard deleted HardDelete bool `json:"hard_delete"` // Whether the user's messages were marked as deleted - MarkMessagesDeleted bool `json:"mark_messages_deleted"` - Custom map[string]any `json:"custom"` - User UserResponseCommonFields `json:"user"` + 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"` + Type string `json:"type"` ReceivedAt *Timestamp `json:"received_at,omitempty"` } @@ -10649,8 +10733,8 @@ func (e *UserDeletedEvent) GetEventType() string { } 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 { @@ -10658,15 +10742,15 @@ type UserFeedbackReportResponse struct { } type UserFeedbackResponse struct { - 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"` + 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. @@ -10676,13 +10760,13 @@ type UserFlaggedEvent struct { // 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"` + TotalFlags int `json:"total_flags"` + User UserResponseCommonFields `json:"user"` // The type of event: "user.flagged" in this case - Type string `json:"type"` + Type string `json:"type"` ReceivedAt *Timestamp `json:"received_at,omitempty"` // Custom data - Custom map[string]any `json:"custom,omitempty"` + Custom map[string]any `json:"custom,omitempty"` TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } @@ -10691,31 +10775,31 @@ func (e *UserFlaggedEvent) GetEventType() string { } 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"` } @@ -10724,25 +10808,25 @@ func (e *UserMessagesDeletedEvent) GetEventType() string { } 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 { // 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.muted" in this case - Type string `json:"type"` + 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"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } func (e *UserMutedEvent) GetEventType() string { @@ -10751,19 +10835,19 @@ func (e *UserMutedEvent) GetEventType() string { 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 { // 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.reactivated" in this case - Type string `json:"type"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` + Type string `json:"type"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (e *UserReactivatedEvent) GetEventType() string { @@ -10775,9 +10859,9 @@ 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 @@ -10785,7 +10869,7 @@ type UserRequest struct { // 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"` @@ -10798,8 +10882,8 @@ type UserResponse struct { // 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 @@ -10809,20 +10893,20 @@ type UserResponse struct { // 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 @@ -10830,59 +10914,59 @@ type UserResponse struct { // 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 { @@ -10892,26 +10976,26 @@ type UserRuleParameters struct { // This event is sent when a user gets unbanned. The event contains information about the user that was unbanned. type UserUnbannedEvent 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.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"` + 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"` + 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"` + Team *string `json:"team,omitempty"` + ChannelCustom map[string]any `json:"channel_custom,omitempty"` + CreatedBy *UserResponseCommonFields `json:"created_by,omitempty"` } func (e *UserUnbannedEvent) GetEventType() string { @@ -10921,15 +11005,15 @@ func (e *UserUnbannedEvent) GetEventType() string { // This event is sent when a user gets unmuted. The event contains information about the user that was unmuted. type UserUnmutedEvent struct { // Date/time of creation - CreatedAt Timestamp `json:"created_at"` - Custom map[string]any `json:"custom"` - User UserResponseCommonFields `json:"user"` + 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"` + 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"` + TargetUser *UserResponseCommonFields `json:"target_user,omitempty"` } func (e *UserUnmutedEvent) GetEventType() string { @@ -10942,10 +11026,10 @@ type UserUnreadReminderEvent struct { CreatedAt Timestamp `json:"created_at"` // The channels with unread messages Channels map[string]*ChannelMessagesResponse `json:"channels"` - Custom map[string]any `json:"custom"` - User UserResponseCommonFields `json:"user"` + 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"` + Type string `json:"type"` ReceivedAt *Timestamp `json:"received_at,omitempty"` } @@ -10956,11 +11040,11 @@ func (e *UserUnreadReminderEvent) GetEventType() string { // 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"` } @@ -10969,36 +11053,36 @@ func (e *UserUpdatedEvent) GetEventType() string { } 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 { @@ -11018,50 +11102,50 @@ type VideoReactionOverTimeResponse struct { } 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 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"` + 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 @@ -11076,55 +11160,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"` + 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/moderation.go b/moderation.go index 16b9617..1adc6f8 100644 --- a/moderation.go +++ b/moderation.go @@ -16,205 +16,232 @@ func NewModerationClient(client *Client) *ModerationClient { } // Appeal against the moderation decision +// func (c *ModerationClient) Appeal(ctx context.Context, request *AppealRequest) (*StreamResponse[AppealResponse], error) { var result AppealResponse - res, err := MakeRequest[AppealRequest, AppealResponse](c.client, ctx, "POST", "/api/v2/moderation/appeal", nil, request, &result, nil) + res, err := MakeRequest[AppealRequest, AppealResponse](c.client, ctx, "POST", "/api/v2/moderation/appeal",nil,request, &result,nil) return res, err } // Retrieve a specific appeal item by its ID -func (c *ModerationClient) GetAppeal(ctx context.Context, id string, request *GetAppealRequest) (*StreamResponse[GetAppealResponse], error) { +// +func (c *ModerationClient) GetAppeal(ctx context.Context,id string, request *GetAppealRequest) (*StreamResponse[GetAppealResponse], error) { var result GetAppealResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetAppealResponse](c.client, ctx, "GET", "/api/v2/moderation/appeal/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetAppealResponse](c.client, ctx, "GET", "/api/v2/moderation/appeal/{id}",nil, nil, &result,pathParams) return res, err } // Query Appeals +// func (c *ModerationClient) QueryAppeals(ctx context.Context, request *QueryAppealsRequest) (*StreamResponse[QueryAppealsResponse], error) { var result QueryAppealsResponse - res, err := MakeRequest[QueryAppealsRequest, QueryAppealsResponse](c.client, ctx, "POST", "/api/v2/moderation/appeals", nil, request, &result, nil) + res, err := MakeRequest[QueryAppealsRequest, QueryAppealsResponse](c.client, ctx, "POST", "/api/v2/moderation/appeals",nil,request, &result,nil) return res, err } // Ban a user from a channel or the entire app +// func (c *ModerationClient) Ban(ctx context.Context, request *BanRequest) (*StreamResponse[BanResponse], error) { var result BanResponse - res, err := MakeRequest[BanRequest, BanResponse](c.client, ctx, "POST", "/api/v2/moderation/ban", nil, request, &result, nil) + res, err := MakeRequest[BanRequest, BanResponse](c.client, ctx, "POST", "/api/v2/moderation/ban",nil,request, &result,nil) return res, err } // Moderate multiple images in bulk using a CSV file +// func (c *ModerationClient) BulkImageModeration(ctx context.Context, request *BulkImageModerationRequest) (*StreamResponse[BulkImageModerationResponse], error) { var result BulkImageModerationResponse - res, err := MakeRequest[BulkImageModerationRequest, BulkImageModerationResponse](c.client, ctx, "POST", "/api/v2/moderation/bulk_image_moderation", nil, request, &result, nil) + res, err := MakeRequest[BulkImageModerationRequest, BulkImageModerationResponse](c.client, ctx, "POST", "/api/v2/moderation/bulk_image_moderation",nil,request, &result,nil) return res, err } // Run moderation checks on the provided content +// func (c *ModerationClient) Check(ctx context.Context, request *CheckRequest) (*StreamResponse[CheckResponse], error) { var result CheckResponse - res, err := MakeRequest[CheckRequest, CheckResponse](c.client, ctx, "POST", "/api/v2/moderation/check", nil, request, &result, nil) + res, err := MakeRequest[CheckRequest, CheckResponse](c.client, ctx, "POST", "/api/v2/moderation/check",nil,request, &result,nil) return res, err } // Create a new moderation configuration or update an existing one. Configure settings for content filtering, AI analysis, toxicity detection, and other moderation features. +// func (c *ModerationClient) UpsertConfig(ctx context.Context, request *UpsertConfigRequest) (*StreamResponse[UpsertConfigResponse], error) { var result UpsertConfigResponse - res, err := MakeRequest[UpsertConfigRequest, UpsertConfigResponse](c.client, ctx, "POST", "/api/v2/moderation/config", nil, request, &result, nil) + res, err := MakeRequest[UpsertConfigRequest, UpsertConfigResponse](c.client, ctx, "POST", "/api/v2/moderation/config",nil,request, &result,nil) return res, err } // Delete a specific moderation policy by its name -func (c *ModerationClient) DeleteConfig(ctx context.Context, key string, request *DeleteConfigRequest) (*StreamResponse[DeleteModerationConfigResponse], error) { +// +func (c *ModerationClient) DeleteConfig(ctx context.Context,key string, request *DeleteConfigRequest) (*StreamResponse[DeleteModerationConfigResponse], error) { var result DeleteModerationConfigResponse pathParams := map[string]string{ "key": key, } params := extractQueryParams(request) - res, err := MakeRequest[any, DeleteModerationConfigResponse](c.client, ctx, "DELETE", "/api/v2/moderation/config/{key}", params, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteModerationConfigResponse](c.client, ctx, "DELETE", "/api/v2/moderation/config/{key}",params, nil, &result,pathParams) return res, err } // Retrieve a specific moderation configuration by its key and team. This configuration contains settings for various moderation features like toxicity detection, AI analysis, and filtering rules. -func (c *ModerationClient) GetConfig(ctx context.Context, key string, request *GetConfigRequest) (*StreamResponse[GetConfigResponse], error) { +// +func (c *ModerationClient) GetConfig(ctx context.Context,key string, request *GetConfigRequest) (*StreamResponse[GetConfigResponse], error) { var result GetConfigResponse pathParams := map[string]string{ "key": key, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetConfigResponse](c.client, ctx, "GET", "/api/v2/moderation/config/{key}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetConfigResponse](c.client, ctx, "GET", "/api/v2/moderation/config/{key}",params, nil, &result,pathParams) return res, err } // Search and filter moderation configurations across your application. This endpoint is designed for building moderation dashboards and managing multiple configuration sets. +// func (c *ModerationClient) QueryModerationConfigs(ctx context.Context, request *QueryModerationConfigsRequest) (*StreamResponse[QueryModerationConfigsResponse], error) { var result QueryModerationConfigsResponse - res, err := MakeRequest[QueryModerationConfigsRequest, QueryModerationConfigsResponse](c.client, ctx, "POST", "/api/v2/moderation/configs", nil, request, &result, nil) + res, err := MakeRequest[QueryModerationConfigsRequest, QueryModerationConfigsResponse](c.client, ctx, "POST", "/api/v2/moderation/configs",nil,request, &result,nil) return res, err } // Custom check, add your own AI model reports to the review queue +// func (c *ModerationClient) CustomCheck(ctx context.Context, request *CustomCheckRequest) (*StreamResponse[CustomCheckResponse], error) { var result CustomCheckResponse - res, err := MakeRequest[CustomCheckRequest, CustomCheckResponse](c.client, ctx, "POST", "/api/v2/moderation/custom_check", nil, request, &result, nil) + res, err := MakeRequest[CustomCheckRequest, CustomCheckResponse](c.client, ctx, "POST", "/api/v2/moderation/custom_check",nil,request, &result,nil) return res, err } // Delete a specific moderation template by its name +// func (c *ModerationClient) V2DeleteTemplate(ctx context.Context, request *V2DeleteTemplateRequest) (*StreamResponse[DeleteModerationTemplateResponse], error) { var result DeleteModerationTemplateResponse - res, err := MakeRequest[any, DeleteModerationTemplateResponse](c.client, ctx, "DELETE", "/api/v2/moderation/feeds_moderation_template", nil, nil, &result, nil) + res, err := MakeRequest[any, DeleteModerationTemplateResponse](c.client, ctx, "DELETE", "/api/v2/moderation/feeds_moderation_template",nil, nil, &result,nil) return res, err } // Retrieve a list of feed moderation templates that define preset moderation rules and configurations. Limited to 100 templates per request. +// func (c *ModerationClient) V2QueryTemplates(ctx context.Context, request *V2QueryTemplatesRequest) (*StreamResponse[QueryFeedModerationTemplatesResponse], error) { var result QueryFeedModerationTemplatesResponse - res, err := MakeRequest[any, QueryFeedModerationTemplatesResponse](c.client, ctx, "GET", "/api/v2/moderation/feeds_moderation_template", nil, nil, &result, nil) + res, err := MakeRequest[any, QueryFeedModerationTemplatesResponse](c.client, ctx, "GET", "/api/v2/moderation/feeds_moderation_template",nil, nil, &result,nil) return res, err } // Upsert feeds template for moderation +// func (c *ModerationClient) V2UpsertTemplate(ctx context.Context, request *V2UpsertTemplateRequest) (*StreamResponse[UpsertModerationTemplateResponse], error) { var result UpsertModerationTemplateResponse - res, err := MakeRequest[V2UpsertTemplateRequest, UpsertModerationTemplateResponse](c.client, ctx, "POST", "/api/v2/moderation/feeds_moderation_template", nil, request, &result, nil) + res, err := MakeRequest[V2UpsertTemplateRequest, UpsertModerationTemplateResponse](c.client, ctx, "POST", "/api/v2/moderation/feeds_moderation_template",nil,request, &result,nil) return res, err } // Flag any type of content (messages, users, channels, activities) for moderation review. Supports custom content types and additional metadata for flagged content. +// func (c *ModerationClient) Flag(ctx context.Context, request *FlagRequest) (*StreamResponse[FlagResponse], error) { var result FlagResponse - res, err := MakeRequest[FlagRequest, FlagResponse](c.client, ctx, "POST", "/api/v2/moderation/flag", nil, request, &result, nil) + res, err := MakeRequest[FlagRequest, FlagResponse](c.client, ctx, "POST", "/api/v2/moderation/flag",nil,request, &result,nil) return res, err } // Query flags associated with moderation items. This is used for building a moderation dashboard. +// func (c *ModerationClient) QueryModerationFlags(ctx context.Context, request *QueryModerationFlagsRequest) (*StreamResponse[QueryModerationFlagsResponse], error) { var result QueryModerationFlagsResponse - res, err := MakeRequest[QueryModerationFlagsRequest, QueryModerationFlagsResponse](c.client, ctx, "POST", "/api/v2/moderation/flags", nil, request, &result, nil) + res, err := MakeRequest[QueryModerationFlagsRequest, QueryModerationFlagsResponse](c.client, ctx, "POST", "/api/v2/moderation/flags",nil,request, &result,nil) return res, err } // Search and filter moderation action logs with support for pagination. View the history of moderation actions taken, including who performed them and when. +// func (c *ModerationClient) QueryModerationLogs(ctx context.Context, request *QueryModerationLogsRequest) (*StreamResponse[QueryModerationLogsResponse], error) { var result QueryModerationLogsResponse - res, err := MakeRequest[QueryModerationLogsRequest, QueryModerationLogsResponse](c.client, ctx, "POST", "/api/v2/moderation/logs", nil, request, &result, nil) + res, err := MakeRequest[QueryModerationLogsRequest, QueryModerationLogsResponse](c.client, ctx, "POST", "/api/v2/moderation/logs",nil,request, &result,nil) return res, err } // Create or update a moderation rule that can apply app-wide or to specific moderation configs +// func (c *ModerationClient) UpsertModerationRule(ctx context.Context, request *UpsertModerationRuleRequest) (*StreamResponse[UpsertModerationRuleResponse], error) { var result UpsertModerationRuleResponse - res, err := MakeRequest[UpsertModerationRuleRequest, UpsertModerationRuleResponse](c.client, ctx, "POST", "/api/v2/moderation/moderation_rule", nil, request, &result, nil) + res, err := MakeRequest[UpsertModerationRuleRequest, UpsertModerationRuleResponse](c.client, ctx, "POST", "/api/v2/moderation/moderation_rule",nil,request, &result,nil) return res, err } // Delete an existing moderation rule +// func (c *ModerationClient) DeleteModerationRule(ctx context.Context, request *DeleteModerationRuleRequest) (*StreamResponse[DeleteModerationRuleResponse], error) { var result DeleteModerationRuleResponse - res, err := MakeRequest[any, DeleteModerationRuleResponse](c.client, ctx, "DELETE", "/api/v2/moderation/moderation_rule/{id}", nil, nil, &result, nil) + res, err := MakeRequest[any, DeleteModerationRuleResponse](c.client, ctx, "DELETE", "/api/v2/moderation/moderation_rule/{id}",nil, nil, &result,nil) return res, err } // Get a specific moderation rule by ID +// func (c *ModerationClient) GetModerationRule(ctx context.Context, request *GetModerationRuleRequest) (*StreamResponse[GetModerationRuleResponse], error) { var result GetModerationRuleResponse - res, err := MakeRequest[any, GetModerationRuleResponse](c.client, ctx, "GET", "/api/v2/moderation/moderation_rule/{id}", nil, nil, &result, nil) + res, err := MakeRequest[any, GetModerationRuleResponse](c.client, ctx, "GET", "/api/v2/moderation/moderation_rule/{id}",nil, nil, &result,nil) return res, err } // Search and filter moderation rules across your application. This endpoint is designed for building moderation dashboards and managing multiple rule sets. +// func (c *ModerationClient) QueryModerationRules(ctx context.Context, request *QueryModerationRulesRequest) (*StreamResponse[QueryModerationRulesResponse], error) { var result QueryModerationRulesResponse - res, err := MakeRequest[QueryModerationRulesRequest, QueryModerationRulesResponse](c.client, ctx, "POST", "/api/v2/moderation/moderation_rules", nil, request, &result, nil) + res, err := MakeRequest[QueryModerationRulesRequest, QueryModerationRulesResponse](c.client, ctx, "POST", "/api/v2/moderation/moderation_rules",nil,request, &result,nil) return res, err } // Mute a user. Mutes are generally not visible to the user you mute, while block is something you notice. +// func (c *ModerationClient) Mute(ctx context.Context, request *MuteRequest) (*StreamResponse[MuteResponse], error) { var result MuteResponse - res, err := MakeRequest[MuteRequest, MuteResponse](c.client, ctx, "POST", "/api/v2/moderation/mute", nil, request, &result, nil) + res, err := MakeRequest[MuteRequest, MuteResponse](c.client, ctx, "POST", "/api/v2/moderation/mute",nil,request, &result,nil) return res, err } // Query review queue items allows you to filter the review queue items. This is used for building a moderation dashboard. +// func (c *ModerationClient) QueryReviewQueue(ctx context.Context, request *QueryReviewQueueRequest) (*StreamResponse[QueryReviewQueueResponse], error) { var result QueryReviewQueueResponse - res, err := MakeRequest[QueryReviewQueueRequest, QueryReviewQueueResponse](c.client, ctx, "POST", "/api/v2/moderation/review_queue", nil, request, &result, nil) + res, err := MakeRequest[QueryReviewQueueRequest, QueryReviewQueueResponse](c.client, ctx, "POST", "/api/v2/moderation/review_queue",nil,request, &result,nil) return res, err } // Retrieve a specific review queue item by its ID -func (c *ModerationClient) GetReviewQueueItem(ctx context.Context, id string, request *GetReviewQueueItemRequest) (*StreamResponse[GetReviewQueueItemResponse], error) { +// +func (c *ModerationClient) GetReviewQueueItem(ctx context.Context,id string, request *GetReviewQueueItemRequest) (*StreamResponse[GetReviewQueueItemResponse], error) { var result GetReviewQueueItemResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, GetReviewQueueItemResponse](c.client, ctx, "GET", "/api/v2/moderation/review_queue/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetReviewQueueItemResponse](c.client, ctx, "GET", "/api/v2/moderation/review_queue/{id}",nil, nil, &result,pathParams) return res, err } // Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions. Supports various action types with configurable parameters. +// func (c *ModerationClient) SubmitAction(ctx context.Context, request *SubmitActionRequest) (*StreamResponse[SubmitActionResponse], error) { var result SubmitActionResponse - res, err := MakeRequest[SubmitActionRequest, SubmitActionResponse](c.client, ctx, "POST", "/api/v2/moderation/submit_action", nil, request, &result, nil) + res, err := MakeRequest[SubmitActionRequest, SubmitActionResponse](c.client, ctx, "POST", "/api/v2/moderation/submit_action",nil,request, &result,nil) return res, err } // Unban a user from a channel or globally. +// func (c *ModerationClient) Unban(ctx context.Context, request *UnbanRequest) (*StreamResponse[UnbanResponse], error) { var result UnbanResponse params := extractQueryParams(request) - res, err := MakeRequest[UnbanRequest, UnbanResponse](c.client, ctx, "POST", "/api/v2/moderation/unban", params, request, &result, nil) + res, err := MakeRequest[UnbanRequest, UnbanResponse](c.client, ctx, "POST", "/api/v2/moderation/unban",params,request, &result,nil) return res, err } // Unmute a user +// func (c *ModerationClient) Unmute(ctx context.Context, request *UnmuteRequest) (*StreamResponse[UnmuteResponse], error) { var result UnmuteResponse - res, err := MakeRequest[UnmuteRequest, UnmuteResponse](c.client, ctx, "POST", "/api/v2/moderation/unmute", nil, request, &result, nil) + res, err := MakeRequest[UnmuteRequest, UnmuteResponse](c.client, ctx, "POST", "/api/v2/moderation/unmute",nil,request, &result,nil) return res, err -} +} \ No newline at end of file diff --git a/requests.go b/requests.go index 5053284..1e86a55 100644 --- a/requests.go +++ b/requests.go @@ -1,67 +1,66 @@ // Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT. package getstream - type GetAppRequest struct { } type UpdateAppRequest struct { - AsyncUrlEnrichEnabled *bool `json:"async_url_enrich_enabled"` - AutoTranslationEnabled *bool `json:"auto_translation_enabled"` - BeforeMessageSendHookUrl *string `json:"before_message_send_hook_url"` - CdnExpirationSeconds *int `json:"cdn_expiration_seconds"` - ChannelHideMembersOnly *bool `json:"channel_hide_members_only"` - 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"` - FeedsModerationEnabled *bool `json:"feeds_moderation_enabled"` - FeedsV2Region *string `json:"feeds_v2_region"` - GuestUserCreationDisabled *bool `json:"guest_user_creation_disabled"` - ImageModerationEnabled *bool `json:"image_moderation_enabled"` - MaxAggregatedActivitiesLength *int `json:"max_aggregated_activities_length"` - MigratePermissionsToV2 *bool `json:"migrate_permissions_to_v2"` - ModerationEnabled *bool `json:"moderation_enabled"` - ModerationWebhookUrl *string `json:"moderation_webhook_url"` - MultiTenantEnabled *bool `json:"multi_tenant_enabled"` - PermissionVersion *string `json:"permission_version"` - RemindersInterval *int `json:"reminders_interval"` - RemindersMaxMembers *int `json:"reminders_max_members"` - RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before"` - 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"` - UserResponseTimeEnabled *bool `json:"user_response_time_enabled"` - WebhookUrl *string `json:"webhook_url"` - AllowedFlagReasons []string `json:"allowed_flag_reasons"` - EventHooks []EventHook `json:"event_hooks"` - ImageModerationBlockLabels []string `json:"image_moderation_block_labels"` - ImageModerationLabels []string `json:"image_moderation_labels"` - UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles"` - WebhookEvents []string `json:"webhook_events"` - ApnConfig *APNConfig `json:"apn_config"` - AsyncModerationConfig *AsyncModerationConfiguration `json:"async_moderation_config"` - DatadogInfo *DataDogInfo `json:"datadog_info"` - FileUploadConfig *FileUploadConfig `json:"file_upload_config"` - FirebaseConfig *FirebaseConfig `json:"firebase_config"` - Grants map[string][]string `json:"grants"` - HuaweiConfig *HuaweiConfig `json:"huawei_config"` - ImageUploadConfig *FileUploadConfig `json:"image_upload_config"` + AsyncUrlEnrichEnabled *bool `json:"async_url_enrich_enabled"` + AutoTranslationEnabled *bool `json:"auto_translation_enabled"` + BeforeMessageSendHookUrl *string `json:"before_message_send_hook_url"` + CdnExpirationSeconds *int `json:"cdn_expiration_seconds"` + ChannelHideMembersOnly *bool `json:"channel_hide_members_only"` + 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"` + FeedsModerationEnabled *bool `json:"feeds_moderation_enabled"` + FeedsV2Region *string `json:"feeds_v2_region"` + GuestUserCreationDisabled *bool `json:"guest_user_creation_disabled"` + ImageModerationEnabled *bool `json:"image_moderation_enabled"` + MaxAggregatedActivitiesLength *int `json:"max_aggregated_activities_length"` + MigratePermissionsToV2 *bool `json:"migrate_permissions_to_v2"` + ModerationEnabled *bool `json:"moderation_enabled"` + ModerationWebhookUrl *string `json:"moderation_webhook_url"` + MultiTenantEnabled *bool `json:"multi_tenant_enabled"` + PermissionVersion *string `json:"permission_version"` + RemindersInterval *int `json:"reminders_interval"` + RemindersMaxMembers *int `json:"reminders_max_members"` + RevokeTokensIssuedBefore *Timestamp `json:"revoke_tokens_issued_before"` + 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"` + UserResponseTimeEnabled *bool `json:"user_response_time_enabled"` + WebhookUrl *string `json:"webhook_url"` + AllowedFlagReasons []string `json:"allowed_flag_reasons"` + EventHooks []EventHook `json:"event_hooks"` + ImageModerationBlockLabels []string `json:"image_moderation_block_labels"` + ImageModerationLabels []string `json:"image_moderation_labels"` + UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles"` + WebhookEvents []string `json:"webhook_events"` + ApnConfig *APNConfig `json:"apn_config"` + AsyncModerationConfig *AsyncModerationConfiguration `json:"async_moderation_config"` + DatadogInfo *DataDogInfo `json:"datadog_info"` + FileUploadConfig *FileUploadConfig `json:"file_upload_config"` + FirebaseConfig *FirebaseConfig `json:"firebase_config"` + Grants map[string][]string `json:"grants"` + HuaweiConfig *HuaweiConfig `json:"huawei_config"` + ImageUploadConfig *FileUploadConfig `json:"image_upload_config"` ModerationDashboardPreferences *ModerationDashboardPreferences `json:"moderation_dashboard_preferences"` - PushConfig *PushConfig `json:"push_config"` - XiaomiConfig *XiaomiConfig `json:"xiaomi_config"` + PushConfig *PushConfig `json:"push_config"` + XiaomiConfig *XiaomiConfig `json:"xiaomi_config"` } type ListBlockListsRequest struct { Team *string `json:"-" query:"team"` } type CreateBlockListRequest struct { - Name string `json:"name"` - Words []string `json:"words"` - IsLeetCheckEnabled *bool `json:"is_leet_check_enabled"` - IsPluralCheckEnabled *bool `json:"is_plural_check_enabled"` - Team *string `json:"team"` - Type *string `json:"type"` + Name string `json:"name"` + Words []string `json:"words"` + IsLeetCheckEnabled *bool `json:"is_leet_check_enabled"` + IsPluralCheckEnabled *bool `json:"is_plural_check_enabled"` + Team *string `json:"team"` + Type *string `json:"type"` } type DeleteBlockListRequest struct { Team *string `json:"-" query:"team"` @@ -70,102 +69,102 @@ type GetBlockListRequest struct { Team *string `json:"-" query:"team"` } type UpdateBlockListRequest struct { - IsLeetCheckEnabled *bool `json:"is_leet_check_enabled"` - IsPluralCheckEnabled *bool `json:"is_plural_check_enabled"` - Team *string `json:"team"` - Words []string `json:"words"` + IsLeetCheckEnabled *bool `json:"is_leet_check_enabled"` + IsPluralCheckEnabled *bool `json:"is_plural_check_enabled"` + Team *string `json:"team"` + Words []string `json:"words"` } type QueryCampaignsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserLimit *int `json:"user_limit"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserLimit *int `json:"user_limit"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` } type GetCampaignRequest struct { - Prev *string `json:"-" query:"prev"` - Next *string `json:"-" query:"next"` - Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` + Limit *int `json:"-" query:"limit"` } type StartCampaignRequest struct { ScheduledFor *Timestamp `json:"scheduled_for"` - StopAt *Timestamp `json:"stop_at"` + StopAt *Timestamp `json:"stop_at"` } -type ScheduleCampaignRequest struct { +type StopCampaignRequest struct { } type QueryChannelsRequest struct { - Limit *int `json:"limit"` - MemberLimit *int `json:"member_limit"` - MessageLimit *int `json:"message_limit"` - Offset *int `json:"offset"` - PredefinedFilter *string `json:"predefined_filter"` - State *bool `json:"state"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - FilterConditions map[string]any `json:"filter_conditions"` - FilterValues map[string]any `json:"filter_values"` - SortValues map[string]any `json:"sort_values"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + MemberLimit *int `json:"member_limit"` + MessageLimit *int `json:"message_limit"` + Offset *int `json:"offset"` + PredefinedFilter *string `json:"predefined_filter"` + State *bool `json:"state"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + FilterConditions map[string]any `json:"filter_conditions"` + FilterValues map[string]any `json:"filter_values"` + SortValues map[string]any `json:"sort_values"` + User *UserRequest `json:"user"` } type DeleteChannelsRequest struct { - Cids []string `json:"cids"` - HardDelete *bool `json:"hard_delete"` + Cids []string `json:"cids"` + HardDelete *bool `json:"hard_delete"` } type MarkDeliveredRequest struct { - UserID *string `json:"-" query:"user_id"` + UserID *string `json:"-" query:"user_id"` LatestDeliveredMessages []DeliveredMessagePayload `json:"latest_delivered_messages"` } type MarkChannelsReadRequest struct { - UserID *string `json:"user_id"` + UserID *string `json:"user_id"` ReadByChannel map[string]string `json:"read_by_channel"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type GetOrCreateDistinctChannelRequest struct { - HideForCreator *bool `json:"hide_for_creator"` - State *bool `json:"state"` - ThreadUnreadCounts *bool `json:"thread_unread_counts"` - Data *ChannelInput `json:"data"` - Members *PaginationParams `json:"members"` - Messages *MessagePaginationParams `json:"messages"` - Watchers *PaginationParams `json:"watchers"` + HideForCreator *bool `json:"hide_for_creator"` + State *bool `json:"state"` + ThreadUnreadCounts *bool `json:"thread_unread_counts"` + Data *ChannelInput `json:"data"` + Members *PaginationParams `json:"members"` + Messages *MessagePaginationParams `json:"messages"` + Watchers *PaginationParams `json:"watchers"` } type DeleteChannelRequest struct { HardDelete *bool `json:"-" query:"hard_delete"` } type UpdateChannelPartialRequest struct { - UserID *string `json:"user_id"` - Unset []string `json:"unset"` - Set map[string]any `json:"set"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + Unset []string `json:"unset"` + Set map[string]any `json:"set"` + User *UserRequest `json:"user"` } type UpdateChannelRequest struct { - AcceptInvite *bool `json:"accept_invite"` - Cooldown *int `json:"cooldown"` - HideHistory *bool `json:"hide_history"` - HideHistoryBefore *Timestamp `json:"hide_history_before"` - RejectInvite *bool `json:"reject_invite"` - SkipPush *bool `json:"skip_push"` - UserID *string `json:"user_id"` - AddFilterTags []string `json:"add_filter_tags"` - AddMembers []ChannelMemberRequest `json:"add_members"` - AddModerators []string `json:"add_moderators"` - AssignRoles []ChannelMemberRequest `json:"assign_roles"` - DemoteModerators []string `json:"demote_moderators"` - Invites []ChannelMemberRequest `json:"invites"` - RemoveFilterTags []string `json:"remove_filter_tags"` - RemoveMembers []string `json:"remove_members"` - Data *ChannelInputRequest `json:"data"` - Message *MessageRequest `json:"message"` - User *UserRequest `json:"user"` + AcceptInvite *bool `json:"accept_invite"` + Cooldown *int `json:"cooldown"` + HideHistory *bool `json:"hide_history"` + HideHistoryBefore *Timestamp `json:"hide_history_before"` + RejectInvite *bool `json:"reject_invite"` + SkipPush *bool `json:"skip_push"` + UserID *string `json:"user_id"` + AddFilterTags []string `json:"add_filter_tags"` + AddMembers []ChannelMemberRequest `json:"add_members"` + AddModerators []string `json:"add_moderators"` + AssignRoles []ChannelMemberRequest `json:"assign_roles"` + DemoteModerators []string `json:"demote_moderators"` + Invites []ChannelMemberRequest `json:"invites"` + RemoveFilterTags []string `json:"remove_filter_tags"` + RemoveMembers []string `json:"remove_members"` + Data *ChannelInputRequest `json:"data"` + Message *MessageRequest `json:"message"` + User *UserRequest `json:"user"` } type DeleteDraftRequest struct { ParentID *string `json:"-" query:"parent_id"` - UserID *string `json:"-" query:"user_id"` + UserID *string `json:"-" query:"user_id"` } type GetDraftRequest struct { ParentID *string `json:"-" query:"parent_id"` - UserID *string `json:"-" query:"user_id"` + UserID *string `json:"-" query:"user_id"` } type SendEventRequest struct { Event EventRequest `json:"event"` @@ -174,263 +173,261 @@ type DeleteChannelFileRequest struct { Url *string `json:"-" query:"url"` } type UploadChannelFileRequest struct { - File *string `json:"file"` + File *string `json:"file"` User *OnlyUserID `json:"user"` } type HideChannelRequest struct { - ClearHistory *bool `json:"clear_history"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + ClearHistory *bool `json:"clear_history"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeleteChannelImageRequest struct { Url *string `json:"-" query:"url"` } type UploadChannelImageRequest struct { - File *string `json:"file"` + File *string `json:"file"` UploadSizes []ImageSize `json:"upload_sizes"` - User *OnlyUserID `json:"user"` + User *OnlyUserID `json:"user"` } type UpdateMemberPartialRequest struct { - UserID *string `json:"-" query:"user_id"` - Unset []string `json:"unset"` - Set map[string]any `json:"set"` + UserID *string `json:"-" query:"user_id"` + Unset []string `json:"unset"` + Set map[string]any `json:"set"` } type SendMessageRequest struct { - Message MessageRequest `json:"message"` - ForceModeration *bool `json:"force_moderation"` - KeepChannelHidden *bool `json:"keep_channel_hidden"` - Pending *bool `json:"pending"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` + Message MessageRequest `json:"message"` + ForceModeration *bool `json:"force_moderation"` + KeepChannelHidden *bool `json:"keep_channel_hidden"` + Pending *bool `json:"pending"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` PendingMessageMetadata map[string]string `json:"pending_message_metadata"` } type GetManyMessagesRequest struct { Ids []string `json:"-" query:"ids"` } type GetOrCreateChannelRequest struct { - HideForCreator *bool `json:"hide_for_creator"` - State *bool `json:"state"` - ThreadUnreadCounts *bool `json:"thread_unread_counts"` - Data *ChannelInput `json:"data"` - Members *PaginationParams `json:"members"` - Messages *MessagePaginationParams `json:"messages"` - Watchers *PaginationParams `json:"watchers"` + HideForCreator *bool `json:"hide_for_creator"` + State *bool `json:"state"` + ThreadUnreadCounts *bool `json:"thread_unread_counts"` + Data *ChannelInput `json:"data"` + Members *PaginationParams `json:"members"` + Messages *MessagePaginationParams `json:"messages"` + Watchers *PaginationParams `json:"watchers"` } type MarkReadRequest struct { - MessageID *string `json:"message_id"` - ThreadID *string `json:"thread_id"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + MessageID *string `json:"message_id"` + ThreadID *string `json:"thread_id"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type ShowChannelRequest struct { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type TruncateChannelRequest struct { - HardDelete *bool `json:"hard_delete"` - SkipPush *bool `json:"skip_push"` - TruncatedAt *Timestamp `json:"truncated_at"` - UserID *string `json:"user_id"` - MemberIds []string `json:"member_ids"` - Message *MessageRequest `json:"message"` - User *UserRequest `json:"user"` + HardDelete *bool `json:"hard_delete"` + SkipPush *bool `json:"skip_push"` + TruncatedAt *Timestamp `json:"truncated_at"` + UserID *string `json:"user_id"` + MemberIds []string `json:"member_ids"` + Message *MessageRequest `json:"message"` + User *UserRequest `json:"user"` } type MarkUnreadRequest struct { - MessageID *string `json:"message_id"` - MessageTimestamp *Timestamp `json:"message_timestamp"` - ThreadID *string `json:"thread_id"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + MessageID *string `json:"message_id"` + MessageTimestamp *Timestamp `json:"message_timestamp"` + ThreadID *string `json:"thread_id"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type ListChannelTypesRequest struct { } type CreateChannelTypeRequest struct { - Automod string `json:"automod"` - AutomodBehavior string `json:"automod_behavior"` - MaxMessageLength int `json:"max_message_length"` - Name string `json:"name"` - Blocklist *string `json:"blocklist"` - BlocklistBehavior *string `json:"blocklist_behavior"` - ConnectEvents *bool `json:"connect_events"` - CountMessages *bool `json:"count_messages"` - CustomEvents *bool `json:"custom_events"` - DeliveryEvents *bool `json:"delivery_events"` - MarkMessagesPending *bool `json:"mark_messages_pending"` - MessageRetention *string `json:"message_retention"` - Mutes *bool `json:"mutes"` - 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"` - 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"` - Uploads *bool `json:"uploads"` - UrlEnrichment *bool `json:"url_enrichment"` - UserMessageReminders *bool `json:"user_message_reminders"` - Blocklists []BlockListOptions `json:"blocklists"` - Commands []string `json:"commands"` - Permissions []PolicyRequest `json:"permissions"` - Grants map[string][]string `json:"grants"` + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + MaxMessageLength int `json:"max_message_length"` + Name string `json:"name"` + Blocklist *string `json:"blocklist"` + BlocklistBehavior *string `json:"blocklist_behavior"` + ConnectEvents *bool `json:"connect_events"` + CountMessages *bool `json:"count_messages"` + CustomEvents *bool `json:"custom_events"` + DeliveryEvents *bool `json:"delivery_events"` + MarkMessagesPending *bool `json:"mark_messages_pending"` + MessageRetention *string `json:"message_retention"` + Mutes *bool `json:"mutes"` + 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"` + 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"` + Uploads *bool `json:"uploads"` + UrlEnrichment *bool `json:"url_enrichment"` + UserMessageReminders *bool `json:"user_message_reminders"` + Blocklists []BlockListOptions `json:"blocklists"` + Commands []string `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + Grants map[string][]string `json:"grants"` } type DeleteChannelTypeRequest struct { } type GetChannelTypeRequest struct { } type UpdateChannelTypeRequest struct { - Automod string `json:"automod"` - AutomodBehavior string `json:"automod_behavior"` - MaxMessageLength int `json:"max_message_length"` - Blocklist *string `json:"blocklist"` - BlocklistBehavior *string `json:"blocklist_behavior"` - ConnectEvents *bool `json:"connect_events"` - CountMessages *bool `json:"count_messages"` - CustomEvents *bool `json:"custom_events"` - DeliveryEvents *bool `json:"delivery_events"` - MarkMessagesPending *bool `json:"mark_messages_pending"` - Mutes *bool `json:"mutes"` - 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"` - 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"` - Uploads *bool `json:"uploads"` - UrlEnrichment *bool `json:"url_enrichment"` - UserMessageReminders *bool `json:"user_message_reminders"` - AllowedFlagReasons []string `json:"allowed_flag_reasons"` - Blocklists []BlockListOptions `json:"blocklists"` - Commands []string `json:"commands"` - Permissions []PolicyRequest `json:"permissions"` - AutomodThresholds *Thresholds `json:"automod_thresholds"` - Grants map[string][]string `json:"grants"` + Automod string `json:"automod"` + AutomodBehavior string `json:"automod_behavior"` + MaxMessageLength int `json:"max_message_length"` + Blocklist *string `json:"blocklist"` + BlocklistBehavior *string `json:"blocklist_behavior"` + ConnectEvents *bool `json:"connect_events"` + CountMessages *bool `json:"count_messages"` + CustomEvents *bool `json:"custom_events"` + DeliveryEvents *bool `json:"delivery_events"` + MarkMessagesPending *bool `json:"mark_messages_pending"` + Mutes *bool `json:"mutes"` + 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"` + 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"` + Uploads *bool `json:"uploads"` + UrlEnrichment *bool `json:"url_enrichment"` + UserMessageReminders *bool `json:"user_message_reminders"` + AllowedFlagReasons []string `json:"allowed_flag_reasons"` + Blocklists []BlockListOptions `json:"blocklists"` + Commands []string `json:"commands"` + Permissions []PolicyRequest `json:"permissions"` + AutomodThresholds *Thresholds `json:"automod_thresholds"` + Grants map[string][]string `json:"grants"` } type ListCommandsRequest struct { } type CreateCommandRequest struct { - Description string `json:"description"` - Name string `json:"name"` - Args *string `json:"args"` - Set *string `json:"set"` + Description string `json:"description"` + Name string `json:"name"` + Args *string `json:"args"` + Set *string `json:"set"` } type DeleteCommandRequest struct { } type GetCommandRequest struct { } type UpdateCommandRequest struct { - Description string `json:"description"` - Args *string `json:"args"` - Set *string `json:"set"` + Description string `json:"description"` + Args *string `json:"args"` + Set *string `json:"set"` } type QueryDraftsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type ExportChannelsRequest struct { - Channels []ChannelExport `json:"channels"` - ClearDeletedMessageText *bool `json:"clear_deleted_message_text"` - ExportUsers *bool `json:"export_users"` - IncludeSoftDeletedChannels *bool `json:"include_soft_deleted_channels"` - IncludeTruncatedMessages *bool `json:"include_truncated_messages"` - Version *string `json:"version"` + Channels []ChannelExport `json:"channels"` + ClearDeletedMessageText *bool `json:"clear_deleted_message_text"` + ExportUsers *bool `json:"export_users"` + IncludeSoftDeletedChannels *bool `json:"include_soft_deleted_channels"` + IncludeTruncatedMessages *bool `json:"include_truncated_messages"` + Version *string `json:"version"` } type QueryMembersRequest struct { Payload *QueryMembersPayload `json:"-" query:"payload"` } type QueryMessageHistoryRequest struct { - 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"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` } type DeleteMessageRequest struct { - Hard *bool `json:"-" query:"hard"` - DeletedBy *string `json:"-" query:"deleted_by"` - DeleteForMe *bool `json:"-" query:"delete_for_me"` + Hard *bool `json:"-" query:"hard"` + DeletedBy *string `json:"-" query:"deleted_by"` + DeleteForMe *bool `json:"-" query:"delete_for_me"` } type GetMessageRequest struct { ShowDeletedMessage *bool `json:"-" query:"show_deleted_message"` } type UpdateMessageRequest struct { - Message MessageRequest `json:"message"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` + Message MessageRequest `json:"message"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` } 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"` - User *UserRequest `json:"user"` + 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"` + User *UserRequest `json:"user"` } type RunMessageActionRequest struct { FormData map[string]string `json:"form_data"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } 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"` - User *UserRequest `json:"user"` + 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"` + User *UserRequest `json:"user"` } type SendReactionRequest struct { - Reaction ReactionRequest `json:"reaction"` - EnforceUnique *bool `json:"enforce_unique"` - SkipPush *bool `json:"skip_push"` + Reaction ReactionRequest `json:"reaction"` + EnforceUnique *bool `json:"enforce_unique"` + SkipPush *bool `json:"skip_push"` } type DeleteReactionRequest struct { UserID *string `json:"-" query:"user_id"` } type GetReactionsRequest struct { - Limit *int `json:"-" query:"limit"` + Limit *int `json:"-" query:"limit"` Offset *int `json:"-" query:"offset"` } type QueryReactionsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type TranslateMessageRequest struct { Language string `json:"language"` } 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 { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` - Vote *VoteData `json:"vote"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` + Vote *VoteData `json:"vote"` } type DeletePollVoteRequest struct { UserID *string `json:"-" query:"user_id"` @@ -439,38 +436,38 @@ type DeleteReminderRequest struct { UserID *string `json:"-" query:"user_id"` } type UpdateReminderRequest struct { - RemindAt *Timestamp `json:"remind_at"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + RemindAt *Timestamp `json:"remind_at"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type CreateReminderRequest struct { - RemindAt *Timestamp `json:"remind_at"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + RemindAt *Timestamp `json:"remind_at"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type GetRepliesRequest struct { - Limit *int `json:"-" query:"limit"` - IDGte *string `json:"-" query:"id_gte"` - IDGt *string `json:"-" query:"id_gt"` - IDLte *string `json:"-" query:"id_lte"` - IDLt *string `json:"-" query:"id_lt"` - IDAround *string `json:"-" query:"id_around"` - Sort []SortParamRequest `json:"-" query:"sort"` + Limit *int `json:"-" query:"limit"` + IDGte *string `json:"-" query:"id_gte"` + IDGt *string `json:"-" query:"id_gt"` + IDLte *string `json:"-" query:"id_lte"` + IDLt *string `json:"-" query:"id_lt"` + IDAround *string `json:"-" query:"id_around"` + Sort []SortParamRequest `json:"-" query:"sort"` } type QueryMessageFlagsRequest struct { Payload *QueryMessageFlagsPayload `json:"-" query:"payload"` } type MuteChannelRequest struct { - Expiration *int `json:"expiration"` - UserID *string `json:"user_id"` - ChannelCids []string `json:"channel_cids"` - User *UserRequest `json:"user"` + Expiration *int `json:"expiration"` + UserID *string `json:"user_id"` + ChannelCids []string `json:"channel_cids"` + User *UserRequest `json:"user"` } type UnmuteChannelRequest struct { - Expiration *int `json:"expiration"` - UserID *string `json:"user_id"` - ChannelCids []string `json:"channel_cids"` - User *UserRequest `json:"user"` + Expiration *int `json:"expiration"` + UserID *string `json:"user_id"` + ChannelCids []string `json:"channel_cids"` + User *UserRequest `json:"user"` } type QueryBannedUsersRequest struct { Payload *QueryBannedUsersPayload `json:"-" query:"payload"` @@ -479,23 +476,23 @@ type QueryFutureChannelBansRequest struct { Payload *QueryFutureChannelBansPayload `json:"-" query:"payload"` } type QueryRemindersRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type SearchRequest struct { Payload *SearchPayload `json:"-" query:"payload"` } type QuerySegmentsRequest struct { - 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"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` } type DeleteSegmentRequest struct { } @@ -507,34 +504,41 @@ type DeleteSegmentTargetsRequest struct { type SegmentTargetExistsRequest struct { } type QuerySegmentTargetsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 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"` - Next *string `json:"next"` - ParticipantLimit *int `json:"participant_limit"` - Prev *string `json:"prev"` - ReplyLimit *int `json:"reply_limit"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + MemberLimit *int `json:"member_limit"` + Next *string `json:"next"` + ParticipantLimit *int `json:"participant_limit"` + Prev *string `json:"prev"` + ReplyLimit *int `json:"reply_limit"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type GetThreadRequest struct { - ReplyLimit *int `json:"-" query:"reply_limit"` + ReplyLimit *int `json:"-" query:"reply_limit"` ParticipantLimit *int `json:"-" query:"participant_limit"` - MemberLimit *int `json:"-" query:"member_limit"` + MemberLimit *int `json:"-" query:"member_limit"` } type UpdateThreadPartialRequest struct { - UserID *string `json:"user_id"` - Unset []string `json:"unset"` - Set map[string]any `json:"set"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + Unset []string `json:"unset"` + Set map[string]any `json:"set"` + User *UserRequest `json:"user"` } type UnreadCountsRequest struct { UserID *string `json:"-" query:"user_id"` @@ -546,41 +550,41 @@ type SendUserCustomEventRequest struct { Event UserCustomEventRequest `json:"event"` } type CheckPushRequest struct { - ApnTemplate *string `json:"apn_template"` - EventType *string `json:"event_type"` - FirebaseDataTemplate *string `json:"firebase_data_template"` - FirebaseTemplate *string `json:"firebase_template"` - MessageID *string `json:"message_id"` - PushProviderName *string `json:"push_provider_name"` - PushProviderType *string `json:"push_provider_type"` - SkipDevices *bool `json:"skip_devices"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + ApnTemplate *string `json:"apn_template"` + EventType *string `json:"event_type"` + FirebaseDataTemplate *string `json:"firebase_data_template"` + FirebaseTemplate *string `json:"firebase_template"` + MessageID *string `json:"message_id"` + PushProviderName *string `json:"push_provider_name"` + PushProviderType *string `json:"push_provider_type"` + SkipDevices *bool `json:"skip_devices"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type CheckSNSRequest struct { - SnsKey *string `json:"sns_key"` - SnsSecret *string `json:"sns_secret"` + SnsKey *string `json:"sns_key"` + SnsSecret *string `json:"sns_secret"` SnsTopicArn *string `json:"sns_topic_arn"` } type CheckSQSRequest struct { - SqsKey *string `json:"sqs_key"` + SqsKey *string `json:"sqs_key"` SqsSecret *string `json:"sqs_secret"` - SqsUrl *string `json:"sqs_url"` + SqsUrl *string `json:"sqs_url"` } type DeleteDeviceRequest struct { - ID string `json:"-" query:"id"` + ID string `json:"-" query:"id"` UserID *string `json:"-" query:"user_id"` } type ListDevicesRequest struct { UserID *string `json:"-" query:"user_id"` } type CreateDeviceRequest struct { - ID string `json:"id"` - PushProvider string `json:"push_provider"` - PushProviderName *string `json:"push_provider_name"` - UserID *string `json:"user_id"` - VoipToken *bool `json:"voip_token"` - User *UserRequest `json:"user"` + ID string `json:"id"` + PushProvider string `json:"push_provider"` + PushProviderName *string `json:"push_provider_name"` + UserID *string `json:"user_id"` + VoipToken *bool `json:"voip_token"` + User *UserRequest `json:"user"` } type ExportUsersRequest struct { UserIds []string `json:"user_ids"` @@ -588,50 +592,50 @@ type ExportUsersRequest struct { type ListExternalStorageRequest struct { } type CreateExternalStorageRequest struct { - Bucket string `json:"bucket"` - Name string `json:"name"` - StorageType string `json:"storage_type"` - GcsCredentials *string `json:"gcs_credentials"` - Path *string `json:"path"` - AWSS3 *S3Request `json:"aws_s3"` - AzureBlob *AzureRequest `json:"azure_blob"` + Bucket string `json:"bucket"` + Name string `json:"name"` + StorageType string `json:"storage_type"` + GcsCredentials *string `json:"gcs_credentials"` + Path *string `json:"path"` + AWSS3 *S3Request `json:"aws_s3"` + AzureBlob *AzureRequest `json:"azure_blob"` } type DeleteExternalStorageRequest struct { } type UpdateExternalStorageRequest struct { - Bucket string `json:"bucket"` - StorageType string `json:"storage_type"` - GcsCredentials *string `json:"gcs_credentials"` - Path *string `json:"path"` - AWSS3 *S3Request `json:"aws_s3"` - AzureBlob *AzureRequest `json:"azure_blob"` + Bucket string `json:"bucket"` + StorageType string `json:"storage_type"` + GcsCredentials *string `json:"gcs_credentials"` + Path *string `json:"path"` + AWSS3 *S3Request `json:"aws_s3"` + AzureBlob *AzureRequest `json:"azure_blob"` } 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"` - ParentID *string `json:"parent_id"` - PollID *string `json:"poll_id"` - RestrictReplies *string `json:"restrict_replies"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` - Text *string `json:"text"` - UserID *string `json:"user_id"` - Visibility *string `json:"visibility"` - VisibilityTag *string `json:"visibility_tag"` - Attachments []Attachment `json:"attachments"` - CollectionRefs []string `json:"collection_refs"` - FilterTags []string `json:"filter_tags"` - InterestTags []string `json:"interest_tags"` - MentionedUserIds []string `json:"mentioned_user_ids"` - Custom map[string]any `json:"custom"` - Location *ActivityLocation `json:"location"` - SearchData map[string]any `json:"search_data"` + Type 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"` + ParentID *string `json:"parent_id"` + PollID *string `json:"poll_id"` + RestrictReplies *string `json:"restrict_replies"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` + Text *string `json:"text"` + UserID *string `json:"user_id"` + Visibility *string `json:"visibility"` + VisibilityTag *string `json:"visibility_tag"` + Attachments []Attachment `json:"attachments"` + CollectionRefs []string `json:"collection_refs"` + FilterTags []string `json:"filter_tags"` + InterestTags []string `json:"interest_tags"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + Location *ActivityLocation `json:"location"` + SearchData map[string]any `json:"search_data"` } type UpsertActivitiesRequest struct { Activities []ActivityRequest `json:"activities"` @@ -640,323 +644,330 @@ type UpdateActivitiesPartialBatchRequest struct { Changes []UpdateActivityPartialChangeRequest `json:"changes"` } type DeleteActivitiesRequest struct { - Ids []string `json:"ids"` - DeleteNotificationActivity *bool `json:"delete_notification_activity"` - HardDelete *bool `json:"hard_delete"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + Ids []string `json:"ids"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` + HardDelete *bool `json:"hard_delete"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type QueryActivitiesRequest struct { - IncludeExpiredActivities *bool `json:"include_expired_activities"` - IncludePrivateActivities *bool `json:"include_private_activities"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + IncludeExpiredActivities *bool `json:"include_expired_activities"` + IncludePrivateActivities *bool `json:"include_private_activities"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type DeleteBookmarkRequest struct { FolderID *string `json:"-" query:"folder_id"` - UserID *string `json:"-" query:"user_id"` + UserID *string `json:"-" query:"user_id"` } type UpdateBookmarkRequest struct { - FolderID *string `json:"folder_id"` - NewFolderID *string `json:"new_folder_id"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` - NewFolder *AddFolderRequest `json:"new_folder"` - User *UserRequest `json:"user"` + FolderID *string `json:"folder_id"` + NewFolderID *string `json:"new_folder_id"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` + NewFolder *AddFolderRequest `json:"new_folder"` + User *UserRequest `json:"user"` } type AddBookmarkRequest struct { - FolderID *string `json:"folder_id"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` + FolderID *string `json:"folder_id"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` NewFolder *AddFolderRequest `json:"new_folder"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type ActivityFeedbackRequest struct { - Hide *bool `json:"hide"` - ShowLess *bool `json:"show_less"` - ShowMore *bool `json:"show_more"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + Hide *bool `json:"hide"` + ShowLess *bool `json:"show_less"` + ShowMore *bool `json:"show_more"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } 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"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + 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"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type QueryActivityReactionsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 DeleteActivityReactionRequest struct { - DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` - UserID *string `json:"-" query:"user_id"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` + UserID *string `json:"-" query:"user_id"` } type DeleteActivityRequest struct { - HardDelete *bool `json:"-" query:"hard_delete"` + HardDelete *bool `json:"-" query:"hard_delete"` DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type GetActivityRequest struct { } type UpdateActivityPartialRequest struct { - 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"` - User *UserRequest `json:"user"` + 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"` + User *UserRequest `json:"user"` } 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"` - Visibility *string `json:"visibility"` - VisibilityTag *string `json:"visibility_tag"` - Attachments []Attachment `json:"attachments"` - CollectionRefs []string `json:"collection_refs"` - Feeds []string `json:"feeds"` - FilterTags []string `json:"filter_tags"` - InterestTags []string `json:"interest_tags"` - MentionedUserIds []string `json:"mentioned_user_ids"` - Custom map[string]any `json:"custom"` - Location *ActivityLocation `json:"location"` - SearchData map[string]any `json:"search_data"` - User *UserRequest `json:"user"` + 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"` + Visibility *string `json:"visibility"` + VisibilityTag *string `json:"visibility_tag"` + Attachments []Attachment `json:"attachments"` + CollectionRefs []string `json:"collection_refs"` + Feeds []string `json:"feeds"` + FilterTags []string `json:"filter_tags"` + InterestTags []string `json:"interest_tags"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + Location *ActivityLocation `json:"location"` + SearchData map[string]any `json:"search_data"` + User *UserRequest `json:"user"` } type RestoreActivityRequest struct { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type QueryBookmarkFoldersRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 DeleteBookmarkFolderRequest struct { } type UpdateBookmarkFolderRequest struct { - Name *string `json:"name"` - UserID *string `json:"user_id"` + Name *string `json:"name"` + UserID *string `json:"user_id"` Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type QueryBookmarksRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 DeleteCollectionsRequest struct { CollectionRefs []string `json:"-" query:"collection_refs"` } type ReadCollectionsRequest struct { CollectionRefs []string `json:"-" query:"collection_refs"` - UserID *string `json:"-" query:"user_id"` + UserID *string `json:"-" query:"user_id"` } type UpdateCollectionsRequest struct { Collections []UpdateCollectionRequest `json:"collections"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type CreateCollectionsRequest struct { Collections []CollectionRequest `json:"collections"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type UpsertCollectionsRequest struct { Collections []CollectionRequest `json:"collections"` } type GetCommentsRequest struct { - ObjectID string `json:"-" query:"object_id"` - ObjectType string `json:"-" query:"object_type"` - Depth *int `json:"-" query:"depth"` - Sort *string `json:"-" query:"sort"` - RepliesLimit *int `json:"-" query:"replies_limit"` - UserID *string `json:"-" query:"user_id"` - Limit *int `json:"-" query:"limit"` - Prev *string `json:"-" query:"prev"` - Next *string `json:"-" query:"next"` + ObjectID string `json:"-" query:"object_id"` + ObjectType string `json:"-" query:"object_type"` + Depth *int `json:"-" query:"depth"` + Sort *string `json:"-" query:"sort"` + RepliesLimit *int `json:"-" query:"replies_limit"` + UserID *string `json:"-" query:"user_id"` + Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` } 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"` - ObjectType *string `json:"object_type"` - ParentID *string `json:"parent_id"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` - UserID *string `json:"user_id"` - Attachments []Attachment `json:"attachments"` - MentionedUserIds []string `json:"mentioned_user_ids"` - Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + 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"` + ObjectType *string `json:"object_type"` + ParentID *string `json:"parent_id"` + SkipEnrichUrl *bool `json:"skip_enrich_url"` + SkipPush *bool `json:"skip_push"` + UserID *string `json:"user_id"` + Attachments []Attachment `json:"attachments"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type AddCommentsBatchRequest struct { Comments []AddCommentRequest `json:"comments"` } 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"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort *string `json:"sort"` } type DeleteCommentRequest struct { - HardDelete *bool `json:"-" query:"hard_delete"` + HardDelete *bool `json:"-" query:"hard_delete"` DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type GetCommentRequest struct { } type UpdateCommentRequest struct { - Comment *string `json:"comment"` - CopyCustomToNotification *bool `json:"copy_custom_to_notification"` - HandleMentionNotifications *bool `json:"handle_mention_notifications"` - SkipEnrichUrl *bool `json:"skip_enrich_url"` - SkipPush *bool `json:"skip_push"` - UserID *string `json:"user_id"` - Attachments []Attachment `json:"attachments"` - MentionedUserIds []string `json:"mentioned_user_ids"` - Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + 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"` + UserID *string `json:"user_id"` + Attachments []Attachment `json:"attachments"` + MentionedUserIds []string `json:"mentioned_user_ids"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type AddCommentReactionRequest struct { - 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"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + 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"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` + User *UserRequest `json:"user"` } type QueryCommentReactionsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 DeleteCommentReactionRequest struct { - DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` - UserID *string `json:"-" query:"user_id"` + DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` + UserID *string `json:"-" query:"user_id"` } type GetCommentRepliesRequest struct { - Depth *int `json:"-" query:"depth"` - Sort *string `json:"-" query:"sort"` - RepliesLimit *int `json:"-" query:"replies_limit"` - UserID *string `json:"-" query:"user_id"` - Limit *int `json:"-" query:"limit"` - Prev *string `json:"-" query:"prev"` - Next *string `json:"-" query:"next"` + Depth *int `json:"-" query:"depth"` + Sort *string `json:"-" query:"sort"` + RepliesLimit *int `json:"-" query:"replies_limit"` + UserID *string `json:"-" query:"user_id"` + Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` } type ListFeedGroupsRequest struct { IncludeSoftDeleted *bool `json:"-" query:"include_soft_deleted"` } type CreateFeedGroupRequest struct { - ID string `json:"id"` - DefaultVisibility *string `json:"default_visibility"` + ID string `json:"id"` + DefaultVisibility *string `json:"default_visibility"` ActivityProcessors []ActivityProcessorConfig `json:"activity_processors"` - ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Custom map[string]any `json:"custom"` - Notification *NotificationConfig `json:"notification"` - PushNotification *PushNotificationConfig `json:"push_notification"` - Ranking *RankingConfig `json:"ranking"` - Stories *StoriesConfig `json:"stories"` + ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` + Aggregation *AggregationConfig `json:"aggregation"` + Custom map[string]any `json:"custom"` + Notification *NotificationConfig `json:"notification"` + PushNotification *PushNotificationConfig `json:"push_notification"` + Ranking *RankingConfig `json:"ranking"` + Stories *StoriesConfig `json:"stories"` } type DeleteFeedRequest struct { HardDelete *bool `json:"-" query:"hard_delete"` } 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"` + 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"` + InterestWeights map[string]float64 `json:"interest_weights"` + MemberPagination *PagerRequest `json:"member_pagination"` + User *UserRequest `json:"user"` } type UpdateFeedRequest struct { - CreatedByID *string `json:"created_by_id"` - Description *string `json:"description"` - Name *string `json:"name"` - FilterTags []string `json:"filter_tags"` - Custom map[string]any `json:"custom"` + CreatedByID *string `json:"created_by_id"` + Description *string `json:"description"` + Name *string `json:"name"` + FilterTags []string `json:"filter_tags"` + Custom map[string]any `json:"custom"` } type MarkActivityRequest struct { - MarkAllRead *bool `json:"mark_all_read"` - MarkAllSeen *bool `json:"mark_all_seen"` - UserID *string `json:"user_id"` - MarkRead []string `json:"mark_read"` - MarkSeen []string `json:"mark_seen"` - MarkWatched []string `json:"mark_watched"` - User *UserRequest `json:"user"` + MarkAllRead *bool `json:"mark_all_read"` + MarkAllSeen *bool `json:"mark_all_seen"` + UserID *string `json:"user_id"` + MarkRead []string `json:"mark_read"` + MarkSeen []string `json:"mark_seen"` + MarkWatched []string `json:"mark_watched"` + User *UserRequest `json:"user"` } type UnpinActivityRequest struct { UserID *string `json:"-" query:"user_id"` } type PinActivityRequest struct { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type UpdateFeedMembersRequest struct { - Operation string `json:"operation"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Members []FeedMemberRequest `json:"members"` + Operation string `json:"operation"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Members []FeedMemberRequest `json:"members"` } type AcceptFeedMemberInviteRequest struct { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type QueryFeedMembersRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 RejectFeedMemberInviteRequest struct { - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + 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"` + Limit *int `json:"-" query:"limit"` UserID *string `json:"-" query:"user_id"` } type DeleteFeedGroupRequest struct { @@ -966,34 +977,34 @@ type GetFeedGroupRequest struct { IncludeSoftDeleted *bool `json:"-" query:"include_soft_deleted"` } type GetOrCreateFeedGroupRequest struct { - DefaultVisibility *string `json:"default_visibility"` + DefaultVisibility *string `json:"default_visibility"` ActivityProcessors []ActivityProcessorConfig `json:"activity_processors"` - ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Custom map[string]any `json:"custom"` - Notification *NotificationConfig `json:"notification"` - PushNotification *PushNotificationConfig `json:"push_notification"` - Ranking *RankingConfig `json:"ranking"` - Stories *StoriesConfig `json:"stories"` + ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` + Aggregation *AggregationConfig `json:"aggregation"` + Custom map[string]any `json:"custom"` + Notification *NotificationConfig `json:"notification"` + PushNotification *PushNotificationConfig `json:"push_notification"` + Ranking *RankingConfig `json:"ranking"` + Stories *StoriesConfig `json:"stories"` } type UpdateFeedGroupRequest struct { - DefaultVisibility *string `json:"default_visibility"` + DefaultVisibility *string `json:"default_visibility"` ActivityProcessors []ActivityProcessorConfig `json:"activity_processors"` - ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Custom map[string]any `json:"custom"` - Notification *NotificationConfig `json:"notification"` - PushNotification *PushNotificationConfig `json:"push_notification"` - Ranking *RankingConfig `json:"ranking"` - Stories *StoriesConfig `json:"stories"` + ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` + Aggregation *AggregationConfig `json:"aggregation"` + Custom map[string]any `json:"custom"` + Notification *NotificationConfig `json:"notification"` + PushNotification *PushNotificationConfig `json:"push_notification"` + Ranking *RankingConfig `json:"ranking"` + Stories *StoriesConfig `json:"stories"` } type ListFeedViewsRequest struct { } type CreateFeedViewRequest struct { - ID string `json:"id"` + ID string `json:"id"` ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Ranking *RankingConfig `json:"ranking"` + Aggregation *AggregationConfig `json:"aggregation"` + Ranking *RankingConfig `json:"ranking"` } type DeleteFeedViewRequest struct { } @@ -1001,13 +1012,13 @@ type GetFeedViewRequest struct { } type GetOrCreateFeedViewRequest struct { ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Ranking *RankingConfig `json:"ranking"` + Aggregation *AggregationConfig `json:"aggregation"` + Ranking *RankingConfig `json:"ranking"` } type UpdateFeedViewRequest struct { ActivitySelectors []ActivitySelectorConfig `json:"activity_selectors"` - Aggregation *AggregationConfig `json:"aggregation"` - Ranking *RankingConfig `json:"ranking"` + Aggregation *AggregationConfig `json:"aggregation"` + Ranking *RankingConfig `json:"ranking"` } type ListFeedVisibilitiesRequest struct { } @@ -1020,54 +1031,54 @@ type CreateFeedsBatchRequest struct { Feeds []FeedRequest `json:"feeds"` } type DeleteFeedsBatchRequest struct { - Feeds []string `json:"feeds"` - HardDelete *bool `json:"hard_delete"` + Feeds []string `json:"feeds"` + HardDelete *bool `json:"hard_delete"` } type OwnBatchRequest struct { - Feeds []string `json:"feeds"` - UserID *string `json:"user_id"` - Fields []string `json:"fields"` - User *UserRequest `json:"user"` + Feeds []string `json:"feeds"` + UserID *string `json:"user_id"` + Fields []string `json:"fields"` + User *UserRequest `json:"user"` } type QueryFeedsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Watch *bool `json:"watch"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Watch *bool `json:"watch"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` } type GetFeedsRateLimitsRequest struct { - Endpoints *string `json:"-" query:"endpoints"` - Android *bool `json:"-" query:"android"` - Ios *bool `json:"-" query:"ios"` - Web *bool `json:"-" query:"web"` - ServerSide *bool `json:"-" query:"server_side"` + Endpoints *string `json:"-" query:"endpoints"` + Android *bool `json:"-" query:"android"` + Ios *bool `json:"-" query:"ios"` + Web *bool `json:"-" query:"web"` + ServerSide *bool `json:"-" query:"server_side"` } 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"` - SkipPush *bool `json:"skip_push"` - Status *string `json:"status"` - Custom map[string]any `json:"custom"` + 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"` + SkipPush *bool `json:"skip_push"` + Status *string `json:"status"` + Custom map[string]any `json:"custom"` } 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"` - Status *string `json:"status"` - Custom map[string]any `json:"custom"` + 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"` + Status *string `json:"status"` + Custom map[string]any `json:"custom"` } type AcceptFollowRequest struct { - Source string `json:"source"` - Target string `json:"target"` + Source string `json:"source"` + Target string `json:"target"` FollowerRole *string `json:"follower_role"` } type FollowBatchRequest struct { @@ -1077,11 +1088,11 @@ type GetOrCreateFollowsRequest struct { Follows []FollowRequest `json:"follows"` } type QueryFollowsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 RejectFollowRequest struct { Source string `json:"source"` @@ -1091,40 +1102,40 @@ type UnfollowRequest struct { DeleteNotificationActivity *bool `json:"-" query:"delete_notification_activity"` } type CreateMembershipLevelRequest struct { - ID string `json:"id"` - Name string `json:"name"` - Description *string `json:"description"` - Priority *int `json:"priority"` - Tags []string `json:"tags"` - Custom map[string]any `json:"custom"` + ID string `json:"id"` + Name string `json:"name"` + Description *string `json:"description"` + Priority *int `json:"priority"` + Tags []string `json:"tags"` + Custom map[string]any `json:"custom"` } type QueryMembershipLevelsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 DeleteMembershipLevelRequest struct { } type UpdateMembershipLevelRequest struct { - Description *string `json:"description"` - Name *string `json:"name"` - Priority *int `json:"priority"` - Tags []string `json:"tags"` - Custom map[string]any `json:"custom"` + Description *string `json:"description"` + Name *string `json:"name"` + Priority *int `json:"priority"` + Tags []string `json:"tags"` + Custom map[string]any `json:"custom"` } type QueryFeedsUsageStatsRequest struct { From *string `json:"from"` - To *string `json:"to"` + To *string `json:"to"` } type UnfollowBatchRequest struct { - Follows []FollowPair `json:"follows"` - DeleteNotificationActivity *bool `json:"delete_notification_activity"` + Follows []FollowPair `json:"follows"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` } type GetOrCreateUnfollowsRequest struct { - Follows []FollowPair `json:"follows"` - DeleteNotificationActivity *bool `json:"delete_notification_activity"` + Follows []FollowPair `json:"follows"` + DeleteNotificationActivity *bool `json:"delete_notification_activity"` } type DeleteFeedUserDataRequest struct { HardDelete *bool `json:"hard_delete"` @@ -1147,10 +1158,10 @@ type ListImportV2TasksRequest struct { State *int `json:"-" query:"state"` } type CreateImportV2TaskRequest struct { - Product string `json:"product"` + Product string `json:"product"` Settings ImportV2TaskSettings `json:"settings"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeleteImportV2TaskRequest struct { } @@ -1159,71 +1170,71 @@ type GetImportV2TaskRequest struct { type GetImportRequest struct { } type AppealRequest struct { - AppealReason string `json:"appeal_reason"` - EntityID string `json:"entity_id"` - EntityType string `json:"entity_type"` - UserID *string `json:"user_id"` - Attachments []string `json:"attachments"` - User *UserRequest `json:"user"` + AppealReason string `json:"appeal_reason"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + UserID *string `json:"user_id"` + Attachments []string `json:"attachments"` + User *UserRequest `json:"user"` } type GetAppealRequest struct { } type QueryAppealsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type BanRequest struct { - TargetUserID string `json:"target_user_id"` - BannedByID *string `json:"banned_by_id"` - ChannelCid *string `json:"channel_cid"` - DeleteMessages *string `json:"delete_messages"` - IpBan *bool `json:"ip_ban"` - Reason *string `json:"reason"` - Shadow *bool `json:"shadow"` - Timeout *int `json:"timeout"` - BannedBy *UserRequest `json:"banned_by"` + TargetUserID string `json:"target_user_id"` + BannedByID *string `json:"banned_by_id"` + ChannelCid *string `json:"channel_cid"` + DeleteMessages *string `json:"delete_messages"` + IpBan *bool `json:"ip_ban"` + Reason *string `json:"reason"` + Shadow *bool `json:"shadow"` + Timeout *int `json:"timeout"` + BannedBy *UserRequest `json:"banned_by"` } type BulkImageModerationRequest struct { CsvFile string `json:"csv_file"` } type CheckRequest struct { - EntityCreatorID string `json:"entity_creator_id"` - EntityID string `json:"entity_id"` - EntityType string `json:"entity_type"` - ConfigKey *string `json:"config_key"` - ConfigTeam *string `json:"config_team"` - TestMode *bool `json:"test_mode"` - UserID *string `json:"user_id"` - Config *ModerationConfig `json:"config"` + EntityCreatorID string `json:"entity_creator_id"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + ConfigKey *string `json:"config_key"` + ConfigTeam *string `json:"config_team"` + TestMode *bool `json:"test_mode"` + UserID *string `json:"user_id"` + Config *ModerationConfig `json:"config"` ModerationPayload *ModerationPayload `json:"moderation_payload"` - Options map[string]any `json:"options"` - User *UserRequest `json:"user"` + Options map[string]any `json:"options"` + User *UserRequest `json:"user"` } type UpsertConfigRequest struct { - Key string `json:"key"` - Async *bool `json:"async"` - Team *string `json:"team"` - UserID *string `json:"user_id"` - AWSRekognitionConfig *AIImageConfig `json:"aws_rekognition_config"` - AiImageConfig *AIImageConfig `json:"ai_image_config"` - AiTextConfig *AITextConfig `json:"ai_text_config"` - AiVideoConfig *AIVideoConfig `json:"ai_video_config"` + Key string `json:"key"` + Async *bool `json:"async"` + Team *string `json:"team"` + UserID *string `json:"user_id"` + AWSRekognitionConfig *AIImageConfig `json:"aws_rekognition_config"` + AiImageConfig *AIImageConfig `json:"ai_image_config"` + AiTextConfig *AITextConfig `json:"ai_text_config"` + AiVideoConfig *AIVideoConfig `json:"ai_video_config"` AutomodPlatformCircumventionConfig *AutomodPlatformCircumventionConfig `json:"automod_platform_circumvention_config"` - AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config"` - AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config"` - BlockListConfig *BlockListConfig `json:"block_list_config"` - BodyguardConfig *AITextConfig `json:"bodyguard_config"` - GoogleVisionConfig *GoogleVisionConfig `json:"google_vision_config"` - LlmConfig *LLMConfig `json:"llm_config"` - RuleBuilderConfig *RuleBuilderConfig `json:"rule_builder_config"` - User *UserRequest `json:"user"` - VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config"` - VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config"` + AutomodSemanticFiltersConfig *AutomodSemanticFiltersConfig `json:"automod_semantic_filters_config"` + AutomodToxicityConfig *AutomodToxicityConfig `json:"automod_toxicity_config"` + BlockListConfig *BlockListConfig `json:"block_list_config"` + BodyguardConfig *AITextConfig `json:"bodyguard_config"` + GoogleVisionConfig *GoogleVisionConfig `json:"google_vision_config"` + LlmConfig *LLMConfig `json:"llm_config"` + RuleBuilderConfig *RuleBuilderConfig `json:"rule_builder_config"` + User *UserRequest `json:"user"` + VelocityFilterConfig *VelocityFilterConfig `json:"velocity_filter_config"` + VideoCallRuleConfig *VideoCallRuleConfig `json:"video_call_rule_config"` } type DeleteConfigRequest struct { Team *string `json:"-" query:"team"` @@ -1232,138 +1243,138 @@ type GetConfigRequest struct { Team *string `json:"-" query:"team"` } type QueryModerationConfigsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type 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"` + 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"` + User *UserRequest `json:"user"` } type V2DeleteTemplateRequest struct { } type V2QueryTemplatesRequest struct { } type V2UpsertTemplateRequest struct { - Name string `json:"name"` + Name string `json:"name"` Config FeedsModerationTemplateConfigPayload `json:"config"` } type FlagRequest struct { - EntityID string `json:"entity_id"` - EntityType string `json:"entity_type"` - EntityCreatorID *string `json:"entity_creator_id"` - Reason *string `json:"reason"` - UserID *string `json:"user_id"` - Custom map[string]any `json:"custom"` + EntityID string `json:"entity_id"` + EntityType string `json:"entity_type"` + EntityCreatorID *string `json:"entity_creator_id"` + Reason *string `json:"reason"` + UserID *string `json:"user_id"` + Custom map[string]any `json:"custom"` ModerationPayload *ModerationPayload `json:"moderation_payload"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type QueryModerationFlagsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `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 { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type UpsertModerationRuleRequest struct { - 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"` + 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 { } type GetModerationRuleRequest struct { } type QueryModerationRulesRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } type MuteRequest struct { - TargetIds []string `json:"target_ids"` - Timeout *int `json:"timeout"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + TargetIds []string `json:"target_ids"` + Timeout *int `json:"timeout"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type QueryReviewQueueRequest struct { - Limit *int `json:"limit"` - LockCount *int `json:"lock_count"` - LockDuration *int `json:"lock_duration"` - LockItems *bool `json:"lock_items"` - Next *string `json:"next"` - Prev *string `json:"prev"` - StatsOnly *bool `json:"stats_only"` - UserID *string `json:"user_id"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` - User *UserRequest `json:"user"` + Limit *int `json:"limit"` + LockCount *int `json:"lock_count"` + LockDuration *int `json:"lock_duration"` + LockItems *bool `json:"lock_items"` + Next *string `json:"next"` + Prev *string `json:"prev"` + StatsOnly *bool `json:"stats_only"` + UserID *string `json:"user_id"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` + User *UserRequest `json:"user"` } 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 *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"` + 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 { - TargetUserID string `json:"-" query:"target_user_id"` - ChannelCid *string `json:"-" query:"channel_cid"` - CreatedBy *string `json:"-" query:"created_by"` - UnbannedByID *string `json:"unbanned_by_id"` - UnbannedBy *UserRequest `json:"unbanned_by"` + TargetUserID string `json:"-" query:"target_user_id"` + ChannelCid *string `json:"-" query:"channel_cid"` + CreatedBy *string `json:"-" query:"created_by"` + UnbannedByID *string `json:"unbanned_by_id"` + UnbannedBy *UserRequest `json:"unbanned_by"` } type UnmuteRequest struct { - TargetIds []string `json:"target_ids"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + TargetIds []string `json:"target_ids"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type GetOGRequest struct { Url string `json:"-" query:"url"` @@ -1373,42 +1384,42 @@ type ListPermissionsRequest struct { type GetPermissionRequest struct { } type CreatePollRequest struct { - Name string `json:"name"` - AllowAnswers *bool `json:"allow_answers"` - AllowUserSuggestedOptions *bool `json:"allow_user_suggested_options"` - Description *string `json:"description"` - EnforceUniqueVote *bool `json:"enforce_unique_vote"` - ID *string `json:"id"` - IsClosed *bool `json:"is_closed"` - MaxVotesAllowed *int `json:"max_votes_allowed"` - UserID *string `json:"user_id"` - VotingVisibility *string `json:"voting_visibility"` - Options []PollOptionInput `json:"options"` - Custom map[string]any `json:"Custom"` - User *UserRequest `json:"user"` + Name string `json:"name"` + AllowAnswers *bool `json:"allow_answers"` + AllowUserSuggestedOptions *bool `json:"allow_user_suggested_options"` + Description *string `json:"description"` + EnforceUniqueVote *bool `json:"enforce_unique_vote"` + ID *string `json:"id"` + IsClosed *bool `json:"is_closed"` + MaxVotesAllowed *int `json:"max_votes_allowed"` + UserID *string `json:"user_id"` + VotingVisibility *string `json:"voting_visibility"` + Options []PollOptionInput `json:"options"` + Custom map[string]any `json:"Custom"` + User *UserRequest `json:"user"` } type UpdatePollRequest struct { - ID string `json:"id"` - Name string `json:"name"` - AllowAnswers *bool `json:"allow_answers"` - AllowUserSuggestedOptions *bool `json:"allow_user_suggested_options"` - Description *string `json:"description"` - EnforceUniqueVote *bool `json:"enforce_unique_vote"` - IsClosed *bool `json:"is_closed"` - MaxVotesAllowed *int `json:"max_votes_allowed"` - UserID *string `json:"user_id"` - VotingVisibility *string `json:"voting_visibility"` - Options []PollOptionRequest `json:"options"` - Custom map[string]any `json:"Custom"` - User *UserRequest `json:"user"` + ID string `json:"id"` + Name string `json:"name"` + AllowAnswers *bool `json:"allow_answers"` + AllowUserSuggestedOptions *bool `json:"allow_user_suggested_options"` + Description *string `json:"description"` + EnforceUniqueVote *bool `json:"enforce_unique_vote"` + IsClosed *bool `json:"is_closed"` + MaxVotesAllowed *int `json:"max_votes_allowed"` + UserID *string `json:"user_id"` + VotingVisibility *string `json:"voting_visibility"` + Options []PollOptionRequest `json:"options"` + Custom map[string]any `json:"Custom"` + User *UserRequest `json:"user"` } type QueryPollsRequest struct { - UserID *string `json:"-" query:"user_id"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` + UserID *string `json:"-" query:"user_id"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` } type DeletePollRequest struct { UserID *string `json:"-" query:"user_id"` @@ -1417,23 +1428,23 @@ type GetPollRequest struct { UserID *string `json:"-" query:"user_id"` } type UpdatePollPartialRequest struct { - UserID *string `json:"user_id"` - Unset []string `json:"unset"` - Set map[string]any `json:"set"` - User *UserRequest `json:"user"` + UserID *string `json:"user_id"` + Unset []string `json:"unset"` + Set map[string]any `json:"set"` + User *UserRequest `json:"user"` } type CreatePollOptionRequest struct { - Text string `json:"text"` - UserID *string `json:"user_id"` + Text string `json:"text"` + UserID *string `json:"user_id"` Custom map[string]any `json:"Custom"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type UpdatePollOptionRequest struct { - ID string `json:"id"` - Text string `json:"text"` - UserID *string `json:"user_id"` + ID string `json:"id"` + Text string `json:"text"` + UserID *string `json:"user_id"` Custom map[string]any `json:"Custom"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type DeletePollOptionRequest struct { UserID *string `json:"-" query:"user_id"` @@ -1442,12 +1453,12 @@ type GetPollOptionRequest struct { UserID *string `json:"-" query:"user_id"` } type QueryPollVotesRequest struct { - UserID *string `json:"-" query:"user_id"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - Filter map[string]any `json:"filter"` + UserID *string `json:"-" query:"user_id"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + Filter map[string]any `json:"filter"` } type UpdatePushNotificationPreferencesRequest struct { Preferences []PushPreferenceInput `json:"preferences"` @@ -1460,22 +1471,22 @@ type UpsertPushProviderRequest struct { type DeletePushProviderRequest struct { } type GetPushTemplatesRequest struct { - PushProviderType string `json:"-" query:"push_provider_type"` + PushProviderType string `json:"-" query:"push_provider_type"` PushProviderName *string `json:"-" query:"push_provider_name"` } type UpsertPushTemplateRequest struct { - EventType string `json:"event_type"` - PushProviderType string `json:"push_provider_type"` - EnablePush *bool `json:"enable_push"` + EventType string `json:"event_type"` + PushProviderType string `json:"push_provider_type"` + EnablePush *bool `json:"enable_push"` PushProviderName *string `json:"push_provider_name"` - Template *string `json:"template"` + Template *string `json:"template"` } type GetRateLimitsRequest struct { - ServerSide *bool `json:"-" query:"server_side"` - Android *bool `json:"-" query:"android"` - Ios *bool `json:"-" query:"ios"` - Web *bool `json:"-" query:"web"` - Endpoints *string `json:"-" query:"endpoints"` + ServerSide *bool `json:"-" query:"server_side"` + Android *bool `json:"-" query:"android"` + Ios *bool `json:"-" query:"ios"` + Web *bool `json:"-" query:"web"` + Endpoints *string `json:"-" query:"endpoints"` } type ListRolesRequest struct { } @@ -1490,16 +1501,16 @@ type DeleteFileRequest struct { Url *string `json:"-" query:"url"` } type UploadFileRequest struct { - File *string `json:"file"` + File *string `json:"file"` User *OnlyUserID `json:"user"` } type DeleteImageRequest struct { Url *string `json:"-" query:"url"` } type UploadImageRequest struct { - File *string `json:"file"` + File *string `json:"file"` UploadSizes []ImageSize `json:"upload_sizes"` - User *OnlyUserID `json:"user"` + User *OnlyUserID `json:"user"` } type QueryUsersRequest struct { Payload *QueryUsersPayload `json:"-" query:"payload"` @@ -1514,175 +1525,175 @@ type GetBlockedUsersRequest struct { UserID *string `json:"-" query:"user_id"` } type BlockUsersRequest struct { - BlockedUserID string `json:"blocked_user_id"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + BlockedUserID string `json:"blocked_user_id"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeactivateUsersRequest struct { - UserIds []string `json:"user_ids"` - CreatedByID *string `json:"created_by_id"` - MarkChannelsDeleted *bool `json:"mark_channels_deleted"` - MarkMessagesDeleted *bool `json:"mark_messages_deleted"` + UserIds []string `json:"user_ids"` + CreatedByID *string `json:"created_by_id"` + MarkChannelsDeleted *bool `json:"mark_channels_deleted"` + MarkMessagesDeleted *bool `json:"mark_messages_deleted"` } type DeleteUsersRequest struct { - UserIds []string `json:"user_ids"` - Calls *string `json:"calls"` - Conversations *string `json:"conversations"` - Files *bool `json:"files"` - Messages *string `json:"messages"` - NewCallOwnerID *string `json:"new_call_owner_id"` - NewChannelOwnerID *string `json:"new_channel_owner_id"` - User *string `json:"user"` + UserIds []string `json:"user_ids"` + Calls *string `json:"calls"` + Conversations *string `json:"conversations"` + Files *bool `json:"files"` + Messages *string `json:"messages"` + NewCallOwnerID *string `json:"new_call_owner_id"` + NewChannelOwnerID *string `json:"new_channel_owner_id"` + User *string `json:"user"` } type GetUserLiveLocationsRequest struct { UserID *string `json:"-" query:"user_id"` } type UpdateLiveLocationRequest struct { - UserID *string `json:"-" query:"user_id"` - MessageID string `json:"message_id"` - EndAt *Timestamp `json:"end_at"` - Latitude *float64 `json:"latitude"` - Longitude *float64 `json:"longitude"` + UserID *string `json:"-" query:"user_id"` + MessageID string `json:"message_id"` + EndAt *Timestamp `json:"end_at"` + Latitude *float64 `json:"latitude"` + Longitude *float64 `json:"longitude"` } type ReactivateUsersRequest struct { - UserIds []string `json:"user_ids"` - CreatedByID *string `json:"created_by_id"` - RestoreChannels *bool `json:"restore_channels"` - RestoreMessages *bool `json:"restore_messages"` + UserIds []string `json:"user_ids"` + CreatedByID *string `json:"created_by_id"` + RestoreChannels *bool `json:"restore_channels"` + RestoreMessages *bool `json:"restore_messages"` } type RestoreUsersRequest struct { UserIds []string `json:"user_ids"` } type UnblockUsersRequest struct { - BlockedUserID string `json:"blocked_user_id"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + BlockedUserID string `json:"blocked_user_id"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeactivateUserRequest struct { - CreatedByID *string `json:"created_by_id"` - MarkMessagesDeleted *bool `json:"mark_messages_deleted"` + CreatedByID *string `json:"created_by_id"` + MarkMessagesDeleted *bool `json:"mark_messages_deleted"` } type ExportUserRequest struct { } type ReactivateUserRequest struct { - CreatedByID *string `json:"created_by_id"` - Name *string `json:"name"` - RestoreMessages *bool `json:"restore_messages"` + CreatedByID *string `json:"created_by_id"` + Name *string `json:"name"` + RestoreMessages *bool `json:"restore_messages"` } type GetActiveCallsStatusRequest struct { } type QueryUserFeedbackRequest struct { - Full *bool `json:"-" query:"full"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - FilterConditions map[string]any `json:"filter_conditions"` + Full *bool `json:"-" query:"full"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + FilterConditions map[string]any `json:"filter_conditions"` } type QueryCallMembersRequest struct { - ID string `json:"id"` - Type string `json:"type"` - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - FilterConditions map[string]any `json:"filter_conditions"` + ID string `json:"id"` + Type string `json:"type"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + FilterConditions map[string]any `json:"filter_conditions"` } type QueryCallStatsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - FilterConditions map[string]any `json:"filter_conditions"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + FilterConditions map[string]any `json:"filter_conditions"` } type GetCallRequest struct { - MembersLimit *int `json:"-" query:"members_limit"` - Ring *bool `json:"-" query:"ring"` - Notify *bool `json:"-" query:"notify"` - Video *bool `json:"-" query:"video"` + MembersLimit *int `json:"-" query:"members_limit"` + Ring *bool `json:"-" query:"ring"` + Notify *bool `json:"-" query:"notify"` + Video *bool `json:"-" query:"video"` } type UpdateCallRequest struct { - StartsAt *Timestamp `json:"starts_at"` - Custom map[string]any `json:"custom"` + StartsAt *Timestamp `json:"starts_at"` + Custom map[string]any `json:"custom"` SettingsOverride *CallSettingsRequest `json:"settings_override"` } type GetOrCreateCallRequest struct { - MembersLimit *int `json:"members_limit"` - Notify *bool `json:"notify"` - Ring *bool `json:"ring"` - Video *bool `json:"video"` - Data *CallRequest `json:"data"` + MembersLimit *int `json:"members_limit"` + Notify *bool `json:"notify"` + Ring *bool `json:"ring"` + Video *bool `json:"video"` + Data *CallRequest `json:"data"` } type BlockUserRequest struct { UserID string `json:"user_id"` } type SendClosedCaptionRequest struct { - SpeakerID string `json:"speaker_id"` - Text string `json:"text"` - EndTime *Timestamp `json:"end_time"` - Language *string `json:"language"` - Service *string `json:"service"` - StartTime *Timestamp `json:"start_time"` - Translated *bool `json:"translated"` - UserID *string `json:"user_id"` - User *UserRequest `json:"user"` + SpeakerID string `json:"speaker_id"` + Text string `json:"text"` + EndTime *Timestamp `json:"end_time"` + Language *string `json:"language"` + Service *string `json:"service"` + StartTime *Timestamp `json:"start_time"` + Translated *bool `json:"translated"` + UserID *string `json:"user_id"` + User *UserRequest `json:"user"` } type DeleteCallRequest struct { Hard *bool `json:"hard"` } type SendCallEventRequest struct { - UserID *string `json:"user_id"` + UserID *string `json:"user_id"` Custom map[string]any `json:"custom"` - User *UserRequest `json:"user"` + User *UserRequest `json:"user"` } type CollectUserFeedbackRequest struct { - Rating int `json:"rating"` - Sdk string `json:"sdk"` - SdkVersion string `json:"sdk_version"` - Reason *string `json:"reason"` - UserSessionID *string `json:"user_session_id"` - Custom map[string]any `json:"custom"` + Rating int `json:"rating"` + Sdk string `json:"sdk"` + SdkVersion string `json:"sdk_version"` + Reason *string `json:"reason"` + UserSessionID *string `json:"user_session_id"` + Custom map[string]any `json:"custom"` } type GoLiveRequest struct { - RecordingStorageName *string `json:"recording_storage_name"` - StartClosedCaption *bool `json:"start_closed_caption"` - StartCompositeRecording *bool `json:"start_composite_recording"` - StartHLS *bool `json:"start_hls"` - StartIndividualRecording *bool `json:"start_individual_recording"` - StartRawRecording *bool `json:"start_raw_recording"` - StartRecording *bool `json:"start_recording"` - StartTranscription *bool `json:"start_transcription"` + RecordingStorageName *string `json:"recording_storage_name"` + StartClosedCaption *bool `json:"start_closed_caption"` + StartCompositeRecording *bool `json:"start_composite_recording"` + StartHLS *bool `json:"start_hls"` + StartIndividualRecording *bool `json:"start_individual_recording"` + StartRawRecording *bool `json:"start_raw_recording"` + StartRecording *bool `json:"start_recording"` + StartTranscription *bool `json:"start_transcription"` TranscriptionStorageName *string `json:"transcription_storage_name"` } type KickUserRequest struct { - UserID string `json:"user_id"` - Block *bool `json:"block"` - KickedByID *string `json:"kicked_by_id"` - KickedBy *UserRequest `json:"kicked_by"` + UserID string `json:"user_id"` + Block *bool `json:"block"` + KickedByID *string `json:"kicked_by_id"` + KickedBy *UserRequest `json:"kicked_by"` } type EndCallRequest struct { } type UpdateCallMembersRequest struct { - RemoveMembers []string `json:"remove_members"` + RemoveMembers []string `json:"remove_members"` UpdateMembers []MemberRequest `json:"update_members"` } type MuteUsersRequest struct { - Audio *bool `json:"audio"` - MuteAllUsers *bool `json:"mute_all_users"` - MutedByID *string `json:"muted_by_id"` - Screenshare *bool `json:"screenshare"` - ScreenshareAudio *bool `json:"screenshare_audio"` - Video *bool `json:"video"` - UserIds []string `json:"user_ids"` - MutedBy *UserRequest `json:"muted_by"` + Audio *bool `json:"audio"` + MuteAllUsers *bool `json:"mute_all_users"` + MutedByID *string `json:"muted_by_id"` + Screenshare *bool `json:"screenshare"` + ScreenshareAudio *bool `json:"screenshare_audio"` + Video *bool `json:"video"` + UserIds []string `json:"user_ids"` + MutedBy *UserRequest `json:"muted_by"` } type QueryCallParticipantsRequest struct { - Limit *int `json:"-" query:"limit"` + Limit *int `json:"-" query:"limit"` FilterConditions map[string]any `json:"filter_conditions"` } type VideoPinRequest struct { SessionID string `json:"session_id"` - UserID string `json:"user_id"` + UserID string `json:"user_id"` } type ListRecordingsRequest struct { } @@ -1695,7 +1706,7 @@ type GetCallReportRequest struct { SessionID *string `json:"-" query:"session_id"` } type RingCallRequest struct { - Video *bool `json:"video"` + Video *bool `json:"video"` MembersIds []string `json:"members_ids"` } type StartRTMPBroadcastsRequest struct { @@ -1710,25 +1721,25 @@ type GetCallParticipantSessionMetricsRequest struct { Until *Timestamp `json:"-" query:"until"` } type QueryCallParticipantSessionsRequest struct { - Limit *int `json:"-" query:"limit"` - Prev *string `json:"-" query:"prev"` - Next *string `json:"-" query:"next"` + Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` FilterConditions map[string]any `json:"-" query:"filter_conditions"` } type StartHLSBroadcastingRequest struct { } type StartClosedCaptionsRequest struct { - EnableTranscription *bool `json:"enable_transcription"` - ExternalStorage *string `json:"external_storage"` - Language *string `json:"language"` + EnableTranscription *bool `json:"enable_transcription"` + ExternalStorage *string `json:"external_storage"` + Language *string `json:"language"` SpeechSegmentConfig *SpeechSegmentConfig `json:"speech_segment_config"` } type StartFrameRecordingRequest struct { RecordingExternalStorage *string `json:"recording_external_storage"` } type StartTranscriptionRequest struct { - EnableClosedCaptions *bool `json:"enable_closed_captions"` - Language *string `json:"language"` + EnableClosedCaptions *bool `json:"enable_closed_captions"` + Language *string `json:"language"` TranscriptionExternalStorage *string `json:"transcription_external_storage"` } type StopHLSBroadcastingRequest struct { @@ -1739,14 +1750,14 @@ type StopClosedCaptionsRequest struct { type StopFrameRecordingRequest struct { } type StopLiveRequest struct { - ContinueClosedCaption *bool `json:"continue_closed_caption"` - ContinueCompositeRecording *bool `json:"continue_composite_recording"` - ContinueHLS *bool `json:"continue_hls"` + ContinueClosedCaption *bool `json:"continue_closed_caption"` + ContinueCompositeRecording *bool `json:"continue_composite_recording"` + ContinueHLS *bool `json:"continue_hls"` ContinueIndividualRecording *bool `json:"continue_individual_recording"` - ContinueRTMPBroadcasts *bool `json:"continue_rtmp_broadcasts"` - ContinueRawRecording *bool `json:"continue_raw_recording"` - ContinueRecording *bool `json:"continue_recording"` - ContinueTranscription *bool `json:"continue_transcription"` + ContinueRTMPBroadcasts *bool `json:"continue_rtmp_broadcasts"` + ContinueRawRecording *bool `json:"continue_raw_recording"` + ContinueRecording *bool `json:"continue_recording"` + ContinueTranscription *bool `json:"continue_transcription"` } type StopTranscriptionRequest struct { StopClosedCaptions *bool `json:"stop_closed_captions"` @@ -1758,11 +1769,11 @@ type UnblockUserRequest struct { } type VideoUnpinRequest struct { SessionID string `json:"session_id"` - UserID string `json:"user_id"` + UserID string `json:"user_id"` } type UpdateUserPermissionsRequest struct { - UserID string `json:"user_id"` - GrantPermissions []string `json:"grant_permissions"` + UserID string `json:"user_id"` + GrantPermissions []string `json:"grant_permissions"` RevokePermissions []string `json:"revoke_permissions"` } type DeleteRecordingRequest struct { @@ -1770,104 +1781,104 @@ type DeleteRecordingRequest struct { type DeleteTranscriptionRequest struct { } type GetCallStatsMapRequest struct { - StartTime *Timestamp `json:"-" query:"start_time"` - EndTime *Timestamp `json:"-" query:"end_time"` - ExcludePublishers *bool `json:"-" query:"exclude_publishers"` - ExcludeSubscribers *bool `json:"-" query:"exclude_subscribers"` - ExcludeSfus *bool `json:"-" query:"exclude_sfus"` + StartTime *Timestamp `json:"-" query:"start_time"` + EndTime *Timestamp `json:"-" query:"end_time"` + ExcludePublishers *bool `json:"-" query:"exclude_publishers"` + ExcludeSubscribers *bool `json:"-" query:"exclude_subscribers"` + ExcludeSfus *bool `json:"-" query:"exclude_sfus"` } type GetCallSessionParticipantStatsDetailsRequest struct { - Since *string `json:"-" query:"since"` - Until *string `json:"-" query:"until"` - MaxPoints *int `json:"-" query:"max_points"` + Since *string `json:"-" query:"since"` + Until *string `json:"-" query:"until"` + MaxPoints *int `json:"-" query:"max_points"` } type QueryCallSessionParticipantStatsRequest struct { - Limit *int `json:"-" query:"limit"` - Prev *string `json:"-" query:"prev"` - Next *string `json:"-" query:"next"` - Sort []SortParamRequest `json:"-" query:"sort"` - FilterConditions map[string]any `json:"-" query:"filter_conditions"` + Limit *int `json:"-" query:"limit"` + Prev *string `json:"-" query:"prev"` + Next *string `json:"-" query:"next"` + Sort []SortParamRequest `json:"-" query:"sort"` + FilterConditions map[string]any `json:"-" query:"filter_conditions"` } type GetCallSessionParticipantStatsTimelineRequest struct { - StartTime *string `json:"-" query:"start_time"` - EndTime *string `json:"-" query:"end_time"` - Severity []string `json:"-" query:"severity"` + StartTime *string `json:"-" query:"start_time"` + EndTime *string `json:"-" query:"end_time"` + Severity []string `json:"-" query:"severity"` } type QueryCallsRequest struct { - Limit *int `json:"limit"` - Next *string `json:"next"` - Prev *string `json:"prev"` - Sort []SortParamRequest `json:"sort"` - FilterConditions map[string]any `json:"filter_conditions"` + Limit *int `json:"limit"` + Next *string `json:"next"` + Prev *string `json:"prev"` + Sort []SortParamRequest `json:"sort"` + FilterConditions map[string]any `json:"filter_conditions"` } type ListCallTypesRequest struct { } type CreateCallTypeRequest struct { - Name string `json:"name"` - ExternalStorage *string `json:"external_storage"` - Grants map[string][]string `json:"grants"` + Name string `json:"name"` + ExternalStorage *string `json:"external_storage"` + Grants map[string][]string `json:"grants"` NotificationSettings *NotificationSettingsRequest `json:"notification_settings"` - Settings *CallSettingsRequest `json:"settings"` + Settings *CallSettingsRequest `json:"settings"` } type DeleteCallTypeRequest struct { } type GetCallTypeRequest struct { } type UpdateCallTypeRequest struct { - ExternalStorage *string `json:"external_storage"` - Grants map[string][]string `json:"grants"` + ExternalStorage *string `json:"external_storage"` + Grants map[string][]string `json:"grants"` NotificationSettings *NotificationSettingsRequest `json:"notification_settings"` - Settings *CallSettingsRequest `json:"settings"` + Settings *CallSettingsRequest `json:"settings"` } type GetEdgesRequest struct { } type ListSIPInboundRoutingRuleRequest struct { } type CreateSIPInboundRoutingRuleRequest struct { - Name string `json:"name"` - TrunkIds []string `json:"trunk_ids"` - CallerConfigs SIPCallerConfigsRequest `json:"caller_configs"` - CalledNumbers []string `json:"called_numbers"` - CallerNumbers []string `json:"caller_numbers"` - CallConfigs *SIPCallConfigsRequest `json:"call_configs"` + Name string `json:"name"` + TrunkIds []string `json:"trunk_ids"` + CallerConfigs SIPCallerConfigsRequest `json:"caller_configs"` + CalledNumbers []string `json:"called_numbers"` + CallerNumbers []string `json:"caller_numbers"` + CallConfigs *SIPCallConfigsRequest `json:"call_configs"` DirectRoutingConfigs *SIPDirectRoutingRuleCallConfigsRequest `json:"direct_routing_configs"` - PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs"` - PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs"` + PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs"` + PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs"` } type DeleteSIPInboundRoutingRuleRequest struct { } type UpdateSIPInboundRoutingRuleRequest struct { - Name string `json:"name"` - CalledNumbers []string `json:"called_numbers"` - TrunkIds []string `json:"trunk_ids"` - CallerConfigs SIPCallerConfigsRequest `json:"caller_configs"` - CallerNumbers []string `json:"caller_numbers"` - CallConfigs *SIPCallConfigsRequest `json:"call_configs"` + Name string `json:"name"` + CalledNumbers []string `json:"called_numbers"` + TrunkIds []string `json:"trunk_ids"` + CallerConfigs SIPCallerConfigsRequest `json:"caller_configs"` + CallerNumbers []string `json:"caller_numbers"` + CallConfigs *SIPCallConfigsRequest `json:"call_configs"` DirectRoutingConfigs *SIPDirectRoutingRuleCallConfigsRequest `json:"direct_routing_configs"` - PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs"` - PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs"` + PinProtectionConfigs *SIPPinProtectionConfigsRequest `json:"pin_protection_configs"` + PinRoutingConfigs *SIPInboundRoutingRulePinConfigsRequest `json:"pin_routing_configs"` } type ListSIPTrunksRequest struct { } type CreateSIPTrunkRequest struct { - Name string `json:"name"` + Name string `json:"name"` Numbers []string `json:"numbers"` } type DeleteSIPTrunkRequest struct { } type UpdateSIPTrunkRequest struct { - Name string `json:"name"` + Name string `json:"name"` Numbers []string `json:"numbers"` } type ResolveSipInboundRequest struct { - 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"` + 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 { - From *string `json:"from"` - To *string `json:"to"` + From *string `json:"from"` + To *string `json:"to"` ReportTypes []string `json:"report_types"` } diff --git a/utils_test.go b/utils_test.go index b3a609b..531d55d 100644 --- a/utils_test.go +++ b/utils_test.go @@ -25,22 +25,20 @@ func (c *StubHTTPClient) Do(req *http.Request) (*http.Response, error) { } func WaitForTask(ctx context.Context, client *Stream, taskID string) (*StreamResponse[GetTaskResponse], error) { - ticker := time.NewTicker(500 * time.Millisecond) - defer ticker.Stop() - for { - select { - case <-ticker.C: - taskResult, err := client.GetTask(ctx, taskID, &GetTaskRequest{}) - if err != nil { - return nil, fmt.Errorf("failed to get task result: %w", err) - } - if taskResult.Data.Status == "completed" || taskResult.Data.Status == "failed" { - return taskResult, nil - } - case <-ctx.Done(): - return nil, ctx.Err() + // Simple polling loop matching stream-chat-go's pattern: + // use background context for HTTP calls so the client's own timeout + // governs each request, not the caller's deadline. + for i := 0; i < 30; i++ { + taskResult, err := client.GetTask(context.Background(), taskID, &GetTaskRequest{}) + if err != nil { + return nil, fmt.Errorf("failed to get task result: %w", err) } + if taskResult.Data.Status == "completed" || taskResult.Data.Status == "failed" { + return taskResult, nil + } + time.Sleep(time.Second) } + return nil, fmt.Errorf("task %s did not complete after 30 attempts", taskID) } // ResourceManager manages resource cleanup for tests. diff --git a/video.go b/video.go index 01bc08c..0f14adf 100644 --- a/video.go +++ b/video.go @@ -16,720 +16,815 @@ func NewVideoClient(client *Client) *VideoClient { } // Get the current status of all active calls including metrics and summary information +// func (c *VideoClient) GetActiveCallsStatus(ctx context.Context, request *GetActiveCallsStatusRequest) (*StreamResponse[GetActiveCallsStatusResponse], error) { var result GetActiveCallsStatusResponse - res, err := MakeRequest[any, GetActiveCallsStatusResponse](c.client, ctx, "GET", "/api/v2/video/active_calls_status", nil, nil, &result, nil) + res, err := MakeRequest[any, GetActiveCallsStatusResponse](c.client, ctx, "GET", "/api/v2/video/active_calls_status",nil, nil, &result,nil) return res, err } +// +// func (c *VideoClient) QueryUserFeedback(ctx context.Context, request *QueryUserFeedbackRequest) (*StreamResponse[QueryUserFeedbackResponse], error) { var result QueryUserFeedbackResponse params := extractQueryParams(request) - res, err := MakeRequest[QueryUserFeedbackRequest, QueryUserFeedbackResponse](c.client, ctx, "POST", "/api/v2/video/call/feedback", params, request, &result, nil) + res, err := MakeRequest[QueryUserFeedbackRequest, QueryUserFeedbackResponse](c.client, ctx, "POST", "/api/v2/video/call/feedback",params,request, &result,nil) return res, err } // Query call members with filter query +// func (c *VideoClient) QueryCallMembers(ctx context.Context, request *QueryCallMembersRequest) (*StreamResponse[QueryCallMembersResponse], error) { var result QueryCallMembersResponse - res, err := MakeRequest[QueryCallMembersRequest, QueryCallMembersResponse](c.client, ctx, "POST", "/api/v2/video/call/members", nil, request, &result, nil) + res, err := MakeRequest[QueryCallMembersRequest, QueryCallMembersResponse](c.client, ctx, "POST", "/api/v2/video/call/members",nil,request, &result,nil) return res, err } +// +// func (c *VideoClient) QueryCallStats(ctx context.Context, request *QueryCallStatsRequest) (*StreamResponse[QueryCallStatsResponse], error) { var result QueryCallStatsResponse - res, err := MakeRequest[QueryCallStatsRequest, QueryCallStatsResponse](c.client, ctx, "POST", "/api/v2/video/call/stats", nil, request, &result, nil) + res, err := MakeRequest[QueryCallStatsRequest, QueryCallStatsResponse](c.client, ctx, "POST", "/api/v2/video/call/stats",nil,request, &result,nil) return res, err } -func (c *VideoClient) GetCall(ctx context.Context, _type string, id string, request *GetCallRequest) (*StreamResponse[GetCallResponse], error) { +// +// +func (c *VideoClient) GetCall(ctx context.Context,_type string, id string, request *GetCallRequest) (*StreamResponse[GetCallResponse], error) { var result GetCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCallResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCallResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}",params, nil, &result,pathParams) return res, err } +// +// // Sends events: // - call.updated -func (c *VideoClient) UpdateCall(ctx context.Context, _type string, id string, request *UpdateCallRequest) (*StreamResponse[UpdateCallResponse], error) { +// +func (c *VideoClient) UpdateCall(ctx context.Context,_type string, id string, request *UpdateCallRequest) (*StreamResponse[UpdateCallResponse], error) { var result UpdateCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UpdateCallRequest, UpdateCallResponse](c.client, ctx, "PATCH", "/api/v2/video/call/{type}/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateCallRequest, UpdateCallResponse](c.client, ctx, "PATCH", "/api/v2/video/call/{type}/{id}",nil,request, &result,pathParams) return res, err } // Gets or creates a new call -// +// // Sends events: // - call.created // - call.notification // - call.ring -func (c *VideoClient) GetOrCreateCall(ctx context.Context, _type string, id string, request *GetOrCreateCallRequest) (*StreamResponse[GetOrCreateCallResponse], error) { +// +func (c *VideoClient) GetOrCreateCall(ctx context.Context,_type string, id string, request *GetOrCreateCallRequest) (*StreamResponse[GetOrCreateCallResponse], error) { var result GetOrCreateCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[GetOrCreateCallRequest, GetOrCreateCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[GetOrCreateCallRequest, GetOrCreateCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}",nil,request, &result,pathParams) return res, err } // Block a user, preventing them from joining the call until they are unblocked. -// +// // Sends events: // - call.blocked_user -func (c *VideoClient) BlockUser(ctx context.Context, _type string, id string, request *BlockUserRequest) (*StreamResponse[BlockUserResponse], error) { +// +func (c *VideoClient) BlockUser(ctx context.Context,_type string, id string, request *BlockUserRequest) (*StreamResponse[BlockUserResponse], error) { var result BlockUserResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[BlockUserRequest, BlockUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/block", nil, request, &result, pathParams) + res, err := MakeRequest[BlockUserRequest, BlockUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/block",nil,request, &result,pathParams) return res, err } // Sends a closed caption event to the call -// +// // Sends events: // - call.closed_caption -func (c *VideoClient) SendClosedCaption(ctx context.Context, _type string, id string, request *SendClosedCaptionRequest) (*StreamResponse[SendClosedCaptionResponse], error) { +// +func (c *VideoClient) SendClosedCaption(ctx context.Context,_type string, id string, request *SendClosedCaptionRequest) (*StreamResponse[SendClosedCaptionResponse], error) { var result SendClosedCaptionResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[SendClosedCaptionRequest, SendClosedCaptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/closed_captions", nil, request, &result, pathParams) + res, err := MakeRequest[SendClosedCaptionRequest, SendClosedCaptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/closed_captions",nil,request, &result,pathParams) return res, err } +// +// // Sends events: // - call.deleted -func (c *VideoClient) DeleteCall(ctx context.Context, _type string, id string, request *DeleteCallRequest) (*StreamResponse[DeleteCallResponse], error) { +// +func (c *VideoClient) DeleteCall(ctx context.Context,_type string, id string, request *DeleteCallRequest) (*StreamResponse[DeleteCallResponse], error) { var result DeleteCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[DeleteCallRequest, DeleteCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/delete", nil, request, &result, pathParams) + res, err := MakeRequest[DeleteCallRequest, DeleteCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/delete",nil,request, &result,pathParams) return res, err } // Sends custom event to the call -// +// // Sends events: // - custom -func (c *VideoClient) SendCallEvent(ctx context.Context, _type string, id string, request *SendCallEventRequest) (*StreamResponse[SendCallEventResponse], error) { +// +func (c *VideoClient) SendCallEvent(ctx context.Context,_type string, id string, request *SendCallEventRequest) (*StreamResponse[SendCallEventResponse], error) { var result SendCallEventResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[SendCallEventRequest, SendCallEventResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/event", nil, request, &result, pathParams) + res, err := MakeRequest[SendCallEventRequest, SendCallEventResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/event",nil,request, &result,pathParams) return res, err } +// +// // Sends events: // - call.user_feedback_submitted -func (c *VideoClient) CollectUserFeedback(ctx context.Context, _type string, id string, request *CollectUserFeedbackRequest) (*StreamResponse[CollectUserFeedbackResponse], error) { +// +func (c *VideoClient) CollectUserFeedback(ctx context.Context,_type string, id string, request *CollectUserFeedbackRequest) (*StreamResponse[CollectUserFeedbackResponse], error) { var result CollectUserFeedbackResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[CollectUserFeedbackRequest, CollectUserFeedbackResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/feedback", nil, request, &result, pathParams) + res, err := MakeRequest[CollectUserFeedbackRequest, CollectUserFeedbackResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/feedback",nil,request, &result,pathParams) return res, err } +// +// // Sends events: // - call.live_started -func (c *VideoClient) GoLive(ctx context.Context, _type string, id string, request *GoLiveRequest) (*StreamResponse[GoLiveResponse], error) { +// +func (c *VideoClient) GoLive(ctx context.Context,_type string, id string, request *GoLiveRequest) (*StreamResponse[GoLiveResponse], error) { var result GoLiveResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[GoLiveRequest, GoLiveResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/go_live", nil, request, &result, pathParams) + res, err := MakeRequest[GoLiveRequest, GoLiveResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/go_live",nil,request, &result,pathParams) return res, err } // Kicks a user from the call. Optionally block the user from rejoining by setting block=true. -// +// // Sends events: // - call.blocked_user // - call.kicked_user -func (c *VideoClient) KickUser(ctx context.Context, _type string, id string, request *KickUserRequest) (*StreamResponse[KickUserResponse], error) { +// +func (c *VideoClient) KickUser(ctx context.Context,_type string, id string, request *KickUserRequest) (*StreamResponse[KickUserResponse], error) { var result KickUserResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[KickUserRequest, KickUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/kick", nil, request, &result, pathParams) + res, err := MakeRequest[KickUserRequest, KickUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/kick",nil,request, &result,pathParams) return res, err } +// +// // Sends events: // - call.ended -func (c *VideoClient) EndCall(ctx context.Context, _type string, id string, request *EndCallRequest) (*StreamResponse[EndCallResponse], error) { +// +func (c *VideoClient) EndCall(ctx context.Context,_type string, id string, request *EndCallRequest) (*StreamResponse[EndCallResponse], error) { var result EndCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, EndCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/mark_ended", nil, nil, &result, pathParams) + res, err := MakeRequest[any, EndCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/mark_ended",nil, nil, &result,pathParams) return res, err } +// +// // Sends events: // - call.member_added // - call.member_removed // - call.member_updated -func (c *VideoClient) UpdateCallMembers(ctx context.Context, _type string, id string, request *UpdateCallMembersRequest) (*StreamResponse[UpdateCallMembersResponse], error) { +// +func (c *VideoClient) UpdateCallMembers(ctx context.Context,_type string, id string, request *UpdateCallMembersRequest) (*StreamResponse[UpdateCallMembersResponse], error) { var result UpdateCallMembersResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UpdateCallMembersRequest, UpdateCallMembersResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/members", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateCallMembersRequest, UpdateCallMembersResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/members",nil,request, &result,pathParams) return res, err } // Mutes users in a call -func (c *VideoClient) MuteUsers(ctx context.Context, _type string, id string, request *MuteUsersRequest) (*StreamResponse[MuteUsersResponse], error) { +// +func (c *VideoClient) MuteUsers(ctx context.Context,_type string, id string, request *MuteUsersRequest) (*StreamResponse[MuteUsersResponse], error) { var result MuteUsersResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[MuteUsersRequest, MuteUsersResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/mute_users", nil, request, &result, pathParams) + res, err := MakeRequest[MuteUsersRequest, MuteUsersResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/mute_users",nil,request, &result,pathParams) return res, err } // Returns a list of participants connected to the call -func (c *VideoClient) QueryCallParticipants(ctx context.Context, id string, _type string, request *QueryCallParticipantsRequest) (*StreamResponse[QueryCallParticipantsResponse], error) { +// +func (c *VideoClient) QueryCallParticipants(ctx context.Context,id string, _type string, request *QueryCallParticipantsRequest) (*StreamResponse[QueryCallParticipantsResponse], error) { var result QueryCallParticipantsResponse pathParams := map[string]string{ - "id": id, + "id": id, "type": _type, } params := extractQueryParams(request) - res, err := MakeRequest[QueryCallParticipantsRequest, QueryCallParticipantsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/participants", params, request, &result, pathParams) + res, err := MakeRequest[QueryCallParticipantsRequest, QueryCallParticipantsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/participants",params,request, &result,pathParams) return res, err } // Pins a track for all users in the call. -func (c *VideoClient) VideoPin(ctx context.Context, _type string, id string, request *VideoPinRequest) (*StreamResponse[PinResponse], error) { +// +func (c *VideoClient) VideoPin(ctx context.Context,_type string, id string, request *VideoPinRequest) (*StreamResponse[PinResponse], error) { var result PinResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[VideoPinRequest, PinResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/pin", nil, request, &result, pathParams) + res, err := MakeRequest[VideoPinRequest, PinResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/pin",nil,request, &result,pathParams) return res, err } // Lists recordings -func (c *VideoClient) ListRecordings(ctx context.Context, _type string, id string, request *ListRecordingsRequest) (*StreamResponse[ListRecordingsResponse], error) { +// +func (c *VideoClient) ListRecordings(ctx context.Context,_type string, id string, request *ListRecordingsRequest) (*StreamResponse[ListRecordingsResponse], error) { var result ListRecordingsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, ListRecordingsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/recordings", nil, nil, &result, pathParams) + res, err := MakeRequest[any, ListRecordingsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/recordings",nil, nil, &result,pathParams) return res, err } // Starts recording -// +// // Sends events: // - call.recording_started -func (c *VideoClient) StartRecording(ctx context.Context, _type string, id string, recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { +// +func (c *VideoClient) StartRecording(ctx context.Context,_type string, id string, recordingType string, request *StartRecordingRequest) (*StreamResponse[StartRecordingResponse], error) { var result StartRecordingResponse pathParams := map[string]string{ - "type": _type, - "id": id, + "type": _type, + "id": id, "recording_type": recordingType, } - res, err := MakeRequest[StartRecordingRequest, StartRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/start", nil, request, &result, pathParams) + res, err := MakeRequest[StartRecordingRequest, StartRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/start",nil,request, &result,pathParams) return res, err } // Stops recording -// +// // Sends events: // - call.recording_stopped -func (c *VideoClient) StopRecording(ctx context.Context, _type string, id string, recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { +// +func (c *VideoClient) StopRecording(ctx context.Context,_type string, id string, recordingType string, request *StopRecordingRequest) (*StreamResponse[StopRecordingResponse], error) { var result StopRecordingResponse pathParams := map[string]string{ - "type": _type, - "id": id, + "type": _type, + "id": id, "recording_type": recordingType, } - res, err := MakeRequest[StopRecordingRequest, StopRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/stop", nil, request, &result, pathParams) + res, err := MakeRequest[StopRecordingRequest, StopRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/recordings/{recording_type}/stop",nil,request, &result,pathParams) return res, err } -func (c *VideoClient) GetCallReport(ctx context.Context, _type string, id string, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse], error) { +// +// +func (c *VideoClient) GetCallReport(ctx context.Context,_type string, id string, request *GetCallReportRequest) (*StreamResponse[GetCallReportResponse], error) { var result GetCallReportResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCallReportResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/report", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCallReportResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/report",params, nil, &result,pathParams) return res, err } // Sends a ring notification to the provided users who are not already in the call. All users should be members of the call -// +// // Sends events: // - call.ring -func (c *VideoClient) RingCall(ctx context.Context, _type string, id string, request *RingCallRequest) (*StreamResponse[RingCallResponse], error) { +// +func (c *VideoClient) RingCall(ctx context.Context,_type string, id string, request *RingCallRequest) (*StreamResponse[RingCallResponse], error) { var result RingCallResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[RingCallRequest, RingCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/ring", nil, request, &result, pathParams) + res, err := MakeRequest[RingCallRequest, RingCallResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/ring",nil,request, &result,pathParams) return res, err } // Starts RTMP broadcasts for the provided RTMP destinations -func (c *VideoClient) StartRTMPBroadcasts(ctx context.Context, _type string, id string, request *StartRTMPBroadcastsRequest) (*StreamResponse[StartRTMPBroadcastsResponse], error) { +// +func (c *VideoClient) StartRTMPBroadcasts(ctx context.Context,_type string, id string, request *StartRTMPBroadcastsRequest) (*StreamResponse[StartRTMPBroadcastsResponse], error) { var result StartRTMPBroadcastsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StartRTMPBroadcastsRequest, StartRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts", nil, request, &result, pathParams) + res, err := MakeRequest[StartRTMPBroadcastsRequest, StartRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts",nil,request, &result,pathParams) return res, err } // Stop all RTMP broadcasts for the provided call -func (c *VideoClient) StopAllRTMPBroadcasts(ctx context.Context, _type string, id string, request *StopAllRTMPBroadcastsRequest) (*StreamResponse[StopAllRTMPBroadcastsResponse], error) { +// +func (c *VideoClient) StopAllRTMPBroadcasts(ctx context.Context,_type string, id string, request *StopAllRTMPBroadcastsRequest) (*StreamResponse[StopAllRTMPBroadcastsResponse], error) { var result StopAllRTMPBroadcastsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, StopAllRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts/stop", nil, nil, &result, pathParams) + res, err := MakeRequest[any, StopAllRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts/stop",nil, nil, &result,pathParams) return res, err } // Stop RTMP broadcasts for the provided RTMP destinations -func (c *VideoClient) StopRTMPBroadcast(ctx context.Context, _type string, id string, name string, request *StopRTMPBroadcastRequest) (*StreamResponse[StopRTMPBroadcastsResponse], error) { +// +func (c *VideoClient) StopRTMPBroadcast(ctx context.Context,_type string, id string, name string, request *StopRTMPBroadcastRequest) (*StreamResponse[StopRTMPBroadcastsResponse], error) { var result StopRTMPBroadcastsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, "name": name, } - res, err := MakeRequest[StopRTMPBroadcastRequest, StopRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts/{name}/stop", nil, request, &result, pathParams) + res, err := MakeRequest[StopRTMPBroadcastRequest, StopRTMPBroadcastsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/rtmp_broadcasts/{name}/stop",nil,request, &result,pathParams) return res, err } -func (c *VideoClient) GetCallParticipantSessionMetrics(ctx context.Context, _type string, id string, 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, + "type": _type, + "id": id, + "session": session, + "user": user, "user_session": userSession, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCallParticipantSessionMetricsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/session/{session}/participant/{user}/{user_session}/details/track", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCallParticipantSessionMetricsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/session/{session}/participant/{user}/{user_session}/details/track",params, nil, &result,pathParams) return res, err } -func (c *VideoClient) QueryCallParticipantSessions(ctx context.Context, _type string, id string, session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse], error) { +// +// +func (c *VideoClient) QueryCallParticipantSessions(ctx context.Context,_type string, id string, session string, request *QueryCallParticipantSessionsRequest) (*StreamResponse[QueryCallParticipantSessionsResponse], error) { var result QueryCallParticipantSessionsResponse pathParams := map[string]string{ - "type": _type, - "id": id, + "type": _type, + "id": id, "session": session, } params := extractQueryParams(request) - res, err := MakeRequest[any, QueryCallParticipantSessionsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/session/{session}/participant_sessions", params, nil, &result, pathParams) + res, err := MakeRequest[any, QueryCallParticipantSessionsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/session/{session}/participant_sessions",params, nil, &result,pathParams) return res, err } // Starts HLS broadcasting -func (c *VideoClient) StartHLSBroadcasting(ctx context.Context, _type string, id string, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { +// +func (c *VideoClient) StartHLSBroadcasting(ctx context.Context,_type string, id string, request *StartHLSBroadcastingRequest) (*StreamResponse[StartHLSBroadcastingResponse], error) { var result StartHLSBroadcastingResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, StartHLSBroadcastingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_broadcasting", nil, nil, &result, pathParams) + res, err := MakeRequest[any, StartHLSBroadcastingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_broadcasting",nil, nil, &result,pathParams) return res, err } // Starts closed captions -func (c *VideoClient) StartClosedCaptions(ctx context.Context, _type string, id string, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse], error) { +// +func (c *VideoClient) StartClosedCaptions(ctx context.Context,_type string, id string, request *StartClosedCaptionsRequest) (*StreamResponse[StartClosedCaptionsResponse], error) { var result StartClosedCaptionsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StartClosedCaptionsRequest, StartClosedCaptionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_closed_captions", nil, request, &result, pathParams) + res, err := MakeRequest[StartClosedCaptionsRequest, StartClosedCaptionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_closed_captions",nil,request, &result,pathParams) return res, err } // Starts frame by frame recording -// +// // Sends events: // - call.frame_recording_started -func (c *VideoClient) StartFrameRecording(ctx context.Context, _type string, id string, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse], error) { +// +func (c *VideoClient) StartFrameRecording(ctx context.Context,_type string, id string, request *StartFrameRecordingRequest) (*StreamResponse[StartFrameRecordingResponse], error) { var result StartFrameRecordingResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StartFrameRecordingRequest, StartFrameRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_frame_recording", nil, request, &result, pathParams) + res, err := MakeRequest[StartFrameRecordingRequest, StartFrameRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_frame_recording",nil,request, &result,pathParams) return res, err } // Starts transcription -func (c *VideoClient) StartTranscription(ctx context.Context, _type string, id string, request *StartTranscriptionRequest) (*StreamResponse[StartTranscriptionResponse], error) { +// +func (c *VideoClient) StartTranscription(ctx context.Context,_type string, id string, request *StartTranscriptionRequest) (*StreamResponse[StartTranscriptionResponse], error) { var result StartTranscriptionResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StartTranscriptionRequest, StartTranscriptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_transcription", nil, request, &result, pathParams) + res, err := MakeRequest[StartTranscriptionRequest, StartTranscriptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/start_transcription",nil,request, &result,pathParams) return res, err } // Stops HLS broadcasting -func (c *VideoClient) StopHLSBroadcasting(ctx context.Context, _type string, id string, request *StopHLSBroadcastingRequest) (*StreamResponse[StopHLSBroadcastingResponse], error) { +// +func (c *VideoClient) StopHLSBroadcasting(ctx context.Context,_type string, id string, request *StopHLSBroadcastingRequest) (*StreamResponse[StopHLSBroadcastingResponse], error) { var result StopHLSBroadcastingResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, StopHLSBroadcastingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_broadcasting", nil, nil, &result, pathParams) + res, err := MakeRequest[any, StopHLSBroadcastingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_broadcasting",nil, nil, &result,pathParams) return res, err } // Stops closed captions -// +// // Sends events: // - call.transcription_stopped -func (c *VideoClient) StopClosedCaptions(ctx context.Context, _type string, id string, request *StopClosedCaptionsRequest) (*StreamResponse[StopClosedCaptionsResponse], error) { +// +func (c *VideoClient) StopClosedCaptions(ctx context.Context,_type string, id string, request *StopClosedCaptionsRequest) (*StreamResponse[StopClosedCaptionsResponse], error) { var result StopClosedCaptionsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StopClosedCaptionsRequest, StopClosedCaptionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_closed_captions", nil, request, &result, pathParams) + res, err := MakeRequest[StopClosedCaptionsRequest, StopClosedCaptionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_closed_captions",nil,request, &result,pathParams) return res, err } // Stops frame recording -// +// // Sends events: // - call.frame_recording_stopped -func (c *VideoClient) StopFrameRecording(ctx context.Context, _type string, id string, request *StopFrameRecordingRequest) (*StreamResponse[StopFrameRecordingResponse], error) { +// +func (c *VideoClient) StopFrameRecording(ctx context.Context,_type string, id string, request *StopFrameRecordingRequest) (*StreamResponse[StopFrameRecordingResponse], error) { var result StopFrameRecordingResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, StopFrameRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_frame_recording", nil, nil, &result, pathParams) + res, err := MakeRequest[any, StopFrameRecordingResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_frame_recording",nil, nil, &result,pathParams) return res, err } +// +// // Sends events: // - call.updated -func (c *VideoClient) StopLive(ctx context.Context, _type string, id string, request *StopLiveRequest) (*StreamResponse[StopLiveResponse], error) { +// +func (c *VideoClient) StopLive(ctx context.Context,_type string, id string, request *StopLiveRequest) (*StreamResponse[StopLiveResponse], error) { var result StopLiveResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StopLiveRequest, StopLiveResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_live", nil, request, &result, pathParams) + res, err := MakeRequest[StopLiveRequest, StopLiveResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_live",nil,request, &result,pathParams) return res, err } // Stops transcription -// +// // Sends events: // - call.transcription_stopped -func (c *VideoClient) StopTranscription(ctx context.Context, _type string, id string, request *StopTranscriptionRequest) (*StreamResponse[StopTranscriptionResponse], error) { +// +func (c *VideoClient) StopTranscription(ctx context.Context,_type string, id string, request *StopTranscriptionRequest) (*StreamResponse[StopTranscriptionResponse], error) { var result StopTranscriptionResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[StopTranscriptionRequest, StopTranscriptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_transcription", nil, request, &result, pathParams) + res, err := MakeRequest[StopTranscriptionRequest, StopTranscriptionResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/stop_transcription",nil,request, &result,pathParams) return res, err } // Lists transcriptions -func (c *VideoClient) ListTranscriptions(ctx context.Context, _type string, id string, request *ListTranscriptionsRequest) (*StreamResponse[ListTranscriptionsResponse], error) { +// +func (c *VideoClient) ListTranscriptions(ctx context.Context,_type string, id string, request *ListTranscriptionsRequest) (*StreamResponse[ListTranscriptionsResponse], error) { var result ListTranscriptionsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[any, ListTranscriptionsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/transcriptions", nil, nil, &result, pathParams) + res, err := MakeRequest[any, ListTranscriptionsResponse](c.client, ctx, "GET", "/api/v2/video/call/{type}/{id}/transcriptions",nil, nil, &result,pathParams) return res, err } // Removes the block for a user on a call. The user will be able to join the call again. -// +// // Sends events: // - call.unblocked_user -func (c *VideoClient) UnblockUser(ctx context.Context, _type string, id string, request *UnblockUserRequest) (*StreamResponse[UnblockUserResponse], error) { +// +func (c *VideoClient) UnblockUser(ctx context.Context,_type string, id string, request *UnblockUserRequest) (*StreamResponse[UnblockUserResponse], error) { var result UnblockUserResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UnblockUserRequest, UnblockUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/unblock", nil, request, &result, pathParams) + res, err := MakeRequest[UnblockUserRequest, UnblockUserResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/unblock",nil,request, &result,pathParams) return res, err } // Unpins a track for all users in the call. -func (c *VideoClient) VideoUnpin(ctx context.Context, _type string, id string, request *VideoUnpinRequest) (*StreamResponse[UnpinResponse], error) { +// +func (c *VideoClient) VideoUnpin(ctx context.Context,_type string, id string, request *VideoUnpinRequest) (*StreamResponse[UnpinResponse], error) { var result UnpinResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[VideoUnpinRequest, UnpinResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/unpin", nil, request, &result, pathParams) + res, err := MakeRequest[VideoUnpinRequest, UnpinResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/unpin",nil,request, &result,pathParams) return res, err } // Updates user permissions -// +// // Sends events: // - call.permissions_updated -func (c *VideoClient) UpdateUserPermissions(ctx context.Context, _type string, id string, request *UpdateUserPermissionsRequest) (*StreamResponse[UpdateUserPermissionsResponse], error) { +// +func (c *VideoClient) UpdateUserPermissions(ctx context.Context,_type string, id string, request *UpdateUserPermissionsRequest) (*StreamResponse[UpdateUserPermissionsResponse], error) { var result UpdateUserPermissionsResponse pathParams := map[string]string{ "type": _type, - "id": id, + "id": id, } - res, err := MakeRequest[UpdateUserPermissionsRequest, UpdateUserPermissionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/user_permissions", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateUserPermissionsRequest, UpdateUserPermissionsResponse](c.client, ctx, "POST", "/api/v2/video/call/{type}/{id}/user_permissions",nil,request, &result,pathParams) return res, err } // Deletes recording -func (c *VideoClient) DeleteRecording(ctx context.Context, _type string, id string, session string, filename string, request *DeleteRecordingRequest) (*StreamResponse[DeleteRecordingResponse], error) { +// +func (c *VideoClient) DeleteRecording(ctx context.Context,_type string, id string, session string, filename string, request *DeleteRecordingRequest) (*StreamResponse[DeleteRecordingResponse], error) { var result DeleteRecordingResponse pathParams := map[string]string{ - "type": _type, - "id": id, - "session": session, + "type": _type, + "id": id, + "session": session, "filename": filename, } - res, err := MakeRequest[any, DeleteRecordingResponse](c.client, ctx, "DELETE", "/api/v2/video/call/{type}/{id}/{session}/recordings/{filename}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteRecordingResponse](c.client, ctx, "DELETE", "/api/v2/video/call/{type}/{id}/{session}/recordings/{filename}",nil, nil, &result,pathParams) return res, err } // Deletes transcription -func (c *VideoClient) DeleteTranscription(ctx context.Context, _type string, id string, session string, filename string, request *DeleteTranscriptionRequest) (*StreamResponse[DeleteTranscriptionResponse], error) { +// +func (c *VideoClient) DeleteTranscription(ctx context.Context,_type string, id string, session string, filename string, request *DeleteTranscriptionRequest) (*StreamResponse[DeleteTranscriptionResponse], error) { var result DeleteTranscriptionResponse pathParams := map[string]string{ - "type": _type, - "id": id, - "session": session, + "type": _type, + "id": id, + "session": session, "filename": filename, } - res, err := MakeRequest[any, DeleteTranscriptionResponse](c.client, ctx, "DELETE", "/api/v2/video/call/{type}/{id}/{session}/transcriptions/{filename}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteTranscriptionResponse](c.client, ctx, "DELETE", "/api/v2/video/call/{type}/{id}/{session}/transcriptions/{filename}",nil, nil, &result,pathParams) return res, err } -func (c *VideoClient) GetCallStatsMap(ctx context.Context, callType string, callID string, session string, request *GetCallStatsMapRequest) (*StreamResponse[QueryCallStatsMapResponse], error) { +// +// +func (c *VideoClient) GetCallStatsMap(ctx context.Context,callType string, callID string, session string, request *GetCallStatsMapRequest) (*StreamResponse[QueryCallStatsMapResponse], error) { var result QueryCallStatsMapResponse pathParams := map[string]string{ "call_type": callType, - "call_id": callID, - "session": session, + "call_id": callID, + "session": session, } params := extractQueryParams(request) - res, err := MakeRequest[any, QueryCallStatsMapResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/map", params, nil, &result, pathParams) + res, err := MakeRequest[any, QueryCallStatsMapResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/map",params, nil, &result,pathParams) return res, err } -func (c *VideoClient) GetCallSessionParticipantStatsDetails(ctx context.Context, callType string, callID string, session string, user string, userSession string, request *GetCallSessionParticipantStatsDetailsRequest) (*StreamResponse[GetCallSessionParticipantStatsDetailsResponse], error) { +// +// +func (c *VideoClient) GetCallSessionParticipantStatsDetails(ctx context.Context,callType string, callID string, session string, user string, userSession string, request *GetCallSessionParticipantStatsDetailsRequest) (*StreamResponse[GetCallSessionParticipantStatsDetailsResponse], error) { var result GetCallSessionParticipantStatsDetailsResponse pathParams := map[string]string{ - "call_type": callType, - "call_id": callID, - "session": session, - "user": user, + "call_type": callType, + "call_id": callID, + "session": session, + "user": user, "user_session": userSession, } params := extractQueryParams(request) - res, err := MakeRequest[any, GetCallSessionParticipantStatsDetailsResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participant/{user}/{user_session}/details", params, nil, &result, pathParams) + res, err := MakeRequest[any, GetCallSessionParticipantStatsDetailsResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participant/{user}/{user_session}/details",params, nil, &result,pathParams) return res, err } -func (c *VideoClient) QueryCallSessionParticipantStats(ctx context.Context, callType string, callID string, session string, request *QueryCallSessionParticipantStatsRequest) (*StreamResponse[QueryCallSessionParticipantStatsResponse], error) { +// +// +func (c *VideoClient) QueryCallSessionParticipantStats(ctx context.Context,callType string, callID string, session string, request *QueryCallSessionParticipantStatsRequest) (*StreamResponse[QueryCallSessionParticipantStatsResponse], error) { var result QueryCallSessionParticipantStatsResponse pathParams := map[string]string{ "call_type": callType, - "call_id": callID, - "session": session, + "call_id": callID, + "session": session, } params := extractQueryParams(request) - res, err := MakeRequest[any, QueryCallSessionParticipantStatsResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants", params, nil, &result, pathParams) + res, err := MakeRequest[any, QueryCallSessionParticipantStatsResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants",params, nil, &result,pathParams) return res, err } -func (c *VideoClient) GetCallSessionParticipantStatsTimeline(ctx context.Context, callType string, callID string, session string, user string, userSession string, request *GetCallSessionParticipantStatsTimelineRequest) (*StreamResponse[QueryCallSessionParticipantStatsTimelineResponse], error) { +// +// +func (c *VideoClient) GetCallSessionParticipantStatsTimeline(ctx context.Context,callType string, callID string, session string, user string, userSession string, request *GetCallSessionParticipantStatsTimelineRequest) (*StreamResponse[QueryCallSessionParticipantStatsTimelineResponse], error) { var result QueryCallSessionParticipantStatsTimelineResponse pathParams := map[string]string{ - "call_type": callType, - "call_id": callID, - "session": session, - "user": user, + "call_type": callType, + "call_id": callID, + "session": session, + "user": user, "user_session": userSession, } params := extractQueryParams(request) - res, err := MakeRequest[any, QueryCallSessionParticipantStatsTimelineResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants/{user}/{user_session}/timeline", params, nil, &result, pathParams) + res, err := MakeRequest[any, QueryCallSessionParticipantStatsTimelineResponse](c.client, ctx, "GET", "/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants/{user}/{user_session}/timeline",params, nil, &result,pathParams) return res, err } // Query calls with filter query +// func (c *VideoClient) QueryCalls(ctx context.Context, request *QueryCallsRequest) (*StreamResponse[QueryCallsResponse], error) { var result QueryCallsResponse - res, err := MakeRequest[QueryCallsRequest, QueryCallsResponse](c.client, ctx, "POST", "/api/v2/video/calls", nil, request, &result, nil) + res, err := MakeRequest[QueryCallsRequest, QueryCallsResponse](c.client, ctx, "POST", "/api/v2/video/calls",nil,request, &result,nil) return res, err } +// +// func (c *VideoClient) ListCallTypes(ctx context.Context, request *ListCallTypesRequest) (*StreamResponse[ListCallTypeResponse], error) { var result ListCallTypeResponse - res, err := MakeRequest[any, ListCallTypeResponse](c.client, ctx, "GET", "/api/v2/video/calltypes", nil, nil, &result, nil) + res, err := MakeRequest[any, ListCallTypeResponse](c.client, ctx, "GET", "/api/v2/video/calltypes",nil, nil, &result,nil) return res, err } +// +// func (c *VideoClient) CreateCallType(ctx context.Context, request *CreateCallTypeRequest) (*StreamResponse[CreateCallTypeResponse], error) { var result CreateCallTypeResponse - res, err := MakeRequest[CreateCallTypeRequest, CreateCallTypeResponse](c.client, ctx, "POST", "/api/v2/video/calltypes", nil, request, &result, nil) + res, err := MakeRequest[CreateCallTypeRequest, CreateCallTypeResponse](c.client, ctx, "POST", "/api/v2/video/calltypes",nil,request, &result,nil) return res, err } -func (c *VideoClient) DeleteCallType(ctx context.Context, name string, request *DeleteCallTypeRequest) (*StreamResponse[Response], error) { +// +// +func (c *VideoClient) DeleteCallType(ctx context.Context,name string, request *DeleteCallTypeRequest) (*StreamResponse[Response], error) { var result Response pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/video/calltypes/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, Response](c.client, ctx, "DELETE", "/api/v2/video/calltypes/{name}",nil, nil, &result,pathParams) return res, err } -func (c *VideoClient) GetCallType(ctx context.Context, name string, request *GetCallTypeRequest) (*StreamResponse[GetCallTypeResponse], error) { +// +// +func (c *VideoClient) GetCallType(ctx context.Context,name string, request *GetCallTypeRequest) (*StreamResponse[GetCallTypeResponse], error) { var result GetCallTypeResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[any, GetCallTypeResponse](c.client, ctx, "GET", "/api/v2/video/calltypes/{name}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, GetCallTypeResponse](c.client, ctx, "GET", "/api/v2/video/calltypes/{name}",nil, nil, &result,pathParams) return res, err } -func (c *VideoClient) UpdateCallType(ctx context.Context, name string, request *UpdateCallTypeRequest) (*StreamResponse[UpdateCallTypeResponse], error) { +// +// +func (c *VideoClient) UpdateCallType(ctx context.Context,name string, request *UpdateCallTypeRequest) (*StreamResponse[UpdateCallTypeResponse], error) { var result UpdateCallTypeResponse pathParams := map[string]string{ "name": name, } - res, err := MakeRequest[UpdateCallTypeRequest, UpdateCallTypeResponse](c.client, ctx, "PUT", "/api/v2/video/calltypes/{name}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateCallTypeRequest, UpdateCallTypeResponse](c.client, ctx, "PUT", "/api/v2/video/calltypes/{name}",nil,request, &result,pathParams) return res, err } // Returns the list of all edges available for video calls. +// func (c *VideoClient) GetEdges(ctx context.Context, request *GetEdgesRequest) (*StreamResponse[GetEdgesResponse], error) { var result GetEdgesResponse - res, err := MakeRequest[any, GetEdgesResponse](c.client, ctx, "GET", "/api/v2/video/edges", nil, nil, &result, nil) + res, err := MakeRequest[any, GetEdgesResponse](c.client, ctx, "GET", "/api/v2/video/edges",nil, nil, &result,nil) return res, err } // List all SIP Inbound Routing Rules for the application +// func (c *VideoClient) ListSIPInboundRoutingRule(ctx context.Context, request *ListSIPInboundRoutingRuleRequest) (*StreamResponse[ListSIPInboundRoutingRuleResponse], error) { var result ListSIPInboundRoutingRuleResponse - res, err := MakeRequest[any, ListSIPInboundRoutingRuleResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_routing_rules", nil, nil, &result, nil) + res, err := MakeRequest[any, ListSIPInboundRoutingRuleResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_routing_rules",nil, nil, &result,nil) return res, err } // Create a new SIP Inbound Routing Rule with either direct routing or PIN routing configuration +// func (c *VideoClient) CreateSIPInboundRoutingRule(ctx context.Context, request *CreateSIPInboundRoutingRuleRequest) (*StreamResponse[SIPInboundRoutingRuleResponse], error) { var result SIPInboundRoutingRuleResponse - res, err := MakeRequest[CreateSIPInboundRoutingRuleRequest, SIPInboundRoutingRuleResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_routing_rules", nil, request, &result, nil) + res, err := MakeRequest[CreateSIPInboundRoutingRuleRequest, SIPInboundRoutingRuleResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_routing_rules",nil,request, &result,nil) return res, err } // Delete a SIP Inbound Routing Rule for the application -func (c *VideoClient) DeleteSIPInboundRoutingRule(ctx context.Context, id string, request *DeleteSIPInboundRoutingRuleRequest) (*StreamResponse[DeleteSIPInboundRoutingRuleResponse], error) { +// +func (c *VideoClient) DeleteSIPInboundRoutingRule(ctx context.Context,id string, request *DeleteSIPInboundRoutingRuleRequest) (*StreamResponse[DeleteSIPInboundRoutingRuleResponse], error) { var result DeleteSIPInboundRoutingRuleResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteSIPInboundRoutingRuleResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_routing_rules/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteSIPInboundRoutingRuleResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_routing_rules/{id}",nil, nil, &result,pathParams) return res, err } // Update an existing SIP Inbound Routing Rule with new configuration -func (c *VideoClient) UpdateSIPInboundRoutingRule(ctx context.Context, id string, request *UpdateSIPInboundRoutingRuleRequest) (*StreamResponse[UpdateSIPInboundRoutingRuleResponse], error) { +// +func (c *VideoClient) UpdateSIPInboundRoutingRule(ctx context.Context,id string, request *UpdateSIPInboundRoutingRuleRequest) (*StreamResponse[UpdateSIPInboundRoutingRuleResponse], error) { var result UpdateSIPInboundRoutingRuleResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateSIPInboundRoutingRuleRequest, UpdateSIPInboundRoutingRuleResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_routing_rules/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateSIPInboundRoutingRuleRequest, UpdateSIPInboundRoutingRuleResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_routing_rules/{id}",nil,request, &result,pathParams) return res, err } // List all SIP trunks for the application +// func (c *VideoClient) ListSIPTrunks(ctx context.Context, request *ListSIPTrunksRequest) (*StreamResponse[ListSIPTrunksResponse], error) { var result ListSIPTrunksResponse - res, err := MakeRequest[any, ListSIPTrunksResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_trunks", nil, nil, &result, nil) + res, err := MakeRequest[any, ListSIPTrunksResponse](c.client, ctx, "GET", "/api/v2/video/sip/inbound_trunks",nil, nil, &result,nil) return res, err } // Create a new SIP trunk for the application +// func (c *VideoClient) CreateSIPTrunk(ctx context.Context, request *CreateSIPTrunkRequest) (*StreamResponse[CreateSIPTrunkResponse], error) { var result CreateSIPTrunkResponse - res, err := MakeRequest[CreateSIPTrunkRequest, CreateSIPTrunkResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_trunks", nil, request, &result, nil) + res, err := MakeRequest[CreateSIPTrunkRequest, CreateSIPTrunkResponse](c.client, ctx, "POST", "/api/v2/video/sip/inbound_trunks",nil,request, &result,nil) return res, err } // Delete a SIP trunk for the application -func (c *VideoClient) DeleteSIPTrunk(ctx context.Context, id string, request *DeleteSIPTrunkRequest) (*StreamResponse[DeleteSIPTrunkResponse], error) { +// +func (c *VideoClient) DeleteSIPTrunk(ctx context.Context,id string, request *DeleteSIPTrunkRequest) (*StreamResponse[DeleteSIPTrunkResponse], error) { var result DeleteSIPTrunkResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[any, DeleteSIPTrunkResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_trunks/{id}", nil, nil, &result, pathParams) + res, err := MakeRequest[any, DeleteSIPTrunkResponse](c.client, ctx, "DELETE", "/api/v2/video/sip/inbound_trunks/{id}",nil, nil, &result,pathParams) return res, err } // Update a SIP trunk for the application -func (c *VideoClient) UpdateSIPTrunk(ctx context.Context, id string, request *UpdateSIPTrunkRequest) (*StreamResponse[UpdateSIPTrunkResponse], error) { +// +func (c *VideoClient) UpdateSIPTrunk(ctx context.Context,id string, request *UpdateSIPTrunkRequest) (*StreamResponse[UpdateSIPTrunkResponse], error) { var result UpdateSIPTrunkResponse pathParams := map[string]string{ "id": id, } - res, err := MakeRequest[UpdateSIPTrunkRequest, UpdateSIPTrunkResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_trunks/{id}", nil, request, &result, pathParams) + res, err := MakeRequest[UpdateSIPTrunkRequest, UpdateSIPTrunkResponse](c.client, ctx, "PUT", "/api/v2/video/sip/inbound_trunks/{id}",nil,request, &result,pathParams) return res, err } // Resolve SIP inbound routing based on trunk number, caller number, and challenge authentication +// func (c *VideoClient) ResolveSipInbound(ctx context.Context, request *ResolveSipInboundRequest) (*StreamResponse[ResolveSipInboundResponse], error) { var result ResolveSipInboundResponse - res, err := MakeRequest[ResolveSipInboundRequest, ResolveSipInboundResponse](c.client, ctx, "POST", "/api/v2/video/sip/resolve", nil, request, &result, nil) + res, err := MakeRequest[ResolveSipInboundRequest, ResolveSipInboundResponse](c.client, ctx, "POST", "/api/v2/video/sip/resolve",nil,request, &result,nil) return res, err } +// +// func (c *VideoClient) QueryAggregateCallStats(ctx context.Context, request *QueryAggregateCallStatsRequest) (*StreamResponse[QueryAggregateCallStatsResponse], error) { var result QueryAggregateCallStatsResponse - res, err := MakeRequest[QueryAggregateCallStatsRequest, QueryAggregateCallStatsResponse](c.client, ctx, "POST", "/api/v2/video/stats", nil, request, &result, nil) + res, err := MakeRequest[QueryAggregateCallStatsRequest, QueryAggregateCallStatsResponse](c.client, ctx, "POST", "/api/v2/video/stats",nil,request, &result,nil) return res, err -} +} \ No newline at end of file diff --git a/video_test.go b/video_test.go index 431c1d6..77ef1ea 100644 --- a/video_test.go +++ b/video_test.go @@ -2,465 +2,464 @@ package getstream_test import ( - "context" - "testing" + "context" + "testing" - "github.com/GetStream/getstream-go/v3" - "github.com/stretchr/testify/require" + "github.com/GetStream/getstream-go/v3" + "github.com/stretchr/testify/require" ) - -func TestVideoGetActiveCallsStatus(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetActiveCallsStatus(context.Background(), &getstream.GetActiveCallsStatusRequest{}) - require.NoError(t, err) -} -func TestVideoQueryUserFeedback(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryUserFeedback(context.Background(), &getstream.QueryUserFeedbackRequest{}) - require.NoError(t, err) -} -func TestVideoQueryCallMembers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCallMembers(context.Background(), &getstream.QueryCallMembersRequest{}) - require.NoError(t, err) -} -func TestVideoQueryCallStats(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCallStats(context.Background(), &getstream.QueryCallStatsRequest{}) - require.NoError(t, err) -} -func TestVideoGetCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCall(context.Background(), "", "", &getstream.GetCallRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateCall(context.Background(), "", "", &getstream.UpdateCallRequest{}) - require.NoError(t, err) -} -func TestVideoGetOrCreateCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetOrCreateCall(context.Background(), "", "", &getstream.GetOrCreateCallRequest{}) - require.NoError(t, err) -} -func TestVideoBlockUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().BlockUser(context.Background(), "", "", &getstream.BlockUserRequest{}) - require.NoError(t, err) -} -func TestVideoSendClosedCaption(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().SendClosedCaption(context.Background(), "", "", &getstream.SendClosedCaptionRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteCall(context.Background(), "", "", &getstream.DeleteCallRequest{}) - require.NoError(t, err) -} -func TestVideoSendCallEvent(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().SendCallEvent(context.Background(), "", "", &getstream.SendCallEventRequest{}) - require.NoError(t, err) -} -func TestVideoCollectUserFeedback(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().CollectUserFeedback(context.Background(), "", "", &getstream.CollectUserFeedbackRequest{}) - require.NoError(t, err) -} -func TestVideoGoLive(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GoLive(context.Background(), "", "", &getstream.GoLiveRequest{}) - require.NoError(t, err) -} -func TestVideoKickUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().KickUser(context.Background(), "", "", &getstream.KickUserRequest{}) - require.NoError(t, err) -} -func TestVideoEndCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().EndCall(context.Background(), "", "", &getstream.EndCallRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateCallMembers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateCallMembers(context.Background(), "", "", &getstream.UpdateCallMembersRequest{}) - require.NoError(t, err) -} -func TestVideoMuteUsers(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().MuteUsers(context.Background(), "", "", &getstream.MuteUsersRequest{}) - require.NoError(t, err) -} -func TestVideoQueryCallParticipants(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCallParticipants(context.Background(), "", "", &getstream.QueryCallParticipantsRequest{}) - require.NoError(t, err) -} -func TestVideoVideoPin(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().VideoPin(context.Background(), "", "", &getstream.VideoPinRequest{}) - require.NoError(t, err) -} -func TestVideoListRecordings(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ListRecordings(context.Background(), "", "", &getstream.ListRecordingsRequest{}) - require.NoError(t, err) -} -func TestVideoStartRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartRecording(context.Background(), "", "", "", &getstream.StartRecordingRequest{}) - require.NoError(t, err) -} -func TestVideoStopRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopRecording(context.Background(), "", "", "", &getstream.StopRecordingRequest{}) - require.NoError(t, err) -} -func TestVideoGetCallReport(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCallReport(context.Background(), "", "", &getstream.GetCallReportRequest{}) - require.NoError(t, err) -} -func TestVideoRingCall(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().RingCall(context.Background(), "", "", &getstream.RingCallRequest{}) - require.NoError(t, err) -} -func TestVideoStartRTMPBroadcasts(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartRTMPBroadcasts(context.Background(), "", "", &getstream.StartRTMPBroadcastsRequest{}) - require.NoError(t, err) -} -func TestVideoStopAllRTMPBroadcasts(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopAllRTMPBroadcasts(context.Background(), "", "", &getstream.StopAllRTMPBroadcastsRequest{}) - require.NoError(t, err) -} -func TestVideoStopRTMPBroadcast(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopRTMPBroadcast(context.Background(), "", "", "", &getstream.StopRTMPBroadcastRequest{}) - require.NoError(t, err) -} -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{}) - require.NoError(t, err) -} -func TestVideoQueryCallParticipantSessions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCallParticipantSessions(context.Background(), "", "", "", &getstream.QueryCallParticipantSessionsRequest{}) - require.NoError(t, err) -} -func TestVideoStartHLSBroadcasting(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartHLSBroadcasting(context.Background(), "", "", &getstream.StartHLSBroadcastingRequest{}) - require.NoError(t, err) -} -func TestVideoStartClosedCaptions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartClosedCaptions(context.Background(), "", "", &getstream.StartClosedCaptionsRequest{}) - require.NoError(t, err) -} -func TestVideoStartFrameRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartFrameRecording(context.Background(), "", "", &getstream.StartFrameRecordingRequest{}) - require.NoError(t, err) -} -func TestVideoStartTranscription(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StartTranscription(context.Background(), "", "", &getstream.StartTranscriptionRequest{}) - require.NoError(t, err) -} -func TestVideoStopHLSBroadcasting(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopHLSBroadcasting(context.Background(), "", "", &getstream.StopHLSBroadcastingRequest{}) - require.NoError(t, err) -} -func TestVideoStopClosedCaptions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopClosedCaptions(context.Background(), "", "", &getstream.StopClosedCaptionsRequest{}) - require.NoError(t, err) -} -func TestVideoStopFrameRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopFrameRecording(context.Background(), "", "", &getstream.StopFrameRecordingRequest{}) - require.NoError(t, err) -} -func TestVideoStopLive(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopLive(context.Background(), "", "", &getstream.StopLiveRequest{}) - require.NoError(t, err) -} -func TestVideoStopTranscription(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().StopTranscription(context.Background(), "", "", &getstream.StopTranscriptionRequest{}) - require.NoError(t, err) -} -func TestVideoListTranscriptions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ListTranscriptions(context.Background(), "", "", &getstream.ListTranscriptionsRequest{}) - require.NoError(t, err) -} -func TestVideoUnblockUser(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UnblockUser(context.Background(), "", "", &getstream.UnblockUserRequest{}) - require.NoError(t, err) -} -func TestVideoVideoUnpin(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().VideoUnpin(context.Background(), "", "", &getstream.VideoUnpinRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateUserPermissions(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateUserPermissions(context.Background(), "", "", &getstream.UpdateUserPermissionsRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteRecording(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteRecording(context.Background(), "", "", "", "", &getstream.DeleteRecordingRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteTranscription(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteTranscription(context.Background(), "", "", "", "", &getstream.DeleteTranscriptionRequest{}) - require.NoError(t, err) -} -func TestVideoGetCallStatsMap(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCallStatsMap(context.Background(), "", "", "", &getstream.GetCallStatsMapRequest{}) - require.NoError(t, err) -} -func TestVideoGetCallSessionParticipantStatsDetails(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCallSessionParticipantStatsDetails(context.Background(), "", "", "", "", "", &getstream.GetCallSessionParticipantStatsDetailsRequest{}) - require.NoError(t, err) -} -func TestVideoQueryCallSessionParticipantStats(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCallSessionParticipantStats(context.Background(), "", "", "", &getstream.QueryCallSessionParticipantStatsRequest{}) - require.NoError(t, err) -} -func TestVideoGetCallSessionParticipantStatsTimeline(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCallSessionParticipantStatsTimeline(context.Background(), "", "", "", "", "", &getstream.GetCallSessionParticipantStatsTimelineRequest{}) - require.NoError(t, err) -} -func TestVideoQueryCalls(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryCalls(context.Background(), &getstream.QueryCallsRequest{}) - require.NoError(t, err) -} -func TestVideoListCallTypes(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ListCallTypes(context.Background(), &getstream.ListCallTypesRequest{}) - require.NoError(t, err) -} -func TestVideoCreateCallType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().CreateCallType(context.Background(), &getstream.CreateCallTypeRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteCallType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteCallType(context.Background(), "", &getstream.DeleteCallTypeRequest{}) - require.NoError(t, err) -} -func TestVideoGetCallType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetCallType(context.Background(), "", &getstream.GetCallTypeRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateCallType(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateCallType(context.Background(), "", &getstream.UpdateCallTypeRequest{}) - require.NoError(t, err) -} -func TestVideoGetEdges(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().GetEdges(context.Background(), &getstream.GetEdgesRequest{}) - require.NoError(t, err) -} -func TestVideoListSIPInboundRoutingRule(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ListSIPInboundRoutingRule(context.Background(), &getstream.ListSIPInboundRoutingRuleRequest{}) - require.NoError(t, err) -} -func TestVideoCreateSIPInboundRoutingRule(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().CreateSIPInboundRoutingRule(context.Background(), &getstream.CreateSIPInboundRoutingRuleRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteSIPInboundRoutingRule(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteSIPInboundRoutingRule(context.Background(), "", &getstream.DeleteSIPInboundRoutingRuleRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateSIPInboundRoutingRule(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateSIPInboundRoutingRule(context.Background(), "", &getstream.UpdateSIPInboundRoutingRuleRequest{}) - require.NoError(t, err) -} -func TestVideoListSIPTrunks(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ListSIPTrunks(context.Background(), &getstream.ListSIPTrunksRequest{}) - require.NoError(t, err) -} -func TestVideoCreateSIPTrunk(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().CreateSIPTrunk(context.Background(), &getstream.CreateSIPTrunkRequest{}) - require.NoError(t, err) -} -func TestVideoDeleteSIPTrunk(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().DeleteSIPTrunk(context.Background(), "", &getstream.DeleteSIPTrunkRequest{}) - require.NoError(t, err) -} -func TestVideoUpdateSIPTrunk(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().UpdateSIPTrunk(context.Background(), "", &getstream.UpdateSIPTrunkRequest{}) - require.NoError(t, err) -} -func TestVideoResolveSipInbound(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().ResolveSipInbound(context.Background(), &getstream.ResolveSipInboundRequest{}) - require.NoError(t, err) -} -func TestVideoQueryAggregateCallStats(t *testing.T) { - client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) - require.NoError(t, err) - - _, err = client.Video().QueryAggregateCallStats(context.Background(), &getstream.QueryAggregateCallStatsRequest{}) - require.NoError(t, err) -} + func TestVideoGetActiveCallsStatus(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetActiveCallsStatus(context.Background(),&getstream.GetActiveCallsStatusRequest{}) + require.NoError(t, err) + } + func TestVideoQueryUserFeedback(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryUserFeedback(context.Background(),&getstream.QueryUserFeedbackRequest{}) + require.NoError(t, err) + } + func TestVideoQueryCallMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallMembers(context.Background(),&getstream.QueryCallMembersRequest{}) + require.NoError(t, err) + } + func TestVideoQueryCallStats(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallStats(context.Background(),&getstream.QueryCallStatsRequest{}) + require.NoError(t, err) + } + func TestVideoGetCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCall(context.Background(),"", "", &getstream.GetCallRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateCall(context.Background(),"", "", &getstream.UpdateCallRequest{}) + require.NoError(t, err) + } + func TestVideoGetOrCreateCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetOrCreateCall(context.Background(),"", "", &getstream.GetOrCreateCallRequest{}) + require.NoError(t, err) + } + func TestVideoBlockUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().BlockUser(context.Background(),"", "", &getstream.BlockUserRequest{}) + require.NoError(t, err) + } + func TestVideoSendClosedCaption(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().SendClosedCaption(context.Background(),"", "", &getstream.SendClosedCaptionRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteCall(context.Background(),"", "", &getstream.DeleteCallRequest{}) + require.NoError(t, err) + } + func TestVideoSendCallEvent(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().SendCallEvent(context.Background(),"", "", &getstream.SendCallEventRequest{}) + require.NoError(t, err) + } + func TestVideoCollectUserFeedback(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().CollectUserFeedback(context.Background(),"", "", &getstream.CollectUserFeedbackRequest{}) + require.NoError(t, err) + } + func TestVideoGoLive(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GoLive(context.Background(),"", "", &getstream.GoLiveRequest{}) + require.NoError(t, err) + } + func TestVideoKickUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().KickUser(context.Background(),"", "", &getstream.KickUserRequest{}) + require.NoError(t, err) + } + func TestVideoEndCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().EndCall(context.Background(),"", "", &getstream.EndCallRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateCallMembers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateCallMembers(context.Background(),"", "", &getstream.UpdateCallMembersRequest{}) + require.NoError(t, err) + } + func TestVideoMuteUsers(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().MuteUsers(context.Background(),"", "", &getstream.MuteUsersRequest{}) + require.NoError(t, err) + } + func TestVideoQueryCallParticipants(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallParticipants(context.Background(),"", "", &getstream.QueryCallParticipantsRequest{}) + require.NoError(t, err) + } + func TestVideoVideoPin(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().VideoPin(context.Background(),"", "", &getstream.VideoPinRequest{}) + require.NoError(t, err) + } + func TestVideoListRecordings(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ListRecordings(context.Background(),"", "", &getstream.ListRecordingsRequest{}) + require.NoError(t, err) + } + func TestVideoStartRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartRecording(context.Background(),"", "", "", &getstream.StartRecordingRequest{}) + require.NoError(t, err) + } + func TestVideoStopRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopRecording(context.Background(),"", "", "", &getstream.StopRecordingRequest{}) + require.NoError(t, err) + } + func TestVideoGetCallReport(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCallReport(context.Background(),"", "", &getstream.GetCallReportRequest{}) + require.NoError(t, err) + } + func TestVideoRingCall(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().RingCall(context.Background(),"", "", &getstream.RingCallRequest{}) + require.NoError(t, err) + } + func TestVideoStartRTMPBroadcasts(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartRTMPBroadcasts(context.Background(),"", "", &getstream.StartRTMPBroadcastsRequest{}) + require.NoError(t, err) + } + func TestVideoStopAllRTMPBroadcasts(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopAllRTMPBroadcasts(context.Background(),"", "", &getstream.StopAllRTMPBroadcastsRequest{}) + require.NoError(t, err) + } + func TestVideoStopRTMPBroadcast(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopRTMPBroadcast(context.Background(),"", "", "", &getstream.StopRTMPBroadcastRequest{}) + require.NoError(t, err) + } + 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{}) + require.NoError(t, err) + } + func TestVideoQueryCallParticipantSessions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallParticipantSessions(context.Background(),"", "", "", &getstream.QueryCallParticipantSessionsRequest{}) + require.NoError(t, err) + } + func TestVideoStartHLSBroadcasting(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartHLSBroadcasting(context.Background(),"", "", &getstream.StartHLSBroadcastingRequest{}) + require.NoError(t, err) + } + func TestVideoStartClosedCaptions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartClosedCaptions(context.Background(),"", "", &getstream.StartClosedCaptionsRequest{}) + require.NoError(t, err) + } + func TestVideoStartFrameRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartFrameRecording(context.Background(),"", "", &getstream.StartFrameRecordingRequest{}) + require.NoError(t, err) + } + func TestVideoStartTranscription(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StartTranscription(context.Background(),"", "", &getstream.StartTranscriptionRequest{}) + require.NoError(t, err) + } + func TestVideoStopHLSBroadcasting(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopHLSBroadcasting(context.Background(),"", "", &getstream.StopHLSBroadcastingRequest{}) + require.NoError(t, err) + } + func TestVideoStopClosedCaptions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopClosedCaptions(context.Background(),"", "", &getstream.StopClosedCaptionsRequest{}) + require.NoError(t, err) + } + func TestVideoStopFrameRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopFrameRecording(context.Background(),"", "", &getstream.StopFrameRecordingRequest{}) + require.NoError(t, err) + } + func TestVideoStopLive(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopLive(context.Background(),"", "", &getstream.StopLiveRequest{}) + require.NoError(t, err) + } + func TestVideoStopTranscription(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().StopTranscription(context.Background(),"", "", &getstream.StopTranscriptionRequest{}) + require.NoError(t, err) + } + func TestVideoListTranscriptions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ListTranscriptions(context.Background(),"", "", &getstream.ListTranscriptionsRequest{}) + require.NoError(t, err) + } + func TestVideoUnblockUser(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UnblockUser(context.Background(),"", "", &getstream.UnblockUserRequest{}) + require.NoError(t, err) + } + func TestVideoVideoUnpin(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().VideoUnpin(context.Background(),"", "", &getstream.VideoUnpinRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateUserPermissions(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateUserPermissions(context.Background(),"", "", &getstream.UpdateUserPermissionsRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteRecording(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteRecording(context.Background(),"", "", "", "", &getstream.DeleteRecordingRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteTranscription(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteTranscription(context.Background(),"", "", "", "", &getstream.DeleteTranscriptionRequest{}) + require.NoError(t, err) + } + func TestVideoGetCallStatsMap(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCallStatsMap(context.Background(),"", "", "", &getstream.GetCallStatsMapRequest{}) + require.NoError(t, err) + } + func TestVideoGetCallSessionParticipantStatsDetails(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCallSessionParticipantStatsDetails(context.Background(),"", "", "", "", "", &getstream.GetCallSessionParticipantStatsDetailsRequest{}) + require.NoError(t, err) + } + func TestVideoQueryCallSessionParticipantStats(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCallSessionParticipantStats(context.Background(),"", "", "", &getstream.QueryCallSessionParticipantStatsRequest{}) + require.NoError(t, err) + } + func TestVideoGetCallSessionParticipantStatsTimeline(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCallSessionParticipantStatsTimeline(context.Background(),"", "", "", "", "", &getstream.GetCallSessionParticipantStatsTimelineRequest{}) + require.NoError(t, err) + } + func TestVideoQueryCalls(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryCalls(context.Background(),&getstream.QueryCallsRequest{}) + require.NoError(t, err) + } + func TestVideoListCallTypes(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ListCallTypes(context.Background(),&getstream.ListCallTypesRequest{}) + require.NoError(t, err) + } + func TestVideoCreateCallType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().CreateCallType(context.Background(),&getstream.CreateCallTypeRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteCallType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteCallType(context.Background(),"", &getstream.DeleteCallTypeRequest{}) + require.NoError(t, err) + } + func TestVideoGetCallType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetCallType(context.Background(),"", &getstream.GetCallTypeRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateCallType(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateCallType(context.Background(),"", &getstream.UpdateCallTypeRequest{}) + require.NoError(t, err) + } + func TestVideoGetEdges(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().GetEdges(context.Background(),&getstream.GetEdgesRequest{}) + require.NoError(t, err) + } + func TestVideoListSIPInboundRoutingRule(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ListSIPInboundRoutingRule(context.Background(),&getstream.ListSIPInboundRoutingRuleRequest{}) + require.NoError(t, err) + } + func TestVideoCreateSIPInboundRoutingRule(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().CreateSIPInboundRoutingRule(context.Background(),&getstream.CreateSIPInboundRoutingRuleRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteSIPInboundRoutingRule(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteSIPInboundRoutingRule(context.Background(),"", &getstream.DeleteSIPInboundRoutingRuleRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateSIPInboundRoutingRule(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateSIPInboundRoutingRule(context.Background(),"", &getstream.UpdateSIPInboundRoutingRuleRequest{}) + require.NoError(t, err) + } + func TestVideoListSIPTrunks(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ListSIPTrunks(context.Background(),&getstream.ListSIPTrunksRequest{}) + require.NoError(t, err) + } + func TestVideoCreateSIPTrunk(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().CreateSIPTrunk(context.Background(),&getstream.CreateSIPTrunkRequest{}) + require.NoError(t, err) + } + func TestVideoDeleteSIPTrunk(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().DeleteSIPTrunk(context.Background(),"", &getstream.DeleteSIPTrunkRequest{}) + require.NoError(t, err) + } + func TestVideoUpdateSIPTrunk(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().UpdateSIPTrunk(context.Background(),"", &getstream.UpdateSIPTrunkRequest{}) + require.NoError(t, err) + } + func TestVideoResolveSipInbound(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().ResolveSipInbound(context.Background(),&getstream.ResolveSipInboundRequest{}) + require.NoError(t, err) + } + func TestVideoQueryAggregateCallStats(t *testing.T) { + client, err := getstream.NewClient("key", "secret", getstream.WithHTTPClient(&StubHTTPClient{})) + require.NoError(t, err) + + _, err = client.Video().QueryAggregateCallStats(context.Background(),&getstream.QueryAggregateCallStatsRequest{}) + require.NoError(t, err) + } diff --git a/webhook.go b/webhook.go index 217a5b7..5852bd9 100644 --- a/webhook.go +++ b/webhook.go @@ -20,166 +20,166 @@ type WebhookEvent interface { // Webhook event type constants const ( - EventTypeWildcard = "*" - EventTypeAppealAccepted = "appeal.accepted" - EventTypeAppealCreated = "appeal.created" - EventTypeAppealRejected = "appeal.rejected" - EventTypeCallAccepted = "call.accepted" - EventTypeCallBlockedUser = "call.blocked_user" - EventTypeCallClosedCaption = "call.closed_caption" - EventTypeCallClosedCaptionsFailed = "call.closed_captions_failed" - EventTypeCallClosedCaptionsStarted = "call.closed_captions_started" - EventTypeCallClosedCaptionsStopped = "call.closed_captions_stopped" - EventTypeCallCreated = "call.created" - EventTypeCallDeleted = "call.deleted" - EventTypeCallDtmf = "call.dtmf" - EventTypeCallEnded = "call.ended" - EventTypeCallFrameRecordingFailed = "call.frame_recording_failed" - EventTypeCallFrameRecordingReady = "call.frame_recording_ready" - EventTypeCallFrameRecordingStarted = "call.frame_recording_started" - EventTypeCallFrameRecordingStopped = "call.frame_recording_stopped" - EventTypeCallHLSBroadcastingFailed = "call.hls_broadcasting_failed" - EventTypeCallHLSBroadcastingStarted = "call.hls_broadcasting_started" - EventTypeCallHLSBroadcastingStopped = "call.hls_broadcasting_stopped" - EventTypeCallKickedUser = "call.kicked_user" - EventTypeCallLiveStarted = "call.live_started" - EventTypeCallMemberAdded = "call.member_added" - EventTypeCallMemberRemoved = "call.member_removed" - EventTypeCallMemberUpdated = "call.member_updated" - EventTypeCallMemberUpdatedPermission = "call.member_updated_permission" - EventTypeCallMissed = "call.missed" - EventTypeCallModerationBlur = "call.moderation_blur" - EventTypeCallModerationWarning = "call.moderation_warning" - EventTypeCallNotification = "call.notification" - EventTypeCallPermissionRequest = "call.permission_request" - EventTypeCallPermissionsUpdated = "call.permissions_updated" - EventTypeCallReactionNew = "call.reaction_new" - EventTypeCallRecordingFailed = "call.recording_failed" - EventTypeCallRecordingReady = "call.recording_ready" - EventTypeCallRecordingStarted = "call.recording_started" - EventTypeCallRecordingStopped = "call.recording_stopped" - EventTypeCallRejected = "call.rejected" - EventTypeCallRing = "call.ring" - EventTypeCallRTMPBroadcastFailed = "call.rtmp_broadcast_failed" - EventTypeCallRTMPBroadcastStarted = "call.rtmp_broadcast_started" - EventTypeCallRTMPBroadcastStopped = "call.rtmp_broadcast_stopped" - EventTypeCallSessionEnded = "call.session_ended" + EventTypeWildcard = "*" + EventTypeAppealAccepted = "appeal.accepted" + EventTypeAppealCreated = "appeal.created" + EventTypeAppealRejected = "appeal.rejected" + EventTypeCallAccepted = "call.accepted" + EventTypeCallBlockedUser = "call.blocked_user" + EventTypeCallClosedCaption = "call.closed_caption" + EventTypeCallClosedCaptionsFailed = "call.closed_captions_failed" + EventTypeCallClosedCaptionsStarted = "call.closed_captions_started" + EventTypeCallClosedCaptionsStopped = "call.closed_captions_stopped" + EventTypeCallCreated = "call.created" + EventTypeCallDeleted = "call.deleted" + EventTypeCallDtmf = "call.dtmf" + EventTypeCallEnded = "call.ended" + EventTypeCallFrameRecordingFailed = "call.frame_recording_failed" + EventTypeCallFrameRecordingReady = "call.frame_recording_ready" + EventTypeCallFrameRecordingStarted = "call.frame_recording_started" + EventTypeCallFrameRecordingStopped = "call.frame_recording_stopped" + EventTypeCallHLSBroadcastingFailed = "call.hls_broadcasting_failed" + EventTypeCallHLSBroadcastingStarted = "call.hls_broadcasting_started" + EventTypeCallHLSBroadcastingStopped = "call.hls_broadcasting_stopped" + EventTypeCallKickedUser = "call.kicked_user" + EventTypeCallLiveStarted = "call.live_started" + EventTypeCallMemberAdded = "call.member_added" + EventTypeCallMemberRemoved = "call.member_removed" + EventTypeCallMemberUpdated = "call.member_updated" + EventTypeCallMemberUpdatedPermission = "call.member_updated_permission" + EventTypeCallMissed = "call.missed" + EventTypeCallModerationBlur = "call.moderation_blur" + EventTypeCallModerationWarning = "call.moderation_warning" + EventTypeCallNotification = "call.notification" + EventTypeCallPermissionRequest = "call.permission_request" + EventTypeCallPermissionsUpdated = "call.permissions_updated" + EventTypeCallReactionNew = "call.reaction_new" + EventTypeCallRecordingFailed = "call.recording_failed" + EventTypeCallRecordingReady = "call.recording_ready" + EventTypeCallRecordingStarted = "call.recording_started" + EventTypeCallRecordingStopped = "call.recording_stopped" + EventTypeCallRejected = "call.rejected" + EventTypeCallRing = "call.ring" + EventTypeCallRTMPBroadcastFailed = "call.rtmp_broadcast_failed" + EventTypeCallRTMPBroadcastStarted = "call.rtmp_broadcast_started" + EventTypeCallRTMPBroadcastStopped = "call.rtmp_broadcast_stopped" + EventTypeCallSessionEnded = "call.session_ended" EventTypeCallSessionParticipantCountUpdated = "call.session_participant_count_updated" - EventTypeCallSessionParticipantJoined = "call.session_participant_joined" - EventTypeCallSessionParticipantLeft = "call.session_participant_left" - EventTypeCallSessionStarted = "call.session_started" - EventTypeCallStatsReportReady = "call.stats_report_ready" - EventTypeCallTranscriptionFailed = "call.transcription_failed" - EventTypeCallTranscriptionReady = "call.transcription_ready" - EventTypeCallTranscriptionStarted = "call.transcription_started" - EventTypeCallTranscriptionStopped = "call.transcription_stopped" - EventTypeCallUnblockedUser = "call.unblocked_user" - EventTypeCallUpdated = "call.updated" - EventTypeCallUserFeedbackSubmitted = "call.user_feedback_submitted" - EventTypeCallUserMuted = "call.user_muted" - EventTypeCampaignCompleted = "campaign.completed" - EventTypeCampaignStarted = "campaign.started" - EventTypeChannelCreated = "channel.created" - EventTypeChannelDeleted = "channel.deleted" - EventTypeChannelFrozen = "channel.frozen" - EventTypeChannelHidden = "channel.hidden" - EventTypeChannelMaxStreakChanged = "channel.max_streak_changed" - EventTypeChannelMuted = "channel.muted" - EventTypeChannelTruncated = "channel.truncated" - EventTypeChannelUnfrozen = "channel.unfrozen" - EventTypeChannelUnmuted = "channel.unmuted" - EventTypeChannelUpdated = "channel.updated" - EventTypeChannelVisible = "channel.visible" - EventTypeChannelBatchUpdateCompleted = "channel_batch_update.completed" - EventTypeChannelBatchUpdateStarted = "channel_batch_update.started" - EventTypeCustom = "custom" - EventTypeExportBulkImageModerationError = "export.bulk_image_moderation.error" - EventTypeExportBulkImageModerationSuccess = "export.bulk_image_moderation.success" - EventTypeExportChannelsError = "export.channels.error" - EventTypeExportChannelsSuccess = "export.channels.success" - EventTypeExportModerationLogsError = "export.moderation_logs.error" - EventTypeExportModerationLogsSuccess = "export.moderation_logs.success" - EventTypeExportUsersError = "export.users.error" - EventTypeExportUsersSuccess = "export.users.success" - EventTypeFeedsActivityAdded = "feeds.activity.added" - EventTypeFeedsActivityDeleted = "feeds.activity.deleted" - EventTypeFeedsActivityFeedback = "feeds.activity.feedback" - EventTypeFeedsActivityMarked = "feeds.activity.marked" - EventTypeFeedsActivityPinned = "feeds.activity.pinned" - EventTypeFeedsActivityReactionAdded = "feeds.activity.reaction.added" - EventTypeFeedsActivityReactionDeleted = "feeds.activity.reaction.deleted" - EventTypeFeedsActivityReactionUpdated = "feeds.activity.reaction.updated" - EventTypeFeedsActivityRemovedFromFeed = "feeds.activity.removed_from_feed" - EventTypeFeedsActivityRestored = "feeds.activity.restored" - EventTypeFeedsActivityUnpinned = "feeds.activity.unpinned" - EventTypeFeedsActivityUpdated = "feeds.activity.updated" - EventTypeFeedsBookmarkAdded = "feeds.bookmark.added" - EventTypeFeedsBookmarkDeleted = "feeds.bookmark.deleted" - EventTypeFeedsBookmarkUpdated = "feeds.bookmark.updated" - EventTypeFeedsBookmarkFolderDeleted = "feeds.bookmark_folder.deleted" - EventTypeFeedsBookmarkFolderUpdated = "feeds.bookmark_folder.updated" - EventTypeFeedsCommentAdded = "feeds.comment.added" - EventTypeFeedsCommentDeleted = "feeds.comment.deleted" - EventTypeFeedsCommentReactionAdded = "feeds.comment.reaction.added" - EventTypeFeedsCommentReactionDeleted = "feeds.comment.reaction.deleted" - EventTypeFeedsCommentReactionUpdated = "feeds.comment.reaction.updated" - EventTypeFeedsCommentUpdated = "feeds.comment.updated" - EventTypeFeedsFeedCreated = "feeds.feed.created" - EventTypeFeedsFeedDeleted = "feeds.feed.deleted" - EventTypeFeedsFeedUpdated = "feeds.feed.updated" - EventTypeFeedsFeedGroupChanged = "feeds.feed_group.changed" - EventTypeFeedsFeedGroupDeleted = "feeds.feed_group.deleted" - EventTypeFeedsFeedMemberAdded = "feeds.feed_member.added" - EventTypeFeedsFeedMemberRemoved = "feeds.feed_member.removed" - EventTypeFeedsFeedMemberUpdated = "feeds.feed_member.updated" - EventTypeFeedsFollowCreated = "feeds.follow.created" - EventTypeFeedsFollowDeleted = "feeds.follow.deleted" - EventTypeFeedsFollowUpdated = "feeds.follow.updated" - EventTypeFeedsNotificationFeedUpdated = "feeds.notification_feed.updated" - EventTypeFeedsStoriesFeedUpdated = "feeds.stories_feed.updated" - EventTypeFlagUpdated = "flag.updated" - EventTypeIngressError = "ingress.error" - EventTypeIngressStarted = "ingress.started" - EventTypeIngressStopped = "ingress.stopped" - EventTypeMemberAdded = "member.added" - EventTypeMemberRemoved = "member.removed" - EventTypeMemberUpdated = "member.updated" - EventTypeMessageDeleted = "message.deleted" - EventTypeMessageFlagged = "message.flagged" - EventTypeMessageNew = "message.new" - EventTypeMessagePending = "message.pending" - EventTypeMessageRead = "message.read" - EventTypeMessageUnblocked = "message.unblocked" - EventTypeMessageUndeleted = "message.undeleted" - EventTypeMessageUpdated = "message.updated" - EventTypeModerationCustomAction = "moderation.custom_action" - EventTypeModerationFlagged = "moderation.flagged" - EventTypeModerationMarkReviewed = "moderation.mark_reviewed" - EventTypeModerationCheckCompleted = "moderation_check.completed" - EventTypeModerationRuleTriggered = "moderation_rule.triggered" - EventTypeNotificationMarkUnread = "notification.mark_unread" - EventTypeNotificationReminderDue = "notification.reminder_due" - EventTypeNotificationThreadMessageNew = "notification.thread_message_new" - EventTypeReactionDeleted = "reaction.deleted" - EventTypeReactionNew = "reaction.new" - EventTypeReactionUpdated = "reaction.updated" - EventTypeReminderCreated = "reminder.created" - EventTypeReminderDeleted = "reminder.deleted" - EventTypeReminderUpdated = "reminder.updated" - EventTypeReviewQueueItemNew = "review_queue_item.new" - EventTypeReviewQueueItemUpdated = "review_queue_item.updated" - EventTypeThreadUpdated = "thread.updated" - EventTypeUserBanned = "user.banned" - EventTypeUserDeactivated = "user.deactivated" - EventTypeUserDeleted = "user.deleted" - EventTypeUserFlagged = "user.flagged" - EventTypeUserMessagesDeleted = "user.messages.deleted" - EventTypeUserMuted = "user.muted" - EventTypeUserReactivated = "user.reactivated" - EventTypeUserUnbanned = "user.unbanned" - EventTypeUserUnmuted = "user.unmuted" - EventTypeUserUnreadMessageReminder = "user.unread_message_reminder" - EventTypeUserUpdated = "user.updated" + EventTypeCallSessionParticipantJoined = "call.session_participant_joined" + EventTypeCallSessionParticipantLeft = "call.session_participant_left" + EventTypeCallSessionStarted = "call.session_started" + EventTypeCallStatsReportReady = "call.stats_report_ready" + EventTypeCallTranscriptionFailed = "call.transcription_failed" + EventTypeCallTranscriptionReady = "call.transcription_ready" + EventTypeCallTranscriptionStarted = "call.transcription_started" + EventTypeCallTranscriptionStopped = "call.transcription_stopped" + EventTypeCallUnblockedUser = "call.unblocked_user" + EventTypeCallUpdated = "call.updated" + EventTypeCallUserFeedbackSubmitted = "call.user_feedback_submitted" + EventTypeCallUserMuted = "call.user_muted" + EventTypeCampaignCompleted = "campaign.completed" + EventTypeCampaignStarted = "campaign.started" + EventTypeChannelCreated = "channel.created" + EventTypeChannelDeleted = "channel.deleted" + EventTypeChannelFrozen = "channel.frozen" + EventTypeChannelHidden = "channel.hidden" + EventTypeChannelMaxStreakChanged = "channel.max_streak_changed" + EventTypeChannelMuted = "channel.muted" + EventTypeChannelTruncated = "channel.truncated" + EventTypeChannelUnfrozen = "channel.unfrozen" + EventTypeChannelUnmuted = "channel.unmuted" + EventTypeChannelUpdated = "channel.updated" + EventTypeChannelVisible = "channel.visible" + EventTypeChannelBatchUpdateCompleted = "channel_batch_update.completed" + EventTypeChannelBatchUpdateStarted = "channel_batch_update.started" + EventTypeCustom = "custom" + EventTypeExportBulkImageModerationError = "export.bulk_image_moderation.error" + EventTypeExportBulkImageModerationSuccess = "export.bulk_image_moderation.success" + EventTypeExportChannelsError = "export.channels.error" + EventTypeExportChannelsSuccess = "export.channels.success" + EventTypeExportModerationLogsError = "export.moderation_logs.error" + EventTypeExportModerationLogsSuccess = "export.moderation_logs.success" + EventTypeExportUsersError = "export.users.error" + EventTypeExportUsersSuccess = "export.users.success" + EventTypeFeedsActivityAdded = "feeds.activity.added" + EventTypeFeedsActivityDeleted = "feeds.activity.deleted" + EventTypeFeedsActivityFeedback = "feeds.activity.feedback" + EventTypeFeedsActivityMarked = "feeds.activity.marked" + EventTypeFeedsActivityPinned = "feeds.activity.pinned" + EventTypeFeedsActivityReactionAdded = "feeds.activity.reaction.added" + EventTypeFeedsActivityReactionDeleted = "feeds.activity.reaction.deleted" + EventTypeFeedsActivityReactionUpdated = "feeds.activity.reaction.updated" + EventTypeFeedsActivityRemovedFromFeed = "feeds.activity.removed_from_feed" + EventTypeFeedsActivityRestored = "feeds.activity.restored" + EventTypeFeedsActivityUnpinned = "feeds.activity.unpinned" + EventTypeFeedsActivityUpdated = "feeds.activity.updated" + EventTypeFeedsBookmarkAdded = "feeds.bookmark.added" + EventTypeFeedsBookmarkDeleted = "feeds.bookmark.deleted" + EventTypeFeedsBookmarkUpdated = "feeds.bookmark.updated" + EventTypeFeedsBookmarkFolderDeleted = "feeds.bookmark_folder.deleted" + EventTypeFeedsBookmarkFolderUpdated = "feeds.bookmark_folder.updated" + EventTypeFeedsCommentAdded = "feeds.comment.added" + EventTypeFeedsCommentDeleted = "feeds.comment.deleted" + EventTypeFeedsCommentReactionAdded = "feeds.comment.reaction.added" + EventTypeFeedsCommentReactionDeleted = "feeds.comment.reaction.deleted" + EventTypeFeedsCommentReactionUpdated = "feeds.comment.reaction.updated" + EventTypeFeedsCommentUpdated = "feeds.comment.updated" + EventTypeFeedsFeedCreated = "feeds.feed.created" + EventTypeFeedsFeedDeleted = "feeds.feed.deleted" + EventTypeFeedsFeedUpdated = "feeds.feed.updated" + EventTypeFeedsFeedGroupChanged = "feeds.feed_group.changed" + EventTypeFeedsFeedGroupDeleted = "feeds.feed_group.deleted" + EventTypeFeedsFeedMemberAdded = "feeds.feed_member.added" + EventTypeFeedsFeedMemberRemoved = "feeds.feed_member.removed" + EventTypeFeedsFeedMemberUpdated = "feeds.feed_member.updated" + EventTypeFeedsFollowCreated = "feeds.follow.created" + EventTypeFeedsFollowDeleted = "feeds.follow.deleted" + EventTypeFeedsFollowUpdated = "feeds.follow.updated" + EventTypeFeedsNotificationFeedUpdated = "feeds.notification_feed.updated" + EventTypeFeedsStoriesFeedUpdated = "feeds.stories_feed.updated" + EventTypeFlagUpdated = "flag.updated" + EventTypeIngressError = "ingress.error" + EventTypeIngressStarted = "ingress.started" + EventTypeIngressStopped = "ingress.stopped" + EventTypeMemberAdded = "member.added" + EventTypeMemberRemoved = "member.removed" + EventTypeMemberUpdated = "member.updated" + EventTypeMessageDeleted = "message.deleted" + EventTypeMessageFlagged = "message.flagged" + EventTypeMessageNew = "message.new" + EventTypeMessagePending = "message.pending" + EventTypeMessageRead = "message.read" + EventTypeMessageUnblocked = "message.unblocked" + EventTypeMessageUndeleted = "message.undeleted" + EventTypeMessageUpdated = "message.updated" + EventTypeModerationCustomAction = "moderation.custom_action" + EventTypeModerationFlagged = "moderation.flagged" + EventTypeModerationMarkReviewed = "moderation.mark_reviewed" + EventTypeModerationCheckCompleted = "moderation_check.completed" + EventTypeModerationRuleTriggered = "moderation_rule.triggered" + EventTypeNotificationMarkUnread = "notification.mark_unread" + EventTypeNotificationReminderDue = "notification.reminder_due" + EventTypeNotificationThreadMessageNew = "notification.thread_message_new" + EventTypeReactionDeleted = "reaction.deleted" + EventTypeReactionNew = "reaction.new" + EventTypeReactionUpdated = "reaction.updated" + EventTypeReminderCreated = "reminder.created" + EventTypeReminderDeleted = "reminder.deleted" + EventTypeReminderUpdated = "reminder.updated" + EventTypeReviewQueueItemNew = "review_queue_item.new" + EventTypeReviewQueueItemUpdated = "review_queue_item.updated" + EventTypeThreadUpdated = "thread.updated" + EventTypeUserBanned = "user.banned" + EventTypeUserDeactivated = "user.deactivated" + EventTypeUserDeleted = "user.deleted" + EventTypeUserFlagged = "user.flagged" + EventTypeUserMessagesDeleted = "user.messages.deleted" + EventTypeUserMuted = "user.muted" + EventTypeUserReactivated = "user.reactivated" + EventTypeUserUnbanned = "user.unbanned" + EventTypeUserUnmuted = "user.unmuted" + EventTypeUserUnreadMessageReminder = "user.unread_message_reminder" + EventTypeUserUpdated = "user.updated" ) // GetEventType extracts the event type from a raw webhook payload.