From 73df541301e383cf2fc38538f2d588a07537688a Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 28 Jun 2024 14:29:18 +0200 Subject: [PATCH] feat!: update to latest open api (#42) --- CONTRIBUTING.md | 18 +- __tests__/block-lists.test.ts | 8 +- __tests__/channel-types.test.ts | 6 +- __tests__/channel.test.ts | 38 +- __tests__/devices-push.test.ts | 8 +- __tests__/messages.test.ts | 14 +- __tests__/user-compat.test.ts | 21 +- __tests__/users.test.ts | 41 +- generate-openapi.sh | 12 +- src/StreamCall.ts | 14 +- src/StreamChannel.ts | 93 +- src/StreamChatClient.ts | 58 +- src/StreamClient.ts | 303 +- src/gen/chat/.openapi-generator/FILES | 20 +- src/gen/chat/apis/ChannelTypesApi.ts | 275 - src/gen/chat/apis/ChannelsApi.ts | 1096 -- src/gen/chat/apis/CustomCommandsApi.ts | 276 - src/gen/chat/apis/DefaultApi.ts | 196 - src/gen/chat/apis/DevicesApi.ts | 180 - src/gen/chat/apis/EventsApi.ts | 147 - src/gen/chat/apis/FilesApi.ts | 312 - src/gen/chat/apis/GDPRApi.ts | 418 - src/gen/chat/apis/ImportsApi.ts | 222 - src/gen/chat/apis/MessagesApi.ts | 1475 --- src/gen/chat/apis/ModerationApi.ts | 1038 -- src/gen/chat/apis/PermissionsV2Api.ts | 259 - src/gen/chat/apis/ProductchatApi.ts | 7007 +++++++++++++ src/gen/chat/apis/PushApi.ts | 183 - src/gen/chat/apis/ReactionsApi.ts | 202 - src/gen/chat/apis/ServerSideApi.ts | 79 - src/gen/chat/apis/SettingsApi.ts | 948 -- src/gen/chat/apis/TasksApi.ts | 75 - src/gen/chat/apis/TestingApi.ts | 185 - src/gen/chat/apis/UsersApi.ts | 1203 --- src/gen/chat/apis/index.ts | 28 +- src/gen/chat/models/index.ts | 12322 +++++++++++------------ src/gen/chat/runtime.ts | 6 +- src/gen/video/apis/ProductvideoApi.ts | 2 +- src/gen/video/models/index.ts | 220 +- src/gen/video/runtime.ts | 2 +- test-cleanup.js | 14 + 41 files changed, 13229 insertions(+), 15795 deletions(-) delete mode 100644 src/gen/chat/apis/ChannelTypesApi.ts delete mode 100644 src/gen/chat/apis/ChannelsApi.ts delete mode 100644 src/gen/chat/apis/CustomCommandsApi.ts delete mode 100644 src/gen/chat/apis/DefaultApi.ts delete mode 100644 src/gen/chat/apis/DevicesApi.ts delete mode 100644 src/gen/chat/apis/EventsApi.ts delete mode 100644 src/gen/chat/apis/FilesApi.ts delete mode 100644 src/gen/chat/apis/GDPRApi.ts delete mode 100644 src/gen/chat/apis/ImportsApi.ts delete mode 100644 src/gen/chat/apis/MessagesApi.ts delete mode 100644 src/gen/chat/apis/ModerationApi.ts delete mode 100644 src/gen/chat/apis/PermissionsV2Api.ts create mode 100644 src/gen/chat/apis/ProductchatApi.ts delete mode 100644 src/gen/chat/apis/PushApi.ts delete mode 100644 src/gen/chat/apis/ReactionsApi.ts delete mode 100644 src/gen/chat/apis/ServerSideApi.ts delete mode 100644 src/gen/chat/apis/SettingsApi.ts delete mode 100644 src/gen/chat/apis/TasksApi.ts delete mode 100644 src/gen/chat/apis/TestingApi.ts delete mode 100644 src/gen/chat/apis/UsersApi.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3bc694..d6ed500 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,23 +48,7 @@ $ PRODUCT=video yarn generate:open-api $ PRODUCT=chat yarn generate:open-api:dev ``` -### Fix issues in chat code - -If you have updated the generated chat code you'll have to fix the following issues manually in the generated code: - -- Add `/** @ts-expect-error */ ` (make sure to use this exact comment format otherwise they will be missing from `d.ts` files) for imports for `ImageSizeRequest`, `OnlyUserIDRequest` in the `gen/chat/FilesApi.ts` and `gen/chat/MessagesApi.ts` files -- Add `/** @ts-expect-error */ ` (make sure to use this exact comment format otherwise they will be missing from `d.ts` files) for duplicate exports in `gen/chat/index.ts` - -### Validate that the generated code works - -To check your work, run the following commands: - -``` -yarn start -yarn test -``` - -If these commands run fine, we're good to go. +The current chat open API contains some issues, to fix some of them apply the following commit manually after updating the chat open API: [87f8672f9c302138d2c19f07b9b5236e3ba98714](https://github.com/GetStream/stream-node/pull/42/commits/87f8672f9c302138d2c19f07b9b5236e3ba98714) ## Release (for Stream developers) diff --git a/__tests__/block-lists.test.ts b/__tests__/block-lists.test.ts index f55c64f..568f1a7 100644 --- a/__tests__/block-lists.test.ts +++ b/__tests__/block-lists.test.ts @@ -2,17 +2,21 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { v4 as uuidv4 } from 'uuid'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; -import { BlockList } from '../src/gen/chat'; +import { + CreateBlockListRequest, + CreateBlockListRequestTypeEnum, +} from '../src/gen/chat'; describe('block lists CRUD API', () => { let client: StreamClient; - let blockList: BlockList; + let blockList: CreateBlockListRequest; beforeAll(() => { client = createTestClient(); blockList = { name: 'streamnodetest-F1' + uuidv4(), words: ['Ricciardo should retire'], + type: CreateBlockListRequestTypeEnum.WORD, }; }); diff --git a/__tests__/channel-types.test.ts b/__tests__/channel-types.test.ts index 6be4570..d54baaf 100644 --- a/__tests__/channel-types.test.ts +++ b/__tests__/channel-types.test.ts @@ -16,6 +16,8 @@ describe('channel types CRUD API', () => { const response = await client.chat.createChannelType({ name: channelType, automod: CreateChannelTypeRequestAutomodEnum.DISABLED, + automod_behavior: 'block', + max_message_length: 1200, }); expect(response.name).toBe(channelType); @@ -30,13 +32,15 @@ describe('channel types CRUD API', () => { it('update', async () => { const response = await client.chat.updateChannelType(channelType, { automod: CreateChannelTypeRequestAutomodEnum.SIMPLE, + automod_behavior: 'block', + max_message_length: 1200, }); expect(response.automod).toBe(CreateChannelTypeRequestAutomodEnum.SIMPLE); const getResponse = await client.chat.getChannelType({ name: channelType }); - // @ts-expect-error typing problem + // Property 'automod' does not exist on type 'Response'. expect(getResponse.automod).toBe( CreateChannelTypeRequestAutomodEnum.SIMPLE, ); diff --git a/__tests__/channel.test.ts b/__tests__/channel.test.ts index 8635208..ee8ea31 100644 --- a/__tests__/channel.test.ts +++ b/__tests__/channel.test.ts @@ -34,20 +34,30 @@ describe('channel API', () => { it('create', async () => { const response = await channel.getOrCreate({ + // Type error: Object literal may only specify known properties, and 'name' does not exist in type 'ChannelInput'. data: { created_by_id: user.id, name: channelId }, }); expect(response.channel?.cid).toBe(`${channel.type}:${channel.id}`); + // Type error: Property 'name' does not exist on type 'ChannelResponse' + expect(response.channel?.name).toBe(channelId); }); - // it("create - without id", async () => { - // const channelWithoutId = client.chat.channel('messaging'); - // const response = await channelWithoutId.getOrCreate({data: {created_by_id: user.id, members: [{user_id: user.id}, {user_id: user2.id}]}}); + it('create - without id', async () => { + const channelWithoutId = client.chat.channel('messaging'); + const response = await channelWithoutId.getOrCreate({ + data: { + created_by_id: user.id, + // Type error: Type '{ user_id: string; }' is missing the following properties from type 'ChannelMember': + // banned, channel_role, created_at, notifications_muted, and 2 more. + members: [{ user_id: user.id }, { user_id: user2.id }], + }, + }); - // expect(response.channel?.cid).toBe(channelWithoutId.cid); + expect(response.channel?.cid).toBe(channelWithoutId.cid); - // await channelWithoutId.delete(); - // }); + await channelWithoutId.delete(); + }); it('update', async () => { const response = await channel.update({ @@ -69,6 +79,22 @@ describe('channel API', () => { expect(response.channel?.cooldown).toBe(100); }); + it('queryChannels', async () => { + const unfilteredResponse = await client.chat.queryChannels(); + + expect(unfilteredResponse.channels.length).toBeGreaterThan(1); + + const filteredResponse = await client.chat.queryChannels({ + filter_conditions: { cid: channel.cid }, + }); + + expect(filteredResponse.channels.length).toBe(1); + + const channelFromResponse = filteredResponse.channels[0]; + + expect(channelFromResponse.channel?.name).toBe(channelId); + }); + it('query members', async () => { const response = await channel.queryMembers({ filter_conditions: { diff --git a/__tests__/devices-push.test.ts b/__tests__/devices-push.test.ts index c6dc2fc..4c57a3b 100644 --- a/__tests__/devices-push.test.ts +++ b/__tests__/devices-push.test.ts @@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid'; import { CreateDeviceRequest, CreateDeviceRequestPushProviderEnum, - PushProviderRequest, + PushProvider, } from '../src/gen/chat'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; @@ -20,9 +20,11 @@ describe('devices and push', () => { push_provider_name: 'firebase', user_id: user.id, }; - const pushProvider: PushProviderRequest = { + // Type '{ name: string; type: string; xiaomi_app_secret: string; xiaomi_package_name: string; }' + // is missing the following properties from type 'PushProvider': created_at, updated_at + const pushProvider: PushProvider = { name: 'test-push-provider', - type: 'xiaomi' as any as number, + type: 'xiaomi', xiaomi_app_secret: '', xiaomi_package_name: '', }; diff --git a/__tests__/messages.test.ts b/__tests__/messages.test.ts index 6c27073..4314acf 100644 --- a/__tests__/messages.test.ts +++ b/__tests__/messages.test.ts @@ -35,6 +35,7 @@ describe('messages API', () => { channel = client.chat.channel('messaging', channelId); await channel.getOrCreate({ data: { + // Type '{ id: string; }' is missing the following properties from type 'UserObject': banned, custom, online, role created_by: { id: user.id }, members: [{ user }, { user: user2 }], }, @@ -54,7 +55,7 @@ describe('messages API', () => { messageId = response.message?.id; - const getResponse = await channel.getManyMessages({ ids: [messageId!] }); + const getResponse = await channel.getManyMessages({ ids: [messageId] }); expect(getResponse.messages.length).toBe(1); }); @@ -66,6 +67,7 @@ describe('messages API', () => { const response = await channel.updateMessage(messageId!, { message: { text: 'https://getstream.io/', + // Property 'custom' is missing in type '{ image_url: string; }' but required in type 'Attachment' attachments: [urlAttachment], user_id: user.id, }, @@ -99,6 +101,7 @@ describe('messages API', () => { language: TranslateMessageRequestLanguageEnum.HU, }); + // Property 'message' does not exist on type 'MessageResponse'. expect(response.message?.i18n?.hu_text).toBeDefined(); }); @@ -150,20 +153,13 @@ describe('messages API', () => { expect(response.results).toBeDefined(); }); - it('flag and unflag', async () => { + it('flag', async () => { const response = await client.flag({ target_message_id: messageId!, user_id: user.id, }); expect(response.flag?.target_message_id).toBe(messageId!); - - const unflagResponse = await client.unflag({ - target_message_id: messageId!, - user_id: user.id, - }); - - expect(unflagResponse).toBeDefined(); }); it('truncate', async () => { diff --git a/__tests__/user-compat.test.ts b/__tests__/user-compat.test.ts index 5cde28f..c255cd6 100644 --- a/__tests__/user-compat.test.ts +++ b/__tests__/user-compat.test.ts @@ -6,7 +6,7 @@ import { StreamClient } from '../src/StreamClient'; describe('user-video compatibility API', () => { let client: StreamClient; const user = { - id: 'stream-node-test-user', + id: uuidv4(), role: 'admin', name: 'Test User for user API compatibily', custom: { @@ -14,19 +14,34 @@ describe('user-video compatibility API', () => { }, }; - beforeAll(async () => { + beforeAll(() => { client = createTestClient(); - await client.upsertUsers({ + }); + + it('upsert user', async () => { + const user = { + id: uuidv4(), + role: 'admin', + name: 'Test User for user API compatibily', + custom: { + note: 'compatibilty test', + }, + }; + + const response = await client.upsertUsers({ users: { [user.id]: { ...user }, }, }); + + expect(response.users[user.id].custom.note).toBe('compatibilty test'); }); it('create call', async () => { const call = client.video.call('default', uuidv4()); const response = await call.create({ data: { created_by: user } }); + // Backend returns: {custom: { custom: { note: 'compatibilty test' } }} expect(response.call.created_by.custom.note).toBe('compatibilty test'); expect(response.call.created_by.name).toBe( 'Test User for user API compatibily', diff --git a/__tests__/users.test.ts b/__tests__/users.test.ts index 0c360ba..4463761 100644 --- a/__tests__/users.test.ts +++ b/__tests__/users.test.ts @@ -2,12 +2,12 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { v4 as uuidv4 } from 'uuid'; import { createTestClient } from './create-test-client'; import { StreamClient } from '../src/StreamClient'; -import { UserObjectRequest } from '../src/gen/chat'; +import { UserRequest } from '../src/gen/chat'; describe('user API', () => { let client: StreamClient; const userId = 'streamnodetest' + uuidv4(); - const newUser: UserObjectRequest = { + const newUser: UserRequest = { id: userId, role: 'user', custom: { @@ -80,7 +80,7 @@ describe('user API', () => { it('create guest', async () => { await client.updateAppSettings({ multi_tenant_enabled: false }); - const guest: UserObjectRequest = { + const guest: UserRequest = { id: uuidv4(), custom: { color: 'red', @@ -132,14 +132,41 @@ describe('user API', () => { expect(muteResponse.mute?.target?.id).toBe(newUser.id); const unmuteResponse = await client.unmuteUser({ - target_id: newUser.id, - target_ids: [], + target_ids: [newUser.id], user_id: user.id, }); expect(unmuteResponse).toBeDefined(); }); + it('block and unblock', async () => { + const badUser: UserRequest = { + id: 'bad-alice', + name: 'Alice', + }; + await client.upsertUsers({ users: { [badUser.id]: badUser } }); + + const blockResponse = await client.blockUsers({ + blocked_user_id: badUser.id, + user_id: user.id, + }); + + expect(blockResponse.blocked_user_id).toBe(badUser.id); + + const blockedUsers = await client.getBlockedUsers({ userId: user.id }); + + expect( + blockedUsers.blocks.find((b) => b.blocked_user_id === badUser.id), + ).toBeDefined(); + + const unblockResponse = await client.unblockUsers({ + blocked_user_id: badUser.id, + user_id: user.id, + }); + + expect(unblockResponse.duration).toBeDefined(); + }); + it('send custom event', async () => { const response = await client.sendCustomEventToUser(newUser.id, { type: 'my-custom-event', @@ -155,7 +182,9 @@ describe('user API', () => { id: newUser.id, set: { role: 'admin', - color: 'blue', + custom: { + color: 'blue', + }, }, unset: ['name'], }, diff --git a/generate-openapi.sh b/generate-openapi.sh index 4e03b4b..5ed1366 100755 --- a/generate-openapi.sh +++ b/generate-openapi.sh @@ -21,14 +21,14 @@ if [ "$PRODUCT" == 'video' ] || [ "$PRODUCT" == 'all' ] ; then PROTOCOL_REPO_DIR="../protocol" fi if [ "$FROM_REPO" == 'chat' ]; then - SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/video-openapi.yaml" + SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/v2/video-openapi.yaml" else SCHEMA_FILE="$PROTOCOL_REPO_DIR/openapi/video-openapi.yaml" fi if [ "$FROM_REPO" == 'chat' ]; then # Generate the Coordinator OpenAPI schema - make -C $PROTOCOL_REPO_DIR video-openapi + make -C $PROTOCOL_REPO_DIR openapi fi OUTPUT_DIR="./src/gen/video" @@ -64,14 +64,14 @@ if [ "$PRODUCT" == 'chat' ] || [ "$PRODUCT" == 'all' ]; then PROTOCOL_REPO_DIR="../protocol" fi if [ "$FROM_REPO" == 'chat' ]; then - SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/chat-openapi.yaml" + SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/v2/chat-serverside-api.yaml" else SCHEMA_FILE="$PROTOCOL_REPO_DIR/openapi/chat-openapi.yaml" fi if [ "$FROM_REPO" == 'chat' ]; then # Generate the Coordinator OpenAPI schema - make -C $PROTOCOL_REPO_DIR chat-openapi + make -C $PROTOCOL_REPO_DIR openapi fi OUTPUT_DIR="./src/gen/chat" @@ -91,7 +91,9 @@ if [ "$PRODUCT" == 'chat' ] || [ "$PRODUCT" == 'all' ]; then --additional-properties=supportsES6=true \ --additional-properties=modelPropertyNaming=original \ --additional-properties=enumPropertyNaming=UPPERCASE \ - --additional-properties=withoutRuntimeChecks=true + --additional-properties=withoutRuntimeChecks=true \ + --global-property=skipFormModel=false \ + --skip-validate-spec # Remove the generated API client, just keep the models cp -r $TEMP_OUTPUT_DIR/ $OUTPUT_DIR diff --git a/src/StreamCall.ts b/src/StreamCall.ts index ad5e6df..21ceb57 100644 --- a/src/StreamCall.ts +++ b/src/StreamCall.ts @@ -48,13 +48,6 @@ export class StreamCall { }); }; - delete = (videoDeleteCallRequest?: VideoDeleteCallRequest) => { - return this.apiClient.deleteCall({ - ...this.baseRequest, - videoDeleteCallRequest: videoDeleteCallRequest ?? null, - }); - }; - endCall = () => { return this.apiClient.endCall({ ...this.baseRequest }); }; @@ -63,6 +56,13 @@ export class StreamCall { return this.apiClient.getCall({ ...(request ?? {}), ...this.baseRequest }); }; + delete = (videoDeleteCallRequest?: VideoDeleteCallRequest) => { + return this.apiClient.deleteCall({ + ...this.baseRequest, + videoDeleteCallRequest: videoDeleteCallRequest ?? null, + }); + }; + getOrCreate = (videoGetOrCreateCallRequest?: VideoGetOrCreateCallRequest) => { return this.apiClient.getOrCreateCall({ ...this.baseRequest, diff --git a/src/StreamChannel.ts b/src/StreamChannel.ts index ab3b3e8..85571b7 100644 --- a/src/StreamChannel.ts +++ b/src/StreamChannel.ts @@ -1,12 +1,10 @@ import { StreamClient } from './StreamClient'; import { ChannelGetOrCreateRequest, - ChannelsApi, DeleteChannelRequest, DeleteMessageRequest, DeleteReactionRequest, EventRequest, - EventsApi, GetManyMessagesRequest, GetMessageRequest, GetOGRequest, @@ -15,8 +13,8 @@ import { HideChannelRequest, MarkReadRequest, MarkUnreadRequest, - MessagesApi, MuteChannelRequest, + ProductchatApi, QueryMembersRequest, SendMessageRequest, SendReactionRequest, @@ -32,9 +30,7 @@ import { import { OmitTypeId } from './types'; export class StreamChannel { - private readonly channelsApi: ChannelsApi; - private readonly messagesApi: MessagesApi; - private readonly eventsApi: EventsApi; + private readonly chatApi: ProductchatApi; constructor( private readonly streamClient: StreamClient, @@ -43,11 +39,7 @@ export class StreamChannel { ) { const configuration = this.streamClient.getConfiguration(); /** @ts-expect-error */ - this.channelsApi = new ChannelsApi(configuration); - /** @ts-expect-error */ - this.messagesApi = new MessagesApi(configuration); - /** @ts-expect-error */ - this.eventsApi = new EventsApi(configuration); + this.chatApi = new ProductchatApi(configuration); } get cid() { @@ -55,14 +47,14 @@ export class StreamChannel { } delete = (request?: OmitTypeId) => { - return this.channelsApi.deleteChannel({ + return this.chatApi.deleteChannel({ ...this.baseRequest, ...(request ?? {}), }); }; update = (updateChannelRequest: OmitTypeId) => { - return this.channelsApi.updateChannel({ + return this.chatApi.updateChannel({ ...this.baseRequest, updateChannelRequest, }); @@ -71,7 +63,7 @@ export class StreamChannel { updatePartial = ( updateChannelPartialRequest: OmitTypeId, ) => { - return this.channelsApi.updateChannelPartial({ + return this.chatApi.updateChannelPartial({ ...this.baseRequest, updateChannelPartialRequest, }); @@ -81,61 +73,65 @@ export class StreamChannel { channelGetOrCreateRequest?: ChannelGetOrCreateRequest, ) => { if (this.id) { - return await this.channelsApi.getOrCreateChannel({ + return await this.chatApi.getOrCreateChannel({ ...this.baseRequest, channelGetOrCreateRequest: channelGetOrCreateRequest ?? {}, }); } else { - throw new Error(`This operation isn't yet implemented`); - // if (!channelGetOrCreateRequest?.data?.members) { - // throw new Error('You need to provide members to create a channel without ID'); - // } - // const response = await this.channelsApi.getOrCreateChannelType1({type: this.type, channelGetOrCreateRequest}); - // this.id = response.channel?.id; - // return response; + if (!channelGetOrCreateRequest?.data?.members) { + throw new Error( + 'You need to provide members to create a channel without ID', + ); + } + const response = await this.chatApi.getOrCreateDistinctChannel({ + type: this.type, + channelGetOrCreateRequest, + }); + this.id = response.channel?.id; + return response; } }; markRead = (markReadRequest: MarkReadRequest) => { - return this.channelsApi.markRead({ ...this.baseRequest, markReadRequest }); + return this.chatApi.markRead({ ...this.baseRequest, markReadRequest }); }; markUnread = (markUnreadRequest: MarkUnreadRequest) => { - return this.channelsApi.markUnread({ + return this.chatApi.markUnread({ ...this.baseRequest, markUnreadRequest, }); }; show = (showChannelRequest: ShowChannelRequest) => { - return this.channelsApi.showChannel({ + return this.chatApi.showChannel({ ...this.baseRequest, showChannelRequest, }); }; hide = (hideChannelRequest: HideChannelRequest) => { - return this.channelsApi.hideChannel({ + return this.chatApi.hideChannel({ ...this.baseRequest, hideChannelRequest, }); }; truncate = (truncateChannelRequest: TruncateChannelRequest) => { - return this.channelsApi.truncateChannel({ + return this.chatApi.truncateChannel({ ...this.baseRequest, truncateChannelRequest, }); }; queryMembers = (request: OmitTypeId) => { - return this.channelsApi.queryMembers({ + return this.chatApi.queryMembers({ payload: { ...this.baseRequest, ...request }, }); }; mute = (muteChannelRequest: Omit) => { - return this.channelsApi.muteChannel({ + return this.chatApi.muteChannel({ muteChannelRequest: { ...muteChannelRequest, channel_cids: [this.cid] }, }); }; @@ -146,63 +142,62 @@ export class StreamChannel { 'channel_cids' | 'channel_cid' >, ) => { - return this.channelsApi.unmuteChannel({ + return this.chatApi.unmuteChannel({ unmuteChannelRequest: { ...unmuteChannelRequest, - channel_cid: this.cid, - channel_cids: [], + channel_cids: [this.cid], }, }); }; // TODO: there is probably an issue with the generated code here // uploadFile = (options: Omit, 'file'>, file: Buffer) => { - // return this.messagesApi.uploadFile({...options, ...this.baseRequest, file: file as any as string}); + // return this.chatApi.uploadFile({...options, ...this.baseRequest, file: file as any as string}); // } // deleteFile = (request: OmitTypeId) => { - // return this.messagesApi.deleteFile({...request, ...this.baseRequest}); + // return this.chatApi.deleteFile({...request, ...this.baseRequest}); // } // uploadImage = (request: OmitTypeId) => { - // return this.messagesApi.uploadImage({...request, ...this.baseRequest}); + // return this.chatApi.uploadImage({...request, ...this.baseRequest}); // } // deleteImage = (request: OmitTypeId) => { - // return this.messagesApi.deleteImage({...request, ...this.baseRequest}); + // return this.chatApi.deleteImage({...request, ...this.baseRequest}); // } sendMessage = (sendMessageRequest: SendMessageRequest) => { - return this.messagesApi.sendMessage({ + return this.chatApi.sendMessage({ ...this.baseRequest, sendMessageRequest, }); }; deleteMessage = (request: DeleteMessageRequest) => { - return this.messagesApi.deleteMessage(request); + return this.chatApi.deleteMessage(request); }; updateMessage = (id: string, updateMessageRequest: UpdateMessageRequest) => { - return this.messagesApi.updateMessage({ id, updateMessageRequest }); + return this.chatApi.updateMessage({ id, updateMessageRequest }); }; updateMessagePartial = ( id: string, updateMessagePartialRequest: UpdateMessagePartialRequest, ) => { - return this.messagesApi.updateMessagePartial({ + return this.chatApi.updateMessagePartial({ id, updateMessagePartialRequest, }); }; getMessage = (request: GetMessageRequest) => { - return this.messagesApi.getMessage(request); + return this.chatApi.getMessage(request); }; getManyMessages = (request: OmitTypeId) => { - return this.messagesApi.getManyMessages({ + return this.chatApi.getManyMessages({ ...request, ...this.baseRequest, }); @@ -212,22 +207,22 @@ export class StreamChannel { id: string, translateMessageRequest: TranslateMessageRequest, ) => { - return this.messagesApi.translateMessage({ id, translateMessageRequest }); + return this.chatApi.translateMessage({ id, translateMessageRequest }); }; getMessagesAround = (request: GetRepliesRequest) => { - return this.messagesApi.getReplies(request); + return this.chatApi.getReplies(request); }; getOpenGraphData = (request: GetOGRequest) => { - return this.messagesApi.getOG(request); + return this.chatApi.getOG(request); }; sendMessageReaction = ( messageId: string, sendReactionRequest: SendReactionRequest, ) => { - return this.messagesApi.sendReaction({ + return this.chatApi.sendReaction({ id: messageId, sendReactionRequest, }); @@ -237,18 +232,18 @@ export class StreamChannel { messageId: string, request: Omit, ) => { - return this.messagesApi.deleteReaction({ ...request, id: messageId }); + return this.chatApi.deleteReaction({ ...request, id: messageId }); }; getMessageReactions = ( messageId: string, request?: Omit, ) => { - return this.messagesApi.getReactions({ ...(request ?? {}), id: messageId }); + return this.chatApi.getReactions({ ...(request ?? {}), id: messageId }); }; sendCustomEvent = (event: EventRequest) => { - return this.eventsApi.sendEvent({ + return this.chatApi.sendEvent({ ...this.baseRequest, sendEventRequest: { event }, }); diff --git a/src/StreamChatClient.ts b/src/StreamChatClient.ts index 1768b96..e0627fc 100644 --- a/src/StreamChatClient.ts +++ b/src/StreamChatClient.ts @@ -1,12 +1,9 @@ import { StreamChannel } from './StreamChannel'; import { StreamClient } from './StreamClient'; import { - ChannelTypesApi, - ChannelsApi, CreateBlockListRequest, CreateChannelTypeRequest, CreateCommandRequest, - CustomCommandsApi, DeleteBlockListRequest, DeleteChannelTypeRequest, DeleteCommandRequest, @@ -15,30 +12,21 @@ import { GetChannelTypeRequest, GetCommandRequest, GetExportChannelsStatusRequest, + ProductchatApi, QueryChannelsRequest, SearchRequest, - SettingsApi, UpdateBlockListRequest, UpdateChannelTypeRequest, UpdateCommandRequest, } from './gen/chat'; export class StreamChatClient { - private readonly settingsApi: SettingsApi; - private readonly channelTypesApi: ChannelTypesApi; - private readonly channelsApi: ChannelsApi; - private readonly commandsApi: CustomCommandsApi; + private readonly chatApi: ProductchatApi; constructor(private readonly streamClient: StreamClient) { const configuration = this.streamClient.getConfiguration(); /** @ts-expect-error */ - this.settingsApi = new SettingsApi(configuration); - /** @ts-expect-error */ - this.channelTypesApi = new ChannelTypesApi(configuration); - /** @ts-expect-error */ - this.channelsApi = new ChannelsApi(configuration); - /** @ts-expect-error */ - this.commandsApi = new CustomCommandsApi(configuration); + this.chatApi = new ProductchatApi(configuration); } channel = (type: string, id?: string) => { @@ -46,94 +34,94 @@ export class StreamChatClient { }; createBlockList = (createBlockListRequest: CreateBlockListRequest) => { - return this.settingsApi.createBlockList({ createBlockListRequest }); + return this.chatApi.createBlockList({ createBlockListRequest }); }; listBlockLists = () => { - return this.settingsApi.listBlockLists(); + return this.chatApi.listBlockLists(); }; getBlockList = (request: GetBlockListRequest) => { - return this.settingsApi.getBlockList(request); + return this.chatApi.getBlockList(request); }; updateBlockList = ( name: string, updateBlockListRequest: UpdateBlockListRequest, ) => { - return this.settingsApi.updateBlockList({ name, updateBlockListRequest }); + return this.chatApi.updateBlockList({ name, updateBlockListRequest }); }; deleteBlockList = (request: DeleteBlockListRequest) => { - return this.settingsApi.deleteBlockList(request); + return this.chatApi.deleteBlockList(request); }; createChannelType = (createChannelTypeRequest: CreateChannelTypeRequest) => { - return this.channelTypesApi.createChannelType({ createChannelTypeRequest }); + return this.chatApi.createChannelType({ createChannelTypeRequest }); }; deleteChannelType = (request: DeleteChannelTypeRequest) => { - return this.channelTypesApi.deleteChannelType(request); + return this.chatApi.deleteChannelType(request); }; getChannelType = (request: GetChannelTypeRequest) => { - return this.channelTypesApi.getChannelType(request); + return this.chatApi.getChannelType(request); }; listChannelTypes = () => { - return this.channelTypesApi.listChannelTypes(); + return this.chatApi.listChannelTypes(); }; updateChannelType = ( name: string, updateChannelTypeRequest: UpdateChannelTypeRequest, ) => { - return this.channelTypesApi.updateChannelType({ + return this.chatApi.updateChannelType({ name, updateChannelTypeRequest, }); }; queryChannels = (queryChannelsRequest?: QueryChannelsRequest) => { - return this.channelsApi.queryChannels({ - queryChannelsRequest: queryChannelsRequest ?? null, + return this.chatApi.queryChannels({ + queryChannelsRequest: queryChannelsRequest ?? {}, }); }; searchMessages = (payload?: SearchRequest) => { - return this.channelsApi.search({ payload }); + return this.chatApi.search({ payload }); }; exportChannels = (exportChannelsRequest?: ExportChannelsRequest) => { - return this.channelsApi.exportChannels({ + return this.chatApi.exportChannels({ exportChannelsRequest: exportChannelsRequest ?? null, }); }; getExportStatus = (request: GetExportChannelsStatusRequest) => { - return this.channelsApi.getExportChannelsStatus(request); + return this.chatApi.getExportChannelsStatus(request); }; listCommands = () => { - return this.commandsApi.listCommands(); + return this.chatApi.listCommands(); }; createCommand = (createCommandRequest: CreateCommandRequest) => { - return this.commandsApi.createCommand({ createCommandRequest }); + return this.chatApi.createCommand({ createCommandRequest }); }; getCommand = (getCommandRequest: GetCommandRequest) => { - return this.commandsApi.getCommand(getCommandRequest); + return this.chatApi.getCommand(getCommandRequest); }; updateCommand = ( name: string, updateCommandRequest: UpdateCommandRequest, ) => { - return this.commandsApi.updateCommand({ name, updateCommandRequest }); + return this.chatApi.updateCommand({ name, updateCommandRequest }); }; deleteCommand = (request: DeleteCommandRequest) => { - return this.commandsApi.deleteCommand(request); + return this.chatApi.deleteCommand(request); }; } diff --git a/src/StreamClient.ts b/src/StreamClient.ts index 21f4ebb..9f93937 100644 --- a/src/StreamClient.ts +++ b/src/StreamClient.ts @@ -3,48 +3,39 @@ import { StreamVideoClient } from './StreamVideoClient'; import { APIError, BanRequest, + BlockUsersRequest, CheckPushRequest, CreateDeviceRequest, + CreateGuestRequest, CreateRoleRequest, DeactivateUserRequest, DeactivateUsersRequest, DeleteDeviceRequest, DeletePushProviderRequest, DeleteRoleRequest, - DeleteUserRequest, DeleteUsersRequest, - DevicesApi, - EventsApi, ExportUserRequest, ExportUsersRequest, FlagRequest, + GetBlockedUsersRequest, GetPermissionRequest, GetTaskRequest, - GuestRequest, ListDevicesRequest, MuteUserRequest, - PermissionsV2Api, - PushApi, - PushProviderRequest, + ProductchatApi, + PushProvider, QueryBannedUsersRequest, - QueryUsersRequest, + QueryUsersPayload, ReactivateUserRequest, ReactivateUsersRequest, RestoreUsersRequest, - ServerSideApi, - SettingsApi, - TasksApi, - TestingApi, UnbanRequest, + UnblockUsersRequest, UnmuteUserRequest, UpdateAppRequest, UpdateUserPartialRequest, UpdateUsersRequest, UserCustomEventRequest, - UserObject, - UserObjectRequest, - UserResponse, - UsersApi, } from './gen/chat'; import { Configuration, @@ -69,15 +60,7 @@ export class StreamClient { public readonly video: StreamVideoClient; public readonly chat: StreamChatClient; public readonly options: StreamClientOptions = {}; - private readonly usersApi: UsersApi; - private readonly devicesApi: DevicesApi; - private readonly pushApi: PushApi; - private readonly serversideApi: ServerSideApi; - private readonly testingApi: TestingApi; - private readonly permissionsApi: PermissionsV2Api; - private readonly settingsApi: SettingsApi; - private readonly eventsApi: EventsApi; - private readonly tasksApi: TasksApi; + private readonly chatApi: ProductchatApi; private readonly token: string; private static readonly DEFAULT_TIMEOUT = 3000; @@ -109,23 +92,7 @@ export class StreamClient { const chatConfiguration = this.getConfiguration(); /** @ts-expect-error */ - this.usersApi = new UsersApi(chatConfiguration); - /** @ts-expect-error */ - this.devicesApi = new DevicesApi(chatConfiguration); - /** @ts-expect-error */ - this.pushApi = new PushApi(chatConfiguration); - /** @ts-expect-error */ - this.serversideApi = new ServerSideApi(chatConfiguration); - /** @ts-expect-error */ - this.testingApi = new TestingApi(chatConfiguration); - /** @ts-expect-error */ - this.permissionsApi = new PermissionsV2Api(chatConfiguration); - /** @ts-expect-error */ - this.settingsApi = new SettingsApi(chatConfiguration); - /** @ts-expect-error */ - this.eventsApi = new EventsApi(chatConfiguration); - /** @ts-expect-error */ - this.tasksApi = new TasksApi(chatConfiguration); + this.chatApi = new ProductchatApi(chatConfiguration); } /** @@ -190,246 +157,160 @@ export class StreamClient { } createDevice = (createDeviceRequest: CreateDeviceRequest) => { - return this.devicesApi.createDevice({ createDeviceRequest }); + return this.chatApi.createDevice({ createDeviceRequest }); }; deleteDevice = (requestParameters: DeleteDeviceRequest) => { - return this.devicesApi.deleteDevice(requestParameters); + return this.chatApi.deleteDevice(requestParameters); }; listDevices = (requestParameters: ListDevicesRequest) => { - return this.devicesApi.listDevices(requestParameters); + return this.chatApi.listDevices(requestParameters); }; listPushProviders = () => { - return this.pushApi.listPushProviders(); + return this.chatApi.listPushProviders(); }; deletePushProvider = (request: DeletePushProviderRequest) => { - return this.pushApi.deletePushProvider(request); + return this.chatApi.deletePushProvider(request); }; - upsertPushProvider = (request: PushProviderRequest) => { - return this.serversideApi.upsertPushProvider({ + upsertPushProvider = (request: PushProvider) => { + return this.chatApi.upsertPushProvider({ upsertPushProviderRequest: { push_provider: request }, }); }; checkPush = (checkPushRequest: CheckPushRequest) => { - return this.testingApi.checkPush({ checkPushRequest }); + return this.chatApi.checkPush({ checkPushRequest }); }; - createGuest = async (guestRequest: GuestRequest) => { - guestRequest.user = this.mapCustomDataBeforeSend(guestRequest.user); - const response = await this.usersApi.createGuest({ guestRequest }); - response.user = this.mapCustomDataAfterReceive(response.user); - - return response; + createGuest = (createGuestRequest: CreateGuestRequest) => { + return this.chatApi.createGuest({ createGuestRequest }); }; banUser = (banRequest: BanRequest) => { - banRequest.user = this.mapCustomDataBeforeSend(banRequest.user); - banRequest.banned_by = this.mapCustomDataBeforeSend(banRequest.banned_by); - return this.usersApi.ban({ banRequest }); + return this.chatApi.ban({ banRequest }); }; - deactivateUser = async (deactivateUserRequest: DeactivateUserRequest) => { - const response = await this.usersApi.deactivateUser({ + deactivateUser = ( + deactivateUserRequest: DeactivateUserRequest & { user_id: string }, + ) => { + return this.chatApi.deactivateUser({ deactivateUserRequest, userId: deactivateUserRequest.user_id, }); - response.user = this.mapCustomDataAfterReceive(response.user); - - return response; }; deactivateUsers = (deactivateUsersRequest: DeactivateUsersRequest) => { - return this.usersApi.deactivateUsers({ deactivateUsersRequest }); - }; - - /** - * @deprecated use `deleteUsers` instead - * @param deleteUsersRequest - * @returns - */ - deleteUser = async (request: DeleteUserRequest) => { - const response = await this.usersApi.deleteUser(request); - response.user = this.mapCustomDataAfterReceive(response.user); - - return response; + return this.chatApi.deactivateUsers({ deactivateUsersRequest }); }; deleteUsers = (deleteUsersRequest: DeleteUsersRequest) => { - return this.usersApi.deleteUsers({ deleteUsersRequest }); + return this.chatApi.deleteUsers({ deleteUsersRequest }); }; exportUser = (request: ExportUserRequest) => { - return this.usersApi.exportUser(request); + return this.chatApi.exportUser(request); }; exportUsers = (exportUsersRequest: ExportUsersRequest) => { - return this.usersApi.exportUsers({ exportUsersRequest }); + return this.chatApi.exportUsers({ exportUsersRequest }); }; - flag = async (flagRequest: FlagRequest) => { - flagRequest.user = this.mapCustomDataBeforeSend(flagRequest.user); - const response = await this.usersApi.flag({ flagRequest }); - if (response.flag?.user) { - response.flag.user = this.mapCustomDataAfterReceive(response.flag?.user); - } - - return response; + flag = (flagRequest: FlagRequest) => { + return this.chatApi.flag({ flagRequest }); }; - queryBannedUsers = async (payload: QueryBannedUsersRequest) => { - payload.user = this.mapCustomDataBeforeSend(payload.user); - const response = await this.usersApi.queryBannedUsers({ payload }); - response.bans.forEach((b) => { - b.banned_by = this.mapCustomDataAfterReceive(b.banned_by); - b.user = this.mapCustomDataAfterReceive(b.user); - }); - - return response; + queryBannedUsers = (payload: QueryBannedUsersRequest) => { + return this.chatApi.queryBannedUsers({ payload }); }; - queryUsers = async (payload: QueryUsersRequest) => { - payload.user = this.mapCustomDataBeforeSend(payload.user); - const response = await this.usersApi.queryUsers({ payload }); - /** @ts-expect-error */ - response.users = response.users.map((u) => - this.mapCustomDataAfterReceive(u), - ); - - return response; + queryUsers = (payload: QueryUsersPayload) => { + return this.chatApi.queryUsers({ payload }); }; - reactivateUser = async (reactivateUserRequest: ReactivateUserRequest) => { - const response = await this.usersApi.reactivateUser({ + reactivateUser = ( + reactivateUserRequest: ReactivateUserRequest & { user_id: string }, + ) => { + return this.chatApi.reactivateUser({ reactivateUserRequest, userId: reactivateUserRequest.user_id, }); - response.user = this.mapCustomDataAfterReceive(response.user); }; reactivateUsers = (reactivateUsersRequest: ReactivateUsersRequest) => { - return this.usersApi.reactivateUsers({ reactivateUsersRequest }); + return this.chatApi.reactivateUsers({ reactivateUsersRequest }); }; restoreUsers = (restoreUsersRequest: RestoreUsersRequest) => { - return this.usersApi.restoreUsers({ restoreUsersRequest }); + return this.chatApi.restoreUsers({ restoreUsersRequest }); }; unbanUser = (request: UnbanRequest) => { - return this.usersApi.unban(request); + return this.chatApi.unban(request); }; - unflag = async (flagRequest: FlagRequest) => { - const response = await this.usersApi.unflag({ flagRequest }); - if (response.flag?.user) { - response.flag.user = this.mapCustomDataAfterReceive(response.flag.user); - } - - return response; + upsertUsers = (updateUsersRequest: UpdateUsersRequest) => { + return this.chatApi.updateUsers({ updateUsersRequest }); }; - upsertUsers = async (updateUsersRequest: UpdateUsersRequest) => { - Object.keys(updateUsersRequest.users).forEach((key) => { - updateUsersRequest.users[key] = this.mapCustomDataBeforeSend( - updateUsersRequest.users[key], - ); - }); - const response = await this.usersApi.updateUsers({ updateUsersRequest }); - Object.keys(response.users).forEach((key) => { - response.users[key] = this.mapCustomDataAfterReceive( - response.users[key], - )!; + updateUsersPartial = (request: { users: UpdateUserPartialRequest[] }) => { + return this.chatApi.updateUsersPartial({ + updateUsersPartialRequest: request, }); - - return response; }; - updateUsersPartial = async (request: { - users: UpdateUserPartialRequest[]; - }) => { - const response = await this.usersApi.updateUsersPartial({ - /** @ts-expect-error */ - updateUserPartialRequest: request, - }); - Object.keys(response.users).forEach((key) => { - response.users[key] = this.mapCustomDataAfterReceive( - response.users[key], - )!; - }); - - return response; - }; - - muteUser = async (muteUserRequest: MuteUserRequest) => { - muteUserRequest.user = this.mapCustomDataBeforeSend(muteUserRequest.user); - const response = await this.usersApi.muteUser({ muteUserRequest }); - if (response.mute?.user) { - response.mute.user = this.mapCustomDataAfterReceive(response.mute?.user); - } - if (response.mutes) { - response.mutes = response.mutes.map((m) => { - return { - ...m, - user: this.mapCustomDataAfterReceive(m.user), - }; - }); - } - - return response; + muteUser = (muteUserRequest: MuteUserRequest) => { + return this.chatApi.muteUser({ muteUserRequest }); }; unmuteUser = (unmuteUserRequest: UnmuteUserRequest) => { - unmuteUserRequest.user = this.mapCustomDataBeforeSend( - unmuteUserRequest.user, - ); - return this.usersApi.unmuteUser({ unmuteUserRequest }); + return this.chatApi.unmuteUser({ unmuteUserRequest }); }; sendCustomEventToUser = (userId: string, event: UserCustomEventRequest) => { - return this.eventsApi.sendUserCustomEvent({ + return this.chatApi.sendUserCustomEvent({ userId, sendUserCustomEventRequest: { event }, }); }; createRole = (createRoleRequest: CreateRoleRequest) => { - return this.permissionsApi.createRole({ createRoleRequest }); + return this.chatApi.createRole({ createRoleRequest }); }; deleteRole = (request: DeleteRoleRequest) => { - return this.permissionsApi.deleteRole(request); + return this.chatApi.deleteRole(request); }; getPermission = (request: GetPermissionRequest) => { - return this.permissionsApi.getPermission(request); + return this.chatApi.getPermission(request); }; listPermissions = () => { - return this.permissionsApi.listPermissions(); + return this.chatApi.listPermissions(); }; listRoles = () => { - return this.permissionsApi.listRoles(); + return this.chatApi.listRoles(); }; getAppSettings = () => { - return this.settingsApi.getApp(); + return this.chatApi.getApp(); }; updateAppSettings = (updateAppRequest: UpdateAppRequest) => { - return this.settingsApi.updateApp({ updateAppRequest }); + return this.chatApi.updateApp({ updateAppRequest }); }; getRateLimits = () => { - return this.settingsApi.getRateLimits(); + return this.chatApi.getRateLimits(); }; getTaskStatus = (request: GetTaskRequest) => { - return this.tasksApi.getTask(request); + return this.chatApi.getTask(request); }; verifyWebhook = (requestBody: string | Buffer, xSignature: string) => { @@ -446,6 +327,18 @@ export class StreamClient { } }; + blockUsers = (blockUsersRequest: BlockUsersRequest) => { + return this.chatApi.blockUsers({ blockUsersRequest }); + }; + + unblockUsers = (unblockUsersRequest: UnblockUsersRequest) => { + return this.chatApi.unblockUsers({ unblockUsersRequest }); + }; + + getBlockedUsers = (request: GetBlockedUsersRequest) => { + return this.chatApi.getBlockedUsers(request); + }; + getConfiguration = (product: 'chat' | 'video' = 'chat') => { return new Configuration({ apiKey: (name: string) => { @@ -536,58 +429,4 @@ export class StreamClient { }, }); }; - - private readonly reservedKeywords = [ - 'ban_expires', - 'banned', - 'id', - 'invisible', - 'language', - 'push_notifications', - 'revoke_tokens_issued_before', - 'role', - 'teams', - 'created_at', - 'deactivated_at', - 'deleted_at', - 'last_active', - 'online', - 'updated_at', - 'shadow_banned', - 'name', - 'image', - ]; - - private readonly mapCustomDataBeforeSend = ( - user: UserObject | UserObjectRequest | UserResponse | undefined, - ) => { - if (!user) { - return undefined; - } - const copy = { ...user }; - delete copy.custom; - return { ...copy, ...user.custom }; - }; - - private mapCustomDataAfterReceive( - user: T, - ) { - if (!user) { - return undefined; - } - /** @ts-expect-error */ - const result: UserObject | UserResponse = {}; - Object.keys(user).forEach((key) => { - if (!this.reservedKeywords.includes(key)) { - if (!result.custom) { - result.custom = {}; - } - result.custom[key] = (user as any)[key]; - } else { - result[key] = (user as any)[key]; - } - }); - - return result; - } } diff --git a/src/gen/chat/.openapi-generator/FILES b/src/gen/chat/.openapi-generator/FILES index 9ae0ffe..abe13fd 100644 --- a/src/gen/chat/.openapi-generator/FILES +++ b/src/gen/chat/.openapi-generator/FILES @@ -1,23 +1,5 @@ .openapi-generator-ignore -apis/ChannelTypesApi.ts -apis/ChannelsApi.ts -apis/CustomCommandsApi.ts -apis/DefaultApi.ts -apis/DevicesApi.ts -apis/EventsApi.ts -apis/FilesApi.ts -apis/GDPRApi.ts -apis/ImportsApi.ts -apis/MessagesApi.ts -apis/ModerationApi.ts -apis/PermissionsV2Api.ts -apis/PushApi.ts -apis/ReactionsApi.ts -apis/ServerSideApi.ts -apis/SettingsApi.ts -apis/TasksApi.ts -apis/TestingApi.ts -apis/UsersApi.ts +apis/ProductchatApi.ts apis/index.ts index.ts models/index.ts diff --git a/src/gen/chat/apis/ChannelTypesApi.ts b/src/gen/chat/apis/ChannelTypesApi.ts deleted file mode 100644 index dddb500..0000000 --- a/src/gen/chat/apis/ChannelTypesApi.ts +++ /dev/null @@ -1,275 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateChannelTypeRequest, - CreateChannelTypeResponse, - ListChannelTypesResponse, - Response, - UpdateChannelTypeRequest, - UpdateChannelTypeResponse, -} from '../models'; - -export interface CreateChannelTypeOperationRequest { - createChannelTypeRequest: CreateChannelTypeRequest | null; -} - -export interface DeleteChannelTypeRequest { - name: string; -} - -export interface GetChannelTypeRequest { - name: string; -} - -export interface UpdateChannelTypeOperationRequest { - name: string; - updateChannelTypeRequest: UpdateChannelTypeRequest | null; -} - -/** - * - */ -export class ChannelTypesApi extends runtime.BaseAPI { - - /** - * Creates new channel type - * Create channel type - */ - async createChannelTypeRaw(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createChannelTypeRequest === null || requestParameters.createChannelTypeRequest === undefined) { - throw new runtime.RequiredError('createChannelTypeRequest','Required parameter requestParameters.createChannelTypeRequest was null or undefined when calling createChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createChannelTypeRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates new channel type - * Create channel type - */ - async createChannelType(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes channel type - * Delete channel type - */ - async deleteChannelTypeRaw(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes channel type - * Delete channel type - */ - async deleteChannelType(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Gets channel type - * Get channel type - */ - async getChannelTypeRaw(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets channel type - * Get channel type - */ - async getChannelType(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Lists all available channel types - * List channel types - */ - async listChannelTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Lists all available channel types - * List channel types - */ - async listChannelTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listChannelTypesRaw(initOverrides); - return await response.value(); - } - - /** - * Updates channel type - * Update channel type - */ - async updateChannelTypeRaw(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateChannelType.'); - } - - if (requestParameters.updateChannelTypeRequest === null || requestParameters.updateChannelTypeRequest === undefined) { - throw new runtime.RequiredError('updateChannelTypeRequest','Required parameter requestParameters.updateChannelTypeRequest was null or undefined when calling updateChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateChannelTypeRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates channel type - * Update channel type - */ - async updateChannelType(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/ChannelsApi.ts b/src/gen/chat/apis/ChannelsApi.ts deleted file mode 100644 index 982700c..0000000 --- a/src/gen/chat/apis/ChannelsApi.ts +++ /dev/null @@ -1,1096 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - ChannelGetOrCreateRequest, - ChannelStateResponse, - ChannelsResponse, - DeleteChannelResponse, - DeleteChannelsRequest, - DeleteChannelsResponse, - ExportChannelsRequest, - ExportChannelsResponse, - GetExportChannelsStatusResponse, - HideChannelRequest, - HideChannelResponse, - MarkChannelsReadRequest, - MarkReadRequest, - MarkReadResponse, - MarkUnreadRequest, - MembersResponse, - MuteChannelRequest, - MuteChannelResponse, - QueryChannelsRequest, - QueryMembersRequest, - Response, - SearchRequest, - SearchResponse, - ShowChannelRequest, - ShowChannelResponse, - TruncateChannelRequest, - TruncateChannelResponse, - UnmuteChannelRequest, - UnmuteResponse, - UnreadCountsResponse, - UpdateChannelPartialRequest, - UpdateChannelPartialResponse, - UpdateChannelRequest, - UpdateChannelResponse, -} from '../models'; - -export interface DeleteChannelRequest { - type: string; - id: string; - hardDelete?: boolean; -} - -export interface DeleteChannelsOperationRequest { - deleteChannelsRequest: DeleteChannelsRequest | null; -} - -export interface ExportChannelsOperationRequest { - exportChannelsRequest: ExportChannelsRequest | null; -} - -export interface GetExportChannelsStatusRequest { - id: string; -} - -export interface GetOrCreateChannelRequest { - type: string; - id: string; - channelGetOrCreateRequest: ChannelGetOrCreateRequest | null; -} - -export interface HideChannelOperationRequest { - type: string; - id: string; - hideChannelRequest: HideChannelRequest | null; -} - -export interface MarkChannelsReadOperationRequest { - markChannelsReadRequest: MarkChannelsReadRequest | null; -} - -export interface MarkReadOperationRequest { - type: string; - id: string; - markReadRequest: MarkReadRequest | null; -} - -export interface MarkUnreadOperationRequest { - type: string; - id: string; - markUnreadRequest: MarkUnreadRequest | null; -} - -export interface MuteChannelOperationRequest { - muteChannelRequest: MuteChannelRequest | null; -} - -export interface QueryChannelsOperationRequest { - queryChannelsRequest: QueryChannelsRequest | null; -} - -export interface QueryMembersOperationRequest { - payload?: QueryMembersRequest; -} - -export interface SearchOperationRequest { - payload?: SearchRequest; -} - -export interface ShowChannelOperationRequest { - type: string; - id: string; - showChannelRequest: ShowChannelRequest | null; -} - -export interface TruncateChannelOperationRequest { - type: string; - id: string; - truncateChannelRequest: TruncateChannelRequest | null; -} - -export interface UnmuteChannelOperationRequest { - unmuteChannelRequest: UnmuteChannelRequest | null; -} - -export interface UpdateChannelOperationRequest { - type: string; - id: string; - updateChannelRequest: UpdateChannelRequest | null; -} - -export interface UpdateChannelPartialOperationRequest { - type: string; - id: string; - updateChannelPartialRequest: UpdateChannelPartialRequest | null; -} - -/** - * - */ -export class ChannelsApi extends runtime.BaseAPI { - - /** - * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel - * Delete channel - */ - async deleteChannelRaw(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteChannel.'); - } - - const queryParameters: any = {}; - - if (requestParameters.hardDelete !== undefined) { - queryParameters['hard_delete'] = requestParameters.hardDelete; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel - * Delete channel - */ - async deleteChannel(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel - * Deletes channels asynchronously - */ - async deleteChannelsRaw(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deleteChannelsRequest === null || requestParameters.deleteChannelsRequest === undefined) { - throw new runtime.RequiredError('deleteChannelsRequest','Required parameter requestParameters.deleteChannelsRequest was null or undefined when calling deleteChannels.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/delete`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deleteChannelsRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel - * Deletes channels asynchronously - */ - async deleteChannels(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteChannelsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Exports channel data to JSON file - * Export channels - */ - async exportChannelsRaw(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.exportChannelsRequest === null || requestParameters.exportChannelsRequest === undefined) { - throw new runtime.RequiredError('exportChannelsRequest','Required parameter requestParameters.exportChannelsRequest was null or undefined when calling exportChannels.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/export_channels`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.exportChannelsRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Exports channel data to JSON file - * Export channels - */ - async exportChannels(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.exportChannelsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * - * Export channels status - */ - async getExportChannelsStatusRaw(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getExportChannelsStatus.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/export_channels/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * - * Export channels status - */ - async getExportChannelsStatus(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getExportChannelsStatusRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * This method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start - * Get or create channel - */ - async getOrCreateChannelRaw(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getOrCreateChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getOrCreateChannel.'); - } - - if (requestParameters.channelGetOrCreateRequest === null || requestParameters.channelGetOrCreateRequest === undefined) { - throw new runtime.RequiredError('channelGetOrCreateRequest','Required parameter requestParameters.channelGetOrCreateRequest was null or undefined when calling getOrCreateChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/query`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.channelGetOrCreateRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * This method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start - * Get or create channel - */ - async getOrCreateChannel(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getOrCreateChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel - * Hide channel - */ - async hideChannelRaw(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling hideChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling hideChannel.'); - } - - if (requestParameters.hideChannelRequest === null || requestParameters.hideChannelRequest === undefined) { - throw new runtime.RequiredError('hideChannelRequest','Required parameter requestParameters.hideChannelRequest was null or undefined when calling hideChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/hide`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.hideChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel - * Hide channel - */ - async hideChannel(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.hideChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel - * Mark channels as read - */ - async markChannelsReadRaw(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.markChannelsReadRequest === null || requestParameters.markChannelsReadRequest === undefined) { - throw new runtime.RequiredError('markChannelsReadRequest','Required parameter requestParameters.markChannelsReadRequest was null or undefined when calling markChannelsRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/read`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markChannelsReadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel - * Mark channels as read - */ - async markChannelsRead(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markChannelsReadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel - * Mark read - */ - async markReadRaw(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markRead.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markRead.'); - } - - if (requestParameters.markReadRequest === null || requestParameters.markReadRequest === undefined) { - throw new runtime.RequiredError('markReadRequest','Required parameter requestParameters.markReadRequest was null or undefined when calling markRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/read`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markReadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel - * Mark read - */ - async markRead(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markReadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channel as unread from a specific message Required permissions: - ReadChannel - * Mark unread - */ - async markUnreadRaw(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markUnread.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markUnread.'); - } - - if (requestParameters.markUnreadRequest === null || requestParameters.markUnreadRequest === undefined) { - throw new runtime.RequiredError('markUnreadRequest','Required parameter requestParameters.markUnreadRequest was null or undefined when calling markUnread.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/unread`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markUnreadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channel as unread from a specific message Required permissions: - ReadChannel - * Mark unread - */ - async markUnread(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markUnreadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel - * Mute channel - */ - async muteChannelRaw(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.muteChannelRequest === null || requestParameters.muteChannelRequest === undefined) { - throw new runtime.RequiredError('muteChannelRequest','Required parameter requestParameters.muteChannelRequest was null or undefined when calling muteChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/mute/channel`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.muteChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel - * Mute channel - */ - async muteChannel(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.muteChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Query channels with filter query Required permissions: - ReadChannel - * Query channels - */ - async queryChannelsRaw(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.queryChannelsRequest === null || requestParameters.queryChannelsRequest === undefined) { - throw new runtime.RequiredError('queryChannelsRequest','Required parameter requestParameters.queryChannelsRequest was null or undefined when calling queryChannels.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.queryChannelsRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Query channels with filter query Required permissions: - ReadChannel - * Query channels - */ - async queryChannels(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryChannelsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter channel members Required permissions: - ReadChannel - * Query members - */ - async queryMembersRaw(requestParameters: QueryMembersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/members`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter channel members Required permissions: - ReadChannel - * Query members - */ - async queryMembers(requestParameters: QueryMembersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryMembersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Search messages across channels Required permissions: - ReadChannel - * Search messages - */ - async searchRaw(requestParameters: SearchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/search`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Search messages across channels Required permissions: - ReadChannel - * Search messages - */ - async search(requestParameters: SearchOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.searchRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Shows previously hidden channel Sends events: - channel.visible - * Show channel - */ - async showChannelRaw(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling showChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling showChannel.'); - } - - if (requestParameters.showChannelRequest === null || requestParameters.showChannelRequest === undefined) { - throw new runtime.RequiredError('showChannelRequest','Required parameter requestParameters.showChannelRequest was null or undefined when calling showChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/show`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.showChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Shows previously hidden channel Sends events: - channel.visible - * Show channel - */ - async showChannel(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.showChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel - * Truncate channel - */ - async truncateChannelRaw(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling truncateChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling truncateChannel.'); - } - - if (requestParameters.truncateChannelRequest === null || requestParameters.truncateChannelRequest === undefined) { - throw new runtime.RequiredError('truncateChannelRequest','Required parameter requestParameters.truncateChannelRequest was null or undefined when calling truncateChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/truncate`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.truncateChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel - * Truncate channel - */ - async truncateChannel(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.truncateChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel - * Unmute channel - */ - async unmuteChannelRaw(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.unmuteChannelRequest === null || requestParameters.unmuteChannelRequest === undefined) { - throw new runtime.RequiredError('unmuteChannelRequest','Required parameter requestParameters.unmuteChannelRequest was null or undefined when calling unmuteChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unmute/channel`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.unmuteChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel - * Unmute channel - */ - async unmuteChannel(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unmuteChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * UnreadCount counts - * UnreadCount counts - */ - async unreadCountsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/unread`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * UnreadCount counts - * UnreadCount counts - */ - async unreadCounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unreadCountsRaw(initOverrides); - return await response.value(); - } - - /** - * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers - * Update channel - */ - async updateChannelRaw(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannel.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannel.'); - } - - if (requestParameters.updateChannelRequest === null || requestParameters.updateChannelRequest === undefined) { - throw new runtime.RequiredError('updateChannelRequest','Required parameter requestParameters.updateChannelRequest was null or undefined when calling updateChannel.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateChannelRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers - * Update channel - */ - async updateChannel(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateChannelRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - * Partially update channel - */ - async updateChannelPartialRaw(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannelPartial.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannelPartial.'); - } - - if (requestParameters.updateChannelPartialRequest === null || requestParameters.updateChannelPartialRequest === undefined) { - throw new runtime.RequiredError('updateChannelPartialRequest','Required parameter requestParameters.updateChannelPartialRequest was null or undefined when calling updateChannelPartial.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateChannelPartialRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - * Partially update channel - */ - async updateChannelPartial(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateChannelPartialRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/CustomCommandsApi.ts b/src/gen/chat/apis/CustomCommandsApi.ts deleted file mode 100644 index f9f0045..0000000 --- a/src/gen/chat/apis/CustomCommandsApi.ts +++ /dev/null @@ -1,276 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateCommandRequest, - CreateCommandResponse, - DeleteCommandResponse, - GetCommandResponse, - ListCommandsResponse, - UpdateCommandRequest, - UpdateCommandResponse, -} from '../models'; - -export interface CreateCommandOperationRequest { - createCommandRequest: CreateCommandRequest | null; -} - -export interface DeleteCommandRequest { - name: string; -} - -export interface GetCommandRequest { - name: string; -} - -export interface UpdateCommandOperationRequest { - name: string; - updateCommandRequest: UpdateCommandRequest | null; -} - -/** - * - */ -export class CustomCommandsApi extends runtime.BaseAPI { - - /** - * Creates custom chat command - * Create command - */ - async createCommandRaw(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createCommandRequest === null || requestParameters.createCommandRequest === undefined) { - throw new runtime.RequiredError('createCommandRequest','Required parameter requestParameters.createCommandRequest was null or undefined when calling createCommand.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/commands`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createCommandRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates custom chat command - * Create command - */ - async createCommand(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createCommandRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes custom chat command - * Delete command - */ - async deleteCommandRaw(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteCommand.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes custom chat command - * Delete command - */ - async deleteCommand(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteCommandRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns custom command by its name - * Get command - */ - async getCommandRaw(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getCommand.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns custom command by its name - * Get command - */ - async getCommand(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getCommandRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns all custom commands - * List commands - */ - async listCommandsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/commands`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns all custom commands - * List commands - */ - async listCommands(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listCommandsRaw(initOverrides); - return await response.value(); - } - - /** - * Updates custom chat command - * Update command - */ - async updateCommandRaw(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateCommand.'); - } - - if (requestParameters.updateCommandRequest === null || requestParameters.updateCommandRequest === undefined) { - throw new runtime.RequiredError('updateCommandRequest','Required parameter requestParameters.updateCommandRequest was null or undefined when calling updateCommand.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateCommandRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates custom chat command - * Update command - */ - async updateCommand(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateCommandRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/DefaultApi.ts b/src/gen/chat/apis/DefaultApi.ts deleted file mode 100644 index ef803a4..0000000 --- a/src/gen/chat/apis/DefaultApi.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateCallRequest, - CreateCallResponse, - GetCallTokenRequest, - GetCallTokenResponse, - MessageResponse, -} from '../models'; - -export interface CommitMessageRequest { - id: string; -} - -export interface CreateCallOperationRequest { - type: string; - id: string; - createCallRequest: CreateCallRequest | null; -} - -export interface GetCallTokenOperationRequest { - callId: string; - getCallTokenRequest: GetCallTokenRequest | null; -} - -/** - * - */ -export class DefaultApi extends runtime.BaseAPI { - - /** - * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated - * Commit message - */ - async commitMessageRaw(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling commitMessage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/commit`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated - * Commit message - */ - async commitMessage(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.commitMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates a call Required permissions: - CreateCall - ReadChannel - * Create a call - */ - async createCallRaw(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling createCall.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling createCall.'); - } - - if (requestParameters.createCallRequest === null || requestParameters.createCallRequest === undefined) { - throw new runtime.RequiredError('createCallRequest','Required parameter requestParameters.createCallRequest was null or undefined when calling createCall.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/call`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createCallRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates a call Required permissions: - CreateCall - ReadChannel - * Create a call - */ - async createCall(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createCallRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel - * Get Call Token - */ - async getCallTokenRaw(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.callId === null || requestParameters.callId === undefined) { - throw new runtime.RequiredError('callId','Required parameter requestParameters.callId was null or undefined when calling getCallToken.'); - } - - if (requestParameters.getCallTokenRequest === null || requestParameters.getCallTokenRequest === undefined) { - throw new runtime.RequiredError('getCallTokenRequest','Required parameter requestParameters.getCallTokenRequest was null or undefined when calling getCallToken.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/calls/{call_id}`.replace(`{${"call_id"}}`, encodeURIComponent(String(requestParameters.callId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.getCallTokenRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel - * Get Call Token - */ - async getCallToken(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getCallTokenRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/DevicesApi.ts b/src/gen/chat/apis/DevicesApi.ts deleted file mode 100644 index 06f2844..0000000 --- a/src/gen/chat/apis/DevicesApi.ts +++ /dev/null @@ -1,180 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateDeviceRequest, - ListDevicesResponse, - Response, -} from '../models'; - -export interface CreateDeviceOperationRequest { - createDeviceRequest: CreateDeviceRequest | null; -} - -export interface DeleteDeviceRequest { - id?: string; - userId?: string; -} - -export interface ListDevicesRequest { - userId?: string; -} - -/** - * - */ -export class DevicesApi extends runtime.BaseAPI { - - /** - * Adds a new device to a user, if the same device already exists the call will have no effect - * Create device - */ - async createDeviceRaw(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createDeviceRequest === null || requestParameters.createDeviceRequest === undefined) { - throw new runtime.RequiredError('createDeviceRequest','Required parameter requestParameters.createDeviceRequest was null or undefined when calling createDevice.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/devices`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createDeviceRequest, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * Adds a new device to a user, if the same device already exists the call will have no effect - * Create device - */ - async createDevice(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.createDeviceRaw(requestParameters, initOverrides); - } - - /** - * Deletes one device - * Delete device - */ - async deleteDeviceRaw(requestParameters: DeleteDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.id !== undefined) { - queryParameters['id'] = requestParameters.id; - } - - if (requestParameters.userId !== undefined) { - queryParameters['user_id'] = requestParameters.userId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/devices`, - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes one device - * Delete device - */ - async deleteDevice(requestParameters: DeleteDeviceRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteDeviceRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns all available devices - * List devices - */ - async listDevicesRaw(requestParameters: ListDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.userId !== undefined) { - queryParameters['user_id'] = requestParameters.userId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/devices`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns all available devices - * List devices - */ - async listDevices(requestParameters: ListDevicesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listDevicesRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/EventsApi.ts b/src/gen/chat/apis/EventsApi.ts deleted file mode 100644 index f575bf1..0000000 --- a/src/gen/chat/apis/EventsApi.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - EventResponse, - Response, - SendEventRequest, - SendUserCustomEventRequest, -} from '../models'; - -export interface SendEventOperationRequest { - type: string; - id: string; - sendEventRequest: SendEventRequest | null; -} - -export interface SendUserCustomEventOperationRequest { - userId: string; - sendUserCustomEventRequest: SendUserCustomEventRequest | null; -} - -/** - * - */ -export class EventsApi extends runtime.BaseAPI { - - /** - * Sends event to the channel Sends events: - any Required permissions: - SendCustomEvent - * Send event - */ - async sendEventRaw(requestParameters: SendEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling sendEvent.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendEvent.'); - } - - if (requestParameters.sendEventRequest === null || requestParameters.sendEventRequest === undefined) { - throw new runtime.RequiredError('sendEventRequest','Required parameter requestParameters.sendEventRequest was null or undefined when calling sendEvent.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/event`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.sendEventRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends event to the channel Sends events: - any Required permissions: - SendCustomEvent - * Send event - */ - async sendEvent(requestParameters: SendEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.sendEventRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Sends a custom event to a user Sends events: - custom - * Send user event - */ - async sendUserCustomEventRaw(requestParameters: SendUserCustomEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling sendUserCustomEvent.'); - } - - if (requestParameters.sendUserCustomEventRequest === null || requestParameters.sendUserCustomEventRequest === undefined) { - throw new runtime.RequiredError('sendUserCustomEventRequest','Required parameter requestParameters.sendUserCustomEventRequest was null or undefined when calling sendUserCustomEvent.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/event`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.sendUserCustomEventRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends a custom event to a user Sends events: - custom - * Send user event - */ - async sendUserCustomEvent(requestParameters: SendUserCustomEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.sendUserCustomEventRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/FilesApi.ts b/src/gen/chat/apis/FilesApi.ts deleted file mode 100644 index 1bc5579..0000000 --- a/src/gen/chat/apis/FilesApi.ts +++ /dev/null @@ -1,312 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - FileDeleteResponse, - FileUploadResponse, - /** @ts-expect-error */ - ImageSizeRequest, - ImageUploadResponse, - /** @ts-expect-error */ - OnlyUserIDRequest, -} from '../models'; - -export interface DeleteFileRequest { - type: string; - id: string; - url?: string; -} - -export interface DeleteImageRequest { - type: string; - id: string; - url?: string; -} - -export interface UploadFileRequest { - type: string; - id: string; - file?: string; - user?: OnlyUserIDRequest; -} - -export interface UploadImageRequest { - type: string; - id: string; - file?: string; - uploadSizes?: Array; - user?: OnlyUserIDRequest; -} - -/** - * - */ -export class FilesApi extends runtime.BaseAPI { - - /** - * Deletes previously uploaded file Required permissions: - DeleteAttachment - * Delete file - */ - async deleteFileRaw(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteFile.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteFile.'); - } - - const queryParameters: any = {}; - - if (requestParameters.url !== undefined) { - queryParameters['url'] = requestParameters.url; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously uploaded file Required permissions: - DeleteAttachment - * Delete file - */ - async deleteFile(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteFileRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes previously uploaded image Required permissions: - DeleteAttachment - * Delete image - */ - async deleteImageRaw(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteImage.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteImage.'); - } - - const queryParameters: any = {}; - - if (requestParameters.url !== undefined) { - queryParameters['url'] = requestParameters.url; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously uploaded image Required permissions: - DeleteAttachment - * Delete image - */ - async deleteImage(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteImageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Uploads file Required permissions: - UploadAttachment - * Upload file - */ - async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadFile.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadFile.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const consumes: runtime.Consume[] = [ - { contentType: 'multipart/form-data' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters.file !== undefined) { - formParams.append('file', requestParameters.file as any); - } - - if (requestParameters.user !== undefined) { - - formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); - } - - const response = await this.request({ - path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Uploads file Required permissions: - UploadAttachment - * Upload file - */ - async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.uploadFileRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Uploads image Required permissions: - UploadAttachment - * Upload image - */ - async uploadImageRaw(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadImage.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadImage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const consumes: runtime.Consume[] = [ - { contentType: 'multipart/form-data' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters.file !== undefined) { - formParams.append('file', requestParameters.file as any); - } - - if (requestParameters.uploadSizes) { - formParams.append('upload_sizes', requestParameters.uploadSizes.join(runtime.COLLECTION_FORMATS["csv"])); - } - - if (requestParameters.user !== undefined) { - - formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); - } - - const response = await this.request({ - path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Uploads image Required permissions: - UploadAttachment - * Upload image - */ - async uploadImage(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.uploadImageRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/GDPRApi.ts b/src/gen/chat/apis/GDPRApi.ts deleted file mode 100644 index 1e7c162..0000000 --- a/src/gen/chat/apis/GDPRApi.ts +++ /dev/null @@ -1,418 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - DeactivateUserRequest, - DeactivateUserResponse, - DeactivateUsersRequest, - DeactivateUsersResponse, - DeleteChannelsRequest, - DeleteChannelsResponse, - DeleteUserResponse, - DeleteUsersRequest, - DeleteUsersResponse, - ReactivateUserRequest, - ReactivateUserResponse, - ReactivateUsersRequest, - ReactivateUsersResponse, -} from '../models'; - -export interface DeactivateUserOperationRequest { - userId: string; - deactivateUserRequest: DeactivateUserRequest | null; -} - -export interface DeactivateUsersOperationRequest { - deactivateUsersRequest: DeactivateUsersRequest | null; -} - -export interface DeleteChannelsOperationRequest { - deleteChannelsRequest: DeleteChannelsRequest | null; -} - -export interface DeleteUserRequest { - userId: string; - markMessagesDeleted?: boolean; - hardDelete?: boolean; - deleteConversationChannels?: boolean; -} - -export interface DeleteUsersOperationRequest { - deleteUsersRequest: DeleteUsersRequest | null; -} - -export interface ReactivateUserOperationRequest { - userId: string; - reactivateUserRequest: ReactivateUserRequest | null; -} - -export interface ReactivateUsersOperationRequest { - reactivateUsersRequest: ReactivateUsersRequest | null; -} - -/** - * - */ -export class GDPRApi extends runtime.BaseAPI { - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUserRaw(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deactivateUser.'); - } - - if (requestParameters.deactivateUserRequest === null || requestParameters.deactivateUserRequest === undefined) { - throw new runtime.RequiredError('deactivateUserRequest','Required parameter requestParameters.deactivateUserRequest was null or undefined when calling deactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/deactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUser(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsersRaw(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deactivateUsersRequest === null || requestParameters.deactivateUsersRequest === undefined) { - throw new runtime.RequiredError('deactivateUsersRequest','Required parameter requestParameters.deactivateUsersRequest was null or undefined when calling deactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/deactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsers(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel - * Deletes channels asynchronously - */ - async deleteChannelsRaw(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deleteChannelsRequest === null || requestParameters.deleteChannelsRequest === undefined) { - throw new runtime.RequiredError('deleteChannelsRequest','Required parameter requestParameters.deleteChannelsRequest was null or undefined when calling deleteChannels.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/delete`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deleteChannelsRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel - * Deletes channels asynchronously - */ - async deleteChannels(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteChannelsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteUser.'); - } - - const queryParameters: any = {}; - - if (requestParameters.markMessagesDeleted !== undefined) { - queryParameters['mark_messages_deleted'] = requestParameters.markMessagesDeleted; - } - - if (requestParameters.hardDelete !== undefined) { - queryParameters['hard_delete'] = requestParameters.hardDelete; - } - - if (requestParameters.deleteConversationChannels !== undefined) { - queryParameters['delete_conversation_channels'] = requestParameters.deleteConversationChannels; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsersRaw(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deleteUsersRequest === null || requestParameters.deleteUsersRequest === undefined) { - throw new runtime.RequiredError('deleteUsersRequest','Required parameter requestParameters.deleteUsersRequest was null or undefined when calling deleteUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/delete`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deleteUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsers(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUserRaw(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling reactivateUser.'); - } - - if (requestParameters.reactivateUserRequest === null || requestParameters.reactivateUserRequest === undefined) { - throw new runtime.RequiredError('reactivateUserRequest','Required parameter requestParameters.reactivateUserRequest was null or undefined when calling reactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/reactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUser(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsersRaw(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.reactivateUsersRequest === null || requestParameters.reactivateUsersRequest === undefined) { - throw new runtime.RequiredError('reactivateUsersRequest','Required parameter requestParameters.reactivateUsersRequest was null or undefined when calling reactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/reactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsers(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/ImportsApi.ts b/src/gen/chat/apis/ImportsApi.ts deleted file mode 100644 index 1bc12f5..0000000 --- a/src/gen/chat/apis/ImportsApi.ts +++ /dev/null @@ -1,222 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateImportRequest, - CreateImportResponse, - CreateImportURLRequest, - CreateImportURLResponse, - GetImportResponse, - ListImportsResponse, -} from '../models'; - -export interface CreateImportOperationRequest { - createImportRequest: CreateImportRequest | null; -} - -export interface CreateImportURLOperationRequest { - createImportURLRequest: CreateImportURLRequest | null; -} - -export interface GetImportRequest { - id: string; -} - -/** - * - */ -export class ImportsApi extends runtime.BaseAPI { - - /** - * Creates a new import - * Create import - */ - async createImportRaw(requestParameters: CreateImportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createImportRequest === null || requestParameters.createImportRequest === undefined) { - throw new runtime.RequiredError('createImportRequest','Required parameter requestParameters.createImportRequest was null or undefined when calling createImport.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/imports`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createImportRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates a new import - * Create import - */ - async createImport(requestParameters: CreateImportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createImportRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates a new import URL - * Create import URL - */ - async createImportURLRaw(requestParameters: CreateImportURLOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createImportURLRequest === null || requestParameters.createImportURLRequest === undefined) { - throw new runtime.RequiredError('createImportURLRequest','Required parameter requestParameters.createImportURLRequest was null or undefined when calling createImportURL.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/import_urls`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createImportURLRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates a new import URL - * Create import URL - */ - async createImportURL(requestParameters: CreateImportURLOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createImportURLRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Gets an import - * Get import - */ - async getImportRaw(requestParameters: GetImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getImport.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/imports/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets an import - * Get import - */ - async getImport(requestParameters: GetImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getImportRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Gets an import - * Get import - */ - async listImportsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/imports`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets an import - * Get import - */ - async listImports(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listImportsRaw(initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/MessagesApi.ts b/src/gen/chat/apis/MessagesApi.ts deleted file mode 100644 index 26d04ca..0000000 --- a/src/gen/chat/apis/MessagesApi.ts +++ /dev/null @@ -1,1475 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - FileDeleteResponse, - FileUploadResponse, - FlagRequest, - FlagResponse, - GetManyMessagesResponse, - GetOGResponse, - GetReactionsResponse, - GetRepliesResponse, - /** @ts-expect-error */ - ImageSizeRequest, - ImageUploadResponse, - MarkChannelsReadRequest, - MarkReadRequest, - MarkReadResponse, - MarkUnreadRequest, - MessageActionRequest, - MessageResponse, - MessageWithPendingMetadataResponse, - /** @ts-expect-error */ - OnlyUserIDRequest, - QueryMessageFlagsRequest, - QueryMessageFlagsResponse, - ReactionRemovalResponse, - ReactionResponse, - Response, - SearchRequest, - SearchResponse, - SendMessageRequest, - SendReactionRequest, - TranslateMessageRequest, - UpdateMessagePartialRequest, - UpdateMessageRequest, -} from '../models'; - -export interface DeleteFileRequest { - type: string; - id: string; - url?: string; -} - -export interface DeleteImageRequest { - type: string; - id: string; - url?: string; -} - -export interface DeleteMessageRequest { - id: string; - hard?: boolean; - deletedBy?: string; -} - -export interface DeleteReactionRequest { - id: string; - type: string; - userId?: string; -} - -export interface FlagOperationRequest { - flagRequest: FlagRequest | null; -} - -export interface GetManyMessagesRequest { - type: string; - id: string; - ids?: Array; -} - -export interface GetMessageRequest { - id: string; -} - -export interface GetOGRequest { - url?: string; -} - -export interface GetReactionsRequest { - id: string; - limit?: number; - offset?: number; -} - -export interface GetRepliesRequest { - parentId: string; - idGte?: string; - idGt?: string; - idLte?: string; - idLt?: string; - createdAtAfterOrEqual?: string; - createdAtAfter?: string; - createdAtBeforeOrEqual?: string; - createdAtBefore?: string; - idAround?: string; - createdAtAround?: string; -} - -export interface MarkChannelsReadOperationRequest { - markChannelsReadRequest: MarkChannelsReadRequest | null; -} - -export interface MarkReadOperationRequest { - type: string; - id: string; - markReadRequest: MarkReadRequest | null; -} - -export interface MarkUnreadOperationRequest { - type: string; - id: string; - markUnreadRequest: MarkUnreadRequest | null; -} - -export interface QueryMessageFlagsOperationRequest { - payload?: QueryMessageFlagsRequest; -} - -export interface RunMessageActionRequest { - id: string; - messageActionRequest: MessageActionRequest | null; -} - -export interface SearchOperationRequest { - payload?: SearchRequest; -} - -export interface SendMessageOperationRequest { - type: string; - id: string; - sendMessageRequest: SendMessageRequest | null; -} - -export interface SendReactionOperationRequest { - id: string; - sendReactionRequest: SendReactionRequest | null; -} - -export interface TranslateMessageOperationRequest { - id: string; - translateMessageRequest: TranslateMessageRequest | null; -} - -export interface UnflagRequest { - flagRequest: FlagRequest | null; -} - -export interface UpdateMessageOperationRequest { - id: string; - updateMessageRequest: UpdateMessageRequest | null; -} - -export interface UpdateMessagePartialOperationRequest { - id: string; - updateMessagePartialRequest: UpdateMessagePartialRequest | null; -} - -export interface UploadFileRequest { - type: string; - id: string; - file?: string; - user?: OnlyUserIDRequest; -} - -export interface UploadImageRequest { - type: string; - id: string; - file?: string; - uploadSizes?: Array; - user?: OnlyUserIDRequest; -} - -/** - * - */ -export class MessagesApi extends runtime.BaseAPI { - - /** - * Deletes previously uploaded file Required permissions: - DeleteAttachment - * Delete file - */ - async deleteFileRaw(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteFile.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteFile.'); - } - - const queryParameters: any = {}; - - if (requestParameters.url !== undefined) { - queryParameters['url'] = requestParameters.url; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously uploaded file Required permissions: - DeleteAttachment - * Delete file - */ - async deleteFile(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteFileRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes previously uploaded image Required permissions: - DeleteAttachment - * Delete image - */ - async deleteImageRaw(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteImage.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteImage.'); - } - - const queryParameters: any = {}; - - if (requestParameters.url !== undefined) { - queryParameters['url'] = requestParameters.url; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously uploaded image Required permissions: - DeleteAttachment - * Delete image - */ - async deleteImage(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteImageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes message Sends events: - message.deleted Required permissions: - DeleteMessage - * Delete message - */ - async deleteMessageRaw(requestParameters: DeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteMessage.'); - } - - const queryParameters: any = {}; - - if (requestParameters.hard !== undefined) { - queryParameters['hard'] = requestParameters.hard; - } - - if (requestParameters.deletedBy !== undefined) { - queryParameters['deleted_by'] = requestParameters.deletedBy; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes message Sends events: - message.deleted Required permissions: - DeleteMessage - * Delete message - */ - async deleteMessage(requestParameters: DeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction - * Delete reaction - */ - async deleteReactionRaw(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteReaction.'); - } - - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteReaction.'); - } - - const queryParameters: any = {}; - - if (requestParameters.userId !== undefined) { - queryParameters['user_id'] = requestParameters.userId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reaction/{type}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction - * Delete reaction - */ - async deleteReaction(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteReactionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flagRaw(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling flag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/flag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flag(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.flagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns list messages found by IDs Required permissions: - ReadChannel - * Get many messages - */ - async getManyMessagesRaw(requestParameters: GetManyMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getManyMessages.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getManyMessages.'); - } - - const queryParameters: any = {}; - - if (requestParameters.ids) { - queryParameters['ids'] = requestParameters.ids; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/messages`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns list messages found by IDs Required permissions: - ReadChannel - * Get many messages - */ - async getManyMessages(requestParameters: GetManyMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getManyMessagesRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns message by ID Required permissions: - ReadChannel - * Get message - */ - async getMessageRaw(requestParameters: GetMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getMessage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns message by ID Required permissions: - ReadChannel - * Get message - */ - async getMessage(requestParameters: GetMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Get an OpenGraph attachment for a link - * Get OG - */ - async getOGRaw(requestParameters: GetOGRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.url !== undefined) { - queryParameters['url'] = requestParameters.url; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/og`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Get an OpenGraph attachment for a link - * Get OG - */ - async getOG(requestParameters: GetOGRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getOGRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns list of reactions of specific message Required permissions: - ReadChannel - * Get reactions - */ - async getReactionsRaw(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getReactions.'); - } - - const queryParameters: any = {}; - - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; - } - - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns list of reactions of specific message Required permissions: - ReadChannel - * Get reactions - */ - async getReactions(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getReactionsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns replies (thread) of the message Required permissions: - ReadChannel - * Get replies - */ - async getRepliesRaw(requestParameters: GetRepliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.parentId === null || requestParameters.parentId === undefined) { - throw new runtime.RequiredError('parentId','Required parameter requestParameters.parentId was null or undefined when calling getReplies.'); - } - - const queryParameters: any = {}; - - if (requestParameters.idGte !== undefined) { - queryParameters['id_gte'] = requestParameters.idGte; - } - - if (requestParameters.idGt !== undefined) { - queryParameters['id_gt'] = requestParameters.idGt; - } - - if (requestParameters.idLte !== undefined) { - queryParameters['id_lte'] = requestParameters.idLte; - } - - if (requestParameters.idLt !== undefined) { - queryParameters['id_lt'] = requestParameters.idLt; - } - - if (requestParameters.createdAtAfterOrEqual !== undefined) { - queryParameters['created_at_after_or_equal'] = requestParameters.createdAtAfterOrEqual; - } - - if (requestParameters.createdAtAfter !== undefined) { - queryParameters['created_at_after'] = requestParameters.createdAtAfter; - } - - if (requestParameters.createdAtBeforeOrEqual !== undefined) { - queryParameters['created_at_before_or_equal'] = requestParameters.createdAtBeforeOrEqual; - } - - if (requestParameters.createdAtBefore !== undefined) { - queryParameters['created_at_before'] = requestParameters.createdAtBefore; - } - - if (requestParameters.idAround !== undefined) { - queryParameters['id_around'] = requestParameters.idAround; - } - - if (requestParameters.createdAtAround !== undefined) { - queryParameters['created_at_around'] = requestParameters.createdAtAround; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{parent_id}/replies`.replace(`{${"parent_id"}}`, encodeURIComponent(String(requestParameters.parentId))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns replies (thread) of the message Required permissions: - ReadChannel - * Get replies - */ - async getReplies(requestParameters: GetRepliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getRepliesRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel - * Mark channels as read - */ - async markChannelsReadRaw(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.markChannelsReadRequest === null || requestParameters.markChannelsReadRequest === undefined) { - throw new runtime.RequiredError('markChannelsReadRequest','Required parameter requestParameters.markChannelsReadRequest was null or undefined when calling markChannelsRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/read`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markChannelsReadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel - * Mark channels as read - */ - async markChannelsRead(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markChannelsReadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel - * Mark read - */ - async markReadRaw(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markRead.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markRead.'); - } - - if (requestParameters.markReadRequest === null || requestParameters.markReadRequest === undefined) { - throw new runtime.RequiredError('markReadRequest','Required parameter requestParameters.markReadRequest was null or undefined when calling markRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/read`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markReadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel - * Mark read - */ - async markRead(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markReadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Marks channel as unread from a specific message Required permissions: - ReadChannel - * Mark unread - */ - async markUnreadRaw(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markUnread.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markUnread.'); - } - - if (requestParameters.markUnreadRequest === null || requestParameters.markUnreadRequest === undefined) { - throw new runtime.RequiredError('markUnreadRequest','Required parameter requestParameters.markUnreadRequest was null or undefined when calling markUnread.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/unread`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.markUnreadRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Marks channel as unread from a specific message Required permissions: - ReadChannel - * Mark unread - */ - async markUnread(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.markUnreadRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter message flags Required permissions: - ReadMessageFlags - * Query Message Flags - */ - async queryMessageFlagsRaw(requestParameters: QueryMessageFlagsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/flags/message`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter message flags Required permissions: - ReadMessageFlags - * Query Message Flags - */ - async queryMessageFlags(requestParameters: QueryMessageFlagsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryMessageFlagsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Executes message command action with given parameters Sends events: - message.new Required permissions: - RunMessageAction - * Run message command action - */ - async runMessageActionRaw(requestParameters: RunMessageActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runMessageAction.'); - } - - if (requestParameters.messageActionRequest === null || requestParameters.messageActionRequest === undefined) { - throw new runtime.RequiredError('messageActionRequest','Required parameter requestParameters.messageActionRequest was null or undefined when calling runMessageAction.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/action`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.messageActionRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Executes message command action with given parameters Sends events: - message.new Required permissions: - RunMessageAction - * Run message command action - */ - async runMessageAction(requestParameters: RunMessageActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.runMessageActionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Search messages across channels Required permissions: - ReadChannel - * Search messages - */ - async searchRaw(requestParameters: SearchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/search`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Search messages across channels Required permissions: - ReadChannel - * Search messages - */ - async search(requestParameters: SearchOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.searchRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Sends new message to the specified channel Sends events: - message.new - message.updated Required permissions: - AddLinks - CreateMessage - PinMessage - SkipChannelCooldown - SkipMessageModeration - UseFrozenChannel - * Send new message - */ - async sendMessageRaw(requestParameters: SendMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling sendMessage.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendMessage.'); - } - - if (requestParameters.sendMessageRequest === null || requestParameters.sendMessageRequest === undefined) { - throw new runtime.RequiredError('sendMessageRequest','Required parameter requestParameters.sendMessageRequest was null or undefined when calling sendMessage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channels/{type}/{id}/message`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.sendMessageRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends new message to the specified channel Sends events: - message.new - message.updated Required permissions: - AddLinks - CreateMessage - PinMessage - SkipChannelCooldown - SkipMessageModeration - UseFrozenChannel - * Send new message - */ - async sendMessage(requestParameters: SendMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.sendMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel - * Send reaction - */ - async sendReactionRaw(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendReaction.'); - } - - if (requestParameters.sendReactionRequest === null || requestParameters.sendReactionRequest === undefined) { - throw new runtime.RequiredError('sendReactionRequest','Required parameter requestParameters.sendReactionRequest was null or undefined when calling sendReaction.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reaction`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.sendReactionRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel - * Send reaction - */ - async sendReaction(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.sendReactionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Translates message to a given language using automated translation software Sends events: - message.updated Required permissions: - ReadChannel - * Translate message - */ - async translateMessageRaw(requestParameters: TranslateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling translateMessage.'); - } - - if (requestParameters.translateMessageRequest === null || requestParameters.translateMessageRequest === undefined) { - throw new runtime.RequiredError('translateMessageRequest','Required parameter requestParameters.translateMessageRequest was null or undefined when calling translateMessage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/translate`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.translateMessageRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Translates message to a given language using automated translation software Sends events: - message.updated Required permissions: - ReadChannel - * Translate message - */ - async translateMessage(requestParameters: TranslateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.translateMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflagRaw(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling unflag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unflag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflag(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unflagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates message with new data Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage - * Update message - */ - async updateMessageRaw(requestParameters: UpdateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateMessage.'); - } - - if (requestParameters.updateMessageRequest === null || requestParameters.updateMessageRequest === undefined) { - throw new runtime.RequiredError('updateMessageRequest','Required parameter requestParameters.updateMessageRequest was null or undefined when calling updateMessage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateMessageRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates message with new data Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage - * Update message - */ - async updateMessage(requestParameters: UpdateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateMessageRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates certain fields of the message Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage - * Partially message update - */ - async updateMessagePartialRaw(requestParameters: UpdateMessagePartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateMessagePartial.'); - } - - if (requestParameters.updateMessagePartialRequest === null || requestParameters.updateMessagePartialRequest === undefined) { - throw new runtime.RequiredError('updateMessagePartialRequest','Required parameter requestParameters.updateMessagePartialRequest was null or undefined when calling updateMessagePartial.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateMessagePartialRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates certain fields of the message Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage - * Partially message update - */ - async updateMessagePartial(requestParameters: UpdateMessagePartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateMessagePartialRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Uploads file Required permissions: - UploadAttachment - * Upload file - */ - async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadFile.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadFile.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const consumes: runtime.Consume[] = [ - { contentType: 'multipart/form-data' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters.file !== undefined) { - formParams.append('file', requestParameters.file as any); - } - - if (requestParameters.user !== undefined) { - - formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); - } - - const response = await this.request({ - path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Uploads file Required permissions: - UploadAttachment - * Upload file - */ - async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.uploadFileRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Uploads image Required permissions: - UploadAttachment - * Upload image - */ - async uploadImageRaw(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadImage.'); - } - - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadImage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const consumes: runtime.Consume[] = [ - { contentType: 'multipart/form-data' }, - ]; - // @ts-ignore: canConsumeForm may be unused - const canConsumeForm = runtime.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): any }; - let useForm = false; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new URLSearchParams(); - } - - if (requestParameters.file !== undefined) { - formParams.append('file', requestParameters.file as any); - } - - if (requestParameters.uploadSizes) { - formParams.append('upload_sizes', requestParameters.uploadSizes.join(runtime.COLLECTION_FORMATS["csv"])); - } - - if (requestParameters.user !== undefined) { - - formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); - } - - const response = await this.request({ - path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: formParams, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Uploads image Required permissions: - UploadAttachment - * Upload image - */ - async uploadImage(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.uploadImageRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/ModerationApi.ts b/src/gen/chat/apis/ModerationApi.ts deleted file mode 100644 index 13323fc..0000000 --- a/src/gen/chat/apis/ModerationApi.ts +++ /dev/null @@ -1,1038 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - BanRequest, - CreateBlockListRequest, - DeactivateUserRequest, - DeactivateUserResponse, - DeactivateUsersRequest, - DeactivateUsersResponse, - DeleteUserResponse, - DeleteUsersRequest, - DeleteUsersResponse, - FlagRequest, - FlagResponse, - GetBlockListResponse, - ListBlockListResponse, - MuteUserRequest, - MuteUserResponse, - QueryBannedUsersRequest, - QueryBannedUsersResponse, - QueryMessageFlagsRequest, - QueryMessageFlagsResponse, - ReactivateUserRequest, - ReactivateUserResponse, - ReactivateUsersRequest, - ReactivateUsersResponse, - Response, - UnmuteResponse, - UnmuteUserRequest, - UpdateBlockListRequest, -} from '../models'; - -export interface BanOperationRequest { - banRequest: BanRequest | null; -} - -export interface CreateBlockListOperationRequest { - createBlockListRequest: CreateBlockListRequest | null; -} - -export interface DeactivateUserOperationRequest { - userId: string; - deactivateUserRequest: DeactivateUserRequest | null; -} - -export interface DeactivateUsersOperationRequest { - deactivateUsersRequest: DeactivateUsersRequest | null; -} - -export interface DeleteBlockListRequest { - name: string; -} - -export interface DeleteUserRequest { - userId: string; - markMessagesDeleted?: boolean; - hardDelete?: boolean; - deleteConversationChannels?: boolean; -} - -export interface DeleteUsersOperationRequest { - deleteUsersRequest: DeleteUsersRequest | null; -} - -export interface FlagOperationRequest { - flagRequest: FlagRequest | null; -} - -export interface GetBlockListRequest { - name: string; -} - -export interface MuteUserOperationRequest { - muteUserRequest: MuteUserRequest | null; -} - -export interface QueryBannedUsersOperationRequest { - payload?: QueryBannedUsersRequest; -} - -export interface QueryMessageFlagsOperationRequest { - payload?: QueryMessageFlagsRequest; -} - -export interface ReactivateUserOperationRequest { - userId: string; - reactivateUserRequest: ReactivateUserRequest | null; -} - -export interface ReactivateUsersOperationRequest { - reactivateUsersRequest: ReactivateUsersRequest | null; -} - -export interface UnbanRequest { - targetUserId?: string; - type?: string; - id?: string; - createdBy?: string; -} - -export interface UnflagRequest { - flagRequest: FlagRequest | null; -} - -export interface UnmuteUserOperationRequest { - unmuteUserRequest: UnmuteUserRequest | null; -} - -export interface UpdateBlockListOperationRequest { - name: string; - updateBlockListRequest: UpdateBlockListRequest | null; -} - -/** - * - */ -export class ModerationApi extends runtime.BaseAPI { - - /** - * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser - * Ban user - */ - async banRaw(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.banRequest === null || requestParameters.banRequest === undefined) { - throw new runtime.RequiredError('banRequest','Required parameter requestParameters.banRequest was null or undefined when calling ban.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/ban`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.banRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser - * Ban user - */ - async ban(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.banRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates a new application blocklist, once created the blocklist can be used by any channel type - * Create block list - */ - async createBlockListRaw(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createBlockListRequest === null || requestParameters.createBlockListRequest === undefined) { - throw new runtime.RequiredError('createBlockListRequest','Required parameter requestParameters.createBlockListRequest was null or undefined when calling createBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createBlockListRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates a new application blocklist, once created the blocklist can be used by any channel type - * Create block list - */ - async createBlockList(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUserRaw(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deactivateUser.'); - } - - if (requestParameters.deactivateUserRequest === null || requestParameters.deactivateUserRequest === undefined) { - throw new runtime.RequiredError('deactivateUserRequest','Required parameter requestParameters.deactivateUserRequest was null or undefined when calling deactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/deactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUser(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsersRaw(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deactivateUsersRequest === null || requestParameters.deactivateUsersRequest === undefined) { - throw new runtime.RequiredError('deactivateUsersRequest','Required parameter requestParameters.deactivateUsersRequest was null or undefined when calling deactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/deactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsers(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes previously created application blocklist - * Delete block list - */ - async deleteBlockListRaw(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously created application blocklist - * Delete block list - */ - async deleteBlockList(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteUser.'); - } - - const queryParameters: any = {}; - - if (requestParameters.markMessagesDeleted !== undefined) { - queryParameters['mark_messages_deleted'] = requestParameters.markMessagesDeleted; - } - - if (requestParameters.hardDelete !== undefined) { - queryParameters['hard_delete'] = requestParameters.hardDelete; - } - - if (requestParameters.deleteConversationChannels !== undefined) { - queryParameters['delete_conversation_channels'] = requestParameters.deleteConversationChannels; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsersRaw(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deleteUsersRequest === null || requestParameters.deleteUsersRequest === undefined) { - throw new runtime.RequiredError('deleteUsersRequest','Required parameter requestParameters.deleteUsersRequest was null or undefined when calling deleteUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/delete`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deleteUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsers(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flagRaw(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling flag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/flag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flag(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.flagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns block list by given name - * Get block list - */ - async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns block list by given name - * Get block list - */ - async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns all available block lists - * List block lists - */ - async listBlockListsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns all available block lists - * List block lists - */ - async listBlockLists(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listBlockListsRaw(initOverrides); - return await response.value(); - } - - /** - * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser - * Mute user - */ - async muteUserRaw(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.muteUserRequest === null || requestParameters.muteUserRequest === undefined) { - throw new runtime.RequiredError('muteUserRequest','Required parameter requestParameters.muteUserRequest was null or undefined when calling muteUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/mute`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.muteUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser - * Mute user - */ - async muteUser(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.muteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter channel scoped or global user bans Required permissions: - ReadChannel - * Query Banned Users - */ - async queryBannedUsersRaw(requestParameters: QueryBannedUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/query_banned_users`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter channel scoped or global user bans Required permissions: - ReadChannel - * Query Banned Users - */ - async queryBannedUsers(requestParameters: QueryBannedUsersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryBannedUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter message flags Required permissions: - ReadMessageFlags - * Query Message Flags - */ - async queryMessageFlagsRaw(requestParameters: QueryMessageFlagsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/flags/message`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter message flags Required permissions: - ReadMessageFlags - * Query Message Flags - */ - async queryMessageFlags(requestParameters: QueryMessageFlagsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryMessageFlagsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUserRaw(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling reactivateUser.'); - } - - if (requestParameters.reactivateUserRequest === null || requestParameters.reactivateUserRequest === undefined) { - throw new runtime.RequiredError('reactivateUserRequest','Required parameter requestParameters.reactivateUserRequest was null or undefined when calling reactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/reactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUser(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsersRaw(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.reactivateUsersRequest === null || requestParameters.reactivateUsersRequest === undefined) { - throw new runtime.RequiredError('reactivateUsersRequest','Required parameter requestParameters.reactivateUsersRequest was null or undefined when calling reactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/reactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsers(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser - * Unban user - */ - async unbanRaw(requestParameters: UnbanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.targetUserId !== undefined) { - queryParameters['target_user_id'] = requestParameters.targetUserId; - } - - if (requestParameters.type !== undefined) { - queryParameters['type'] = requestParameters.type; - } - - if (requestParameters.id !== undefined) { - queryParameters['id'] = requestParameters.id; - } - - if (requestParameters.createdBy !== undefined) { - queryParameters['created_by'] = requestParameters.createdBy; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/ban`, - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser - * Unban user - */ - async unban(requestParameters: UnbanRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unbanRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflagRaw(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling unflag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unflag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflag(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unflagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser - * Unmute user - */ - async unmuteUserRaw(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.unmuteUserRequest === null || requestParameters.unmuteUserRequest === undefined) { - throw new runtime.RequiredError('unmuteUserRequest','Required parameter requestParameters.unmuteUserRequest was null or undefined when calling unmuteUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unmute`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.unmuteUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser - * Unmute user - */ - async unmuteUser(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unmuteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates contents of the block list - * Update block list - */ - async updateBlockListRaw(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateBlockList.'); - } - - if (requestParameters.updateBlockListRequest === null || requestParameters.updateBlockListRequest === undefined) { - throw new runtime.RequiredError('updateBlockListRequest','Required parameter requestParameters.updateBlockListRequest was null or undefined when calling updateBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateBlockListRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates contents of the block list - * Update block list - */ - async updateBlockList(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/PermissionsV2Api.ts b/src/gen/chat/apis/PermissionsV2Api.ts deleted file mode 100644 index 487a209..0000000 --- a/src/gen/chat/apis/PermissionsV2Api.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateRoleRequest, - CreateRoleResponse, - GetCustomPermissionResponse, - ListPermissionsResponse, - ListRolesResponse, - Response, -} from '../models'; - -export interface CreateRoleOperationRequest { - createRoleRequest: CreateRoleRequest | null; -} - -export interface DeleteRoleRequest { - name: string; -} - -export interface GetPermissionRequest { - id: string; -} - -/** - * - */ -export class PermissionsV2Api extends runtime.BaseAPI { - - /** - * Creates custom role - * Create role - */ - async createRoleRaw(requestParameters: CreateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createRoleRequest === null || requestParameters.createRoleRequest === undefined) { - throw new runtime.RequiredError('createRoleRequest','Required parameter requestParameters.createRoleRequest was null or undefined when calling createRole.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/roles`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createRoleRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates custom role - * Create role - */ - async createRole(requestParameters: CreateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createRoleRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes custom role - * Delete role - */ - async deleteRoleRaw(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteRole.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/roles/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes custom role - * Delete role - */ - async deleteRole(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteRoleRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Gets custom permission - * Get permission - */ - async getPermissionRaw(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getPermission.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/permissions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets custom permission - * Get permission - */ - async getPermission(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getPermissionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Lists all available permissions - * List permissions - */ - async listPermissionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/permissions`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Lists all available permissions - * List permissions - */ - async listPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listPermissionsRaw(initOverrides); - return await response.value(); - } - - /** - * Lists all available roles - * List roles - */ - async listRolesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/roles`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Lists all available roles - * List roles - */ - async listRoles(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listRolesRaw(initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/ProductchatApi.ts b/src/gen/chat/apis/ProductchatApi.ts new file mode 100644 index 0000000..f8576e6 --- /dev/null +++ b/src/gen/chat/apis/ProductchatApi.ts @@ -0,0 +1,7007 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Stream API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v122.3.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + APIError, + BanRequest, + BlockUsersRequest, + BlockUsersResponse, + CastPollVoteRequest, + ChannelGetOrCreateRequest, + ChannelStateResponse, + CheckExternalStorageResponse, + CheckPushRequest, + CheckPushResponse, + CheckSNSRequest, + CheckSNSResponse, + CheckSQSRequest, + CheckSQSResponse, + CreateBlockListRequest, + CreateCallRequest, + CreateCallResponse, + CreateChannelTypeRequest, + CreateChannelTypeResponse, + CreateCommandRequest, + CreateCommandResponse, + CreateDeviceRequest, + CreateExternalStorageRequest, + CreateExternalStorageResponse, + CreateGuestRequest, + CreateGuestResponse, + CreateImportRequest, + CreateImportResponse, + CreateImportURLRequest, + CreateImportURLResponse, + CreatePollOptionRequest, + CreatePollRequest, + CreateRoleRequest, + CreateRoleResponse, + DeactivateUserRequest, + DeactivateUserResponse, + DeactivateUsersRequest, + DeactivateUsersResponse, + DeleteChannelResponse, + DeleteChannelsRequest, + DeleteChannelsResponse, + DeleteCommandResponse, + DeleteExternalStorageResponse, + DeleteMessageResponse, + DeleteUsersRequest, + DeleteUsersResponse, + EventResponse, + ExportChannelsRequest, + ExportChannelsResponse, + ExportUserResponse, + ExportUsersRequest, + ExportUsersResponse, + FileDeleteResponse, + FileUploadResponse, + FlagRequest, + FlagResponse, + GetApplicationResponse, + GetBlockListResponse, + GetBlockedUsersResponse, + GetCallTokenRequest, + GetCallTokenResponse, + GetCommandResponse, + GetCustomPermissionResponse, + GetExportChannelsStatusResponse, + GetImportResponse, + GetManyMessagesResponse, + GetMessageResponse, + GetOGResponse, + GetRateLimitsResponse, + GetReactionsResponse, + GetRepliesResponse, + GetTaskResponse, + GetThreadResponse, + HideChannelRequest, + HideChannelResponse, + ImageSize, + ImageUploadResponse, + ListBlockListResponse, + ListChannelTypesResponse, + ListCommandsResponse, + ListDevicesResponse, + ListExternalStorageResponse, + ListImportsResponse, + ListPermissionsResponse, + ListPushProvidersResponse, + ListRolesResponse, + MarkChannelsReadRequest, + MarkReadRequest, + MarkReadResponse, + MarkUnreadRequest, + MembersResponse, + MessageActionRequest, + MessageResponse, + MuteChannelRequest, + MuteChannelResponse, + MuteUserRequest, + MuteUserResponse, + OnlyUserID, + PollOptionResponse, + PollResponse, + PollVoteResponse, + PollVotesResponse, + QueryBannedUsersRequest, + QueryBannedUsersResponse, + QueryChannelsRequest, + QueryChannelsResponse, + QueryMembersRequest, + QueryMessageFlagsRequest, + QueryMessageFlagsResponse, + QueryMessageHistoryRequest, + QueryMessageHistoryResponse, + QueryPollVotesRequest, + QueryPollsRequest, + QueryPollsResponse, + QueryReactionsRequest, + QueryReactionsResponse, + QueryThreadsRequest, + QueryThreadsResponse, + QueryUsersPayload, + QueryUsersResponse, + ReactionRemovalResponse, + ReactivateUserRequest, + ReactivateUserResponse, + ReactivateUsersRequest, + ReactivateUsersResponse, + Response, + RestoreUsersRequest, + SearchRequest, + SearchResponse, + SendEventRequest, + SendMessageRequest, + SendMessageResponse, + SendReactionRequest, + SendReactionResponse, + SendUserCustomEventRequest, + ShowChannelRequest, + ShowChannelResponse, + SortParam, + TranslateMessageRequest, + TruncateChannelRequest, + TruncateChannelResponse, + UnblockUsersRequest, + UnblockUsersResponse, + UnmuteChannelRequest, + UnmuteResponse, + UnmuteUserRequest, + UnreadCountsBatchRequest, + UnreadCountsBatchResponse, + UpdateAppRequest, + UpdateBlockListRequest, + UpdateChannelPartialRequest, + UpdateChannelPartialResponse, + UpdateChannelRequest, + UpdateChannelResponse, + UpdateChannelTypeRequest, + UpdateChannelTypeResponse, + UpdateCommandRequest, + UpdateCommandResponse, + UpdateExternalStorageRequest, + UpdateExternalStorageResponse, + UpdateMessagePartialRequest, + UpdateMessagePartialResponse, + UpdateMessageRequest, + UpdateMessageResponse, + UpdatePollOptionRequest, + UpdatePollPartialRequest, + UpdatePollRequest, + UpdateThreadPartialRequest, + UpdateThreadPartialResponse, + UpdateUsersPartialRequest, + UpdateUsersRequest, + UpdateUsersResponse, + UpsertPushProviderRequest, + UpsertPushProviderResponse, + WrappedUnreadCountsResponse, +} from '../models'; + +export interface BanOperationRequest { + banRequest: BanRequest | null; +} + +export interface BlockUsersOperationRequest { + blockUsersRequest: BlockUsersRequest | null; +} + +export interface CastPollVoteOperationRequest { + messageId: string; + pollId: string; + castPollVoteRequest: CastPollVoteRequest | null; +} + +export interface CheckExternalStorageRequest { + name: string; +} + +export interface CheckPushOperationRequest { + checkPushRequest: CheckPushRequest | null; +} + +export interface CheckSNSOperationRequest { + checkSNSRequest: CheckSNSRequest | null; +} + +export interface CheckSQSOperationRequest { + checkSQSRequest: CheckSQSRequest | null; +} + +export interface CommitMessageRequest { + id: string; +} + +export interface CreateBlockListOperationRequest { + createBlockListRequest: CreateBlockListRequest | null; +} + +export interface CreateCallOperationRequest { + type: string; + id: string; + createCallRequest: CreateCallRequest | null; +} + +export interface CreateChannelTypeOperationRequest { + createChannelTypeRequest: CreateChannelTypeRequest | null; +} + +export interface CreateCommandOperationRequest { + createCommandRequest: CreateCommandRequest | null; +} + +export interface CreateDeviceOperationRequest { + createDeviceRequest: CreateDeviceRequest | null; +} + +export interface CreateExternalStorageOperationRequest { + createExternalStorageRequest: CreateExternalStorageRequest | null; +} + +export interface CreateGuestOperationRequest { + createGuestRequest: CreateGuestRequest | null; +} + +export interface CreateImportOperationRequest { + createImportRequest: CreateImportRequest | null; +} + +export interface CreateImportURLOperationRequest { + createImportURLRequest: CreateImportURLRequest | null; +} + +export interface CreatePollOperationRequest { + createPollRequest: CreatePollRequest | null; +} + +export interface CreatePollOptionOperationRequest { + pollId: string; + createPollOptionRequest: CreatePollOptionRequest | null; +} + +export interface CreateRoleOperationRequest { + createRoleRequest: CreateRoleRequest | null; +} + +export interface DeactivateUserOperationRequest { + userId: string; + deactivateUserRequest: DeactivateUserRequest | null; +} + +export interface DeactivateUsersOperationRequest { + deactivateUsersRequest: DeactivateUsersRequest | null; +} + +export interface DeleteBlockListRequest { + name: string; +} + +export interface DeleteChannelRequest { + type: string; + id: string; + hardDelete?: boolean; +} + +export interface DeleteChannelTypeRequest { + name: string; +} + +export interface DeleteChannelsOperationRequest { + deleteChannelsRequest: DeleteChannelsRequest | null; +} + +export interface DeleteCommandRequest { + name: string; +} + +export interface DeleteDeviceRequest { + id: string; + userId?: string; +} + +export interface DeleteExternalStorageRequest { + name: string; +} + +export interface DeleteFileRequest { + type: string; + id: string; + url?: string; +} + +export interface DeleteImageRequest { + type: string; + id: string; + url?: string; +} + +export interface DeleteMessageRequest { + id: string; + hard?: boolean; + deletedBy?: string; +} + +export interface DeletePollRequest { + pollId: string; + userId?: string; +} + +export interface DeletePollOptionRequest { + pollId: string; + optionId: string; + userId?: string; +} + +export interface DeletePushProviderRequest { + type: DeletePushProviderTypeEnum; + name: string; +} + +export interface DeleteReactionRequest { + id: string; + type: string; + userId?: string; +} + +export interface DeleteRoleRequest { + name: string; +} + +export interface DeleteUsersOperationRequest { + deleteUsersRequest: DeleteUsersRequest | null; +} + +export interface ExportChannelsOperationRequest { + exportChannelsRequest: ExportChannelsRequest | null; +} + +export interface ExportUserRequest { + userId: string; +} + +export interface ExportUsersOperationRequest { + exportUsersRequest: ExportUsersRequest | null; +} + +export interface FlagOperationRequest { + flagRequest: FlagRequest | null; +} + +export interface GetBlockListRequest { + name: string; +} + +export interface GetBlockedUsersRequest { + userId?: string; +} + +export interface GetCallTokenOperationRequest { + getCallTokenRequest: GetCallTokenRequest | null; +} + +export interface GetCallToken0Request { + callId: string; + getCallTokenRequest: GetCallTokenRequest | null; +} + +export interface GetChannelTypeRequest { + name: string; +} + +export interface GetCommandRequest { + name: string; +} + +export interface GetExportChannelsStatusRequest { + id: string; +} + +export interface GetImportRequest { + id: string; +} + +export interface GetManyMessagesRequest { + type: string; + id: string; + ids: Array; +} + +export interface GetMessageRequest { + id: string; + showDeletedMessage?: boolean; +} + +export interface GetOGRequest { + url: string; +} + +export interface GetOrCreateChannelRequest { + type: string; + id: string; + channelGetOrCreateRequest: ChannelGetOrCreateRequest | null; +} + +export interface GetOrCreateDistinctChannelRequest { + type: string; + channelGetOrCreateRequest: ChannelGetOrCreateRequest | null; +} + +export interface GetPermissionRequest { + id: string; +} + +export interface GetPollRequest { + pollId: string; + userId?: string; +} + +export interface GetPollOptionRequest { + pollId: string; + optionId: string; + userId?: string; +} + +export interface GetRateLimitsRequest { + serverSide?: boolean; + android?: boolean; + ios?: boolean; + web?: boolean; + endpoints?: string; +} + +export interface GetReactionsRequest { + id: string; + limit?: number; + offset?: number; +} + +export interface GetRepliesRequest { + parentId: string; + sort?: Array; + limit?: number; + offset?: number; + idGte?: string; + idGt?: string; + idLte?: string; + idLt?: string; + createdAtAfterOrEqual?: string; + createdAtAfter?: string; + createdAtBeforeOrEqual?: string; + createdAtBefore?: string; + idAround?: string; + createdAtAround?: string; +} + +export interface GetTaskRequest { + id: string; +} + +export interface GetThreadRequest { + messageId: string; + connectionId?: string; + replyLimit?: number; + participantLimit?: number; + memberLimit?: number; +} + +export interface HideChannelOperationRequest { + type: string; + id: string; + hideChannelRequest: HideChannelRequest | null; +} + +export interface ListDevicesRequest { + userId?: string; +} + +export interface MarkChannelsReadOperationRequest { + markChannelsReadRequest: MarkChannelsReadRequest | null; +} + +export interface MarkReadOperationRequest { + type: string; + id: string; + markReadRequest: MarkReadRequest | null; +} + +export interface MarkUnreadOperationRequest { + type: string; + id: string; + markUnreadRequest: MarkUnreadRequest | null; +} + +export interface MuteChannelOperationRequest { + muteChannelRequest: MuteChannelRequest | null; +} + +export interface MuteUserOperationRequest { + muteUserRequest: MuteUserRequest | null; +} + +export interface QueryBannedUsersOperationRequest { + payload?: QueryBannedUsersRequest; +} + +export interface QueryChannelsOperationRequest { + queryChannelsRequest: QueryChannelsRequest | null; +} + +export interface QueryMembersOperationRequest { + payload?: QueryMembersRequest; +} + +export interface QueryMessageFlagsOperationRequest { + payload?: QueryMessageFlagsRequest; +} + +export interface QueryMessageHistoryOperationRequest { + queryMessageHistoryRequest: QueryMessageHistoryRequest | null; +} + +export interface QueryPollVotesOperationRequest { + pollId: string; + queryPollVotesRequest: QueryPollVotesRequest | null; + userId?: string; +} + +export interface QueryPollsOperationRequest { + queryPollsRequest: QueryPollsRequest | null; + userId?: string; +} + +export interface QueryReactionsOperationRequest { + id: string; + queryReactionsRequest: QueryReactionsRequest; +} + +export interface QueryThreadsOperationRequest { + queryThreadsRequest: QueryThreadsRequest | null; +} + +export interface QueryUsersRequest { + payload?: QueryUsersPayload; +} + +export interface ReactivateUserOperationRequest { + userId: string; + reactivateUserRequest: ReactivateUserRequest | null; +} + +export interface ReactivateUsersOperationRequest { + reactivateUsersRequest: ReactivateUsersRequest | null; +} + +export interface RemovePollVoteRequest { + messageId: string; + pollId: string; + voteId: string; + userId?: string; +} + +export interface RestoreUsersOperationRequest { + restoreUsersRequest: RestoreUsersRequest | null; +} + +export interface RunMessageActionRequest { + id: string; + messageActionRequest: MessageActionRequest | null; +} + +export interface SearchOperationRequest { + payload?: SearchRequest; +} + +export interface SendEventOperationRequest { + type: string; + id: string; + sendEventRequest: SendEventRequest | null; +} + +export interface SendMessageOperationRequest { + type: string; + id: string; + sendMessageRequest: SendMessageRequest | null; +} + +export interface SendReactionOperationRequest { + id: string; + sendReactionRequest: SendReactionRequest | null; +} + +export interface SendUserCustomEventOperationRequest { + userId: string; + sendUserCustomEventRequest: SendUserCustomEventRequest | null; +} + +export interface ShowChannelOperationRequest { + type: string; + id: string; + showChannelRequest: ShowChannelRequest | null; +} + +export interface TranslateMessageOperationRequest { + id: string; + translateMessageRequest: TranslateMessageRequest | null; +} + +export interface TruncateChannelOperationRequest { + type: string; + id: string; + truncateChannelRequest: TruncateChannelRequest | null; +} + +export interface UnbanRequest { + targetUserId: string; + channelCid?: string; + createdBy?: string; +} + +export interface UnblockUsersOperationRequest { + unblockUsersRequest: UnblockUsersRequest | null; +} + +export interface UndeleteMessageRequest { + id: string; + updateMessageRequest: UpdateMessageRequest | null; +} + +export interface UnmuteChannelOperationRequest { + unmuteChannelRequest: UnmuteChannelRequest | null; +} + +export interface UnmuteUserOperationRequest { + unmuteUserRequest: UnmuteUserRequest | null; +} + +export interface UnreadCountsBatchOperationRequest { + unreadCountsBatchRequest: UnreadCountsBatchRequest | null; +} + +export interface UpdateAppOperationRequest { + updateAppRequest: UpdateAppRequest | null; +} + +export interface UpdateBlockListOperationRequest { + name: string; + updateBlockListRequest: UpdateBlockListRequest | null; +} + +export interface UpdateChannelOperationRequest { + type: string; + id: string; + updateChannelRequest: UpdateChannelRequest | null; +} + +export interface UpdateChannelPartialOperationRequest { + type: string; + id: string; + updateChannelPartialRequest: UpdateChannelPartialRequest | null; +} + +export interface UpdateChannelTypeOperationRequest { + name: string; + updateChannelTypeRequest: UpdateChannelTypeRequest | null; +} + +export interface UpdateCommandOperationRequest { + name: string; + updateCommandRequest: UpdateCommandRequest | null; +} + +export interface UpdateExternalStorageOperationRequest { + name: string; + updateExternalStorageRequest: UpdateExternalStorageRequest | null; +} + +export interface UpdateMessageOperationRequest { + id: string; + updateMessageRequest: UpdateMessageRequest | null; +} + +export interface UpdateMessagePartialOperationRequest { + id: string; + updateMessagePartialRequest: UpdateMessagePartialRequest | null; +} + +export interface UpdatePollOperationRequest { + updatePollRequest: UpdatePollRequest | null; +} + +export interface UpdatePollOptionOperationRequest { + pollId: string; + updatePollOptionRequest: UpdatePollOptionRequest | null; +} + +export interface UpdatePollPartialOperationRequest { + pollId: string; + updatePollPartialRequest: UpdatePollPartialRequest | null; +} + +export interface UpdateThreadPartialOperationRequest { + messageId: string; + updateThreadPartialRequest: UpdateThreadPartialRequest | null; +} + +export interface UpdateUsersOperationRequest { + updateUsersRequest: UpdateUsersRequest | null; +} + +export interface UpdateUsersPartialOperationRequest { + updateUsersPartialRequest: UpdateUsersPartialRequest | null; +} + +export interface UploadFileRequest { + type: string; + id: string; + file?: string; + user?: OnlyUserID; +} + +export interface UploadImageRequest { + type: string; + id: string; + file?: string; + uploadSizes?: Array; + user?: OnlyUserID; +} + +export interface UpsertPushProviderOperationRequest { + upsertPushProviderRequest: UpsertPushProviderRequest | null; +} + +/** + * + */ +export class ProductchatApi extends runtime.BaseAPI { + + /** + * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser + * Ban user + */ + async banRaw(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.banRequest === null || requestParameters.banRequest === undefined) { + throw new runtime.RequiredError('banRequest','Required parameter requestParameters.banRequest was null or undefined when calling ban.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/ban`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.banRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser + * Ban user + */ + async ban(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.banRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Block users + * Block user + */ + async blockUsersRaw(requestParameters: BlockUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.blockUsersRequest === null || requestParameters.blockUsersRequest === undefined) { + throw new runtime.RequiredError('blockUsersRequest','Required parameter requestParameters.blockUsersRequest was null or undefined when calling blockUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/block`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.blockUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Block users + * Block user + */ + async blockUsers(requestParameters: BlockUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.blockUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Cast a vote on a poll Sends events: - poll.vote_casted Required permissions: - CastVote + * Cast vote + */ + async castPollVoteRaw(requestParameters: CastPollVoteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling castPollVote.'); + } + + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling castPollVote.'); + } + + if (requestParameters.castPollVoteRequest === null || requestParameters.castPollVoteRequest === undefined) { + throw new runtime.RequiredError('castPollVoteRequest','Required parameter requestParameters.castPollVoteRequest was null or undefined when calling castPollVote.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{message_id}/polls/{poll_id}/vote`.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters.messageId))).replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.castPollVoteRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Cast a vote on a poll Sends events: - poll.vote_casted Required permissions: - CastVote + * Cast vote + */ + async castPollVote(requestParameters: CastPollVoteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.castPollVoteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * Check External Storage + */ + async checkExternalStorageRaw(requestParameters: CheckExternalStorageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling checkExternalStorage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/external_storage/{name}/check`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * Check External Storage + */ + async checkExternalStorage(requestParameters: CheckExternalStorageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.checkExternalStorageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Sends a test message via push, this is a test endpoint to verify your push settings + * Check push + */ + async checkPushRaw(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.checkPushRequest === null || requestParameters.checkPushRequest === undefined) { + throw new runtime.RequiredError('checkPushRequest','Required parameter requestParameters.checkPushRequest was null or undefined when calling checkPush.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/check_push`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.checkPushRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends a test message via push, this is a test endpoint to verify your push settings + * Check push + */ + async checkPush(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.checkPushRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Validates Amazon SNS configuration + * Check SNS + */ + async checkSNSRaw(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.checkSNSRequest === null || requestParameters.checkSNSRequest === undefined) { + throw new runtime.RequiredError('checkSNSRequest','Required parameter requestParameters.checkSNSRequest was null or undefined when calling checkSNS.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/check_sns`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.checkSNSRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Validates Amazon SNS configuration + * Check SNS + */ + async checkSNS(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.checkSNSRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Validates Amazon SQS credentials + * Check SQS + */ + async checkSQSRaw(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.checkSQSRequest === null || requestParameters.checkSQSRequest === undefined) { + throw new runtime.RequiredError('checkSQSRequest','Required parameter requestParameters.checkSQSRequest was null or undefined when calling checkSQS.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/check_sqs`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.checkSQSRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Validates Amazon SQS credentials + * Check SQS + */ + async checkSQS(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.checkSQSRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated + * Commit message + */ + async commitMessageRaw(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling commitMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/commit`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Commits a pending message, which will make it visible in the channel Sends events: - message.new - message.updated + * Commit message + */ + async commitMessage(requestParameters: CommitMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commitMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new application blocklist, once created the blocklist can be used by any channel type + * Create block list + */ + async createBlockListRaw(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createBlockListRequest === null || requestParameters.createBlockListRequest === undefined) { + throw new runtime.RequiredError('createBlockListRequest','Required parameter requestParameters.createBlockListRequest was null or undefined when calling createBlockList.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/blocklists`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createBlockListRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a new application blocklist, once created the blocklist can be used by any channel type + * Create block list + */ + async createBlockList(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createBlockListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a call Required permissions: - CreateCall - ReadChannel + * Create a call + */ + async createCallRaw(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling createCall.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling createCall.'); + } + + if (requestParameters.createCallRequest === null || requestParameters.createCallRequest === undefined) { + throw new runtime.RequiredError('createCallRequest','Required parameter requestParameters.createCallRequest was null or undefined when calling createCall.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/call`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createCallRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a call Required permissions: - CreateCall - ReadChannel + * Create a call + */ + async createCall(requestParameters: CreateCallOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createCallRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates new channel type + * Create channel type + */ + async createChannelTypeRaw(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createChannelTypeRequest === null || requestParameters.createChannelTypeRequest === undefined) { + throw new runtime.RequiredError('createChannelTypeRequest','Required parameter requestParameters.createChannelTypeRequest was null or undefined when calling createChannelType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channeltypes`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createChannelTypeRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates new channel type + * Create channel type + */ + async createChannelType(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createChannelTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates custom chat command + * Create command + */ + async createCommandRaw(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createCommandRequest === null || requestParameters.createCommandRequest === undefined) { + throw new runtime.RequiredError('createCommandRequest','Required parameter requestParameters.createCommandRequest was null or undefined when calling createCommand.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/commands`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createCommandRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates custom chat command + * Create command + */ + async createCommand(requestParameters: CreateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createCommandRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Adds a new device to a user, if the same device already exists the call will have no effect + * Create device + */ + async createDeviceRaw(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createDeviceRequest === null || requestParameters.createDeviceRequest === undefined) { + throw new runtime.RequiredError('createDeviceRequest','Required parameter requestParameters.createDeviceRequest was null or undefined when calling createDevice.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/devices`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createDeviceRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Adds a new device to a user, if the same device already exists the call will have no effect + * Create device + */ + async createDevice(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createDeviceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates new external storage + * Create external storage + */ + async createExternalStorageRaw(requestParameters: CreateExternalStorageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createExternalStorageRequest === null || requestParameters.createExternalStorageRequest === undefined) { + throw new runtime.RequiredError('createExternalStorageRequest','Required parameter requestParameters.createExternalStorageRequest was null or undefined when calling createExternalStorage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/external_storage`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createExternalStorageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates new external storage + * Create external storage + */ + async createExternalStorage(requestParameters: CreateExternalStorageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createExternalStorageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * Create Guest + */ + async createGuestRaw(requestParameters: CreateGuestOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createGuestRequest === null || requestParameters.createGuestRequest === undefined) { + throw new runtime.RequiredError('createGuestRequest','Required parameter requestParameters.createGuestRequest was null or undefined when calling createGuest.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/guest`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createGuestRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * Create Guest + */ + async createGuest(requestParameters: CreateGuestOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createGuestRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new import + * Create import + */ + async createImportRaw(requestParameters: CreateImportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createImportRequest === null || requestParameters.createImportRequest === undefined) { + throw new runtime.RequiredError('createImportRequest','Required parameter requestParameters.createImportRequest was null or undefined when calling createImport.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/imports`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createImportRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a new import + * Create import + */ + async createImport(requestParameters: CreateImportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createImportRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new import URL + * Create import URL + */ + async createImportURLRaw(requestParameters: CreateImportURLOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createImportURLRequest === null || requestParameters.createImportURLRequest === undefined) { + throw new runtime.RequiredError('createImportURLRequest','Required parameter requestParameters.createImportURLRequest was null or undefined when calling createImportURL.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/import_urls`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createImportURLRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a new import URL + * Create import URL + */ + async createImportURL(requestParameters: CreateImportURLOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createImportURLRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a new poll Required permissions: - CreatePoll + * Create poll + */ + async createPollRaw(requestParameters: CreatePollOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createPollRequest === null || requestParameters.createPollRequest === undefined) { + throw new runtime.RequiredError('createPollRequest','Required parameter requestParameters.createPollRequest was null or undefined when calling createPoll.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createPollRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a new poll Required permissions: - CreatePoll + * Create poll + */ + async createPoll(requestParameters: CreatePollOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createPollRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a poll option Sends events: - poll.updated Required permissions: - CastVote - UpdatePoll + * Create poll option + */ + async createPollOptionRaw(requestParameters: CreatePollOptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling createPollOption.'); + } + + if (requestParameters.createPollOptionRequest === null || requestParameters.createPollOptionRequest === undefined) { + throw new runtime.RequiredError('createPollOptionRequest','Required parameter requestParameters.createPollOptionRequest was null or undefined when calling createPollOption.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}/options`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createPollOptionRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates a poll option Sends events: - poll.updated Required permissions: - CastVote - UpdatePoll + * Create poll option + */ + async createPollOption(requestParameters: CreatePollOptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createPollOptionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates custom role + * Create role + */ + async createRoleRaw(requestParameters: CreateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.createRoleRequest === null || requestParameters.createRoleRequest === undefined) { + throw new runtime.RequiredError('createRoleRequest','Required parameter requestParameters.createRoleRequest was null or undefined when calling createRole.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/roles`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.createRoleRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Creates custom role + * Create role + */ + async createRole(requestParameters: CreateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createRoleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deactivates user with possibility to activate it back Sends events: - user.deactivated + * Deactivate user + */ + async deactivateUserRaw(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deactivateUser.'); + } + + if (requestParameters.deactivateUserRequest === null || requestParameters.deactivateUserRequest === undefined) { + throw new runtime.RequiredError('deactivateUserRequest','Required parameter requestParameters.deactivateUserRequest was null or undefined when calling deactivateUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/{user_id}/deactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.deactivateUserRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deactivates user with possibility to activate it back Sends events: - user.deactivated + * Deactivate user + */ + async deactivateUser(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deactivateUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deactivate users in batches Sends events: - user.deactivated + * Deactivate users + */ + async deactivateUsersRaw(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.deactivateUsersRequest === null || requestParameters.deactivateUsersRequest === undefined) { + throw new runtime.RequiredError('deactivateUsersRequest','Required parameter requestParameters.deactivateUsersRequest was null or undefined when calling deactivateUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/deactivate`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.deactivateUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deactivate users in batches Sends events: - user.deactivated + * Deactivate users + */ + async deactivateUsers(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deactivateUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes previously created application blocklist + * Delete block list + */ + async deleteBlockListRaw(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteBlockList.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes previously created application blocklist + * Delete block list + */ + async deleteBlockList(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteBlockListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel + * Delete channel + */ + async deleteChannelRaw(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteChannel.'); + } + + const queryParameters: any = {}; + + if (requestParameters.hardDelete !== undefined) { + queryParameters['hard_delete'] = requestParameters.hardDelete; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes channel Sends events: - channel.deleted Required permissions: - DeleteChannel + * Delete channel + */ + async deleteChannel(requestParameters: DeleteChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes channel type + * Delete channel type + */ + async deleteChannelTypeRaw(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteChannelType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes channel type + * Delete channel type + */ + async deleteChannelType(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteChannelTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel + * Deletes channels asynchronously + */ + async deleteChannelsRaw(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.deleteChannelsRequest === null || requestParameters.deleteChannelsRequest === undefined) { + throw new runtime.RequiredError('deleteChannelsRequest','Required parameter requestParameters.deleteChannelsRequest was null or undefined when calling deleteChannels.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/delete`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.deleteChannelsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Allows to delete several channels at once asynchronously Sends events: - channel.deleted Required permissions: - DeleteChannel + * Deletes channels asynchronously + */ + async deleteChannels(requestParameters: DeleteChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteChannelsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes custom chat command + * Delete command + */ + async deleteCommandRaw(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteCommand.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes custom chat command + * Delete command + */ + async deleteCommand(requestParameters: DeleteCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteCommandRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes one device + * Delete device + */ + async deleteDeviceRaw(requestParameters: DeleteDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteDevice.'); + } + + const queryParameters: any = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/devices`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes one device + * Delete device + */ + async deleteDevice(requestParameters: DeleteDeviceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteDeviceRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes external storage + * Delete external storage + */ + async deleteExternalStorageRaw(requestParameters: DeleteExternalStorageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteExternalStorage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/external_storage/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes external storage + * Delete external storage + */ + async deleteExternalStorage(requestParameters: DeleteExternalStorageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteExternalStorageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes previously uploaded file Required permissions: - DeleteAttachment + * Delete file + */ + async deleteFileRaw(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteFile.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteFile.'); + } + + const queryParameters: any = {}; + + if (requestParameters.url !== undefined) { + queryParameters['url'] = requestParameters.url; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes previously uploaded file Required permissions: - DeleteAttachment + * Delete file + */ + async deleteFile(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteFileRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes previously uploaded image Required permissions: - DeleteAttachment + * Delete image + */ + async deleteImageRaw(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteImage.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteImage.'); + } + + const queryParameters: any = {}; + + if (requestParameters.url !== undefined) { + queryParameters['url'] = requestParameters.url; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes previously uploaded image Required permissions: - DeleteAttachment + * Delete image + */ + async deleteImage(requestParameters: DeleteImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteImageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes message Sends events: - message.deleted Required permissions: - DeleteMessage + * Delete message + */ + async deleteMessageRaw(requestParameters: DeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteMessage.'); + } + + const queryParameters: any = {}; + + if (requestParameters.hard !== undefined) { + queryParameters['hard'] = requestParameters.hard; + } + + if (requestParameters.deletedBy !== undefined) { + queryParameters['deleted_by'] = requestParameters.deletedBy; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes message Sends events: - message.deleted Required permissions: - DeleteMessage + * Delete message + */ + async deleteMessage(requestParameters: DeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes a poll Sends events: - poll.deleted Required permissions: - DeletePoll + * Delete poll + */ + async deletePollRaw(requestParameters: DeletePollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling deletePoll.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes a poll Sends events: - poll.deleted Required permissions: - DeletePoll + * Delete poll + */ + async deletePoll(requestParameters: DeletePollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deletePollRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes a poll option Sends events: - poll.updated Required permissions: - UpdatePoll + * Delete poll option + */ + async deletePollOptionRaw(requestParameters: DeletePollOptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling deletePollOption.'); + } + + if (requestParameters.optionId === null || requestParameters.optionId === undefined) { + throw new runtime.RequiredError('optionId','Required parameter requestParameters.optionId was null or undefined when calling deletePollOption.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}/options/{option_id}`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))).replace(`{${"option_id"}}`, encodeURIComponent(String(requestParameters.optionId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes a poll option Sends events: - poll.updated Required permissions: - UpdatePoll + * Delete poll option + */ + async deletePollOption(requestParameters: DeletePollOptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deletePollOptionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint + * Delete a push provider + */ + async deletePushProviderRaw(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deletePushProvider.'); + } + + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deletePushProvider.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/push_providers/{type}/{name}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint + * Delete a push provider + */ + async deletePushProvider(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deletePushProviderRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction + * Delete reaction + */ + async deleteReactionRaw(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteReaction.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteReaction.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/reaction/{type}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction + * Delete reaction + */ + async deleteReaction(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteReactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes custom role + * Delete role + */ + async deleteRoleRaw(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteRole.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/roles/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes custom role + * Delete role + */ + async deleteRole(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteRoleRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted + * Delete Users + */ + async deleteUsersRaw(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.deleteUsersRequest === null || requestParameters.deleteUsersRequest === undefined) { + throw new runtime.RequiredError('deleteUsersRequest','Required parameter requestParameters.deleteUsersRequest was null or undefined when calling deleteUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/delete`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.deleteUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted + * Delete Users + */ + async deleteUsers(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Exports channel data to JSON file + * Export channels + */ + async exportChannelsRaw(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.exportChannelsRequest === null || requestParameters.exportChannelsRequest === undefined) { + throw new runtime.RequiredError('exportChannelsRequest','Required parameter requestParameters.exportChannelsRequest was null or undefined when calling exportChannels.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/export_channels`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.exportChannelsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Exports channel data to JSON file + * Export channels + */ + async exportChannels(requestParameters: ExportChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportChannelsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Exports the user\'s profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions + * Export user + */ + async exportUserRaw(requestParameters: ExportUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling exportUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/{user_id}/export`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Exports the user\'s profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions + * Export user + */ + async exportUser(requestParameters: ExportUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Exports user profile, reactions and messages for list of given users + * Export users + */ + async exportUsersRaw(requestParameters: ExportUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.exportUsersRequest === null || requestParameters.exportUsersRequest === undefined) { + throw new runtime.RequiredError('exportUsersRequest','Required parameter requestParameters.exportUsersRequest was null or undefined when calling exportUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/export/users`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.exportUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Exports user profile, reactions and messages for list of given users + * Export users + */ + async exportUsers(requestParameters: ExportUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.exportUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser + * Flag + */ + async flagRaw(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { + throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling flag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/flag`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.flagRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser + * Flag + */ + async flag(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.flagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This Method returns the application settings + * Get App Settings + */ + async getAppRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/app`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This Method returns the application settings + * Get App Settings + */ + async getApp(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAppRaw(initOverrides); + return await response.value(); + } + + /** + * Returns block list by given name + * Get block list + */ + async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getBlockList.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns block list by given name + * Get block list + */ + async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getBlockListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get list of blocked Users + * Get list of blocked Users + */ + async getBlockedUsersRaw(requestParameters: GetBlockedUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/block`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get list of blocked Users + * Get list of blocked Users + */ + async getBlockedUsers(requestParameters: GetBlockedUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getBlockedUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel + * Get Call Token + */ + async getCallTokenRaw(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.getCallTokenRequest === null || requestParameters.getCallTokenRequest === undefined) { + throw new runtime.RequiredError('getCallTokenRequest','Required parameter requestParameters.getCallTokenRequest was null or undefined when calling getCallToken.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/calls`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.getCallTokenRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel + * Get Call Token + */ + async getCallToken(requestParameters: GetCallTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCallTokenRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel + * Get Call Token + */ + async getCallToken_1Raw(requestParameters: GetCallToken0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.callId === null || requestParameters.callId === undefined) { + throw new runtime.RequiredError('callId','Required parameter requestParameters.callId was null or undefined when calling getCallToken_1.'); + } + + if (requestParameters.getCallTokenRequest === null || requestParameters.getCallTokenRequest === undefined) { + throw new runtime.RequiredError('getCallTokenRequest','Required parameter requestParameters.getCallTokenRequest was null or undefined when calling getCallToken_1.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/calls/{call_id}`.replace(`{${"call_id"}}`, encodeURIComponent(String(requestParameters.callId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.getCallTokenRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieves the token to join a call Required permissions: - JoinCall - ReadChannel + * Get Call Token + */ + async getCallToken_1(requestParameters: GetCallToken0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCallToken_1Raw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Gets channel type + * Get channel type + */ + async getChannelTypeRaw(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getChannelType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Gets channel type + * Get channel type + */ + async getChannelType(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getChannelTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns custom command by its name + * Get command + */ + async getCommandRaw(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getCommand.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns custom command by its name + * Get command + */ + async getCommand(requestParameters: GetCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getCommandRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * Export channels status + */ + async getExportChannelsStatusRaw(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getExportChannelsStatus.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/export_channels/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * Export channels status + */ + async getExportChannelsStatus(requestParameters: GetExportChannelsStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getExportChannelsStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Gets an import + * Get import + */ + async getImportRaw(requestParameters: GetImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getImport.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/imports/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Gets an import + * Get import + */ + async getImport(requestParameters: GetImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getImportRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns list messages found by IDs Required permissions: - ReadChannel + * Get many messages + */ + async getManyMessagesRaw(requestParameters: GetManyMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getManyMessages.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getManyMessages.'); + } + + if (requestParameters.ids === null || requestParameters.ids === undefined) { + throw new runtime.RequiredError('ids','Required parameter requestParameters.ids was null or undefined when calling getManyMessages.'); + } + + const queryParameters: any = {}; + + if (requestParameters.ids) { + queryParameters['ids'] = requestParameters.ids; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/messages`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns list messages found by IDs Required permissions: - ReadChannel + * Get many messages + */ + async getManyMessages(requestParameters: GetManyMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getManyMessagesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns message by ID Required permissions: - ReadChannel + * Get message + */ + async getMessageRaw(requestParameters: GetMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getMessage.'); + } + + const queryParameters: any = {}; + + if (requestParameters.showDeletedMessage !== undefined) { + queryParameters['show_deleted_message'] = requestParameters.showDeletedMessage; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns message by ID Required permissions: - ReadChannel + * Get message + */ + async getMessage(requestParameters: GetMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get an OpenGraph attachment for a link + * Get OG + */ + async getOGRaw(requestParameters: GetOGRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.url === null || requestParameters.url === undefined) { + throw new runtime.RequiredError('url','Required parameter requestParameters.url was null or undefined when calling getOG.'); + } + + const queryParameters: any = {}; + + if (requestParameters.url !== undefined) { + queryParameters['url'] = requestParameters.url; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/og`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get an OpenGraph attachment for a link + * Get OG + */ + async getOG(requestParameters: GetOGRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getOGRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This Method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start + * Get or create channel + */ + async getOrCreateChannelRaw(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getOrCreateChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getOrCreateChannel.'); + } + + if (requestParameters.channelGetOrCreateRequest === null || requestParameters.channelGetOrCreateRequest === undefined) { + throw new runtime.RequiredError('channelGetOrCreateRequest','Required parameter requestParameters.channelGetOrCreateRequest was null or undefined when calling getOrCreateChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/query`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.channelGetOrCreateRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This Method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start + * Get or create channel + */ + async getOrCreateChannel(requestParameters: GetOrCreateChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getOrCreateChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This Method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start + * Get or create channel + */ + async getOrCreateDistinctChannelRaw(requestParameters: GetOrCreateDistinctChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getOrCreateDistinctChannel.'); + } + + if (requestParameters.channelGetOrCreateRequest === null || requestParameters.channelGetOrCreateRequest === undefined) { + throw new runtime.RequiredError('channelGetOrCreateRequest','Required parameter requestParameters.channelGetOrCreateRequest was null or undefined when calling getOrCreateDistinctChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/query`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.channelGetOrCreateRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This Method creates a channel or returns an existing one with matching attributes Sends events: - channel.created - member.added - member.removed - member.updated - user.watching.start + * Get or create channel + */ + async getOrCreateDistinctChannel(requestParameters: GetOrCreateDistinctChannelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getOrCreateDistinctChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Gets custom permission + * Get permission + */ + async getPermissionRaw(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getPermission.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/permissions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Gets custom permission + * Get permission + */ + async getPermission(requestParameters: GetPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieves a poll + * Get poll + */ + async getPollRaw(requestParameters: GetPollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling getPoll.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieves a poll + * Get poll + */ + async getPoll(requestParameters: GetPollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPollRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieves a poll option + * Get poll option + */ + async getPollOptionRaw(requestParameters: GetPollOptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling getPollOption.'); + } + + if (requestParameters.optionId === null || requestParameters.optionId === undefined) { + throw new runtime.RequiredError('optionId','Required parameter requestParameters.optionId was null or undefined when calling getPollOption.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}/options/{option_id}`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))).replace(`{${"option_id"}}`, encodeURIComponent(String(requestParameters.optionId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Retrieves a poll option + * Get poll option + */ + async getPollOption(requestParameters: GetPollOptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPollOptionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get rate limits usage and quotas + * Get rate limits + */ + async getRateLimitsRaw(requestParameters: GetRateLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.serverSide !== undefined) { + queryParameters['server_side'] = requestParameters.serverSide; + } + + if (requestParameters.android !== undefined) { + queryParameters['android'] = requestParameters.android; + } + + if (requestParameters.ios !== undefined) { + queryParameters['ios'] = requestParameters.ios; + } + + if (requestParameters.web !== undefined) { + queryParameters['web'] = requestParameters.web; + } + + if (requestParameters.endpoints !== undefined) { + queryParameters['endpoints'] = requestParameters.endpoints; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/rate_limits`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get rate limits usage and quotas + * Get rate limits + */ + async getRateLimits(requestParameters: GetRateLimitsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRateLimitsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns list of reactions of specific message Required permissions: - ReadChannel + * Get reactions + */ + async getReactionsRaw(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getReactions.'); + } + + const queryParameters: any = {}; + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/reactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns list of reactions of specific message Required permissions: - ReadChannel + * Get reactions + */ + async getReactions(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getReactionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns replies (thread) of the message Required permissions: - ReadChannel + * Get replies + */ + async getRepliesRaw(requestParameters: GetRepliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.parentId === null || requestParameters.parentId === undefined) { + throw new runtime.RequiredError('parentId','Required parameter requestParameters.parentId was null or undefined when calling getReplies.'); + } + + const queryParameters: any = {}; + + if (requestParameters.sort) { + queryParameters['sort'] = requestParameters.sort; + } + + if (requestParameters.limit !== undefined) { + queryParameters['limit'] = requestParameters.limit; + } + + if (requestParameters.offset !== undefined) { + queryParameters['offset'] = requestParameters.offset; + } + + if (requestParameters.idGte !== undefined) { + queryParameters['id_gte'] = requestParameters.idGte; + } + + if (requestParameters.idGt !== undefined) { + queryParameters['id_gt'] = requestParameters.idGt; + } + + if (requestParameters.idLte !== undefined) { + queryParameters['id_lte'] = requestParameters.idLte; + } + + if (requestParameters.idLt !== undefined) { + queryParameters['id_lt'] = requestParameters.idLt; + } + + if (requestParameters.createdAtAfterOrEqual !== undefined) { + queryParameters['created_at_after_or_equal'] = requestParameters.createdAtAfterOrEqual; + } + + if (requestParameters.createdAtAfter !== undefined) { + queryParameters['created_at_after'] = requestParameters.createdAtAfter; + } + + if (requestParameters.createdAtBeforeOrEqual !== undefined) { + queryParameters['created_at_before_or_equal'] = requestParameters.createdAtBeforeOrEqual; + } + + if (requestParameters.createdAtBefore !== undefined) { + queryParameters['created_at_before'] = requestParameters.createdAtBefore; + } + + if (requestParameters.idAround !== undefined) { + queryParameters['id_around'] = requestParameters.idAround; + } + + if (requestParameters.createdAtAround !== undefined) { + queryParameters['created_at_around'] = requestParameters.createdAtAround; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{parent_id}/replies`.replace(`{${"parent_id"}}`, encodeURIComponent(String(requestParameters.parentId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns replies (thread) of the message Required permissions: - ReadChannel + * Get replies + */ + async getReplies(requestParameters: GetRepliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRepliesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Gets status of a task + * Get status of a task + */ + async getTaskRaw(requestParameters: GetTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getTask.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Gets status of a task + * Get status of a task + */ + async getTask(requestParameters: GetTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTaskRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Return a specific thread Required permissions: - ReadChannel + * Get Thread + */ + async getThreadRaw(requestParameters: GetThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling getThread.'); + } + + const queryParameters: any = {}; + + if (requestParameters.connectionId !== undefined) { + queryParameters['connection_id'] = requestParameters.connectionId; + } + + if (requestParameters.replyLimit !== undefined) { + queryParameters['reply_limit'] = requestParameters.replyLimit; + } + + if (requestParameters.participantLimit !== undefined) { + queryParameters['participant_limit'] = requestParameters.participantLimit; + } + + if (requestParameters.memberLimit !== undefined) { + queryParameters['member_limit'] = requestParameters.memberLimit; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/threads/{message_id}`.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters.messageId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Return a specific thread Required permissions: - ReadChannel + * Get Thread + */ + async getThread(requestParameters: GetThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getThreadRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel + * Hide channel + */ + async hideChannelRaw(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling hideChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling hideChannel.'); + } + + if (requestParameters.hideChannelRequest === null || requestParameters.hideChannelRequest === undefined) { + throw new runtime.RequiredError('hideChannelRequest','Required parameter requestParameters.hideChannelRequest was null or undefined when calling hideChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/hide`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.hideChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Marks channel as hidden for current user Sends events: - channel.hidden Required permissions: - ReadChannel + * Hide channel + */ + async hideChannel(requestParameters: HideChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hideChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns all available block lists + * List block lists + */ + async listBlockListsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/blocklists`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns all available block lists + * List block lists + */ + async listBlockLists(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listBlockListsRaw(initOverrides); + return await response.value(); + } + + /** + * Lists all available channel types + * List channel types + */ + async listChannelTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channeltypes`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Lists all available channel types + * List channel types + */ + async listChannelTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listChannelTypesRaw(initOverrides); + return await response.value(); + } + + /** + * Returns all custom commands + * List commands + */ + async listCommandsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/commands`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns all custom commands + * List commands + */ + async listCommands(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listCommandsRaw(initOverrides); + return await response.value(); + } + + /** + * Returns all available devices + * List devices + */ + async listDevicesRaw(requestParameters: ListDevicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/devices`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns all available devices + * List devices + */ + async listDevices(requestParameters: ListDevicesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listDevicesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Lists external storage + * List external storage + */ + async listExternalStorageRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/external_storage`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Lists external storage + * List external storage + */ + async listExternalStorage(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listExternalStorageRaw(initOverrides); + return await response.value(); + } + + /** + * Gets an import + * Get import + */ + async listImportsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/imports`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Gets an import + * Get import + */ + async listImports(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listImportsRaw(initOverrides); + return await response.value(); + } + + /** + * Lists all available permissions + * List permissions + */ + async listPermissionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/permissions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Lists all available permissions + * List permissions + */ + async listPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPermissionsRaw(initOverrides); + return await response.value(); + } + + /** + * List details of all push providers. + * List push providers + */ + async listPushProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/push_providers`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * List details of all push providers. + * List push providers + */ + async listPushProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listPushProvidersRaw(initOverrides); + return await response.value(); + } + + /** + * Lists all available roles + * List roles + */ + async listRolesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/roles`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Lists all available roles + * List roles + */ + async listRoles(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.listRolesRaw(initOverrides); + return await response.value(); + } + + /** + * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel + * Mark channels as read + */ + async markChannelsReadRaw(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.markChannelsReadRequest === null || requestParameters.markChannelsReadRequest === undefined) { + throw new runtime.RequiredError('markChannelsReadRequest','Required parameter requestParameters.markChannelsReadRequest was null or undefined when calling markChannelsRead.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/read`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.markChannelsReadRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Marks channels as read up to the specific message. If no channels is given, mark all channel as read Sends events: - message.read Required permissions: - ReadChannel + * Mark channels as read + */ + async markChannelsRead(requestParameters: MarkChannelsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.markChannelsReadRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel + * Mark read + */ + async markReadRaw(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markRead.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markRead.'); + } + + if (requestParameters.markReadRequest === null || requestParameters.markReadRequest === undefined) { + throw new runtime.RequiredError('markReadRequest','Required parameter requestParameters.markReadRequest was null or undefined when calling markRead.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/read`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.markReadRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Marks channel as read up to the specific message Sends events: - message.read Required permissions: - ReadChannel + * Mark read + */ + async markRead(requestParameters: MarkReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.markReadRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Marks channel as unread from a specific message Required permissions: - ReadChannel + * Mark unread + */ + async markUnreadRaw(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling markUnread.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling markUnread.'); + } + + if (requestParameters.markUnreadRequest === null || requestParameters.markUnreadRequest === undefined) { + throw new runtime.RequiredError('markUnreadRequest','Required parameter requestParameters.markUnreadRequest was null or undefined when calling markUnread.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/unread`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.markUnreadRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Marks channel as unread from a specific message Required permissions: - ReadChannel + * Mark unread + */ + async markUnread(requestParameters: MarkUnreadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.markUnreadRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel + * Mute channel + */ + async muteChannelRaw(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.muteChannelRequest === null || requestParameters.muteChannelRequest === undefined) { + throw new runtime.RequiredError('muteChannelRequest','Required parameter requestParameters.muteChannelRequest was null or undefined when calling muteChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/mute/channel`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.muteChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Mutes channel for user Sends events: - channel.muted Required permissions: - MuteChannel + * Mute channel + */ + async muteChannel(requestParameters: MuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.muteChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser + * Mute user + */ + async muteUserRaw(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.muteUserRequest === null || requestParameters.muteUserRequest === undefined) { + throw new runtime.RequiredError('muteUserRequest','Required parameter requestParameters.muteUserRequest was null or undefined when calling muteUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/mute`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.muteUserRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser + * Mute user + */ + async muteUser(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.muteUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Find and filter channel scoped or global user bans Required permissions: - ReadChannel + * Query Banned Users + */ + async queryBannedUsersRaw(requestParameters: QueryBannedUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.payload !== undefined) { + queryParameters['payload'] = requestParameters.payload; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/query_banned_users`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Find and filter channel scoped or global user bans Required permissions: - ReadChannel + * Query Banned Users + */ + async queryBannedUsers(requestParameters: QueryBannedUsersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryBannedUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Query channels with filter query Required permissions: - ReadChannel + * Query channels + */ + async queryChannelsRaw(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.queryChannelsRequest === null || requestParameters.queryChannelsRequest === undefined) { + throw new runtime.RequiredError('queryChannelsRequest','Required parameter requestParameters.queryChannelsRequest was null or undefined when calling queryChannels.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryChannelsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Query channels with filter query Required permissions: - ReadChannel + * Query channels + */ + async queryChannels(requestParameters: QueryChannelsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryChannelsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Find and filter channel members Required permissions: - ReadChannel + * Query members + */ + async queryMembersRaw(requestParameters: QueryMembersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.payload !== undefined) { + queryParameters['payload'] = requestParameters.payload; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/members`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Find and filter channel members Required permissions: - ReadChannel + * Query members + */ + async queryMembers(requestParameters: QueryMembersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryMembersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Find and filter message flags Required permissions: - ReadMessageFlags + * Query Message Flags + */ + async queryMessageFlagsRaw(requestParameters: QueryMessageFlagsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.payload !== undefined) { + queryParameters['payload'] = requestParameters.payload; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/flags/message`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Find and filter message flags Required permissions: - ReadMessageFlags + * Query Message Flags + */ + async queryMessageFlags(requestParameters: QueryMessageFlagsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryMessageFlagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Queries history for one message + * Query message history + */ + async queryMessageHistoryRaw(requestParameters: QueryMessageHistoryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.queryMessageHistoryRequest === null || requestParameters.queryMessageHistoryRequest === undefined) { + throw new runtime.RequiredError('queryMessageHistoryRequest','Required parameter requestParameters.queryMessageHistoryRequest was null or undefined when calling queryMessageHistory.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/history`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryMessageHistoryRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Queries history for one message + * Query message history + */ + async queryMessageHistory(requestParameters: QueryMessageHistoryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryMessageHistoryRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Queries votes + * Query votes + */ + async queryPollVotesRaw(requestParameters: QueryPollVotesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling queryPollVotes.'); + } + + if (requestParameters.queryPollVotesRequest === null || requestParameters.queryPollVotesRequest === undefined) { + throw new runtime.RequiredError('queryPollVotesRequest','Required parameter requestParameters.queryPollVotesRequest was null or undefined when calling queryPollVotes.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}/votes`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryPollVotesRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Queries votes + * Query votes + */ + async queryPollVotes(requestParameters: QueryPollVotesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryPollVotesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Queries polls + * Query polls + */ + async queryPollsRaw(requestParameters: QueryPollsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.queryPollsRequest === null || requestParameters.queryPollsRequest === undefined) { + throw new runtime.RequiredError('queryPollsRequest','Required parameter requestParameters.queryPollsRequest was null or undefined when calling queryPolls.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/query`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryPollsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Queries polls + * Query polls + */ + async queryPolls(requestParameters: QueryPollsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryPollsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get reactions on a message Required permissions: - ReadChannel + */ + async queryReactionsRaw(requestParameters: QueryReactionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling queryReactions.'); + } + + if (requestParameters.queryReactionsRequest === null || requestParameters.queryReactionsRequest === undefined) { + throw new runtime.RequiredError('queryReactionsRequest','Required parameter requestParameters.queryReactionsRequest was null or undefined when calling queryReactions.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/reactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryReactionsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Get reactions on a message Required permissions: - ReadChannel + */ + async queryReactions(requestParameters: QueryReactionsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryReactionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns the list of threads for specific user Required permissions: - ReadChannel + * Query Threads + */ + async queryThreadsRaw(requestParameters: QueryThreadsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.queryThreadsRequest === null || requestParameters.queryThreadsRequest === undefined) { + throw new runtime.RequiredError('queryThreadsRequest','Required parameter requestParameters.queryThreadsRequest was null or undefined when calling queryThreads.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/threads`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.queryThreadsRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns the list of threads for specific user Required permissions: - ReadChannel + * Query Threads + */ + async queryThreads(requestParameters: QueryThreadsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryThreadsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Find and filter users Required permissions: - SearchUser + * Query users + */ + async queryUsersRaw(requestParameters: QueryUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.payload !== undefined) { + queryParameters['payload'] = requestParameters.payload; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Find and filter users Required permissions: - SearchUser + * Query users + */ + async queryUsers(requestParameters: QueryUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.queryUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Activates user who\'s been deactivated previously Sends events: - user.reactivated + * Reactivate user + */ + async reactivateUserRaw(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling reactivateUser.'); + } + + if (requestParameters.reactivateUserRequest === null || requestParameters.reactivateUserRequest === undefined) { + throw new runtime.RequiredError('reactivateUserRequest','Required parameter requestParameters.reactivateUserRequest was null or undefined when calling reactivateUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/{user_id}/reactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.reactivateUserRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Activates user who\'s been deactivated previously Sends events: - user.reactivated + * Reactivate user + */ + async reactivateUser(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.reactivateUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Reactivate users in batches Sends events: - user.reactivated + * Reactivate users + */ + async reactivateUsersRaw(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.reactivateUsersRequest === null || requestParameters.reactivateUsersRequest === undefined) { + throw new runtime.RequiredError('reactivateUsersRequest','Required parameter requestParameters.reactivateUsersRequest was null or undefined when calling reactivateUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/reactivate`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.reactivateUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Reactivate users in batches Sends events: - user.reactivated + * Reactivate users + */ + async reactivateUsers(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.reactivateUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a vote from a poll Sends events: - poll.vote_removed Required permissions: - CastVote + * Delete vote + */ + async removePollVoteRaw(requestParameters: RemovePollVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling removePollVote.'); + } + + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling removePollVote.'); + } + + if (requestParameters.voteId === null || requestParameters.voteId === undefined) { + throw new runtime.RequiredError('voteId','Required parameter requestParameters.voteId was null or undefined when calling removePollVote.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['user_id'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{message_id}/polls/{poll_id}/vote/{vote_id}`.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters.messageId))).replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))).replace(`{${"vote_id"}}`, encodeURIComponent(String(requestParameters.voteId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Delete a vote from a poll Sends events: - poll.vote_removed Required permissions: - CastVote + * Delete vote + */ + async removePollVote(requestParameters: RemovePollVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.removePollVoteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Restore soft deleted users + * Restore users + */ + async restoreUsersRaw(requestParameters: RestoreUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.restoreUsersRequest === null || requestParameters.restoreUsersRequest === undefined) { + throw new runtime.RequiredError('restoreUsersRequest','Required parameter requestParameters.restoreUsersRequest was null or undefined when calling restoreUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/restore`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.restoreUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Restore soft deleted users + * Restore users + */ + async restoreUsers(requestParameters: RestoreUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.restoreUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Executes message command action with given parameters Sends events: - message.new Required permissions: - RunMessageAction + * Run message command action + */ + async runMessageActionRaw(requestParameters: RunMessageActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling runMessageAction.'); + } + + if (requestParameters.messageActionRequest === null || requestParameters.messageActionRequest === undefined) { + throw new runtime.RequiredError('messageActionRequest','Required parameter requestParameters.messageActionRequest was null or undefined when calling runMessageAction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/action`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.messageActionRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Executes message command action with given parameters Sends events: - message.new Required permissions: - RunMessageAction + * Run message command action + */ + async runMessageAction(requestParameters: RunMessageActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.runMessageActionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Search messages across channels Required permissions: - ReadChannel + * Search messages + */ + async searchRaw(requestParameters: SearchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.payload !== undefined) { + queryParameters['payload'] = requestParameters.payload; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/search`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Search messages across channels Required permissions: - ReadChannel + * Search messages + */ + async search(requestParameters: SearchOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.searchRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Sends event to the channel Required permissions: - SendCustomEvent + * Send event + */ + async sendEventRaw(requestParameters: SendEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling sendEvent.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendEvent.'); + } + + if (requestParameters.sendEventRequest === null || requestParameters.sendEventRequest === undefined) { + throw new runtime.RequiredError('sendEventRequest','Required parameter requestParameters.sendEventRequest was null or undefined when calling sendEvent.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/event`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.sendEventRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends event to the channel Required permissions: - SendCustomEvent + * Send event + */ + async sendEvent(requestParameters: SendEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sendEventRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Sends new message to the specified channel Sends events: - message.new - message.updated Required permissions: - AddLinks - CreateMessage - PinMessage - SkipChannelCooldown - SkipMessageModeration - UseFrozenChannel + * Send new message + */ + async sendMessageRaw(requestParameters: SendMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling sendMessage.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendMessage.'); + } + + if (requestParameters.sendMessageRequest === null || requestParameters.sendMessageRequest === undefined) { + throw new runtime.RequiredError('sendMessageRequest','Required parameter requestParameters.sendMessageRequest was null or undefined when calling sendMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/message`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.sendMessageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends new message to the specified channel Sends events: - message.new - message.updated Required permissions: - AddLinks - CreateMessage - PinMessage - SkipChannelCooldown - SkipMessageModeration - UseFrozenChannel + * Send new message + */ + async sendMessage(requestParameters: SendMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sendMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel + * Send reaction + */ + async sendReactionRaw(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendReaction.'); + } + + if (requestParameters.sendReactionRequest === null || requestParameters.sendReactionRequest === undefined) { + throw new runtime.RequiredError('sendReactionRequest','Required parameter requestParameters.sendReactionRequest was null or undefined when calling sendReaction.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/reaction`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.sendReactionRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel + * Send reaction + */ + async sendReaction(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sendReactionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Sends a custom event to a user Sends events: - * + * Send user event + */ + async sendUserCustomEventRaw(requestParameters: SendUserCustomEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling sendUserCustomEvent.'); + } + + if (requestParameters.sendUserCustomEventRequest === null || requestParameters.sendUserCustomEventRequest === undefined) { + throw new runtime.RequiredError('sendUserCustomEventRequest','Required parameter requestParameters.sendUserCustomEventRequest was null or undefined when calling sendUserCustomEvent.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/{user_id}/event`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.sendUserCustomEventRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Sends a custom event to a user Sends events: - * + * Send user event + */ + async sendUserCustomEvent(requestParameters: SendUserCustomEventOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sendUserCustomEventRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Shows previously hidden channel Sends events: - channel.visible + * Show channel + */ + async showChannelRaw(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling showChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling showChannel.'); + } + + if (requestParameters.showChannelRequest === null || requestParameters.showChannelRequest === undefined) { + throw new runtime.RequiredError('showChannelRequest','Required parameter requestParameters.showChannelRequest was null or undefined when calling showChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/show`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.showChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Shows previously hidden channel Sends events: - channel.visible + * Show channel + */ + async showChannel(requestParameters: ShowChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.showChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Translates message to a given language using automated translation software Sends events: - message.updated Required permissions: - ReadChannel + * Translate message + */ + async translateMessageRaw(requestParameters: TranslateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling translateMessage.'); + } + + if (requestParameters.translateMessageRequest === null || requestParameters.translateMessageRequest === undefined) { + throw new runtime.RequiredError('translateMessageRequest','Required parameter requestParameters.translateMessageRequest was null or undefined when calling translateMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/translate`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.translateMessageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Translates message to a given language using automated translation software Sends events: - message.updated Required permissions: - ReadChannel + * Translate message + */ + async translateMessage(requestParameters: TranslateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.translateMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel + * Truncate channel + */ + async truncateChannelRaw(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling truncateChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling truncateChannel.'); + } + + if (requestParameters.truncateChannelRequest === null || requestParameters.truncateChannelRequest === undefined) { + throw new runtime.RequiredError('truncateChannelRequest','Required parameter requestParameters.truncateChannelRequest was null or undefined when calling truncateChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}/truncate`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.truncateChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Truncates channel Sends events: - channel.truncated Required permissions: - DeleteChannel - TruncateChannel + * Truncate channel + */ + async truncateChannel(requestParameters: TruncateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.truncateChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser + * Unban user + */ + async unbanRaw(requestParameters: UnbanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.targetUserId === null || requestParameters.targetUserId === undefined) { + throw new runtime.RequiredError('targetUserId','Required parameter requestParameters.targetUserId was null or undefined when calling unban.'); + } + + const queryParameters: any = {}; + + if (requestParameters.targetUserId !== undefined) { + queryParameters['target_user_id'] = requestParameters.targetUserId; + } + + if (requestParameters.channelCid !== undefined) { + queryParameters['channel_cid'] = requestParameters.channelCid; + } + + if (requestParameters.createdBy !== undefined) { + queryParameters['created_by'] = requestParameters.createdBy; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/ban`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser + * Unban user + */ + async unban(requestParameters: UnbanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unbanRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Unblock users + * Unblock user + */ + async unblockUsersRaw(requestParameters: UnblockUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.unblockUsersRequest === null || requestParameters.unblockUsersRequest === undefined) { + throw new runtime.RequiredError('unblockUsersRequest','Required parameter requestParameters.unblockUsersRequest was null or undefined when calling unblockUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users/unblock`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.unblockUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Unblock users + * Unblock user + */ + async unblockUsers(requestParameters: UnblockUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unblockUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Undelete a message that was previously soft-deleted Sends events: - message.undeleted + * Undelete message + */ + async undeleteMessageRaw(requestParameters: UndeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling undeleteMessage.'); + } + + if (requestParameters.updateMessageRequest === null || requestParameters.updateMessageRequest === undefined) { + throw new runtime.RequiredError('updateMessageRequest','Required parameter requestParameters.updateMessageRequest was null or undefined when calling undeleteMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}/undelete`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateMessageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Undelete a message that was previously soft-deleted Sends events: - message.undeleted + * Undelete message + */ + async undeleteMessage(requestParameters: UndeleteMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.undeleteMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel + * Unmute channel + */ + async unmuteChannelRaw(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.unmuteChannelRequest === null || requestParameters.unmuteChannelRequest === undefined) { + throw new runtime.RequiredError('unmuteChannelRequest','Required parameter requestParameters.unmuteChannelRequest was null or undefined when calling unmuteChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/unmute/channel`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.unmuteChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Unmutes channel for user Sends events: - channel.unmuted Required permissions: - MuteChannel + * Unmute channel + */ + async unmuteChannel(requestParameters: UnmuteChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unmuteChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser + * Unmute user + */ + async unmuteUserRaw(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.unmuteUserRequest === null || requestParameters.unmuteUserRequest === undefined) { + throw new runtime.RequiredError('unmuteUserRequest','Required parameter requestParameters.unmuteUserRequest was null or undefined when calling unmuteUser.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/moderation/unmute`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.unmuteUserRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser + * Unmute user + */ + async unmuteUser(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unmuteUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Fetch unread counts for a single user + * Unread counts + */ + async unreadCountsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/unread`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Fetch unread counts for a single user + * Unread counts + */ + async unreadCounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unreadCountsRaw(initOverrides); + return await response.value(); + } + + /** + * Fetch unread counts in batch for multiple users in one call + * Batch unread counts + */ + async unreadCountsBatchRaw(requestParameters: UnreadCountsBatchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.unreadCountsBatchRequest === null || requestParameters.unreadCountsBatchRequest === undefined) { + throw new runtime.RequiredError('unreadCountsBatchRequest','Required parameter requestParameters.unreadCountsBatchRequest was null or undefined when calling unreadCountsBatch.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/unread_batch`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.unreadCountsBatchRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Fetch unread counts in batch for multiple users in one call + * Batch unread counts + */ + async unreadCountsBatch(requestParameters: UnreadCountsBatchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.unreadCountsBatchRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This Method updates one or more application settings + * Update App Settings + */ + async updateAppRaw(requestParameters: UpdateAppOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.updateAppRequest === null || requestParameters.updateAppRequest === undefined) { + throw new runtime.RequiredError('updateAppRequest','Required parameter requestParameters.updateAppRequest was null or undefined when calling updateApp.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/app`, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateAppRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * This Method updates one or more application settings + * Update App Settings + */ + async updateApp(requestParameters: UpdateAppOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateAppRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates contents of the block list + * Update block list + */ + async updateBlockListRaw(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateBlockList.'); + } + + if (requestParameters.updateBlockListRequest === null || requestParameters.updateBlockListRequest === undefined) { + throw new runtime.RequiredError('updateBlockListRequest','Required parameter requestParameters.updateBlockListRequest was null or undefined when calling updateBlockList.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateBlockListRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates contents of the block list + * Update block list + */ + async updateBlockList(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateBlockListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers + * Update channel + */ + async updateChannelRaw(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannel.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannel.'); + } + + if (requestParameters.updateChannelRequest === null || requestParameters.updateChannelRequest === undefined) { + throw new runtime.RequiredError('updateChannelRequest','Required parameter requestParameters.updateChannelRequest was null or undefined when calling updateChannel.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateChannelRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Change channel data Sends events: - channel.updated - member.added - member.removed - member.updated - message.new Required permissions: - AddOwnChannelMembership - RemoveOwnChannelMembership - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen - UpdateChannelMembers + * Update channel + */ + async updateChannel(requestParameters: UpdateChannelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateChannelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen + * Partially update channel + */ + async updateChannelPartialRaw(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling updateChannelPartial.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateChannelPartial.'); + } + + if (requestParameters.updateChannelPartialRequest === null || requestParameters.updateChannelPartialRequest === undefined) { + throw new runtime.RequiredError('updateChannelPartialRequest','Required parameter requestParameters.updateChannelPartialRequest was null or undefined when calling updateChannelPartial.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channels/{type}/{id}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateChannelPartialRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates certain fields of the channel Sends events: - channel.updated Required permissions: - UpdateChannel - UpdateChannelCooldown - UpdateChannelFrozen + * Partially update channel + */ + async updateChannelPartial(requestParameters: UpdateChannelPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateChannelPartialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates channel type + * Update channel type + */ + async updateChannelTypeRaw(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateChannelType.'); + } + + if (requestParameters.updateChannelTypeRequest === null || requestParameters.updateChannelTypeRequest === undefined) { + throw new runtime.RequiredError('updateChannelTypeRequest','Required parameter requestParameters.updateChannelTypeRequest was null or undefined when calling updateChannelType.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateChannelTypeRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates channel type + * Update channel type + */ + async updateChannelType(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateChannelTypeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates custom chat command + * Update command + */ + async updateCommandRaw(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateCommand.'); + } + + if (requestParameters.updateCommandRequest === null || requestParameters.updateCommandRequest === undefined) { + throw new runtime.RequiredError('updateCommandRequest','Required parameter requestParameters.updateCommandRequest was null or undefined when calling updateCommand.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/commands/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateCommandRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates custom chat command + * Update command + */ + async updateCommand(requestParameters: UpdateCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateCommandRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * Update External Storage + */ + async updateExternalStorageRaw(requestParameters: UpdateExternalStorageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.name === null || requestParameters.name === undefined) { + throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateExternalStorage.'); + } + + if (requestParameters.updateExternalStorageRequest === null || requestParameters.updateExternalStorageRequest === undefined) { + throw new runtime.RequiredError('updateExternalStorageRequest','Required parameter requestParameters.updateExternalStorageRequest was null or undefined when calling updateExternalStorage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/external_storage/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateExternalStorageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * Update External Storage + */ + async updateExternalStorage(requestParameters: UpdateExternalStorageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateExternalStorageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates message with new data Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage + * Update message + */ + async updateMessageRaw(requestParameters: UpdateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateMessage.'); + } + + if (requestParameters.updateMessageRequest === null || requestParameters.updateMessageRequest === undefined) { + throw new runtime.RequiredError('updateMessageRequest','Required parameter requestParameters.updateMessageRequest was null or undefined when calling updateMessage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateMessageRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates message with new data Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage + * Update message + */ + async updateMessage(requestParameters: UpdateMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateMessageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates certain fields of the message Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage + * Partially message update + */ + async updateMessagePartialRaw(requestParameters: UpdateMessagePartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling updateMessagePartial.'); + } + + if (requestParameters.updateMessagePartialRequest === null || requestParameters.updateMessagePartialRequest === undefined) { + throw new runtime.RequiredError('updateMessagePartialRequest','Required parameter requestParameters.updateMessagePartialRequest was null or undefined when calling updateMessagePartial.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/messages/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateMessagePartialRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates certain fields of the message Sends events: - message.updated Required permissions: - AddLinks - PinMessage - SkipMessageModeration - UpdateMessage + * Partially message update + */ + async updateMessagePartial(requestParameters: UpdateMessagePartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateMessagePartialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates a poll Sends events: - poll.closed - poll.updated Required permissions: - UpdatePoll + * Update poll + */ + async updatePollRaw(requestParameters: UpdatePollOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.updatePollRequest === null || requestParameters.updatePollRequest === undefined) { + throw new runtime.RequiredError('updatePollRequest','Required parameter requestParameters.updatePollRequest was null or undefined when calling updatePoll.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updatePollRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates a poll Sends events: - poll.closed - poll.updated Required permissions: - UpdatePoll + * Update poll + */ + async updatePoll(requestParameters: UpdatePollOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePollRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates a poll option Sends events: - poll.updated Required permissions: - UpdatePoll + * Update poll option + */ + async updatePollOptionRaw(requestParameters: UpdatePollOptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling updatePollOption.'); + } + + if (requestParameters.updatePollOptionRequest === null || requestParameters.updatePollOptionRequest === undefined) { + throw new runtime.RequiredError('updatePollOptionRequest','Required parameter requestParameters.updatePollOptionRequest was null or undefined when calling updatePollOption.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}/options`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updatePollOptionRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates a poll option Sends events: - poll.updated Required permissions: - UpdatePoll + * Update poll option + */ + async updatePollOption(requestParameters: UpdatePollOptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePollOptionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates a poll partially Sends events: - poll.updated Required permissions: - UpdatePoll + * Partial update poll + */ + async updatePollPartialRaw(requestParameters: UpdatePollPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.pollId === null || requestParameters.pollId === undefined) { + throw new runtime.RequiredError('pollId','Required parameter requestParameters.pollId was null or undefined when calling updatePollPartial.'); + } + + if (requestParameters.updatePollPartialRequest === null || requestParameters.updatePollPartialRequest === undefined) { + throw new runtime.RequiredError('updatePollPartialRequest','Required parameter requestParameters.updatePollPartialRequest was null or undefined when calling updatePollPartial.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/polls/{poll_id}`.replace(`{${"poll_id"}}`, encodeURIComponent(String(requestParameters.pollId))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updatePollPartialRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates a poll partially Sends events: - poll.updated Required permissions: - UpdatePoll + * Partial update poll + */ + async updatePollPartial(requestParameters: UpdatePollPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updatePollPartialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates certain fields of the thread Sends events: - thread.updated Required permissions: - ReadChannel - UpdateThread + * Partially update thread + */ + async updateThreadPartialRaw(requestParameters: UpdateThreadPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.messageId === null || requestParameters.messageId === undefined) { + throw new runtime.RequiredError('messageId','Required parameter requestParameters.messageId was null or undefined when calling updateThreadPartial.'); + } + + if (requestParameters.updateThreadPartialRequest === null || requestParameters.updateThreadPartialRequest === undefined) { + throw new runtime.RequiredError('updateThreadPartialRequest','Required parameter requestParameters.updateThreadPartialRequest was null or undefined when calling updateThreadPartial.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/threads/{message_id}`.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters.messageId))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateThreadPartialRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates certain fields of the thread Sends events: - thread.updated Required permissions: - ReadChannel - UpdateThread + * Partially update thread + */ + async updateThreadPartial(requestParameters: UpdateThreadPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateThreadPartialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update or create users in bulk Sends events: - user.updated + * Upsert users + */ + async updateUsersRaw(requestParameters: UpdateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.updateUsersRequest === null || requestParameters.updateUsersRequest === undefined) { + throw new runtime.RequiredError('updateUsersRequest','Required parameter requestParameters.updateUsersRequest was null or undefined when calling updateUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateUsersRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Update or create users in bulk Sends events: - user.updated + * Upsert users + */ + async updateUsers(requestParameters: UpdateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Updates certain fields of the user Sends events: - user.presence.changed - user.updated + * Partially update user + */ + async updateUsersPartialRaw(requestParameters: UpdateUsersPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.updateUsersPartialRequest === null || requestParameters.updateUsersPartialRequest === undefined) { + throw new runtime.RequiredError('updateUsersPartialRequest','Required parameter requestParameters.updateUsersPartialRequest was null or undefined when calling updateUsersPartial.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/users`, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.updateUsersPartialRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Updates certain fields of the user Sends events: - user.presence.changed - user.updated + * Partially update user + */ + async updateUsersPartial(requestParameters: UpdateUsersPartialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateUsersPartialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Uploads file Required permissions: - UploadAttachment + * Upload file + */ + async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadFile.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadFile.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.file !== undefined) { + formParams.append('file', requestParameters.file as any); + } + + if (requestParameters.user !== undefined) { + + formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); + } + + const response = await this.request({ + path: `/channels/{type}/{id}/file`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Uploads file Required permissions: - UploadAttachment + * Upload file + */ + async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.uploadFileRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Uploads image Required permissions: - UploadAttachment + * Upload image + */ + async uploadImageRaw(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling uploadImage.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling uploadImage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.file !== undefined) { + formParams.append('file', requestParameters.file as any); + } + + if (requestParameters.uploadSizes) { + formParams.append('upload_sizes', requestParameters.uploadSizes.join(runtime.COLLECTION_FORMATS["csv"])); + } + + if (requestParameters.user !== undefined) { + + formParams.append('user', new Blob([JSON.stringify(requestParameters.user)], { type: "application/json", })); + } + + const response = await this.request({ + path: `/channels/{type}/{id}/image`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Uploads image Required permissions: - UploadAttachment + * Upload image + */ + async uploadImage(requestParameters: UploadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.uploadImageRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Upsert a push provider for v2 with multi bundle/package support + * Upsert a push provider + */ + async upsertPushProviderRaw(requestParameters: UpsertPushProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.upsertPushProviderRequest === null || requestParameters.upsertPushProviderRequest === undefined) { + throw new runtime.RequiredError('upsertPushProviderRequest','Required parameter requestParameters.upsertPushProviderRequest was null or undefined when calling upsertPushProvider.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication + } + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication + } + + const response = await this.request({ + path: `/push_providers`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.upsertPushProviderRequest, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Upsert a push provider for v2 with multi bundle/package support + * Upsert a push provider + */ + async upsertPushProvider(requestParameters: UpsertPushProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.upsertPushProviderRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const DeletePushProviderTypeEnum = { + APN: 'apn', + FIREBASE: 'firebase', + HUAWEI: 'huawei', + XIAOMI: 'xiaomi' +} as const; +export type DeletePushProviderTypeEnum = typeof DeletePushProviderTypeEnum[keyof typeof DeletePushProviderTypeEnum]; diff --git a/src/gen/chat/apis/PushApi.ts b/src/gen/chat/apis/PushApi.ts deleted file mode 100644 index f811ee5..0000000 --- a/src/gen/chat/apis/PushApi.ts +++ /dev/null @@ -1,183 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CreateDeviceRequest, - ListPushProvidersResponse, - Response, -} from '../models'; - -export interface CreateDeviceOperationRequest { - createDeviceRequest: CreateDeviceRequest | null; -} - -export interface DeletePushProviderRequest { - type: DeletePushProviderTypeEnum; - name: string; -} - -/** - * - */ -export class PushApi extends runtime.BaseAPI { - - /** - * Adds a new device to a user, if the same device already exists the call will have no effect - * Create device - */ - async createDeviceRaw(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createDeviceRequest === null || requestParameters.createDeviceRequest === undefined) { - throw new runtime.RequiredError('createDeviceRequest','Required parameter requestParameters.createDeviceRequest was null or undefined when calling createDevice.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/devices`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createDeviceRequest, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * Adds a new device to a user, if the same device already exists the call will have no effect - * Create device - */ - async createDevice(requestParameters: CreateDeviceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.createDeviceRaw(requestParameters, initOverrides); - } - - /** - * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint - * Delete a push provider - */ - async deletePushProviderRaw(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deletePushProvider.'); - } - - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deletePushProvider.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/push_providers/{type}/{name}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint - * Delete a push provider - */ - async deletePushProvider(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deletePushProviderRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * List details of all push providers. - * List push providers - */ - async listPushProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/push_providers`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * List details of all push providers. - * List push providers - */ - async listPushProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listPushProvidersRaw(initOverrides); - return await response.value(); - } - -} - -/** - * @export - */ -export const DeletePushProviderTypeEnum = { - APN: 'apn', - FIREBASE: 'firebase', - HUAWEI: 'huawei', - XIAOMI: 'xiaomi' -} as const; -export type DeletePushProviderTypeEnum = typeof DeletePushProviderTypeEnum[keyof typeof DeletePushProviderTypeEnum]; diff --git a/src/gen/chat/apis/ReactionsApi.ts b/src/gen/chat/apis/ReactionsApi.ts deleted file mode 100644 index b94ffa5..0000000 --- a/src/gen/chat/apis/ReactionsApi.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - GetReactionsResponse, - ReactionRemovalResponse, - ReactionResponse, - SendReactionRequest, -} from '../models'; - -export interface DeleteReactionRequest { - id: string; - type: string; - userId?: string; -} - -export interface GetReactionsRequest { - id: string; - limit?: number; - offset?: number; -} - -export interface SendReactionOperationRequest { - id: string; - sendReactionRequest: SendReactionRequest | null; -} - -/** - * - */ -export class ReactionsApi extends runtime.BaseAPI { - - /** - * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction - * Delete reaction - */ - async deleteReactionRaw(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteReaction.'); - } - - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deleteReaction.'); - } - - const queryParameters: any = {}; - - if (requestParameters.userId !== undefined) { - queryParameters['user_id'] = requestParameters.userId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reaction/{type}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes user reaction from the message Sends events: - reaction.deleted Required permissions: - DeleteReaction - * Delete reaction - */ - async deleteReaction(requestParameters: DeleteReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteReactionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns list of reactions of specific message Required permissions: - ReadChannel - * Get reactions - */ - async getReactionsRaw(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getReactions.'); - } - - const queryParameters: any = {}; - - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; - } - - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reactions`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns list of reactions of specific message Required permissions: - ReadChannel - * Get reactions - */ - async getReactions(requestParameters: GetReactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getReactionsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel - * Send reaction - */ - async sendReactionRaw(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling sendReaction.'); - } - - if (requestParameters.sendReactionRequest === null || requestParameters.sendReactionRequest === undefined) { - throw new runtime.RequiredError('sendReactionRequest','Required parameter requestParameters.sendReactionRequest was null or undefined when calling sendReaction.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/messages/{id}/reaction`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.sendReactionRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends reaction to specified message Sends events: - reaction.new - reaction.updated Required permissions: - CreateReaction - UseFrozenChannel - * Send reaction - */ - async sendReaction(requestParameters: SendReactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.sendReactionRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/ServerSideApi.ts b/src/gen/chat/apis/ServerSideApi.ts deleted file mode 100644 index 717bf79..0000000 --- a/src/gen/chat/apis/ServerSideApi.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - UpsertPushProviderRequest, - UpsertPushProviderResponse, -} from '../models'; - -export interface UpsertPushProviderOperationRequest { - upsertPushProviderRequest: UpsertPushProviderRequest | null; -} - -/** - * - */ -export class ServerSideApi extends runtime.BaseAPI { - - /** - * Upsert a push provider for v2 with multi bundle/package support - * Upsert a push provider - */ - async upsertPushProviderRaw(requestParameters: UpsertPushProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.upsertPushProviderRequest === null || requestParameters.upsertPushProviderRequest === undefined) { - throw new runtime.RequiredError('upsertPushProviderRequest','Required parameter requestParameters.upsertPushProviderRequest was null or undefined when calling upsertPushProvider.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/push_providers`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.upsertPushProviderRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Upsert a push provider for v2 with multi bundle/package support - * Upsert a push provider - */ - async upsertPushProvider(requestParameters: UpsertPushProviderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.upsertPushProviderRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/SettingsApi.ts b/src/gen/chat/apis/SettingsApi.ts deleted file mode 100644 index 416cc77..0000000 --- a/src/gen/chat/apis/SettingsApi.ts +++ /dev/null @@ -1,948 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CheckPushRequest, - CheckPushResponse, - CheckSNSRequest, - CheckSNSResponse, - CheckSQSRequest, - CheckSQSResponse, - CreateBlockListRequest, - CreateChannelTypeRequest, - CreateChannelTypeResponse, - GetApplicationResponse, - GetBlockListResponse, - GetRateLimitsResponse, - ListBlockListResponse, - ListChannelTypesResponse, - ListPushProvidersResponse, - Response, - UpdateAppRequest, - UpdateBlockListRequest, - UpdateChannelTypeRequest, - UpdateChannelTypeResponse, -} from '../models'; - -export interface CheckPushOperationRequest { - checkPushRequest: CheckPushRequest | null; -} - -export interface CheckSNSOperationRequest { - checkSNSRequest: CheckSNSRequest | null; -} - -export interface CheckSQSOperationRequest { - checkSQSRequest: CheckSQSRequest | null; -} - -export interface CreateBlockListOperationRequest { - createBlockListRequest: CreateBlockListRequest | null; -} - -export interface CreateChannelTypeOperationRequest { - createChannelTypeRequest: CreateChannelTypeRequest | null; -} - -export interface DeleteBlockListRequest { - name: string; -} - -export interface DeleteChannelTypeRequest { - name: string; -} - -export interface DeletePushProviderRequest { - type: DeletePushProviderTypeEnum; - name: string; -} - -export interface GetBlockListRequest { - name: string; -} - -export interface GetChannelTypeRequest { - name: string; -} - -export interface GetRateLimitsRequest { - serverSide?: boolean; - android?: boolean; - ios?: boolean; - web?: boolean; - endpoints?: string; -} - -export interface UpdateAppOperationRequest { - updateAppRequest: UpdateAppRequest | null; -} - -export interface UpdateBlockListOperationRequest { - name: string; - updateBlockListRequest: UpdateBlockListRequest | null; -} - -export interface UpdateChannelTypeOperationRequest { - name: string; - updateChannelTypeRequest: UpdateChannelTypeRequest | null; -} - -/** - * - */ -export class SettingsApi extends runtime.BaseAPI { - - /** - * Sends a test message via push, this is a test endpoint to verify your push settings - * Check push - */ - async checkPushRaw(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkPushRequest === null || requestParameters.checkPushRequest === undefined) { - throw new runtime.RequiredError('checkPushRequest','Required parameter requestParameters.checkPushRequest was null or undefined when calling checkPush.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_push`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkPushRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends a test message via push, this is a test endpoint to verify your push settings - * Check push - */ - async checkPush(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkPushRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Validates Amazon SNS configuration - * Check SNS - */ - async checkSNSRaw(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkSNSRequest === null || requestParameters.checkSNSRequest === undefined) { - throw new runtime.RequiredError('checkSNSRequest','Required parameter requestParameters.checkSNSRequest was null or undefined when calling checkSNS.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_sns`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkSNSRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Validates Amazon SNS configuration - * Check SNS - */ - async checkSNS(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkSNSRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Validates Amazon SQS credentials - * Check SQS - */ - async checkSQSRaw(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkSQSRequest === null || requestParameters.checkSQSRequest === undefined) { - throw new runtime.RequiredError('checkSQSRequest','Required parameter requestParameters.checkSQSRequest was null or undefined when calling checkSQS.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_sqs`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkSQSRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Validates Amazon SQS credentials - * Check SQS - */ - async checkSQS(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkSQSRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates a new application blocklist, once created the blocklist can be used by any channel type - * Create block list - */ - async createBlockListRaw(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createBlockListRequest === null || requestParameters.createBlockListRequest === undefined) { - throw new runtime.RequiredError('createBlockListRequest','Required parameter requestParameters.createBlockListRequest was null or undefined when calling createBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createBlockListRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates a new application blocklist, once created the blocklist can be used by any channel type - * Create block list - */ - async createBlockList(requestParameters: CreateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Creates new channel type - * Create channel type - */ - async createChannelTypeRaw(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createChannelTypeRequest === null || requestParameters.createChannelTypeRequest === undefined) { - throw new runtime.RequiredError('createChannelTypeRequest','Required parameter requestParameters.createChannelTypeRequest was null or undefined when calling createChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.createChannelTypeRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates new channel type - * Create channel type - */ - async createChannelType(requestParameters: CreateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes previously created application blocklist - * Delete block list - */ - async deleteBlockListRaw(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes previously created application blocklist - * Delete block list - */ - async deleteBlockList(requestParameters: DeleteBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes channel type - * Delete channel type - */ - async deleteChannelTypeRaw(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes channel type - * Delete channel type - */ - async deleteChannelType(requestParameters: DeleteChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint - * Delete a push provider - */ - async deletePushProviderRaw(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling deletePushProvider.'); - } - - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deletePushProvider.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/push_providers/{type}/{name}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Delete a push provider from v2 with multi bundle/package support. v1 isn\'t supported in this endpoint - * Delete a push provider - */ - async deletePushProvider(requestParameters: DeletePushProviderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deletePushProviderRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * This method returns the application settings - * Get App Settings - */ - async getAppRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/app`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * This method returns the application settings - * Get App Settings - */ - async getApp(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getAppRaw(initOverrides); - return await response.value(); - } - - /** - * Returns block list by given name - * Get block list - */ - async getBlockListRaw(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns block list by given name - * Get block list - */ - async getBlockList(requestParameters: GetBlockListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Gets channel type - * Get channel type - */ - async getChannelTypeRaw(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets channel type - * Get channel type - */ - async getChannelType(requestParameters: GetChannelTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Get rate limits usage and quotas - * Get rate limits - */ - async getRateLimitsRaw(requestParameters: GetRateLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.serverSide !== undefined) { - queryParameters['server_side'] = requestParameters.serverSide; - } - - if (requestParameters.android !== undefined) { - queryParameters['android'] = requestParameters.android; - } - - if (requestParameters.ios !== undefined) { - queryParameters['ios'] = requestParameters.ios; - } - - if (requestParameters.web !== undefined) { - queryParameters['web'] = requestParameters.web; - } - - if (requestParameters.endpoints !== undefined) { - queryParameters['endpoints'] = requestParameters.endpoints; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/rate_limits`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Get rate limits usage and quotas - * Get rate limits - */ - async getRateLimits(requestParameters: GetRateLimitsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getRateLimitsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Returns all available block lists - * List block lists - */ - async listBlockListsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Returns all available block lists - * List block lists - */ - async listBlockLists(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listBlockListsRaw(initOverrides); - return await response.value(); - } - - /** - * Lists all available channel types - * List channel types - */ - async listChannelTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Lists all available channel types - * List channel types - */ - async listChannelTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listChannelTypesRaw(initOverrides); - return await response.value(); - } - - /** - * List details of all push providers. - * List push providers - */ - async listPushProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/push_providers`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * List details of all push providers. - * List push providers - */ - async listPushProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.listPushProvidersRaw(initOverrides); - return await response.value(); - } - - /** - * This method updates one or more application settings - * Update App Settings - */ - async updateAppRaw(requestParameters: UpdateAppOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.updateAppRequest === null || requestParameters.updateAppRequest === undefined) { - throw new runtime.RequiredError('updateAppRequest','Required parameter requestParameters.updateAppRequest was null or undefined when calling updateApp.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/app`, - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateAppRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * This method updates one or more application settings - * Update App Settings - */ - async updateApp(requestParameters: UpdateAppOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateAppRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates contents of the block list - * Update block list - */ - async updateBlockListRaw(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateBlockList.'); - } - - if (requestParameters.updateBlockListRequest === null || requestParameters.updateBlockListRequest === undefined) { - throw new runtime.RequiredError('updateBlockListRequest','Required parameter requestParameters.updateBlockListRequest was null or undefined when calling updateBlockList.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/blocklists/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateBlockListRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates contents of the block list - * Update block list - */ - async updateBlockList(requestParameters: UpdateBlockListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateBlockListRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates channel type - * Update channel type - */ - async updateChannelTypeRaw(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling updateChannelType.'); - } - - if (requestParameters.updateChannelTypeRequest === null || requestParameters.updateChannelTypeRequest === undefined) { - throw new runtime.RequiredError('updateChannelTypeRequest','Required parameter requestParameters.updateChannelTypeRequest was null or undefined when calling updateChannelType.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/channeltypes/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateChannelTypeRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates channel type - * Update channel type - */ - async updateChannelType(requestParameters: UpdateChannelTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateChannelTypeRaw(requestParameters, initOverrides); - return await response.value(); - } - -} - -/** - * @export - */ -export const DeletePushProviderTypeEnum = { - APN: 'apn', - FIREBASE: 'firebase', - HUAWEI: 'huawei', - XIAOMI: 'xiaomi' -} as const; -export type DeletePushProviderTypeEnum = typeof DeletePushProviderTypeEnum[keyof typeof DeletePushProviderTypeEnum]; diff --git a/src/gen/chat/apis/TasksApi.ts b/src/gen/chat/apis/TasksApi.ts deleted file mode 100644 index 57c4c2e..0000000 --- a/src/gen/chat/apis/TasksApi.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - GetTaskResponse, -} from '../models'; - -export interface GetTaskRequest { - id: string; -} - -/** - * - */ -export class TasksApi extends runtime.BaseAPI { - - /** - * Gets status of a task - * Get status of a task - */ - async getTaskRaw(requestParameters: GetTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getTask.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Gets status of a task - * Get status of a task - */ - async getTask(requestParameters: GetTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getTaskRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/TestingApi.ts b/src/gen/chat/apis/TestingApi.ts deleted file mode 100644 index 738d530..0000000 --- a/src/gen/chat/apis/TestingApi.ts +++ /dev/null @@ -1,185 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - CheckPushRequest, - CheckPushResponse, - CheckSNSRequest, - CheckSNSResponse, - CheckSQSRequest, - CheckSQSResponse, -} from '../models'; - -export interface CheckPushOperationRequest { - checkPushRequest: CheckPushRequest | null; -} - -export interface CheckSNSOperationRequest { - checkSNSRequest: CheckSNSRequest | null; -} - -export interface CheckSQSOperationRequest { - checkSQSRequest: CheckSQSRequest | null; -} - -/** - * - */ -export class TestingApi extends runtime.BaseAPI { - - /** - * Sends a test message via push, this is a test endpoint to verify your push settings - * Check push - */ - async checkPushRaw(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkPushRequest === null || requestParameters.checkPushRequest === undefined) { - throw new runtime.RequiredError('checkPushRequest','Required parameter requestParameters.checkPushRequest was null or undefined when calling checkPush.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_push`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkPushRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Sends a test message via push, this is a test endpoint to verify your push settings - * Check push - */ - async checkPush(requestParameters: CheckPushOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkPushRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Validates Amazon SNS configuration - * Check SNS - */ - async checkSNSRaw(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkSNSRequest === null || requestParameters.checkSNSRequest === undefined) { - throw new runtime.RequiredError('checkSNSRequest','Required parameter requestParameters.checkSNSRequest was null or undefined when calling checkSNS.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_sns`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkSNSRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Validates Amazon SNS configuration - * Check SNS - */ - async checkSNS(requestParameters: CheckSNSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkSNSRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Validates Amazon SQS credentials - * Check SQS - */ - async checkSQSRaw(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.checkSQSRequest === null || requestParameters.checkSQSRequest === undefined) { - throw new runtime.RequiredError('checkSQSRequest','Required parameter requestParameters.checkSQSRequest was null or undefined when calling checkSQS.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/check_sqs`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.checkSQSRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Validates Amazon SQS credentials - * Check SQS - */ - async checkSQS(requestParameters: CheckSQSOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.checkSQSRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/UsersApi.ts b/src/gen/chat/apis/UsersApi.ts deleted file mode 100644 index 3e35315..0000000 --- a/src/gen/chat/apis/UsersApi.ts +++ /dev/null @@ -1,1203 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Stream Chat API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v92.7.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - APIError, - BanRequest, - ConnectRequest, - DeactivateUserRequest, - DeactivateUserResponse, - DeactivateUsersRequest, - DeactivateUsersResponse, - DeleteUserResponse, - DeleteUsersRequest, - DeleteUsersResponse, - ExportUserResponse, - ExportUsersRequest, - ExportUsersResponse, - FlagRequest, - FlagResponse, - GuestRequest, - GuestResponse, - MuteUserRequest, - MuteUserResponse, - QueryBannedUsersRequest, - QueryBannedUsersResponse, - QueryUsersRequest, - ReactivateUserRequest, - ReactivateUserResponse, - ReactivateUsersRequest, - ReactivateUsersResponse, - Response, - RestoreUsersRequest, - UnmuteResponse, - UnmuteUserRequest, - UpdateUserPartialRequest, - UpdateUsersRequest, - UpdateUsersResponse, - UsersResponse, -} from '../models'; - -export interface BanOperationRequest { - banRequest: BanRequest | null; -} - -export interface ConnectOperationRequest { - json?: ConnectRequest; -} - -export interface CreateGuestRequest { - guestRequest: GuestRequest | null; -} - -export interface DeactivateUserOperationRequest { - userId: string; - deactivateUserRequest: DeactivateUserRequest | null; -} - -export interface DeactivateUsersOperationRequest { - deactivateUsersRequest: DeactivateUsersRequest | null; -} - -export interface DeleteUserRequest { - userId: string; - markMessagesDeleted?: boolean; - hardDelete?: boolean; - deleteConversationChannels?: boolean; -} - -export interface DeleteUsersOperationRequest { - deleteUsersRequest: DeleteUsersRequest | null; -} - -export interface ExportUserRequest { - userId: string; -} - -export interface ExportUsersOperationRequest { - exportUsersRequest: ExportUsersRequest | null; -} - -export interface FlagOperationRequest { - flagRequest: FlagRequest | null; -} - -export interface LongPollRequest { - json?: ConnectRequest; - connectionId?: string; -} - -export interface MuteUserOperationRequest { - muteUserRequest: MuteUserRequest | null; -} - -export interface QueryBannedUsersOperationRequest { - payload?: QueryBannedUsersRequest; -} - -export interface QueryUsersOperationRequest { - payload?: QueryUsersRequest; -} - -export interface ReactivateUserOperationRequest { - userId: string; - reactivateUserRequest: ReactivateUserRequest | null; -} - -export interface ReactivateUsersOperationRequest { - reactivateUsersRequest: ReactivateUsersRequest | null; -} - -export interface RestoreUsersOperationRequest { - restoreUsersRequest: RestoreUsersRequest | null; -} - -export interface UnbanRequest { - targetUserId?: string; - type?: string; - id?: string; - createdBy?: string; -} - -export interface UnflagRequest { - flagRequest: FlagRequest | null; -} - -export interface UnmuteUserOperationRequest { - unmuteUserRequest: UnmuteUserRequest | null; -} - -export interface UpdateUsersOperationRequest { - updateUsersRequest: UpdateUsersRequest | null; -} - -export interface UpdateUsersPartialRequest { - updateUserPartialRequest: UpdateUserPartialRequest | null; -} - -/** - * - */ -export class UsersApi extends runtime.BaseAPI { - - /** - * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser - * Ban user - */ - async banRaw(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.banRequest === null || requestParameters.banRequest === undefined) { - throw new runtime.RequiredError('banRequest','Required parameter requestParameters.banRequest was null or undefined when calling ban.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/ban`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.banRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Restricts user activity either in specific channel or globally Sends events: - user.banned Required permissions: - BanChannelMember - BanUser - * Ban user - */ - async ban(requestParameters: BanOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.banRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Establishes WebSocket connection for user Sends events: - user.updated - * Connect (WebSocket) - */ - async connectRaw(requestParameters: ConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.json !== undefined) { - queryParameters['json'] = requestParameters.json; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/connect`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * Establishes WebSocket connection for user Sends events: - user.updated - * Connect (WebSocket) - */ - async connect(requestParameters: ConnectOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.connectRaw(requestParameters, initOverrides); - } - - /** - * Creates guest user - * Create guest - */ - async createGuestRaw(requestParameters: CreateGuestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.guestRequest === null || requestParameters.guestRequest === undefined) { - throw new runtime.RequiredError('guestRequest','Required parameter requestParameters.guestRequest was null or undefined when calling createGuest.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/guest`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.guestRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Creates guest user - * Create guest - */ - async createGuest(requestParameters: CreateGuestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createGuestRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUserRaw(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deactivateUser.'); - } - - if (requestParameters.deactivateUserRequest === null || requestParameters.deactivateUserRequest === undefined) { - throw new runtime.RequiredError('deactivateUserRequest','Required parameter requestParameters.deactivateUserRequest was null or undefined when calling deactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/deactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivates user with possibility to activate it back Sends events: - user.deactivated - * Deactivate user - */ - async deactivateUser(requestParameters: DeactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsersRaw(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deactivateUsersRequest === null || requestParameters.deactivateUsersRequest === undefined) { - throw new runtime.RequiredError('deactivateUsersRequest','Required parameter requestParameters.deactivateUsersRequest was null or undefined when calling deactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/deactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deactivate users in batches Sends events: - user.deactivated - * Deactivate users - */ - async deactivateUsers(requestParameters: DeactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteUser.'); - } - - const queryParameters: any = {}; - - if (requestParameters.markMessagesDeleted !== undefined) { - queryParameters['mark_messages_deleted'] = requestParameters.markMessagesDeleted; - } - - if (requestParameters.hardDelete !== undefined) { - queryParameters['hard_delete'] = requestParameters.hardDelete; - } - - if (requestParameters.deleteConversationChannels !== undefined) { - queryParameters['delete_conversation_channels'] = requestParameters.deleteConversationChannels; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes user and optionally all their belongings. The Endpoint is deprecated, please use \'Delete Users\' endpoint instead Sends events: - channel.deleted - message.deleted - user.deleted - * Delete user - */ - async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsersRaw(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.deleteUsersRequest === null || requestParameters.deleteUsersRequest === undefined) { - throw new runtime.RequiredError('deleteUsersRequest','Required parameter requestParameters.deleteUsersRequest was null or undefined when calling deleteUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/delete`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.deleteUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Deletes users and optionally all their belongings asynchronously. Sends events: - channel.deleted - user.deleted - * Delete Users - */ - async deleteUsers(requestParameters: DeleteUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Exports the user\'s profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions - * Export user - */ - async exportUserRaw(requestParameters: ExportUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling exportUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/export`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Exports the user\'s profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions - * Export user - */ - async exportUser(requestParameters: ExportUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.exportUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Exports user profile, reactions and messages for list of given users - * Export users - */ - async exportUsersRaw(requestParameters: ExportUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.exportUsersRequest === null || requestParameters.exportUsersRequest === undefined) { - throw new runtime.RequiredError('exportUsersRequest','Required parameter requestParameters.exportUsersRequest was null or undefined when calling exportUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/export/users`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.exportUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Exports user profile, reactions and messages for list of given users - * Export users - */ - async exportUsers(requestParameters: ExportUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.exportUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flagRaw(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling flag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/flag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reports message or user for review by moderators Sends events: - message.flagged - user.flagged Required permissions: - FlagMessage - FlagUser - * Flag - */ - async flag(requestParameters: FlagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.flagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * WebSocket fallback transport endpoint Sends events: - user.updated - * Long Poll (Transport) - */ - async longPollRaw(requestParameters: LongPollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.json !== undefined) { - queryParameters['json'] = requestParameters.json; - } - - if (requestParameters.connectionId !== undefined) { - queryParameters['connection_id'] = requestParameters.connectionId; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/longpoll`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * WebSocket fallback transport endpoint Sends events: - user.updated - * Long Poll (Transport) - */ - async longPoll(requestParameters: LongPollRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.longPollRaw(requestParameters, initOverrides); - } - - /** - * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser - * Mute user - */ - async muteUserRaw(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.muteUserRequest === null || requestParameters.muteUserRequest === undefined) { - throw new runtime.RequiredError('muteUserRequest','Required parameter requestParameters.muteUserRequest was null or undefined when calling muteUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/mute`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.muteUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Mutes one or several users Sends events: - user.muted Required permissions: - MuteUser - * Mute user - */ - async muteUser(requestParameters: MuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.muteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter channel scoped or global user bans Required permissions: - ReadChannel - * Query Banned Users - */ - async queryBannedUsersRaw(requestParameters: QueryBannedUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/query_banned_users`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter channel scoped or global user bans Required permissions: - ReadChannel - * Query Banned Users - */ - async queryBannedUsers(requestParameters: QueryBannedUsersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryBannedUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Find and filter users Required permissions: - SearchUser - * Query users - */ - async queryUsersRaw(requestParameters: QueryUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.payload !== undefined) { - queryParameters['payload'] = requestParameters.payload; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Find and filter users Required permissions: - SearchUser - * Query users - */ - async queryUsers(requestParameters: QueryUsersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.queryUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUserRaw(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userId === null || requestParameters.userId === undefined) { - throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling reactivateUser.'); - } - - if (requestParameters.reactivateUserRequest === null || requestParameters.reactivateUserRequest === undefined) { - throw new runtime.RequiredError('reactivateUserRequest','Required parameter requestParameters.reactivateUserRequest was null or undefined when calling reactivateUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/{user_id}/reactivate`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters.userId))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Activates user who\'s been deactivated previously Sends events: - user.reactivated - * Reactivate user - */ - async reactivateUser(requestParameters: ReactivateUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsersRaw(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.reactivateUsersRequest === null || requestParameters.reactivateUsersRequest === undefined) { - throw new runtime.RequiredError('reactivateUsersRequest','Required parameter requestParameters.reactivateUsersRequest was null or undefined when calling reactivateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/reactivate`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.reactivateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Reactivate users in batches Sends events: - user.reactivated - * Reactivate users - */ - async reactivateUsers(requestParameters: ReactivateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.reactivateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Restore soft deleted users - * Restore users - */ - async restoreUsersRaw(requestParameters: RestoreUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.restoreUsersRequest === null || requestParameters.restoreUsersRequest === undefined) { - throw new runtime.RequiredError('restoreUsersRequest','Required parameter requestParameters.restoreUsersRequest was null or undefined when calling restoreUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users/restore`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.restoreUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Restore soft deleted users - * Restore users - */ - async restoreUsers(requestParameters: RestoreUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.restoreUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser - * Unban user - */ - async unbanRaw(requestParameters: UnbanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters.targetUserId !== undefined) { - queryParameters['target_user_id'] = requestParameters.targetUserId; - } - - if (requestParameters.type !== undefined) { - queryParameters['type'] = requestParameters.type; - } - - if (requestParameters.id !== undefined) { - queryParameters['id'] = requestParameters.id; - } - - if (requestParameters.createdBy !== undefined) { - queryParameters['created_by'] = requestParameters.createdBy; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/ban`, - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes previously applied ban Sends events: - user.unbanned Required permissions: - BanChannelMember - BanUser - * Unban user - */ - async unban(requestParameters: UnbanRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unbanRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflagRaw(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.flagRequest === null || requestParameters.flagRequest === undefined) { - throw new runtime.RequiredError('flagRequest','Required parameter requestParameters.flagRequest was null or undefined when calling unflag.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unflag`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.flagRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Removes previously created user or message flag Required permissions: - FlagMessage - FlagUser - * Unflag - */ - async unflag(requestParameters: UnflagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unflagRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser - * Unmute user - */ - async unmuteUserRaw(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.unmuteUserRequest === null || requestParameters.unmuteUserRequest === undefined) { - throw new runtime.RequiredError('unmuteUserRequest','Required parameter requestParameters.unmuteUserRequest was null or undefined when calling unmuteUser.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/moderation/unmute`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.unmuteUserRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Unmutes previously muted user Sends events: - user.unmuted Required permissions: - MuteUser - * Unmute user - */ - async unmuteUser(requestParameters: UnmuteUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.unmuteUserRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Update or create users in bulk Sends events: - user.updated - * Upsert users - */ - async updateUsersRaw(requestParameters: UpdateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.updateUsersRequest === null || requestParameters.updateUsersRequest === undefined) { - throw new runtime.RequiredError('updateUsersRequest','Required parameter requestParameters.updateUsersRequest was null or undefined when calling updateUsers.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateUsersRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Update or create users in bulk Sends events: - user.updated - * Upsert users - */ - async updateUsers(requestParameters: UpdateUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateUsersRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * Updates certain fields of the user Sends events: - user.presence.changed - user.updated - * Partially update user - */ - async updateUsersPartialRaw(requestParameters: UpdateUsersPartialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.updateUserPartialRequest === null || requestParameters.updateUserPartialRequest === undefined) { - throw new runtime.RequiredError('updateUserPartialRequest','Required parameter requestParameters.updateUserPartialRequest was null or undefined when calling updateUsersPartial.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Stream-Auth-Type"] = this.configuration.apiKey("Stream-Auth-Type"); // stream-auth-type authentication - } - - if (this.configuration && this.configuration.apiKey) { - queryParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication - } - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // JWT authentication - } - - const response = await this.request({ - path: `/users`, - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: requestParameters.updateUserPartialRequest, - }, initOverrides); - - return new runtime.JSONApiResponse(response); - } - - /** - * Updates certain fields of the user Sends events: - user.presence.changed - user.updated - * Partially update user - */ - async updateUsersPartial(requestParameters: UpdateUsersPartialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateUsersPartialRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/gen/chat/apis/index.ts b/src/gen/chat/apis/index.ts index e60051e..0c76241 100644 --- a/src/gen/chat/apis/index.ts +++ b/src/gen/chat/apis/index.ts @@ -1,29 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -export * from './ChannelTypesApi'; -export * from './ChannelsApi'; -export * from './CustomCommandsApi'; -export * from './DefaultApi'; -export * from './DevicesApi'; -export * from './EventsApi'; -export * from './FilesApi'; -/** @ts-expect-error */ -export * from './GDPRApi'; -export * from './ImportsApi'; -/** @ts-expect-error */ -export * from './MessagesApi'; -/** @ts-expect-error */ -export * from './ModerationApi'; -export * from './PermissionsV2Api'; -/** @ts-expect-error */ -export * from './PushApi'; -/** @ts-expect-error */ -export * from './ReactionsApi'; -export * from './ServerSideApi'; -/** @ts-expect-error */ -export * from './SettingsApi'; -export * from './TasksApi'; -/** @ts-expect-error */ -export * from './TestingApi'; -/** @ts-expect-error */ -export * from './UsersApi'; +export * from './ProductchatApi'; diff --git a/src/gen/chat/models/index.ts b/src/gen/chat/models/index.ts index 8dd9b93..57a38a4 100644 --- a/src/gen/chat/models/index.ts +++ b/src/gen/chat/models/index.ts @@ -52,148 +52,148 @@ export interface APIError { /** * * @export - * @interface APNConfigFields + * @interface APNConfig */ -export interface APNConfigFields { +export interface APNConfig { /** * - * @type {string} - * @memberof APNConfigFields + * @type {boolean} + * @memberof APNConfig */ - auth_key?: string; + Disabled?: boolean; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ - auth_type?: string; + auth_key?: string; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ - bundle_id?: string; + auth_type?: APNConfigAuthTypeEnum; /** * - * @type {boolean} - * @memberof APNConfigFields + * @type {string} + * @memberof APNConfig */ - development: boolean; + bundle_id?: string; /** * * @type {boolean} - * @memberof APNConfigFields + * @memberof APNConfig */ - enabled: boolean; + development?: boolean; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ host?: string; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ key_id?: string; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ - notification_template: string; + notification_template?: string; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ p12_cert?: string; /** * * @type {string} - * @memberof APNConfigFields + * @memberof APNConfig */ team_id?: string; } + + +/** + * @export + */ +export const APNConfigAuthTypeEnum = { + CERTIFICATE: 'certificate', + TOKEN: 'token' +} as const; +export type APNConfigAuthTypeEnum = typeof APNConfigAuthTypeEnum[keyof typeof APNConfigAuthTypeEnum]; + /** * * @export - * @interface APNConfigRequest + * @interface APNConfigFields */ -export interface APNConfigRequest { - /** - * - * @type {boolean} - * @memberof APNConfigRequest - */ - Disabled?: boolean; +export interface APNConfigFields { /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ auth_key?: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ - auth_type?: APNConfigRequestAuthTypeEnum; + auth_type?: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ bundle_id?: string; /** * * @type {boolean} - * @memberof APNConfigRequest + * @memberof APNConfigFields + */ + development: boolean; + /** + * + * @type {boolean} + * @memberof APNConfigFields */ - development?: boolean; + enabled: boolean; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ host?: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ key_id?: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ - notification_template?: string; + notification_template: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ p12_cert?: string; /** * * @type {string} - * @memberof APNConfigRequest + * @memberof APNConfigFields */ team_id?: string; } - - -/** - * @export - */ -export const APNConfigRequestAuthTypeEnum = { - CERTIFICATE: 'certificate', - TOKEN: 'token' -} as const; -export type APNConfigRequestAuthTypeEnum = typeof APNConfigRequestAuthTypeEnum[keyof typeof APNConfigRequestAuthTypeEnum]; - /** * * @export @@ -250,43 +250,6 @@ export interface Action { */ value?: string; } -/** - * - * @export - * @interface ActionRequest - */ -export interface ActionRequest { - /** - * - * @type {string} - * @memberof ActionRequest - */ - name?: string; - /** - * - * @type {string} - * @memberof ActionRequest - */ - style?: string; - /** - * - * @type {string} - * @memberof ActionRequest - */ - text?: string; - /** - * - * @type {string} - * @memberof ActionRequest - */ - type?: string; - /** - * - * @type {string} - * @memberof ActionRequest - */ - value?: string; -} /** * * @export @@ -303,303 +266,278 @@ export interface AgoraCall { /** * * @export - * @interface AnyEvent + * @interface AppResponseFields */ -export interface AnyEvent { - /** - * - * @type {string} - * @memberof AnyEvent - */ - created_at: string; +export interface AppResponseFields { /** * - * @type {string} - * @memberof AnyEvent + * @type {Config} + * @memberof AppResponseFields */ - type: string; -} -/** - * - * @export - * @interface App - */ -export interface App { + agora_options?: Config; /** * - * @type {Config} - * @memberof App + * @type {Array} + * @memberof AppResponseFields */ - agora_options?: Config; + allowed_flag_reasons?: Array; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ async_url_enrich_enabled: boolean; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ - auto_translation_enabled?: boolean; + auto_translation_enabled: boolean; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ before_message_send_hook_url?: string; /** * * @type {{ [key: string]: CallType; }} - * @memberof App + * @memberof AppResponseFields */ call_types: { [key: string]: CallType; }; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ campaign_enabled: boolean; /** * * @type {number} - * @memberof App + * @memberof AppResponseFields */ cdn_expiration_seconds: number; /** - * Object with channel configs + * * @type {{ [key: string]: ChannelConfig; }} - * @memberof App + * @memberof AppResponseFields */ channel_configs: { [key: string]: ChannelConfig; }; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ custom_action_handler_url: string; /** * * @type {DataDogInfo} - * @memberof App + * @memberof AppResponseFields */ datadog_info?: DataDogInfo; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ disable_auth_checks: boolean; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ disable_permissions_checks: boolean; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ enforce_unique_usernames: string; /** * * @type {FileUploadConfig} - * @memberof App + * @memberof AppResponseFields */ file_upload_config: FileUploadConfig; /** * * @type {Array} - * @memberof App + * @memberof AppResponseFields */ geofences?: Array; /** * * @type {{ [key: string]: Array; }} - * @memberof App + * @memberof AppResponseFields */ grants: { [key: string]: Array; }; /** * * @type {Config} - * @memberof App + * @memberof AppResponseFields */ hms_options?: Config; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ image_moderation_enabled: boolean; /** * * @type {Array} - * @memberof App + * @memberof AppResponseFields */ image_moderation_labels?: Array; /** * * @type {FileUploadConfig} - * @memberof App + * @memberof AppResponseFields */ image_upload_config: FileUploadConfig; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ multi_tenant_enabled: boolean; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ name: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ organization: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ permission_version: string; /** * * @type {{ [key: string]: Array; }} - * @memberof App + * @memberof AppResponseFields */ policies: { [key: string]: Array; }; + /** + * + * @type {boolean} + * @memberof AppResponseFields + */ + polls_enabled: boolean; /** * * @type {PushNotificationFields} - * @memberof App + * @memberof AppResponseFields */ push_notifications: PushNotificationFields; /** * * @type {number} - * @memberof App + * @memberof AppResponseFields */ reminders_interval: number; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ revoke_tokens_issued_before?: string; - /** - * Backend implementation used for search - * @type {string} - * @memberof App - */ - search_backend: AppSearchBackendEnum; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sns_key: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sns_secret: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sns_topic_arn: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sqs_key: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sqs_secret: string; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ sqs_url: string; /** * * @type {boolean} - * @memberof App + * @memberof AppResponseFields */ suspended: boolean; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ suspended_explanation: string; /** * * @type {Array} - * @memberof App + * @memberof AppResponseFields */ user_search_disallowed_roles: Array; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ video_provider: string; /** * * @type {Array} - * @memberof App + * @memberof AppResponseFields */ webhook_events: Array; /** * * @type {string} - * @memberof App + * @memberof AppResponseFields */ webhook_url: string; } - - -/** - * @export - */ -export const AppSearchBackendEnum = { - ELASTICSEARCH: 'elasticsearch', - POSTGRES: 'postgres', - DISABLED: 'disabled' -} as const; -export type AppSearchBackendEnum = typeof AppSearchBackendEnum[keyof typeof AppSearchBackendEnum]; - /** * * @export - * @interface AsyncModerationCallbackConfigRequest + * @interface AsyncModerationCallbackConfig */ -export interface AsyncModerationCallbackConfigRequest { +export interface AsyncModerationCallbackConfig { /** * * @type {string} - * @memberof AsyncModerationCallbackConfigRequest + * @memberof AsyncModerationCallbackConfig */ - mode?: AsyncModerationCallbackConfigRequestModeEnum; + mode?: AsyncModerationCallbackConfigModeEnum; /** * * @type {string} - * @memberof AsyncModerationCallbackConfigRequest + * @memberof AsyncModerationCallbackConfig */ server_url?: string; } @@ -608,29 +546,29 @@ export interface AsyncModerationCallbackConfigRequest { /** * @export */ -export const AsyncModerationCallbackConfigRequestModeEnum = { +export const AsyncModerationCallbackConfigModeEnum = { NONE: 'CALLBACK_MODE_NONE', REST: 'CALLBACK_MODE_REST', TWIRP: 'CALLBACK_MODE_TWIRP' } as const; -export type AsyncModerationCallbackConfigRequestModeEnum = typeof AsyncModerationCallbackConfigRequestModeEnum[keyof typeof AsyncModerationCallbackConfigRequestModeEnum]; +export type AsyncModerationCallbackConfigModeEnum = typeof AsyncModerationCallbackConfigModeEnum[keyof typeof AsyncModerationCallbackConfigModeEnum]; /** * * @export - * @interface AsyncModerationConfigurationRequest + * @interface AsyncModerationConfiguration */ -export interface AsyncModerationConfigurationRequest { +export interface AsyncModerationConfiguration { /** * - * @type {AsyncModerationCallbackConfigRequest} - * @memberof AsyncModerationConfigurationRequest + * @type {AsyncModerationCallbackConfig} + * @memberof AsyncModerationConfiguration */ - callback?: AsyncModerationCallbackConfigRequest; + callback?: AsyncModerationCallbackConfig; /** * * @type {number} - * @memberof AsyncModerationConfigurationRequest + * @memberof AsyncModerationConfiguration */ timeout_ms?: number; } @@ -640,7 +578,6 @@ export interface AsyncModerationConfigurationRequest { * @interface Attachment */ export interface Attachment { - [key: string]: any | any; /** * * @type {Array} @@ -677,6 +614,12 @@ export interface Attachment { * @memberof Attachment */ color?: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Attachment + */ + custom: { [key: string]: any; }; /** * * @type {string} @@ -762,146 +705,12 @@ export interface Attachment { */ title_link?: string; /** - * Attachment type (e.g. image, video, url) + * Attachment type (e.g. image, video, url, poll) * @type {string} * @memberof Attachment */ type?: string; } -/** - * - * @export - * @interface AttachmentRequest - */ -export interface AttachmentRequest { - [key: string]: any | any; - /** - * - * @type {Array} - * @memberof AttachmentRequest - */ - actions?: Array; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - asset_url?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - author_icon?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - author_link?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - author_name?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - color?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - fallback?: string; - /** - * - * @type {Array} - * @memberof AttachmentRequest - */ - fields?: Array; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - footer?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - footer_icon?: string; - /** - * - * @type {ImagesRequest} - * @memberof AttachmentRequest - */ - giphy?: ImagesRequest; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - image_url?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - og_scrape_url?: string; - /** - * - * @type {number} - * @memberof AttachmentRequest - */ - original_height?: number; - /** - * - * @type {number} - * @memberof AttachmentRequest - */ - original_width?: number; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - pretext?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - text?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - thumb_url?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - title?: string; - /** - * - * @type {string} - * @memberof AttachmentRequest - */ - title_link?: string; - /** - * Attachment type (e.g. image, video, url) - * @type {string} - * @memberof AttachmentRequest - */ - type?: string; -} /** * * @export @@ -926,6 +735,12 @@ export interface AudioSettings { * @memberof AudioSettings */ mic_default_on: boolean; + /** + * + * @type {NoiseCancellationSettings} + * @memberof AudioSettings + */ + noise_cancellation?: NoiseCancellationSettings; /** * * @type {boolean} @@ -996,28 +811,65 @@ export interface AutomodDetails { /** * * @export - * @interface BackstageSettings + * @interface AzureRequest */ -export interface BackstageSettings { +export interface AzureRequest { /** * - * @type {boolean} - * @memberof BackstageSettings + * @type {string} + * @memberof AzureRequest */ - enabled: boolean; -} -/** - * + abs_account_name: string; + /** + * + * @type {string} + * @memberof AzureRequest + */ + abs_client_id: string; + /** + * + * @type {string} + * @memberof AzureRequest + */ + abs_client_secret: string; + /** + * + * @type {string} + * @memberof AzureRequest + */ + abs_tenant_id: string; +} +/** + * + * @export + * @interface BackstageSettings + */ +export interface BackstageSettings { + /** + * + * @type {boolean} + * @memberof BackstageSettings + */ + enabled: boolean; + /** + * + * @type {number} + * @memberof BackstageSettings + */ + join_ahead_time_seconds?: number; +} +/** + * * @export * @interface BanRequest */ export interface BanRequest { /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof BanRequest */ - banned_by?: UserObjectRequest; + banned_by?: UserRequest; /** * User ID who issued a ban * @type {string} @@ -1025,11 +877,11 @@ export interface BanRequest { */ banned_by_id?: string; /** - * Channel ID to ban user in + * Channel CID to ban user in eg. messaging:123 * @type {string} * @memberof BanRequest */ - id?: string; + channel_cid?: string; /** * Whether to perform IP ban or not * @type {boolean} @@ -1060,18 +912,12 @@ export interface BanRequest { * @memberof BanRequest */ timeout?: number; - /** - * Channel type to ban user in - * @type {string} - * @memberof BanRequest - */ - type?: string; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof BanRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -1146,6 +992,12 @@ export interface BlockList { * @memberof BlockList */ name: string; + /** + * Block list type. + * @type {string} + * @memberof BlockList + */ + type: string; /** * Date/time of the last update * @type {string} @@ -1185,40 +1037,104 @@ export interface BlockListOptions { */ export const BlockListOptionsBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type BlockListOptionsBehaviorEnum = typeof BlockListOptionsBehaviorEnum[keyof typeof BlockListOptionsBehaviorEnum]; /** * * @export - * @interface BlockListOptionsRequest + * @interface BlockUsersRequest */ -export interface BlockListOptionsRequest { +export interface BlockUsersRequest { + /** + * User id to block + * @type {string} + * @memberof BlockUsersRequest + */ + blocked_user_id: string; + /** + * + * @type {UserRequest} + * @memberof BlockUsersRequest + */ + user?: UserRequest; /** * * @type {string} - * @memberof BlockListOptionsRequest + * @memberof BlockUsersRequest */ - behavior?: BlockListOptionsRequestBehaviorEnum; + user_id?: string; +} +/** + * + * @export + * @interface BlockUsersResponse + */ +export interface BlockUsersResponse { /** * * @type {string} - * @memberof BlockListOptionsRequest + * @memberof BlockUsersResponse */ - blocklist?: string; + blocked_by_user_id: string; + /** + * + * @type {string} + * @memberof BlockUsersResponse + */ + blocked_user_id: string; + /** + * + * @type {string} + * @memberof BlockUsersResponse + */ + created_at: string; + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof BlockUsersResponse + */ + duration: string; } - - /** + * * @export + * @interface BlockedUserResponse */ -export const BlockListOptionsRequestBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type BlockListOptionsRequestBehaviorEnum = typeof BlockListOptionsRequestBehaviorEnum[keyof typeof BlockListOptionsRequestBehaviorEnum]; - +export interface BlockedUserResponse { + /** + * + * @type {UserResponse} + * @memberof BlockedUserResponse + */ + blocked_user: UserResponse; + /** + * ID of the user who got blocked + * @type {string} + * @memberof BlockedUserResponse + */ + blocked_user_id: string; + /** + * + * @type {string} + * @memberof BlockedUserResponse + */ + created_at: string; + /** + * + * @type {UserResponse} + * @memberof BlockedUserResponse + */ + user: UserResponse; + /** + * ID of the user who blocked another user + * @type {string} + * @memberof BlockedUserResponse + */ + user_id: string; +} /** * * @export @@ -1305,6 +1221,12 @@ export interface CallSettings { * @memberof CallSettings */ geofencing?: GeofenceSettings; + /** + * + * @type {LimitsSettings} + * @memberof CallSettings + */ + limits?: LimitsSettings; /** * * @type {RecordSettings} @@ -1360,6 +1282,12 @@ export interface CallType { * @memberof CallType */ CreatedAt: string; + /** + * + * @type {string} + * @memberof CallType + */ + ExternalStorage: string; /** * * @type {string} @@ -1391,13 +1319,37 @@ export interface CallType { */ UpdatedAt: string; } +/** + * + * @export + * @interface CastPollVoteRequest + */ +export interface CastPollVoteRequest { + /** + * + * @type {UserRequest} + * @memberof CastPollVoteRequest + */ + user?: UserRequest; + /** + * + * @type {string} + * @memberof CastPollVoteRequest + */ + user_id?: string; + /** + * + * @type {VoteData} + * @memberof CastPollVoteRequest + */ + vote?: VoteData; +} /** * * @export * @interface Channel */ export interface Channel { - [key: string]: any | any; /** * * @type {boolean} @@ -1446,6 +1398,12 @@ export interface Channel { * @memberof Channel */ created_by?: UserObject; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Channel + */ + custom: { [key: string]: any; }; /** * * @type {string} @@ -1525,6 +1483,12 @@ export interface Channel { * @interface ChannelConfig */ export interface ChannelConfig { + /** + * + * @type {Array} + * @memberof ChannelConfig + */ + allowed_flag_reasons?: Array; /** * * @type {string} @@ -1597,12 +1561,6 @@ export interface ChannelConfig { * @memberof ChannelConfig */ max_message_length: number; - /** - * - * @type {string} - * @memberof ChannelConfig - */ - message_retention: string; /** * * @type {boolean} @@ -1615,6 +1573,12 @@ export interface ChannelConfig { * @memberof ChannelConfig */ name: string; + /** + * + * @type {boolean} + * @memberof ChannelConfig + */ + polls: boolean; /** * * @type {boolean} @@ -1699,7 +1663,8 @@ export type ChannelConfigAutomodEnum = typeof ChannelConfigAutomodEnum[keyof typ */ export const ChannelConfigAutomodBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type ChannelConfigAutomodBehaviorEnum = typeof ChannelConfigAutomodBehaviorEnum[keyof typeof ChannelConfigAutomodBehaviorEnum]; @@ -1708,100 +1673,23 @@ export type ChannelConfigAutomodBehaviorEnum = typeof ChannelConfigAutomodBehavi */ export const ChannelConfigBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type ChannelConfigBlocklistBehaviorEnum = typeof ChannelConfigBlocklistBehaviorEnum[keyof typeof ChannelConfigBlocklistBehaviorEnum]; /** - * Channel configuration overrides + * * @export - * @interface ChannelConfigRequest + * @interface ChannelConfigWithInfo */ -export interface ChannelConfigRequest { - /** - * - * @type {string} - * @memberof ChannelConfigRequest - */ - blocklist?: string; - /** - * - * @type {string} - * @memberof ChannelConfigRequest - */ - blocklist_behavior?: ChannelConfigRequestBlocklistBehaviorEnum; +export interface ChannelConfigWithInfo { /** * * @type {Array} - * @memberof ChannelConfigRequest - */ - commands?: Array; - /** - * - * @type {{ [key: string]: Array; }} - * @memberof ChannelConfigRequest - */ - grants?: { [key: string]: Array; }; - /** - * Overrides max message length - * @type {number} - * @memberof ChannelConfigRequest - */ - max_message_length?: number; - /** - * Enables message quotes - * @type {boolean} - * @memberof ChannelConfigRequest - */ - quotes?: boolean; - /** - * Enables or disables reactions - * @type {boolean} - * @memberof ChannelConfigRequest - */ - reactions?: boolean; - /** - * Enables message replies (threads) - * @type {boolean} - * @memberof ChannelConfigRequest - */ - replies?: boolean; - /** - * Enables or disables typing events - * @type {boolean} - * @memberof ChannelConfigRequest - */ - typing_events?: boolean; - /** - * Enables or disables file uploads - * @type {boolean} - * @memberof ChannelConfigRequest - */ - uploads?: boolean; - /** - * Enables or disables URL enrichment - * @type {boolean} - * @memberof ChannelConfigRequest + * @memberof ChannelConfigWithInfo */ - url_enrichment?: boolean; -} - - -/** - * @export - */ -export const ChannelConfigRequestBlocklistBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type ChannelConfigRequestBlocklistBehaviorEnum = typeof ChannelConfigRequestBlocklistBehaviorEnum[keyof typeof ChannelConfigRequestBlocklistBehaviorEnum]; - -/** - * - * @export - * @interface ChannelConfigWithInfo - */ -export interface ChannelConfigWithInfo { + allowed_flag_reasons?: Array; /** * * @type {string} @@ -1880,12 +1768,6 @@ export interface ChannelConfigWithInfo { * @memberof ChannelConfigWithInfo */ max_message_length: number; - /** - * - * @type {string} - * @memberof ChannelConfigWithInfo - */ - message_retention: string; /** * * @type {boolean} @@ -1898,6 +1780,12 @@ export interface ChannelConfigWithInfo { * @memberof ChannelConfigWithInfo */ name: string; + /** + * + * @type {boolean} + * @memberof ChannelConfigWithInfo + */ + polls: boolean; /** * * @type {boolean} @@ -1982,7 +1870,8 @@ export type ChannelConfigWithInfoAutomodEnum = typeof ChannelConfigWithInfoAutom */ export const ChannelConfigWithInfoAutomodBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type ChannelConfigWithInfoAutomodBehaviorEnum = typeof ChannelConfigWithInfoAutomodBehaviorEnum[keyof typeof ChannelConfigWithInfoAutomodBehaviorEnum]; @@ -1991,1581 +1880,817 @@ export type ChannelConfigWithInfoAutomodBehaviorEnum = typeof ChannelConfigWithI */ export const ChannelConfigWithInfoBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type ChannelConfigWithInfoBlocklistBehaviorEnum = typeof ChannelConfigWithInfoBlocklistBehaviorEnum[keyof typeof ChannelConfigWithInfoBlocklistBehaviorEnum]; /** * * @export - * @interface ChannelConfigWithInfoRequest + * @interface ChannelExport */ -export interface ChannelConfigWithInfoRequest { +export interface ChannelExport { /** * * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelExport */ - automod: ChannelConfigWithInfoRequestAutomodEnum; + cid?: string; /** - * + * Channel ID * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelExport */ - automod_behavior?: ChannelConfigWithInfoRequestAutomodBehaviorEnum; + id?: string; /** - * - * @type {ThresholdsRequest} - * @memberof ChannelConfigWithInfoRequest + * Date to export messages since + * @type {string} + * @memberof ChannelExport */ - automod_thresholds?: ThresholdsRequest; + messages_since?: string; /** - * + * Date to export messages until * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelExport */ - blocklist?: string; + messages_until?: string; /** - * + * Channel type * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelExport */ - blocklist_behavior?: ChannelConfigWithInfoRequestBlocklistBehaviorEnum; + type?: string; +} +/** + * + * @export + * @interface ChannelGetOrCreateRequest + */ +export interface ChannelGetOrCreateRequest { /** * - * @type {Array} - * @memberof ChannelConfigWithInfoRequest + * @type {ChannelInput} + * @memberof ChannelGetOrCreateRequest */ - blocklists?: Array; + data?: ChannelInput; /** - * - * @type {Array} - * @memberof ChannelConfigWithInfoRequest + * Whether this channel will be hidden for the user who created the channel or not + * @type {boolean} + * @memberof ChannelGetOrCreateRequest */ - commands?: Array; + hide_for_creator?: boolean; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {PaginationParams} + * @memberof ChannelGetOrCreateRequest */ - connect_events?: boolean; + members?: PaginationParams; /** * - * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @type {object} + * @memberof ChannelGetOrCreateRequest */ - created_at?: string; + messages?: object; /** - * + * Refresh channel state * @type {boolean} - * @memberof ChannelConfigWithInfoRequest - */ - custom_events?: boolean; - /** - * - * @type {{ [key: string]: Array; }} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelGetOrCreateRequest */ - grants?: { [key: string]: Array; }; + state?: boolean; /** * * @type {boolean} - * @memberof ChannelConfigWithInfoRequest - */ - mark_messages_pending?: boolean; - /** - * - * @type {number} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelGetOrCreateRequest */ - max_message_length?: number; + thread_unread_counts?: boolean; /** * - * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @type {PaginationParams} + * @memberof ChannelGetOrCreateRequest */ - message_retention?: string; + watchers?: PaginationParams; +} +/** + * + * @export + * @interface ChannelInput + */ +export interface ChannelInput { + [key: string]: any; /** - * + * Enable or disable auto translation * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelInput */ - mutes?: boolean; + auto_translation_enabled?: boolean; /** - * + * Switch auto translation language * @type {string} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelInput */ - name?: string; + auto_translation_language?: string; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {ChannelConfig} + * @memberof ChannelInput */ - push_notifications?: boolean; + config_overrides?: ChannelConfig; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {UserObject} + * @memberof ChannelInput */ - quotes?: boolean; + created_by?: UserObject; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {string} + * @memberof ChannelInput */ - reactions?: boolean; + created_by_id?: string; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {{ [key: string]: any; }} + * @memberof ChannelInput */ - read_events?: boolean; + custom?: { [key: string]: any; }; /** * * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelInput */ - reminders?: boolean; + disabled?: boolean; /** - * + * Freeze or unfreeze the channel * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelInput */ - replies?: boolean; + frozen?: boolean; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {Array} + * @memberof ChannelInput */ - search?: boolean; + invites?: Array; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {Array} + * @memberof ChannelInput */ - typing_events?: boolean; + members?: Array>; /** - * + * Team the channel belongs to (if multi-tenant mode is enabled) * @type {string} - * @memberof ChannelConfigWithInfoRequest - */ - updated_at?: string; - /** - * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @memberof ChannelInput */ - uploads?: boolean; + team?: string; /** * - * @type {boolean} - * @memberof ChannelConfigWithInfoRequest + * @type {string} + * @memberof ChannelInput */ - url_enrichment?: boolean; + truncated_by_id?: string; } - - -/** - * @export - */ -export const ChannelConfigWithInfoRequestAutomodEnum = { - DISABLED: 'disabled', - SIMPLE: 'simple', - AI: 'AI' -} as const; -export type ChannelConfigWithInfoRequestAutomodEnum = typeof ChannelConfigWithInfoRequestAutomodEnum[keyof typeof ChannelConfigWithInfoRequestAutomodEnum]; - -/** - * @export - */ -export const ChannelConfigWithInfoRequestAutomodBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type ChannelConfigWithInfoRequestAutomodBehaviorEnum = typeof ChannelConfigWithInfoRequestAutomodBehaviorEnum[keyof typeof ChannelConfigWithInfoRequestAutomodBehaviorEnum]; - -/** - * @export - */ -export const ChannelConfigWithInfoRequestBlocklistBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type ChannelConfigWithInfoRequestBlocklistBehaviorEnum = typeof ChannelConfigWithInfoRequestBlocklistBehaviorEnum[keyof typeof ChannelConfigWithInfoRequestBlocklistBehaviorEnum]; - /** * * @export - * @interface ChannelCreatedEvent + * @interface ChannelMember */ -export interface ChannelCreatedEvent { +export interface ChannelMember { /** - * + * Expiration date of the ban * @type {string} - * @memberof ChannelCreatedEvent + * @memberof ChannelMember */ - created_at: string; + ban_expires?: string; /** - * - * @type {string} - * @memberof ChannelCreatedEvent + * Whether member is banned this channel or not + * @type {boolean} + * @memberof ChannelMember */ - type: string; -} -/** - * - * @export - * @interface ChannelDeletedEvent - */ -export interface ChannelDeletedEvent { + banned: boolean; /** - * - * @type {ChannelResponse} - * @memberof ChannelDeletedEvent + * Role of the member in the channel + * @type {string} + * @memberof ChannelMember */ - channel?: ChannelResponse; + channel_role: string; /** - * + * Date/time of creation * @type {string} - * @memberof ChannelDeletedEvent + * @memberof ChannelMember */ - channel_id: string; + created_at: string; /** * * @type {string} - * @memberof ChannelDeletedEvent + * @memberof ChannelMember */ - channel_type: string; + deleted_at?: string; /** - * + * Date when invite was accepted * @type {string} - * @memberof ChannelDeletedEvent + * @memberof ChannelMember */ - cid: string; + invite_accepted_at?: string; /** - * + * Date when invite was rejected * @type {string} - * @memberof ChannelDeletedEvent + * @memberof ChannelMember */ - created_at: string; + invite_rejected_at?: string; /** - * - * @type {string} - * @memberof ChannelDeletedEvent + * Whether member was invited or not + * @type {boolean} + * @memberof ChannelMember */ - team?: string; + invited?: boolean; /** - * - * @type {string} - * @memberof ChannelDeletedEvent + * Whether member is channel moderator or not + * @type {boolean} + * @memberof ChannelMember */ - type: string; -} -/** - * - * @export - * @interface ChannelExportRequest - */ -export interface ChannelExportRequest { + is_moderator?: boolean; /** * - * @type {string} - * @memberof ChannelExportRequest + * @type {boolean} + * @memberof ChannelMember */ - cid?: string; + notifications_muted: boolean; /** - * Channel ID - * @type {string} - * @memberof ChannelExportRequest + * Whether member is shadow banned in this channel or not + * @type {boolean} + * @memberof ChannelMember */ - id?: string; + shadow_banned: boolean; /** - * Date to export messages since + * * @type {string} - * @memberof ChannelExportRequest + * @memberof ChannelMember */ - messages_since?: string; + status?: string; /** - * Date to export messages until + * Date/time of the last update * @type {string} - * @memberof ChannelExportRequest + * @memberof ChannelMember */ - messages_until?: string; + updated_at: string; /** - * Channel type + * + * @type {UserObject} + * @memberof ChannelMember + */ + user?: UserObject; + /** + * * @type {string} - * @memberof ChannelExportRequest + * @memberof ChannelMember */ - type?: string; + user_id?: string; } /** * * @export - * @interface ChannelFrozenEvent + * @interface ChannelMute */ -export interface ChannelFrozenEvent { +export interface ChannelMute { /** * - * @type {string} - * @memberof ChannelFrozenEvent + * @type {ChannelResponse} + * @memberof ChannelMute */ - channel_id: string; + channel?: ChannelResponse; /** - * + * Date/time of creation * @type {string} - * @memberof ChannelFrozenEvent + * @memberof ChannelMute */ - channel_type: string; + created_at: string; /** - * + * Date/time of mute expiration * @type {string} - * @memberof ChannelFrozenEvent + * @memberof ChannelMute */ - cid: string; + expires?: string; /** - * + * Date/time of the last update * @type {string} - * @memberof ChannelFrozenEvent + * @memberof ChannelMute */ - created_at: string; + updated_at: string; /** * - * @type {string} - * @memberof ChannelFrozenEvent + * @type {UserObject} + * @memberof ChannelMute */ - type: string; + user?: UserObject; } /** - * + * Represents channel in chat * @export - * @interface ChannelGetOrCreateRequest + * @interface ChannelResponse */ -export interface ChannelGetOrCreateRequest { - /** - * - * @type {ChannelRequest} - * @memberof ChannelGetOrCreateRequest - */ - data?: ChannelRequest; +export interface ChannelResponse { + [key: string]: any; /** - * Whether this channel will be hidden for the user who created the channel or not + * Whether auto translation is enabled or not * @type {boolean} - * @memberof ChannelGetOrCreateRequest - */ - hide_for_creator?: boolean; - /** - * - * @type {PaginationParamsRequest} - * @memberof ChannelGetOrCreateRequest + * @memberof ChannelResponse */ - members?: PaginationParamsRequest; + auto_translation_enabled?: boolean; /** - * - * @type {MessagePaginationParamsRequest} - * @memberof ChannelGetOrCreateRequest + * Language to translate to when auto translation is active + * @type {string} + * @memberof ChannelResponse */ - messages?: MessagePaginationParamsRequest; + auto_translation_language?: string; /** - * Refresh channel state + * Whether this channel is blocked by current user or not * @type {boolean} - * @memberof ChannelGetOrCreateRequest + * @memberof ChannelResponse */ - state?: boolean; + blocked?: boolean; /** - * - * @type {PaginationParamsRequest} - * @memberof ChannelGetOrCreateRequest + * Channel CID (:) + * @type {string} + * @memberof ChannelResponse */ - watchers?: PaginationParamsRequest; -} -/** - * - * @export - * @interface ChannelHiddenEvent - */ -export interface ChannelHiddenEvent { + cid: string; /** * - * @type {ChannelResponse} - * @memberof ChannelHiddenEvent + * @type {ChannelConfigWithInfo} + * @memberof ChannelResponse */ - channel?: ChannelResponse; + config?: ChannelConfigWithInfo; /** - * - * @type {string} - * @memberof ChannelHiddenEvent + * Cooldown period after sending each message + * @type {number} + * @memberof ChannelResponse */ - channel_id: string; + cooldown?: number; /** - * + * Date/time of creation * @type {string} - * @memberof ChannelHiddenEvent + * @memberof ChannelResponse */ - channel_type: string; + created_at: string; /** * - * @type {string} - * @memberof ChannelHiddenEvent + * @type {UserObject} + * @memberof ChannelResponse */ - cid: string; + created_by?: UserObject; /** * - * @type {boolean} - * @memberof ChannelHiddenEvent + * @type {{ [key: string]: any; }} + * @memberof ChannelResponse */ - clear_history: boolean; + custom: { [key: string]: any; }; /** - * + * Date/time of deletion * @type {string} - * @memberof ChannelHiddenEvent + * @memberof ChannelResponse */ - created_at: string; + deleted_at?: string; /** * - * @type {string} - * @memberof ChannelHiddenEvent + * @type {boolean} + * @memberof ChannelResponse */ - type: string; + disabled: boolean; /** - * - * @type {UserObject} - * @memberof ChannelHiddenEvent + * Whether channel is frozen or not + * @type {boolean} + * @memberof ChannelResponse */ - user?: UserObject; -} -/** - * - * @export - * @interface ChannelKickedEvent - */ -export interface ChannelKickedEvent { + frozen: boolean; /** - * - * @type {ChannelResponse} - * @memberof ChannelKickedEvent + * Whether this channel is hidden by current user or not + * @type {boolean} + * @memberof ChannelResponse */ - channel?: ChannelResponse; + hidden?: boolean; /** - * + * Date since when the message history is accessible * @type {string} - * @memberof ChannelKickedEvent + * @memberof ChannelResponse */ - channel_id: string; + hide_messages_before?: string; /** - * + * Channel unique ID * @type {string} - * @memberof ChannelKickedEvent + * @memberof ChannelResponse */ - channel_type: string; + id: string; /** - * + * Date of the last message sent * @type {string} - * @memberof ChannelKickedEvent + * @memberof ChannelResponse */ - cid: string; + last_message_at?: string; /** - * - * @type {string} - * @memberof ChannelKickedEvent + * Number of members in the channel + * @type {number} + * @memberof ChannelResponse */ - created_at: string; + member_count?: number; /** - * - * @type {string} - * @memberof ChannelKickedEvent + * List of channel members (max 100) + * @type {Array} + * @memberof ChannelResponse */ - type: string; -} -/** - * - * @export - * @interface ChannelMember - */ -export interface ChannelMember { + members?: Array>; /** - * Expiration date of the ban + * Date of mute expiration * @type {string} - * @memberof ChannelMember + * @memberof ChannelResponse */ - ban_expires?: string; + mute_expires_at?: string; /** - * Whether member is banned this channel or not + * Whether this channel is muted or not * @type {boolean} - * @memberof ChannelMember + * @memberof ChannelResponse */ - banned: boolean; + muted?: boolean; /** - * Role of the member in the channel + * List of channel capabilities of authenticated user + * @type {Array} + * @memberof ChannelResponse + */ + own_capabilities?: Array; + /** + * Team the channel belongs to (multi-tenant only) * @type {string} - * @memberof ChannelMember + * @memberof ChannelResponse */ - channel_role: string; + team?: string; /** - * Date/time of creation + * Date of the latest truncation of the channel * @type {string} - * @memberof ChannelMember + * @memberof ChannelResponse */ - created_at: string; + truncated_at?: string; /** * - * @type {string} - * @memberof ChannelMember + * @type {UserObject} + * @memberof ChannelResponse */ - deleted_at?: string; + truncated_by?: UserObject; /** - * Date when invite was accepted + * Type of the channel * @type {string} - * @memberof ChannelMember + * @memberof ChannelResponse */ - invite_accepted_at?: string; + type: string; /** - * Date when invite was rejected + * Date/time of the last update * @type {string} - * @memberof ChannelMember + * @memberof ChannelResponse */ - invite_rejected_at?: string; + updated_at: string; +} +/** + * + * @export + * @interface ChannelStateResponse + */ +export interface ChannelStateResponse { /** - * Whether member was invited or not - * @type {boolean} - * @memberof ChannelMember + * + * @type {ChannelResponse} + * @memberof ChannelStateResponse */ - invited?: boolean; + channel?: ChannelResponse; /** - * Whether member is channel moderator or not - * @type {boolean} - * @memberof ChannelMember + * + * @type {string} + * @memberof ChannelStateResponse */ - is_moderator?: boolean; + duration: string; /** * * @type {boolean} - * @memberof ChannelMember + * @memberof ChannelStateResponse */ - notifications_muted: boolean; + hidden?: boolean; /** - * Permission level of the member in the channel (DEPRECATED: use channel_role instead) + * * @type {string} - * @memberof ChannelMember + * @memberof ChannelStateResponse */ - role?: ChannelMemberRoleEnum; + hide_messages_before?: string; /** - * Whether member is shadow banned in this channel or not - * @type {boolean} - * @memberof ChannelMember + * + * @type {Array} + * @memberof ChannelStateResponse */ - shadow_banned: boolean; + members: Array; /** * - * @type {string} - * @memberof ChannelMember + * @type {ChannelMember} + * @memberof ChannelStateResponse */ - status?: string; + membership?: ChannelMember | null; /** - * Date/time of the last update - * @type {string} - * @memberof ChannelMember + * + * @type {Array} + * @memberof ChannelStateResponse */ - updated_at: string; + messages: Array; /** * - * @type {UserObject} - * @memberof ChannelMember + * @type {Array} + * @memberof ChannelStateResponse */ - user?: UserObject; + pending_messages?: Array; /** * - * @type {string} - * @memberof ChannelMember + * @type {Array} + * @memberof ChannelStateResponse */ - user_id?: string; + pinned_messages: Array; + /** + * + * @type {Array} + * @memberof ChannelStateResponse + */ + read?: Array; + /** + * + * @type {Array} + * @memberof ChannelStateResponse + */ + threads: Array; + /** + * + * @type {number} + * @memberof ChannelStateResponse + */ + watcher_count?: number; + /** + * + * @type {Array} + * @memberof ChannelStateResponse + */ + watchers?: Array; } - - -/** - * @export - */ -export const ChannelMemberRoleEnum = { - MEMBER: 'member', - MODERATOR: 'moderator', - ADMIN: 'admin', - OWNER: 'owner' -} as const; -export type ChannelMemberRoleEnum = typeof ChannelMemberRoleEnum[keyof typeof ChannelMemberRoleEnum]; - /** * * @export - * @interface ChannelMemberRequest + * @interface ChannelStateResponseFields */ -export interface ChannelMemberRequest { +export interface ChannelStateResponseFields { /** - * Expiration date of the ban - * @type {string} - * @memberof ChannelMemberRequest + * + * @type {ChannelResponse} + * @memberof ChannelStateResponseFields */ - ban_expires?: string; + channel?: ChannelResponse; /** - * Whether member is banned this channel or not + * Whether this channel is hidden or not * @type {boolean} - * @memberof ChannelMemberRequest + * @memberof ChannelStateResponseFields */ - banned?: boolean; + hidden?: boolean; /** - * Role of the member in the channel + * Messages before this date are hidden from the user * @type {string} - * @memberof ChannelMemberRequest + * @memberof ChannelStateResponseFields */ - channel_role?: string; + hide_messages_before?: string; /** - * Date/time of creation - * @type {string} - * @memberof ChannelMemberRequest - */ - created_at?: string; - /** - * - * @type {string} - * @memberof ChannelMemberRequest - */ - deleted_at?: string; - /** - * Date when invite was accepted - * @type {string} - * @memberof ChannelMemberRequest - */ - invite_accepted_at?: string; - /** - * Date when invite was rejected - * @type {string} - * @memberof ChannelMemberRequest + * List of channel members + * @type {Array} + * @memberof ChannelStateResponseFields */ - invite_rejected_at?: string; + members: Array; /** - * Whether member was invited or not - * @type {boolean} - * @memberof ChannelMemberRequest + * + * @type {ChannelMember} + * @memberof ChannelStateResponseFields */ - invited?: boolean; + membership?: ChannelMember | null; /** - * Whether member is channel moderator or not - * @type {boolean} - * @memberof ChannelMemberRequest + * List of channel messages + * @type {Array} + * @memberof ChannelStateResponseFields */ - is_moderator?: boolean; + messages: Array; /** - * - * @type {boolean} - * @memberof ChannelMemberRequest + * Pending messages that this user has sent + * @type {Array} + * @memberof ChannelStateResponseFields */ - notifications_muted?: boolean; + pending_messages?: Array; /** - * Permission level of the member in the channel (DEPRECATED: use channel_role instead) - * @type {string} - * @memberof ChannelMemberRequest + * List of pinned messages in the channel + * @type {Array} + * @memberof ChannelStateResponseFields */ - role?: ChannelMemberRequestRoleEnum; + pinned_messages: Array; /** - * Whether member is shadow banned in this channel or not - * @type {boolean} - * @memberof ChannelMemberRequest + * List of read states + * @type {Array} + * @memberof ChannelStateResponseFields */ - shadow_banned?: boolean; + read?: Array; /** * - * @type {string} - * @memberof ChannelMemberRequest - */ - status?: string; - /** - * Date/time of the last update - * @type {string} - * @memberof ChannelMemberRequest + * @type {Array} + * @memberof ChannelStateResponseFields */ - updated_at?: string; + threads: Array; /** - * - * @type {UserObjectRequest} - * @memberof ChannelMemberRequest + * Number of channel watchers + * @type {number} + * @memberof ChannelStateResponseFields */ - user?: UserObjectRequest; + watcher_count?: number; /** - * - * @type {string} - * @memberof ChannelMemberRequest + * List of user who is watching the channel + * @type {Array} + * @memberof ChannelStateResponseFields */ - user_id?: string; + watchers?: Array; } - - -/** - * @export - */ -export const ChannelMemberRequestRoleEnum = { - MEMBER: 'member', - MODERATOR: 'moderator', - ADMIN: 'admin', - OWNER: 'owner' -} as const; -export type ChannelMemberRequestRoleEnum = typeof ChannelMemberRequestRoleEnum[keyof typeof ChannelMemberRequestRoleEnum]; - /** * * @export - * @interface ChannelMessages + * @interface ChannelTypeConfig */ -export interface ChannelMessages { +export interface ChannelTypeConfig { /** * - * @type {ChannelResponse} - * @memberof ChannelMessages + * @type {Array} + * @memberof ChannelTypeConfig */ - channel?: ChannelResponse; + allowed_flag_reasons?: Array; /** * - * @type {Array} - * @memberof ChannelMessages + * @type {string} + * @memberof ChannelTypeConfig */ - messages: Array; -} -/** - * - * @export - * @interface ChannelMute - */ -export interface ChannelMute { + automod: ChannelTypeConfigAutomodEnum; /** * - * @type {ChannelResponse} - * @memberof ChannelMute + * @type {string} + * @memberof ChannelTypeConfig */ - channel?: ChannelResponse; + automod_behavior: ChannelTypeConfigAutomodBehaviorEnum; /** - * Date/time of creation - * @type {string} - * @memberof ChannelMute + * + * @type {Thresholds} + * @memberof ChannelTypeConfig */ - created_at: string; + automod_thresholds?: Thresholds; /** - * Date/time of mute expiration + * * @type {string} - * @memberof ChannelMute + * @memberof ChannelTypeConfig */ - expires?: string; + blocklist?: string; /** - * Date/time of the last update + * * @type {string} - * @memberof ChannelMute + * @memberof ChannelTypeConfig */ - updated_at: string; + blocklist_behavior?: ChannelTypeConfigBlocklistBehaviorEnum; /** * - * @type {UserObject} - * @memberof ChannelMute + * @type {Array} + * @memberof ChannelTypeConfig */ - user?: UserObject; -} -/** - * - * @export - * @interface ChannelMuteRequest - */ -export interface ChannelMuteRequest { + blocklists?: Array; /** - * - * @type {ChannelResponseRequest} - * @memberof ChannelMuteRequest + * List of commands that channel supports + * @type {Array} + * @memberof ChannelTypeConfig */ - channel?: ChannelResponseRequest; + commands: Array; /** - * Date/time of creation - * @type {string} - * @memberof ChannelMuteRequest + * + * @type {boolean} + * @memberof ChannelTypeConfig */ - created_at?: string; + connect_events: boolean; /** - * Date/time of mute expiration + * * @type {string} - * @memberof ChannelMuteRequest + * @memberof ChannelTypeConfig */ - expires?: string; + created_at: string; /** - * Date/time of the last update - * @type {string} - * @memberof ChannelMuteRequest + * + * @type {boolean} + * @memberof ChannelTypeConfig */ - updated_at?: string; + custom_events: boolean; /** * - * @type {UserObjectRequest} - * @memberof ChannelMuteRequest + * @type {{ [key: string]: Array; }} + * @memberof ChannelTypeConfig */ - user?: UserObjectRequest; -} -/** - * - * @export - * @interface ChannelMutedEvent - */ -export interface ChannelMutedEvent { + grants: { [key: string]: Array; }; /** * - * @type {string} - * @memberof ChannelMutedEvent + * @type {boolean} + * @memberof ChannelTypeConfig */ - created_at: string; + mark_messages_pending: boolean; /** * - * @type {string} - * @memberof ChannelMutedEvent + * @type {number} + * @memberof ChannelTypeConfig */ - type: string; -} -/** - * - * @export - * @interface ChannelRequest - */ -export interface ChannelRequest { - [key: string]: any | any; + max_message_length: number; /** - * Enable or disable auto translation + * * @type {boolean} - * @memberof ChannelRequest + * @memberof ChannelTypeConfig */ - auto_translation_enabled?: boolean; + mutes: boolean; /** - * Switch auto translation language + * * @type {string} - * @memberof ChannelRequest + * @memberof ChannelTypeConfig */ - auto_translation_language?: string; + name: string; /** * - * @type {ChannelConfigRequest} - * @memberof ChannelRequest + * @type {Array} + * @memberof ChannelTypeConfig */ - config_overrides?: ChannelConfigRequest; + permissions: Array; /** * * @type {boolean} - * @memberof ChannelRequest + * @memberof ChannelTypeConfig */ - disabled?: boolean; + polls: boolean; /** - * Freeze or unfreeze the channel + * * @type {boolean} - * @memberof ChannelRequest + * @memberof ChannelTypeConfig */ - frozen?: boolean; + push_notifications: boolean; /** * - * @type {Array} - * @memberof ChannelRequest + * @type {boolean} + * @memberof ChannelTypeConfig */ - members?: Array; + quotes: boolean; /** * - * @type {Array} - * @memberof ChannelRequest - */ - own_capabilities?: Array; - /** - * Team the channel belongs to (if multi-tenant mode is enabled) - * @type {string} - * @memberof ChannelRequest + * @type {boolean} + * @memberof ChannelTypeConfig */ - team?: string; + reactions: boolean; /** * - * @type {Array} - * @memberof ChannelRequest + * @type {boolean} + * @memberof ChannelTypeConfig */ - truncated_at?: Array; + read_events: boolean; /** * - * @type {Array} - * @memberof ChannelRequest + * @type {boolean} + * @memberof ChannelTypeConfig */ - truncated_by?: Array; + reminders: boolean; /** * - * @type {string} - * @memberof ChannelRequest + * @type {boolean} + * @memberof ChannelTypeConfig */ - truncated_by_id?: string; -} -/** - * Represents channel in chat - * @export - * @interface ChannelResponse - */ -export interface ChannelResponse { - [key: string]: any | any; + replies: boolean; /** - * Whether auto translation is enabled or not + * * @type {boolean} - * @memberof ChannelResponse + * @memberof ChannelTypeConfig */ - auto_translation_enabled?: boolean; + search: boolean; /** - * Language to translate to when auto translation is active - * @type {string} - * @memberof ChannelResponse + * + * @type {boolean} + * @memberof ChannelTypeConfig */ - auto_translation_language?: string; + typing_events: boolean; /** - * Channel CID (:) + * * @type {string} - * @memberof ChannelResponse + * @memberof ChannelTypeConfig */ - cid: string; + updated_at: string; /** * - * @type {ChannelConfigWithInfo} - * @memberof ChannelResponse + * @type {boolean} + * @memberof ChannelTypeConfig */ - config?: ChannelConfigWithInfo; + uploads: boolean; /** - * Cooldown period after sending each message - * @type {number} - * @memberof ChannelResponse - */ - cooldown?: number; - /** - * Date/time of creation - * @type {string} - * @memberof ChannelResponse - */ - created_at?: string; - /** - * - * @type {UserObject} - * @memberof ChannelResponse - */ - created_by?: UserObject; - /** - * Date/time of deletion - * @type {string} - * @memberof ChannelResponse - */ - deleted_at?: string; - /** - * - * @type {boolean} - * @memberof ChannelResponse - */ - disabled: boolean; - /** - * Whether channel is frozen or not - * @type {boolean} - * @memberof ChannelResponse - */ - frozen: boolean; - /** - * Whether this channel is hidden by current user or not - * @type {boolean} - * @memberof ChannelResponse - */ - hidden?: boolean; - /** - * Date since when the message history is accessible - * @type {string} - * @memberof ChannelResponse - */ - hide_messages_before?: string; - /** - * Channel unique ID - * @type {string} - * @memberof ChannelResponse - */ - id: string; - /** - * Date of the last message sent - * @type {string} - * @memberof ChannelResponse - */ - last_message_at?: string; - /** - * Number of members in the channel - * @type {number} - * @memberof ChannelResponse - */ - member_count?: number; - /** - * List of channel members (max 100) - * @type {Array} - * @memberof ChannelResponse - */ - members?: Array; - /** - * Date of mute expiration - * @type {string} - * @memberof ChannelResponse - */ - mute_expires_at?: string; - /** - * Whether this channel is muted or not - * @type {boolean} - * @memberof ChannelResponse - */ - muted?: boolean; - /** - * List of channel capabilities of authenticated user - * @type {Array} - * @memberof ChannelResponse - */ - own_capabilities?: Array; - /** - * Team the channel belongs to (multi-tenant only) - * @type {string} - * @memberof ChannelResponse - */ - team?: string; - /** - * Date of the latest truncation of the channel - * @type {string} - * @memberof ChannelResponse - */ - truncated_at?: string; - /** - * - * @type {UserObject} - * @memberof ChannelResponse - */ - truncated_by?: UserObject; - /** - * Type of the channel - * @type {string} - * @memberof ChannelResponse - */ - type: string; - /** - * Date/time of the last update - * @type {string} - * @memberof ChannelResponse - */ - updated_at?: string; -} -/** - * Represents channel in chat - * @export - * @interface ChannelResponseRequest - */ -export interface ChannelResponseRequest { - [key: string]: any | any; - /** - * Whether auto translation is enabled or not - * @type {boolean} - * @memberof ChannelResponseRequest - */ - auto_translation_enabled?: boolean; - /** - * Language to translate to when auto translation is active - * @type {string} - * @memberof ChannelResponseRequest - */ - auto_translation_language?: string; - /** - * Channel CID (:) - * @type {string} - * @memberof ChannelResponseRequest - */ - cid?: string; - /** - * - * @type {ChannelConfigWithInfoRequest} - * @memberof ChannelResponseRequest - */ - config?: ChannelConfigWithInfoRequest; - /** - * Cooldown period after sending each message - * @type {number} - * @memberof ChannelResponseRequest - */ - cooldown?: number; - /** - * Date/time of creation - * @type {string} - * @memberof ChannelResponseRequest - */ - created_at?: string; - /** - * - * @type {UserObjectRequest} - * @memberof ChannelResponseRequest - */ - created_by?: UserObjectRequest; - /** - * Date/time of deletion - * @type {string} - * @memberof ChannelResponseRequest - */ - deleted_at?: string; - /** - * - * @type {boolean} - * @memberof ChannelResponseRequest - */ - disabled?: boolean; - /** - * Whether channel is frozen or not - * @type {boolean} - * @memberof ChannelResponseRequest - */ - frozen?: boolean; - /** - * Whether this channel is hidden by current user or not - * @type {boolean} - * @memberof ChannelResponseRequest - */ - hidden?: boolean; - /** - * Date since when the message history is accessible - * @type {string} - * @memberof ChannelResponseRequest - */ - hide_messages_before?: string; - /** - * Channel unique ID - * @type {string} - * @memberof ChannelResponseRequest - */ - id?: string; - /** - * Date of the last message sent - * @type {string} - * @memberof ChannelResponseRequest - */ - last_message_at?: string; - /** - * Number of members in the channel - * @type {number} - * @memberof ChannelResponseRequest - */ - member_count?: number; - /** - * List of channel members (max 100) - * @type {Array} - * @memberof ChannelResponseRequest - */ - members?: Array; - /** - * Date of mute expiration - * @type {string} - * @memberof ChannelResponseRequest - */ - mute_expires_at?: string; - /** - * Whether this channel is muted or not - * @type {boolean} - * @memberof ChannelResponseRequest - */ - muted?: boolean; - /** - * List of channel capabilities of authenticated user - * @type {Array} - * @memberof ChannelResponseRequest - */ - own_capabilities?: Array; - /** - * Team the channel belongs to (multi-tenant only) - * @type {string} - * @memberof ChannelResponseRequest - */ - team?: string; - /** - * Date of the latest truncation of the channel - * @type {string} - * @memberof ChannelResponseRequest - */ - truncated_at?: string; - /** - * - * @type {UserObjectRequest} - * @memberof ChannelResponseRequest - */ - truncated_by?: UserObjectRequest; - /** - * Type of the channel - * @type {string} - * @memberof ChannelResponseRequest - */ - type?: string; - /** - * Date/time of the last update - * @type {string} - * @memberof ChannelResponseRequest - */ - updated_at?: string; -} -/** - * - * @export - * @interface ChannelStateResponse - */ -export interface ChannelStateResponse { - /** - * - * @type {ChannelResponse} - * @memberof ChannelStateResponse - */ - channel?: ChannelResponse; - /** - * - * @type {string} - * @memberof ChannelStateResponse - */ - duration: string; - /** - * - * @type {boolean} - * @memberof ChannelStateResponse - */ - hidden?: boolean; - /** - * - * @type {string} - * @memberof ChannelStateResponse - */ - hide_messages_before?: string; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - members: Array; - /** - * - * @type {ChannelMember} - * @memberof ChannelStateResponse - */ - membership?: ChannelMember | null; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - messages: Array; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - pending_messages?: Array; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - pinned_messages: Array; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - read?: Array; - /** - * - * @type {number} - * @memberof ChannelStateResponse - */ - watcher_count?: number; - /** - * - * @type {Array} - * @memberof ChannelStateResponse - */ - watchers?: Array; -} -/** - * - * @export - * @interface ChannelStateResponseFields - */ -export interface ChannelStateResponseFields { - /** - * - * @type {ChannelResponse} - * @memberof ChannelStateResponseFields - */ - channel?: ChannelResponse; - /** - * Whether this channel is hidden or not - * @type {boolean} - * @memberof ChannelStateResponseFields - */ - hidden?: boolean; - /** - * Messages before this date are hidden from the user - * @type {string} - * @memberof ChannelStateResponseFields - */ - hide_messages_before?: string; - /** - * List of channel members - * @type {Array} - * @memberof ChannelStateResponseFields - */ - members: Array; - /** - * - * @type {ChannelMember} - * @memberof ChannelStateResponseFields - */ - membership?: ChannelMember | null; - /** - * List of channel messages - * @type {Array} - * @memberof ChannelStateResponseFields - */ - messages: Array; - /** - * Pending messages that this user has sent - * @type {Array} - * @memberof ChannelStateResponseFields - */ - pending_messages?: Array; - /** - * List of pinned messages in the channel - * @type {Array} - * @memberof ChannelStateResponseFields - */ - pinned_messages: Array; - /** - * List of read states - * @type {Array} - * @memberof ChannelStateResponseFields - */ - read?: Array; - /** - * Number of channel watchers - * @type {number} - * @memberof ChannelStateResponseFields - */ - watcher_count?: number; - /** - * List of user who is watching the channel - * @type {Array} - * @memberof ChannelStateResponseFields - */ - watchers?: Array; -} -/** - * - * @export - * @interface ChannelTruncatedEvent - */ -export interface ChannelTruncatedEvent { - /** - * - * @type {ChannelResponse} - * @memberof ChannelTruncatedEvent - */ - channel?: ChannelResponse; - /** - * - * @type {string} - * @memberof ChannelTruncatedEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof ChannelTruncatedEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof ChannelTruncatedEvent - */ - cid: string; - /** - * - * @type {string} - * @memberof ChannelTruncatedEvent - */ - created_at: string; - /** - * - * @type {string} - * @memberof ChannelTruncatedEvent - */ - type: string; -} -/** - * - * @export - * @interface ChannelTypeConfig - */ -export interface ChannelTypeConfig { - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - automod: ChannelTypeConfigAutomodEnum; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - automod_behavior: ChannelTypeConfigAutomodBehaviorEnum; - /** - * - * @type {Thresholds} - * @memberof ChannelTypeConfig - */ - automod_thresholds?: Thresholds; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - blocklist?: string; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - blocklist_behavior?: ChannelTypeConfigBlocklistBehaviorEnum; - /** - * - * @type {Array} - * @memberof ChannelTypeConfig - */ - blocklists?: Array; - /** - * List of commands that channel supports - * @type {Array} - * @memberof ChannelTypeConfig - */ - commands: Array; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - connect_events: boolean; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - created_at: string; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - custom_events: boolean; - /** - * - * @type {{ [key: string]: Array; }} - * @memberof ChannelTypeConfig - */ - grants: { [key: string]: Array; }; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - mark_messages_pending: boolean; - /** - * - * @type {number} - * @memberof ChannelTypeConfig - */ - max_message_length: number; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - message_retention: string; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - mutes: boolean; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - name: string; - /** - * - * @type {Array} - * @memberof ChannelTypeConfig - */ - permissions: Array; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - push_notifications: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - quotes: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - reactions: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - read_events: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - reminders: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - replies: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - search: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - typing_events: boolean; - /** - * - * @type {string} - * @memberof ChannelTypeConfig - */ - updated_at: string; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig - */ - uploads: boolean; - /** - * - * @type {boolean} - * @memberof ChannelTypeConfig + * + * @type {boolean} + * @memberof ChannelTypeConfig */ url_enrichment: boolean; } @@ -3582,208 +2707,44 @@ export const ChannelTypeConfigAutomodEnum = { export type ChannelTypeConfigAutomodEnum = typeof ChannelTypeConfigAutomodEnum[keyof typeof ChannelTypeConfigAutomodEnum]; /** - * @export - */ -export const ChannelTypeConfigAutomodBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type ChannelTypeConfigAutomodBehaviorEnum = typeof ChannelTypeConfigAutomodBehaviorEnum[keyof typeof ChannelTypeConfigAutomodBehaviorEnum]; - -/** - * @export - */ -export const ChannelTypeConfigBlocklistBehaviorEnum = { - FLAG: 'flag', - BLOCK: 'block' -} as const; -export type ChannelTypeConfigBlocklistBehaviorEnum = typeof ChannelTypeConfigBlocklistBehaviorEnum[keyof typeof ChannelTypeConfigBlocklistBehaviorEnum]; - -/** - * - * @export - * @interface ChannelUnFrozenEvent - */ -export interface ChannelUnFrozenEvent { - /** - * - * @type {string} - * @memberof ChannelUnFrozenEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof ChannelUnFrozenEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof ChannelUnFrozenEvent - */ - cid: string; - /** - * - * @type {string} - * @memberof ChannelUnFrozenEvent - */ - created_at: string; - /** - * - * @type {string} - * @memberof ChannelUnFrozenEvent - */ - type: string; -} -/** - * - * @export - * @interface ChannelUnmutedEvent - */ -export interface ChannelUnmutedEvent { - /** - * - * @type {string} - * @memberof ChannelUnmutedEvent - */ - created_at: string; - /** - * - * @type {string} - * @memberof ChannelUnmutedEvent - */ - type: string; -} -/** - * - * @export - * @interface ChannelUpdatedEvent - */ -export interface ChannelUpdatedEvent { - /** - * - * @type {ChannelResponse} - * @memberof ChannelUpdatedEvent - */ - channel?: ChannelResponse; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - cid: string; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - created_at: string; - /** - * - * @type {Message} - * @memberof ChannelUpdatedEvent - */ - message?: Message | null; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - team?: string; - /** - * - * @type {string} - * @memberof ChannelUpdatedEvent - */ - type: string; - /** - * - * @type {UserObject} - * @memberof ChannelUpdatedEvent - */ - user?: UserObject; -} -/** - * - * @export - * @interface ChannelVisibleEvent - */ -export interface ChannelVisibleEvent { - /** - * - * @type {string} - * @memberof ChannelVisibleEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof ChannelVisibleEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof ChannelVisibleEvent - */ - cid: string; - /** - * - * @type {string} - * @memberof ChannelVisibleEvent - */ - created_at: string; - /** - * - * @type {string} - * @memberof ChannelVisibleEvent - */ - type: string; - /** - * - * @type {UserObject} - * @memberof ChannelVisibleEvent - */ - user?: UserObject; -} -/** + * @export + */ +export const ChannelTypeConfigAutomodBehaviorEnum = { + FLAG: 'flag', + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' +} as const; +export type ChannelTypeConfigAutomodBehaviorEnum = typeof ChannelTypeConfigAutomodBehaviorEnum[keyof typeof ChannelTypeConfigAutomodBehaviorEnum]; + +/** + * @export + */ +export const ChannelTypeConfigBlocklistBehaviorEnum = { + FLAG: 'flag', + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' +} as const; +export type ChannelTypeConfigBlocklistBehaviorEnum = typeof ChannelTypeConfigBlocklistBehaviorEnum[keyof typeof ChannelTypeConfigBlocklistBehaviorEnum]; + +/** * * @export - * @interface ChannelsResponse + * @interface CheckExternalStorageResponse */ -export interface ChannelsResponse { +export interface CheckExternalStorageResponse { /** - * List of channels - * @type {Array} - * @memberof ChannelsResponse + * Duration of the request in human-readable format + * @type {string} + * @memberof CheckExternalStorageResponse */ - channels: Array; + duration: string; /** * * @type {string} - * @memberof ChannelsResponse + * @memberof CheckExternalStorageResponse */ - duration: string; + file_url: string; } -/** - * @type ChatEvent - * The discriminator object for all websocket events, you should use this to map event payloads to their own type - * @export - */ -export type ChatEvent = { type: 'any' } & AnyEvent | { type: 'channel.created' } & ChannelCreatedEvent | { type: 'channel.deleted' } & ChannelDeletedEvent | { type: 'channel.frozen' } & ChannelFrozenEvent | { type: 'channel.hidden' } & ChannelHiddenEvent | { type: 'channel.kicked' } & ChannelKickedEvent | { type: 'channel.muted' } & ChannelMutedEvent | { type: 'channel.truncated' } & ChannelTruncatedEvent | { type: 'channel.unfrozen' } & ChannelUnFrozenEvent | { type: 'channel.unmuted' } & ChannelUnmutedEvent | { type: 'channel.updated' } & ChannelUpdatedEvent | { type: 'channel.visible' } & ChannelVisibleEvent | { type: 'custom' } & AnyEvent | { type: 'flag.updated' } & FlagUpdatedEvent | { type: 'health.check' } & HealthCheckEvent | { type: 'member.added' } & MemberAddedEvent | { type: 'member.removed' } & MemberRemovedEvent | { type: 'member.updated' } & MemberUpdatedEvent | { type: 'message.deleted' } & MessageDeletedEvent | { type: 'message.flagged' } & MessageFlaggedEvent | { type: 'message.new' } & MessageNewEvent | { type: 'message.read' } & MessageReadEvent | { type: 'message.unblocked' } & MessageUnblockedEvent | { type: 'message.updated' } & MessageUpdatedEvent | { type: 'notification.added_to_channel' } & NotificationAddedToChannelEvent | { type: 'notification.channel_deleted' } & NotificationChannelDeletedEvent | { type: 'notification.channel_mutes_updated' } & NotificationChannelMutesUpdatedEvent | { type: 'notification.channel_truncated' } & NotificationChannelTruncatedEvent | { type: 'notification.invite_accepted' } & NotificationInviteAcceptedEvent | { type: 'notification.invite_rejected' } & NotificationInviteRejectedEvent | { type: 'notification.invited' } & NotificationInvitedEvent | { type: 'notification.mark_read' } & NotificationMarkReadEvent | { type: 'notification.mark_unread' } & NotificationMarkUnreadEvent | { type: 'notification.message_new' } & NotificationNewMessageEvent | { type: 'notification.mutes_updated' } & NotificationMutesUpdatedEvent | { type: 'notification.removed_from_channel' } & NotificationRemovedFromChannelEvent | { type: 'reaction.deleted' } & ReactionDeletedEvent | { type: 'reaction.new' } & ReactionNewEvent | { type: 'reaction.updated' } & ReactionUpdatedEvent | { type: 'typing.start' } & TypingStartEvent | { type: 'typing.stop' } & TypingStopEvent | { type: 'user.banned' } & UserBannedEvent | { type: 'user.deactivated' } & UserDeactivatedEvent | { type: 'user.deleted' } & UserDeletedEvent | { type: 'user.flagged' } & UserFlaggedEvent | { type: 'user.muted' } & UserMutedEvent | { type: 'user.presence.changed' } & UserPresenceChangedEvent | { type: 'user.reactivated' } & UserReactivatedEvent | { type: 'user.unbanned' } & UserUnbannedEvent | { type: 'user.unmuted' } & UserUnmutedEvent | { type: 'user.unread_message_reminder' } & UserUnreadReminderEvent | { type: 'user.updated' } & UserUpdatedEvent | { type: 'user.watching.start' } & UserWatchingStartEvent | { type: 'user.watching.stop' } & UserWatchingStopEvent; /** * * @export @@ -3834,10 +2795,10 @@ export interface CheckPushRequest { skip_devices?: boolean; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof CheckPushRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -4084,37 +3045,6 @@ export interface Command { */ readonly updated_at?: string; } -/** - * Represents custom chat command - * @export - * @interface CommandRequest - */ -export interface CommandRequest { - /** - * Arguments help text, shown in commands auto-completion - * @type {string} - * @memberof CommandRequest - */ - args?: string; - /** - * Description, shown in commands auto-completion - * @type {string} - * @memberof CommandRequest - */ - description?: string; - /** - * Unique command name - * @type {string} - * @memberof CommandRequest - */ - name?: string; - /** - * Set name used for grouping commands - * @type {string} - * @memberof CommandRequest - */ - set?: string; -} /** * * @export @@ -4159,69 +3089,6 @@ export const ConfigDefaultRoleEnum = { } as const; export type ConfigDefaultRoleEnum = typeof ConfigDefaultRoleEnum[keyof typeof ConfigDefaultRoleEnum]; -/** - * - * @export - * @interface ConfigRequest - */ -export interface ConfigRequest { - /** - * - * @type {string} - * @memberof ConfigRequest - */ - app_certificate: string; - /** - * - * @type {string} - * @memberof ConfigRequest - */ - app_id: string; - /** - * - * @type {string} - * @memberof ConfigRequest - */ - default_role?: ConfigRequestDefaultRoleEnum; - /** - * - * @type {{ [key: string]: string; }} - * @memberof ConfigRequest - */ - role_map?: { [key: string]: string; }; -} - - -/** - * @export - */ -export const ConfigRequestDefaultRoleEnum = { - ATTENDEE: 'attendee', - PUBLISHER: 'publisher', - SUBSCRIBER: 'subscriber', - ADMIN: 'admin' -} as const; -export type ConfigRequestDefaultRoleEnum = typeof ConfigRequestDefaultRoleEnum[keyof typeof ConfigRequestDefaultRoleEnum]; - -/** - * - * @export - * @interface ConnectRequest - */ -export interface ConnectRequest { - /** - * - * @type {DeviceFields} - * @memberof ConnectRequest - */ - device?: DeviceFields; - /** - * - * @type {UserObject} - * @memberof ConnectRequest - */ - user_details: UserObject; -} /** * Block list contains restricted words * @export @@ -4234,6 +3101,12 @@ export interface CreateBlockListRequest { * @memberof CreateBlockListRequest */ name: string; + /** + * Block list type. + * @type {string} + * @memberof CreateBlockListRequest + */ + type?: CreateBlockListRequestTypeEnum; /** * List of words to block * @type {Array} @@ -4241,6 +3114,19 @@ export interface CreateBlockListRequest { */ words: Array; } + + +/** + * @export + */ +export const CreateBlockListRequestTypeEnum = { + REGEX: 'regex', + DOMAIN: 'domain', + EMAIL: 'email', + WORD: 'word' +} as const; +export type CreateBlockListRequestTypeEnum = typeof CreateBlockListRequestTypeEnum[keyof typeof CreateBlockListRequestTypeEnum]; + /** * * @export @@ -4267,12 +3153,12 @@ export interface CreateCallRequest { type: CreateCallRequestTypeEnum; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof CreateCallRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** - * **Server-side only**. User ID which server acts upon + * * @type {string} * @memberof CreateCallRequest */ @@ -4343,7 +3229,7 @@ export interface CreateChannelTypeRequest { * @type {string} * @memberof CreateChannelTypeRequest */ - automod_behavior?: CreateChannelTypeRequestAutomodBehaviorEnum; + automod_behavior: CreateChannelTypeRequestAutomodBehaviorEnum; /** * Name of the blocklist to use * @type {string} @@ -4358,10 +3244,10 @@ export interface CreateChannelTypeRequest { blocklist_behavior?: CreateChannelTypeRequestBlocklistBehaviorEnum; /** * - * @type {{ [key: string]: BlockListOptionsRequest; }} + * @type {Array} * @memberof CreateChannelTypeRequest */ - blocklists?: { [key: string]: BlockListOptionsRequest; }; + blocklists?: Array; /** * List of commands that channel supports * @type {Array} @@ -4397,9 +3283,9 @@ export interface CreateChannelTypeRequest { * @type {number} * @memberof CreateChannelTypeRequest */ - max_message_length?: number; + max_message_length: number; /** - * Number of days to keep messages. 'infinite' disables retention + * * @type {string} * @memberof CreateChannelTypeRequest */ @@ -4422,6 +3308,12 @@ export interface CreateChannelTypeRequest { * @memberof CreateChannelTypeRequest */ permissions?: Array; + /** + * Enables polls + * @type {boolean} + * @memberof CreateChannelTypeRequest + */ + polls?: boolean; /** * Enables push notifications * @type {boolean} @@ -4497,7 +3389,8 @@ export type CreateChannelTypeRequestAutomodBehaviorEnum = typeof CreateChannelTy */ export const CreateChannelTypeRequestBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type CreateChannelTypeRequestBlocklistBehaviorEnum = typeof CreateChannelTypeRequestBlocklistBehaviorEnum[keyof typeof CreateChannelTypeRequestBlocklistBehaviorEnum]; @@ -4507,6 +3400,12 @@ export type CreateChannelTypeRequestBlocklistBehaviorEnum = typeof CreateChannel * @interface CreateChannelTypeResponse */ export interface CreateChannelTypeResponse { + /** + * + * @type {Array} + * @memberof CreateChannelTypeResponse + */ + allowed_flag_reasons?: Array; /** * * @type {string} @@ -4591,12 +3490,6 @@ export interface CreateChannelTypeResponse { * @memberof CreateChannelTypeResponse */ max_message_length: number; - /** - * - * @type {string} - * @memberof CreateChannelTypeResponse - */ - message_retention: string; /** * * @type {boolean} @@ -4611,10 +3504,16 @@ export interface CreateChannelTypeResponse { name: string; /** * - * @type {Array} + * @type {Array} + * @memberof CreateChannelTypeResponse + */ + permissions: Array; + /** + * + * @type {boolean} * @memberof CreateChannelTypeResponse */ - permissions: Array; + polls: boolean; /** * * @type {boolean} @@ -4699,7 +3598,8 @@ export type CreateChannelTypeResponseAutomodEnum = typeof CreateChannelTypeRespo */ export const CreateChannelTypeResponseAutomodBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type CreateChannelTypeResponseAutomodBehaviorEnum = typeof CreateChannelTypeResponseAutomodBehaviorEnum[keyof typeof CreateChannelTypeResponseAutomodBehaviorEnum]; @@ -4708,7 +3608,8 @@ export type CreateChannelTypeResponseAutomodBehaviorEnum = typeof CreateChannelT */ export const CreateChannelTypeResponseBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type CreateChannelTypeResponseBlocklistBehaviorEnum = typeof CreateChannelTypeResponseBlocklistBehaviorEnum[keyof typeof CreateChannelTypeResponseBlocklistBehaviorEnum]; @@ -4773,13 +3674,13 @@ export interface CreateDeviceRequest { * @type {string} * @memberof CreateDeviceRequest */ - id?: string; + id: string; /** * * @type {string} * @memberof CreateDeviceRequest */ - push_provider?: CreateDeviceRequestPushProviderEnum; + push_provider: CreateDeviceRequestPushProviderEnum; /** * * @type {string} @@ -4818,6 +3719,118 @@ export const CreateDeviceRequestPushProviderEnum = { } as const; export type CreateDeviceRequestPushProviderEnum = typeof CreateDeviceRequestPushProviderEnum[keyof typeof CreateDeviceRequestPushProviderEnum]; +/** + * + * @export + * @interface CreateExternalStorageRequest + */ +export interface CreateExternalStorageRequest { + /** + * + * @type {S3Request} + * @memberof CreateExternalStorageRequest + */ + aws_s3?: S3Request; + /** + * + * @type {AzureRequest} + * @memberof CreateExternalStorageRequest + */ + azure_blob?: AzureRequest; + /** + * + * @type {string} + * @memberof CreateExternalStorageRequest + */ + bucket: string; + /** + * + * @type {string} + * @memberof CreateExternalStorageRequest + */ + gcs_credentials?: string; + /** + * + * @type {string} + * @memberof CreateExternalStorageRequest + */ + name: string; + /** + * + * @type {string} + * @memberof CreateExternalStorageRequest + */ + path?: string; + /** + * + * @type {string} + * @memberof CreateExternalStorageRequest + */ + storage_type: CreateExternalStorageRequestStorageTypeEnum; +} + + +/** + * @export + */ +export const CreateExternalStorageRequestStorageTypeEnum = { + S3: 's3', + GCS: 'gcs', + ABS: 'abs' +} as const; +export type CreateExternalStorageRequestStorageTypeEnum = typeof CreateExternalStorageRequestStorageTypeEnum[keyof typeof CreateExternalStorageRequestStorageTypeEnum]; + +/** + * + * @export + * @interface CreateExternalStorageResponse + */ +export interface CreateExternalStorageResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof CreateExternalStorageResponse + */ + duration: string; +} +/** + * + * @export + * @interface CreateGuestRequest + */ +export interface CreateGuestRequest { + /** + * + * @type {UserRequest} + * @memberof CreateGuestRequest + */ + user: UserRequest; +} +/** + * + * @export + * @interface CreateGuestResponse + */ +export interface CreateGuestResponse { + /** + * the access token to authenticate the user + * @type {string} + * @memberof CreateGuestResponse + */ + access_token: string; + /** + * + * @type {string} + * @memberof CreateGuestResponse + */ + duration: string; + /** + * + * @type {UserResponse} + * @memberof CreateGuestResponse + */ + user: UserResponse; +} /** * * @export @@ -4829,7 +3842,7 @@ export interface CreateImportRequest { * @type {string} * @memberof CreateImportRequest */ - mode?: CreateImportRequestModeEnum; + mode: CreateImportRequestModeEnum; /** * * @type {string} @@ -4865,46 +3878,179 @@ export interface CreateImportResponse { * @type {ImportTask} * @memberof CreateImportResponse */ - import_task?: ImportTask; + import_task?: ImportTask; +} +/** + * + * @export + * @interface CreateImportURLRequest + */ +export interface CreateImportURLRequest { + /** + * + * @type {string} + * @memberof CreateImportURLRequest + */ + filename?: string; +} +/** + * + * @export + * @interface CreateImportURLResponse + */ +export interface CreateImportURLResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof CreateImportURLResponse + */ + duration: string; + /** + * + * @type {string} + * @memberof CreateImportURLResponse + */ + path: string; + /** + * + * @type {string} + * @memberof CreateImportURLResponse + */ + upload_url: string; } /** * * @export - * @interface CreateImportURLRequest + * @interface CreatePollOptionRequest */ -export interface CreateImportURLRequest { +export interface CreatePollOptionRequest { + /** + * + * @type {{ [key: string]: any; }} + * @memberof CreatePollOptionRequest + */ + Custom?: { [key: string]: any; }; + /** + * + * @type {number} + * @memberof CreatePollOptionRequest + */ + position?: number; /** * * @type {string} - * @memberof CreateImportURLRequest + * @memberof CreatePollOptionRequest */ - filename?: string; + text: string; + /** + * + * @type {UserRequest} + * @memberof CreatePollOptionRequest + */ + user?: UserRequest; + /** + * + * @type {string} + * @memberof CreatePollOptionRequest + */ + user_id?: string; } /** - * + * Contains all information needed to create a new poll * @export - * @interface CreateImportURLResponse + * @interface CreatePollRequest */ -export interface CreateImportURLResponse { +export interface CreatePollRequest { /** - * Duration of the request in human-readable format + * + * @type {{ [key: string]: any; }} + * @memberof CreatePollRequest + */ + Custom?: { [key: string]: any; }; + /** + * Indicates whether users can suggest user defined answers + * @type {boolean} + * @memberof CreatePollRequest + */ + allow_answers?: boolean; + /** + * + * @type {boolean} + * @memberof CreatePollRequest + */ + allow_user_suggested_options?: boolean; + /** + * A description of the poll * @type {string} - * @memberof CreateImportURLResponse + * @memberof CreatePollRequest */ - duration: string; + description?: string; + /** + * Indicates whether users can cast multiple votes + * @type {boolean} + * @memberof CreatePollRequest + */ + enforce_unique_vote?: boolean; /** * * @type {string} - * @memberof CreateImportURLResponse + * @memberof CreatePollRequest */ - path: string; + id?: string; + /** + * Indicates whether the poll is open for voting + * @type {boolean} + * @memberof CreatePollRequest + */ + is_closed?: boolean; + /** + * Indicates the maximum amount of votes a user can cast + * @type {number} + * @memberof CreatePollRequest + */ + max_votes_allowed?: number; + /** + * The name of the poll + * @type {string} + * @memberof CreatePollRequest + */ + name: string; + /** + * + * @type {Array} + * @memberof CreatePollRequest + */ + options?: Array; + /** + * + * @type {UserRequest} + * @memberof CreatePollRequest + */ + user?: UserRequest; /** * * @type {string} - * @memberof CreateImportURLResponse + * @memberof CreatePollRequest */ - upload_url: string; + user_id?: string; + /** + * + * @type {string} + * @memberof CreatePollRequest + */ + voting_visibility?: CreatePollRequestVotingVisibilityEnum; } + + +/** + * @export + */ +export const CreatePollRequestVotingVisibilityEnum = { + ANONYMOUS: 'anonymous', + PUBLIC: 'public' +} as const; +export type CreatePollRequestVotingVisibilityEnum = typeof CreatePollRequestVotingVisibilityEnum[keyof typeof CreatePollRequestVotingVisibilityEnum]; + /** * * @export @@ -4948,30 +4094,17 @@ export interface DataDogInfo { * @type {string} * @memberof DataDogInfo */ - api_key: string; + api_key?: string; /** * - * @type {string} + * @type {boolean} * @memberof DataDogInfo */ - site: string; -} -/** - * - * @export - * @interface DataDogInfoRequest - */ -export interface DataDogInfoRequest { - /** - * - * @type {string} - * @memberof DataDogInfoRequest - */ - api_key?: string; + enabled?: boolean; /** * * @type {string} - * @memberof DataDogInfoRequest + * @memberof DataDogInfo */ site?: string; } @@ -4993,12 +4126,6 @@ export interface DeactivateUserRequest { * @memberof DeactivateUserRequest */ mark_messages_deleted?: boolean; - /** - * - * @type {string} - * @memberof DeactivateUserRequest - */ - user_id: string; } /** * @@ -5031,6 +4158,12 @@ export interface DeactivateUsersRequest { * @memberof DeactivateUsersRequest */ created_by_id?: string; + /** + * + * @type {boolean} + * @memberof DeactivateUsersRequest + */ + mark_channels_deleted?: boolean; /** * Makes messages appear to be deleted * @type {boolean} @@ -5093,7 +4226,7 @@ export interface DeleteChannelsRequest { * @type {Array} * @memberof DeleteChannelsRequest */ - cids?: Array; + cids: Array; /** * Specify if channels and all ressources should be hard deleted * @type {boolean} @@ -5167,27 +4300,34 @@ export interface DeleteCommandResponse { /** * * @export - * @interface DeleteUserResponse + * @interface DeleteExternalStorageResponse */ -export interface DeleteUserResponse { +export interface DeleteExternalStorageResponse { /** * Duration of the request in human-readable format * @type {string} - * @memberof DeleteUserResponse + * @memberof DeleteExternalStorageResponse */ duration: string; +} +/** + * + * @export + * @interface DeleteMessageResponse + */ +export interface DeleteMessageResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof DeleteUserResponse + * @memberof DeleteMessageResponse */ - task_id: string; + duration: string; /** * - * @type {UserObject} - * @memberof DeleteUserResponse + * @type {MessageResponse} + * @memberof DeleteMessageResponse */ - user?: UserObject; + message: MessageResponse; } /** * @@ -5195,6 +4335,17 @@ export interface DeleteUserResponse { * @interface DeleteUsersRequest */ export interface DeleteUsersRequest { + /** + * Calls delete mode. + * Affected calls are those that include exactly two members, one of whom is the user being deleted. + * + * * null or empty string - doesn't delete any calls + * * soft - marks user's calls and their related data as deleted (soft-delete) + * * hard - deletes user's calls and their data completely (hard-delete) + * @type {string} + * @memberof DeleteUsersRequest + */ + calls?: DeleteUsersRequestCallsEnum; /** * Conversation channels delete mode. * Conversation channel is any channel which only has two members one of which is the user being deleted. @@ -5217,6 +4368,12 @@ export interface DeleteUsersRequest { * @memberof DeleteUsersRequest */ messages?: DeleteUsersRequestMessagesEnum; + /** + * + * @type {string} + * @memberof DeleteUsersRequest + */ + new_call_owner_id?: string; /** * * @type {string} @@ -5242,6 +4399,15 @@ export interface DeleteUsersRequest { } +/** + * @export + */ +export const DeleteUsersRequestCallsEnum = { + SOFT: 'soft', + HARD: 'hard' +} as const; +export type DeleteUsersRequestCallsEnum = typeof DeleteUsersRequestCallsEnum[keyof typeof DeleteUsersRequestCallsEnum]; + /** * @export */ @@ -5275,210 +4441,73 @@ export type DeleteUsersRequestUserEnum = typeof DeleteUsersRequestUserEnum[keyof * * @export * @interface DeleteUsersResponse - */ -export interface DeleteUsersResponse { - /** - * Duration of the request in human-readable format - * @type {string} - * @memberof DeleteUsersResponse - */ - duration: string; - /** - * - * @type {string} - * @memberof DeleteUsersResponse - */ - task_id: string; -} -/** - * - * @export - * @interface Device - */ -export interface Device { - /** - * - * @type {string} - * @memberof Device - */ - created_at: string; - /** - * - * @type {boolean} - * @memberof Device - */ - disabled?: boolean; - /** - * - * @type {string} - * @memberof Device - */ - disabled_reason?: string; - /** - * Device ID - * @type {string} - * @memberof Device - */ - id: string; - /** - * - * @type {string} - * @memberof Device - */ - push_provider: DevicePushProviderEnum; - /** - * Name of the push provider configuration - * @type {string} - * @memberof Device - */ - push_provider_name?: string; - /** - * - * @type {string} - * @memberof Device - */ - user_id: string; - /** - * - * @type {boolean} - * @memberof Device - */ - voip?: boolean; -} - - -/** - * @export - */ -export const DevicePushProviderEnum = { - FIREBASE: 'firebase', - APN: 'apn', - HUAWEI: 'huawei', - XIAOMI: 'xiaomi' -} as const; -export type DevicePushProviderEnum = typeof DevicePushProviderEnum[keyof typeof DevicePushProviderEnum]; - -/** - * - * @export - * @interface DeviceErrorInfo - */ -export interface DeviceErrorInfo { - /** - * - * @type {string} - * @memberof DeviceErrorInfo - */ - error_message: string; - /** - * - * @type {string} - * @memberof DeviceErrorInfo - */ - provider: string; - /** - * - * @type {string} - * @memberof DeviceErrorInfo - */ - provider_name: string; -} -/** - * - * @export - * @interface DeviceFields - */ -export interface DeviceFields { - /** - * Device ID - * @type {string} - * @memberof DeviceFields - */ - id: string; - /** - * - * @type {string} - * @memberof DeviceFields - */ - push_provider: DeviceFieldsPushProviderEnum; + */ +export interface DeleteUsersResponse { /** - * Name of the push provider configuration + * Duration of the request in human-readable format * @type {string} - * @memberof DeviceFields + * @memberof DeleteUsersResponse */ - push_provider_name?: string; + duration: string; /** * - * @type {boolean} - * @memberof DeviceFields + * @type {string} + * @memberof DeleteUsersResponse */ - voip?: boolean; + task_id: string; } - - -/** - * @export - */ -export const DeviceFieldsPushProviderEnum = { - FIREBASE: 'firebase', - APN: 'apn', - HUAWEI: 'huawei', - XIAOMI: 'xiaomi' -} as const; -export type DeviceFieldsPushProviderEnum = typeof DeviceFieldsPushProviderEnum[keyof typeof DeviceFieldsPushProviderEnum]; - /** * * @export - * @interface DeviceRequest + * @interface Device */ -export interface DeviceRequest { +export interface Device { /** * * @type {string} - * @memberof DeviceRequest + * @memberof Device */ - created_at?: string; + created_at: string; /** * * @type {boolean} - * @memberof DeviceRequest + * @memberof Device */ disabled?: boolean; /** * * @type {string} - * @memberof DeviceRequest + * @memberof Device */ disabled_reason?: string; /** * Device ID * @type {string} - * @memberof DeviceRequest + * @memberof Device */ id: string; /** * * @type {string} - * @memberof DeviceRequest + * @memberof Device */ - push_provider: DeviceRequestPushProviderEnum; + push_provider: DevicePushProviderEnum; /** * Name of the push provider configuration * @type {string} - * @memberof DeviceRequest + * @memberof Device */ push_provider_name?: string; /** * * @type {string} - * @memberof DeviceRequest + * @memberof Device */ - user_id?: string; + user_id: string; /** * * @type {boolean} - * @memberof DeviceRequest + * @memberof Device */ voip?: boolean; } @@ -5487,172 +4516,63 @@ export interface DeviceRequest { /** * @export */ -export const DeviceRequestPushProviderEnum = { +export const DevicePushProviderEnum = { FIREBASE: 'firebase', APN: 'apn', HUAWEI: 'huawei', XIAOMI: 'xiaomi' } as const; -export type DeviceRequestPushProviderEnum = typeof DeviceRequestPushProviderEnum[keyof typeof DeviceRequestPushProviderEnum]; +export type DevicePushProviderEnum = typeof DevicePushProviderEnum[keyof typeof DevicePushProviderEnum]; /** * * @export - * @interface ErrorResult + * @interface DeviceErrorInfo */ -export interface ErrorResult { - /** - * - * @type {any} - * @memberof ErrorResult - */ - description: any | null; +export interface DeviceErrorInfo { /** * * @type {string} - * @memberof ErrorResult + * @memberof DeviceErrorInfo */ - stacktrace?: string; + error_message: string; /** * * @type {string} - * @memberof ErrorResult + * @memberof DeviceErrorInfo */ - type: string; + provider: string; /** * * @type {string} - * @memberof ErrorResult + * @memberof DeviceErrorInfo */ - version?: string; + provider_name: string; } /** - * Represents an BaseEvent that happened in Stream Chat + * * @export - * @interface Event + * @interface ErrorResult */ -export interface Event { - [key: string]: any | any; - /** - * Only applicable to `message.flagged` BaseEvent. - * @type {boolean} - * @memberof Event - */ - automoderation?: boolean; - /** - * - * @type {ModerationResponse} - * @memberof Event - */ - automoderation_scores?: ModerationResponse; - /** - * - * @type {ChannelResponse} - * @memberof Event - */ - channel?: ChannelResponse; - /** - * - * @type {string} - * @memberof Event - */ - channel_id?: string; - /** - * - * @type {string} - * @memberof Event - */ - channel_type?: string; - /** - * Channel CID (:) - * @type {string} - * @memberof Event - */ - cid?: string; - /** - * Only applicable to `health.check` BaseEvent - * @type {string} - * @memberof Event - */ - connection_id?: string; - /** - * Date/time of creation - * @type {string} - * @memberof Event - */ - created_at: string; - /** - * - * @type {UserObject} - * @memberof Event - */ - created_by?: UserObject; - /** - * - * @type {OwnUser} - * @memberof Event - */ - me?: OwnUser; - /** - * - * @type {ChannelMember} - * @memberof Event - */ - member?: ChannelMember | null; - /** - * - * @type {Message} - * @memberof Event - */ - message?: Message | null; - /** - * ID of thread. Used in typing events - * @type {string} - * @memberof Event - */ - parent_id?: string; +export interface ErrorResult { /** * - * @type {Reaction} - * @memberof Event - */ - reaction?: Reaction | null; - /** - * Ban reason. Only applicable to `user.banned` BaseEvent * @type {string} - * @memberof Event + * @memberof ErrorResult */ - reason?: string; + stacktrace?: string; /** * * @type {string} - * @memberof Event - */ - team?: string; - /** - * Event type. To use custom BaseEvent types see Custom Events documentation - * @type {string} - * @memberof Event + * @memberof ErrorResult */ type: string; - /** - * - * @type {UserObject} - * @memberof Event - */ - user?: UserObject; /** * * @type {string} - * @memberof Event - */ - user_id?: string; - /** - * Number of watchers who received this BaseEvent - * @type {number} - * @memberof Event + * @memberof ErrorResult */ - watcher_count?: number; + version?: string; } /** * @@ -5674,132 +4594,41 @@ export interface EventNotificationSettings { enabled: boolean; } /** - * Represents an BaseEvent that happened in Stream Chat + * * @export * @interface EventRequest */ export interface EventRequest { - [key: string]: any | any; - /** - * Only applicable to `message.flagged` BaseEvent. - * @type {boolean} - * @memberof EventRequest - */ - automoderation?: boolean; - /** - * - * @type {ModerationResponseRequest} - * @memberof EventRequest - */ - automoderation_scores?: ModerationResponseRequest; - /** - * - * @type {ChannelResponseRequest} - * @memberof EventRequest - */ - channel?: ChannelResponseRequest; - /** - * - * @type {string} - * @memberof EventRequest - */ - channel_id?: string; - /** - * - * @type {string} - * @memberof EventRequest - */ - channel_type?: string; - /** - * Channel CID (:) - * @type {string} - * @memberof EventRequest - */ - cid?: string; - /** - * Only applicable to `health.check` BaseEvent - * @type {string} - * @memberof EventRequest - */ - connection_id?: string; - /** - * Date/time of creation - * @type {string} - * @memberof EventRequest - */ - created_at?: string; - /** - * - * @type {UserObjectRequest} - * @memberof EventRequest - */ - created_by?: UserObjectRequest; - /** - * - * @type {OwnUserRequest} - * @memberof EventRequest - */ - me?: OwnUserRequest; /** * - * @type {ChannelMemberRequest} + * @type {{ [key: string]: any; }} * @memberof EventRequest */ - member?: ChannelMemberRequest | null; + custom?: { [key: string]: any; }; /** * - * @type {MessageRequest1} - * @memberof EventRequest - */ - message?: MessageRequest1; - /** - * ID of thread. Used in typing events * @type {string} * @memberof EventRequest */ parent_id?: string; - /** - * - * @type {ReactionRequest} - * @memberof EventRequest - */ - reaction?: ReactionRequest | null; - /** - * Ban reason. Only applicable to `user.banned` BaseEvent - * @type {string} - * @memberof EventRequest - */ - reason?: string; /** * * @type {string} * @memberof EventRequest */ - team?: string; - /** - * Event type. To use custom BaseEvent types see Custom Events documentation - * @type {string} - * @memberof EventRequest - */ type: string; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof EventRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} * @memberof EventRequest */ user_id?: string; - /** - * Number of watchers who received this BaseEvent - * @type {number} - * @memberof EventRequest - */ - watcher_count?: number; } /** * @@ -5815,10 +4644,10 @@ export interface EventResponse { duration: string; /** * - * @type {Event} + * @type {WSEvent} * @memberof EventResponse */ - event?: Event; + event: WSEvent; } /** * @@ -5828,10 +4657,10 @@ export interface EventResponse { export interface ExportChannelsRequest { /** * Export options for channels - * @type {Array} + * @type {Array} * @memberof ExportChannelsRequest */ - channels?: Array; + channels: Array; /** * Set if deleted message text should be cleared * @type {boolean} @@ -5844,6 +4673,12 @@ export interface ExportChannelsRequest { * @memberof ExportChannelsRequest */ export_users?: boolean; + /** + * Set if you want to include deleted channels + * @type {boolean} + * @memberof ExportChannelsRequest + */ + include_soft_deleted_channels?: boolean; /** * Set if you want to include truncated messages * @type {boolean} @@ -5960,10 +4795,53 @@ export interface ExportUsersResponse { /** * * @type {string} - * @memberof ExportUsersResponse + * @memberof ExportUsersResponse + */ + task_id: string; +} +/** + * + * @export + * @interface ExternalStorageResponse + */ +export interface ExternalStorageResponse { + /** + * + * @type {string} + * @memberof ExternalStorageResponse + */ + bucket: string; + /** + * + * @type {string} + * @memberof ExternalStorageResponse + */ + name: string; + /** + * + * @type {string} + * @memberof ExternalStorageResponse + */ + path: string; + /** + * + * @type {string} + * @memberof ExternalStorageResponse */ - task_id: string; + type: ExternalStorageResponseTypeEnum; } + + +/** + * @export + */ +export const ExternalStorageResponseTypeEnum = { + S3: 's3', + GCS: 'gcs', + ABS: 'abs' +} as const; +export type ExternalStorageResponseTypeEnum = typeof ExternalStorageResponseTypeEnum[keyof typeof ExternalStorageResponseTypeEnum]; + /** * * @export @@ -5989,31 +4867,6 @@ export interface Field { */ value: string; } -/** - * - * @export - * @interface FieldRequest - */ -export interface FieldRequest { - /** - * - * @type {boolean} - * @memberof FieldRequest - */ - _short?: boolean; - /** - * - * @type {string} - * @memberof FieldRequest - */ - title?: string; - /** - * - * @type {string} - * @memberof FieldRequest - */ - value?: string; -} /** * * @export @@ -6038,56 +4891,50 @@ export interface FileUploadConfig { * @type {Array} * @memberof FileUploadConfig */ - allowed_file_extensions: Array; + allowed_file_extensions?: Array; /** * * @type {Array} * @memberof FileUploadConfig */ - allowed_mime_types: Array; + allowed_mime_types?: Array; /** * * @type {Array} * @memberof FileUploadConfig */ - blocked_file_extensions: Array; + blocked_file_extensions?: Array; /** * * @type {Array} * @memberof FileUploadConfig */ - blocked_mime_types: Array; + blocked_mime_types?: Array; + /** + * + * @type {number} + * @memberof FileUploadConfig + */ + size_limit: number; } /** * * @export - * @interface FileUploadConfigRequest + * @interface FileUploadRequest */ -export interface FileUploadConfigRequest { - /** - * - * @type {Array} - * @memberof FileUploadConfigRequest - */ - allowed_file_extensions?: Array; - /** - * - * @type {Array} - * @memberof FileUploadConfigRequest - */ - allowed_mime_types?: Array; +export interface FileUploadRequest { /** - * - * @type {Array} - * @memberof FileUploadConfigRequest + * file field + * @type {string} + * @memberof FileUploadRequest */ - blocked_file_extensions?: Array; + file?: string; /** * - * @type {Array} - * @memberof FileUploadConfigRequest + * @type {OnlyUserID} + * @memberof FileUploadRequest */ - blocked_mime_types?: Array; + user?: OnlyUserID; } /** * @@ -6117,86 +4964,86 @@ export interface FileUploadResponse { /** * * @export - * @interface FirebaseConfigFields + * @interface FirebaseConfig */ -export interface FirebaseConfigFields { +export interface FirebaseConfig { /** * - * @type {string} - * @memberof FirebaseConfigFields + * @type {boolean} + * @memberof FirebaseConfig */ - apn_template: string; + Disabled?: boolean; /** * * @type {string} - * @memberof FirebaseConfigFields + * @memberof FirebaseConfig */ - credentials_json?: string; + apn_template?: string; /** * * @type {string} - * @memberof FirebaseConfigFields + * @memberof FirebaseConfig */ - data_template: string; + credentials_json?: string; /** * - * @type {boolean} - * @memberof FirebaseConfigFields + * @type {string} + * @memberof FirebaseConfig */ - enabled: boolean; + data_template?: string; /** * * @type {string} - * @memberof FirebaseConfigFields + * @memberof FirebaseConfig */ - notification_template: string; + notification_template?: string; /** * * @type {string} - * @memberof FirebaseConfigFields + * @memberof FirebaseConfig */ server_key?: string; } /** * * @export - * @interface FirebaseConfigRequest + * @interface FirebaseConfigFields */ -export interface FirebaseConfigRequest { +export interface FirebaseConfigFields { /** * - * @type {boolean} - * @memberof FirebaseConfigRequest + * @type {string} + * @memberof FirebaseConfigFields */ - Disabled?: boolean; + apn_template: string; /** * * @type {string} - * @memberof FirebaseConfigRequest + * @memberof FirebaseConfigFields */ - apn_template?: string; + credentials_json?: string; /** * * @type {string} - * @memberof FirebaseConfigRequest + * @memberof FirebaseConfigFields */ - credentials_json?: string; + data_template: string; /** * - * @type {string} - * @memberof FirebaseConfigRequest + * @type {boolean} + * @memberof FirebaseConfigFields */ - data_template?: string; + enabled: boolean; /** * * @type {string} - * @memberof FirebaseConfigRequest + * @memberof FirebaseConfigFields */ - notification_template?: string; + notification_template: string; /** * * @type {string} - * @memberof FirebaseConfigRequest + * @memberof FirebaseConfigFields */ server_key?: string; } @@ -6224,12 +5071,24 @@ export interface Flag { * @memberof Flag */ created_by_automod: boolean; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Flag + */ + custom?: { [key: string]: any; }; /** * * @type {FlagDetails} * @memberof Flag */ details?: FlagDetails; + /** + * + * @type {string} + * @memberof Flag + */ + reason?: string; /** * Date of the rejection * @type {string} @@ -6242,12 +5101,18 @@ export interface Flag { * @memberof Flag */ reviewed_at?: string; + /** + * + * @type {string} + * @memberof Flag + */ + reviewed_by?: string; /** * * @type {Message} * @memberof Flag */ - target_message?: Message | null; + target_message?: Message; /** * ID of flagged message * @type {string} @@ -6279,13 +5144,24 @@ export interface Flag { * @interface FlagDetails */ export interface FlagDetails { - [key: string]: any | any; + /** + * + * @type {{ [key: string]: any; }} + * @memberof FlagDetails + */ + Extra: { [key: string]: any; }; /** * * @type {AutomodDetails} * @memberof FlagDetails */ automod?: AutomodDetails; + /** + * + * @type {string} + * @memberof FlagDetails + */ + original_text: string; } /** * @@ -6349,18 +5225,36 @@ export interface FlagMessageDetails { * @interface FlagRequest */ export interface FlagRequest { + /** + * + * @type {{ [key: string]: any; }} + * @memberof FlagRequest + */ + custom?: { [key: string]: any; }; + /** + * + * @type {string} + * @memberof FlagRequest + */ + reason?: string; /** * ID of the message when reporting a message * @type {string} * @memberof FlagRequest */ target_message_id?: string; + /** + * ID of the user when reporting a user + * @type {string} + * @memberof FlagRequest + */ + target_user_id?: string; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof FlagRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -6390,45 +5284,171 @@ export interface FlagResponse { /** * * @export - * @interface FlagUpdatedEvent + * @interface FullUserResponse */ -export interface FlagUpdatedEvent { +export interface FullUserResponse { /** * - * @type {UserObject} - * @memberof FlagUpdatedEvent + * @type {boolean} + * @memberof FullUserResponse + */ + banned: boolean; + /** + * + * @type {Array} + * @memberof FullUserResponse + */ + blocked_user_ids: Array; + /** + * + * @type {Array} + * @memberof FullUserResponse */ - CreatedBy?: UserObject; + channel_mutes: Array; /** * * @type {string} - * @memberof FlagUpdatedEvent + * @memberof FullUserResponse */ created_at: string; /** * - * @type {Message} - * @memberof FlagUpdatedEvent + * @type {{ [key: string]: any; }} + * @memberof FullUserResponse */ - message?: Message | null; + custom: { [key: string]: any; }; /** * - * @type {Array} - * @memberof FlagUpdatedEvent + * @type {string} + * @memberof FullUserResponse */ - thread_participants?: Array; + deactivated_at?: string; /** * * @type {string} - * @memberof FlagUpdatedEvent + * @memberof FullUserResponse */ - type: string; + deleted_at?: string; /** * - * @type {UserObject} - * @memberof FlagUpdatedEvent + * @type {Array} + * @memberof FullUserResponse + */ + devices: Array; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + id: string; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + image?: string; + /** + * + * @type {boolean} + * @memberof FullUserResponse + */ + invisible: boolean; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + language: string; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + last_active?: string; + /** + * + * @type {Array} + * @memberof FullUserResponse + */ + latest_hidden_channels?: Array; + /** + * + * @type {Array} + * @memberof FullUserResponse + */ + mutes: Array; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + name?: string; + /** + * + * @type {boolean} + * @memberof FullUserResponse + */ + online: boolean; + /** + * + * @type {PrivacySettings} + * @memberof FullUserResponse + */ + privacy_settings?: PrivacySettings; + /** + * + * @type {PushNotificationSettings} + * @memberof FullUserResponse + */ + push_notifications?: PushNotificationSettings; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + revoke_tokens_issued_before?: string; + /** + * + * @type {string} + * @memberof FullUserResponse + */ + role: string; + /** + * + * @type {boolean} + * @memberof FullUserResponse + */ + shadow_banned: boolean; + /** + * + * @type {Array} + * @memberof FullUserResponse + */ + teams: Array; + /** + * + * @type {number} + * @memberof FullUserResponse + */ + total_unread_count: number; + /** + * + * @type {number} + * @memberof FullUserResponse + */ + unread_channels: number; + /** + * + * @type {number} + * @memberof FullUserResponse + */ + unread_threads: number; + /** + * + * @type {string} + * @memberof FullUserResponse */ - user?: UserObject; + updated_at: string; } /** * @@ -6482,10 +5502,10 @@ export interface GeofenceSettings { export interface GetApplicationResponse { /** * - * @type {App} + * @type {AppResponseFields} * @memberof GetApplicationResponse */ - app: App; + app: AppResponseFields; /** * Duration of the request in human-readable format * @type {string} @@ -6504,7 +5524,7 @@ export interface GetBlockListResponse { * @type {BlockList} * @memberof GetBlockListResponse */ - blocklist?: BlockList; + blocklist?: BlockList | null; /** * Duration of the request in human-readable format * @type {string} @@ -6512,6 +5532,25 @@ export interface GetBlockListResponse { */ duration: string; } +/** + * + * @export + * @interface GetBlockedUsersResponse + */ +export interface GetBlockedUsersResponse { + /** + * Array of blocked user object + * @type {Array} + * @memberof GetBlockedUsersResponse + */ + blocks: Array; + /** + * + * @type {string} + * @memberof GetBlockedUsersResponse + */ + duration: string; +} /** * * @export @@ -6520,12 +5559,12 @@ export interface GetBlockListResponse { export interface GetCallTokenRequest { /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof GetCallTokenRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** - * **Server-side only**. User ID which server acts upon + * * @type {string} * @memberof GetCallTokenRequest */ @@ -6717,13 +5756,37 @@ export interface GetManyMessagesResponse { */ messages: Array; } +/** + * + * @export + * @interface GetMessageResponse + */ +export interface GetMessageResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof GetMessageResponse + */ + duration: string; + /** + * + * @type {MessageWithChannelResponse} + * @memberof GetMessageResponse + */ + message: MessageWithChannelResponse; + /** + * + * @type {{ [key: string]: string; }} + * @memberof GetMessageResponse + */ + pending_message_metadata?: { [key: string]: string; }; +} /** * * @export * @interface GetOGResponse */ export interface GetOGResponse { - [key: string]: any | any; /** * * @type {Array} @@ -6760,6 +5823,12 @@ export interface GetOGResponse { * @memberof GetOGResponse */ color?: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof GetOGResponse + */ + custom: { [key: string]: any; }; /** * * @type {string} @@ -6920,17 +5989,17 @@ export interface GetReactionsResponse { */ export interface GetRepliesResponse { /** - * + * Duration of the request in human-readable format * @type {string} * @memberof GetRepliesResponse */ duration: string; /** - * List of messages - * @type {Array} + * + * @type {Array} * @memberof GetRepliesResponse */ - messages: Array; + messages: Array; } /** * @@ -6984,5940 +6053,6067 @@ export interface GetTaskResponse { /** * * @export - * @interface GuestRequest + * @interface GetThreadResponse + */ +export interface GetThreadResponse { + /** + * + * @type {string} + * @memberof GetThreadResponse + */ + duration: string; + /** + * + * @type {ThreadStateResponse} + * @memberof GetThreadResponse + */ + thread: ThreadStateResponse; +} +/** + * + * @export + * @interface HLSSettings */ -export interface GuestRequest { +export interface HLSSettings { + /** + * + * @type {boolean} + * @memberof HLSSettings + */ + auto_on: boolean; + /** + * + * @type {boolean} + * @memberof HLSSettings + */ + enabled: boolean; + /** + * + * @type {LayoutSettings} + * @memberof HLSSettings + */ + layout?: LayoutSettings; /** * - * @type {UserObjectRequest} - * @memberof GuestRequest + * @type {Array} + * @memberof HLSSettings */ - user: UserObjectRequest; + quality_tracks: Array; } /** * * @export - * @interface GuestResponse + * @interface HMSCall */ -export interface GuestResponse { +export interface HMSCall { /** - * Authentication token to use for guest user + * * @type {string} - * @memberof GuestResponse + * @memberof HMSCall */ - access_token: string; + room_id: string; + /** + * + * @type {string} + * @memberof HMSCall + */ + room_name: string; +} +/** + * + * @export + * @interface HideChannelRequest + */ +export interface HideChannelRequest { + /** + * Whether to clear message history of the channel or not + * @type {boolean} + * @memberof HideChannelRequest + */ + clear_history?: boolean; + /** + * + * @type {UserRequest} + * @memberof HideChannelRequest + */ + user?: UserRequest; /** * * @type {string} - * @memberof GuestResponse + * @memberof HideChannelRequest + */ + user_id?: string; +} +/** + * + * @export + * @interface HideChannelResponse + */ +export interface HideChannelResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof HideChannelResponse */ duration: string; +} +/** + * + * @export + * @interface HuaweiConfig + */ +export interface HuaweiConfig { /** * - * @type {UserObject} - * @memberof GuestResponse + * @type {boolean} + * @memberof HuaweiConfig */ - user?: UserObject; + Disabled?: boolean; + /** + * + * @type {string} + * @memberof HuaweiConfig + */ + id?: string; + /** + * + * @type {string} + * @memberof HuaweiConfig + */ + secret?: string; } /** * * @export - * @interface HLSSettings + * @interface HuaweiConfigFields */ -export interface HLSSettings { +export interface HuaweiConfigFields { /** * * @type {boolean} - * @memberof HLSSettings + * @memberof HuaweiConfigFields */ - auto_on: boolean; + enabled: boolean; + /** + * + * @type {string} + * @memberof HuaweiConfigFields + */ + id?: string; + /** + * + * @type {string} + * @memberof HuaweiConfigFields + */ + secret?: string; +} +/** + * + * @export + * @interface ImageData + */ +export interface ImageData { + /** + * + * @type {string} + * @memberof ImageData + */ + frames: string; + /** + * + * @type {string} + * @memberof ImageData + */ + height: string; + /** + * + * @type {string} + * @memberof ImageData + */ + size: string; + /** + * + * @type {string} + * @memberof ImageData + */ + url: string; + /** + * + * @type {string} + * @memberof ImageData + */ + width: string; +} +/** + * + * @export + * @interface ImageSize + */ +export interface ImageSize { + /** + * Crop mode + * @type {string} + * @memberof ImageSize + */ + crop?: ImageSizeCropEnum; + /** + * Target image height + * @type {number} + * @memberof ImageSize + */ + height?: number; + /** + * Resize method + * @type {string} + * @memberof ImageSize + */ + resize?: ImageSizeResizeEnum; + /** + * Target image width + * @type {number} + * @memberof ImageSize + */ + width?: number; +} + + +/** + * @export + */ +export const ImageSizeCropEnum = { + TOP: 'top', + BOTTOM: 'bottom', + LEFT: 'left', + RIGHT: 'right', + CENTER: 'center' +} as const; +export type ImageSizeCropEnum = typeof ImageSizeCropEnum[keyof typeof ImageSizeCropEnum]; + +/** + * @export + */ +export const ImageSizeResizeEnum = { + CLIP: 'clip', + CROP: 'crop', + SCALE: 'scale', + FILL: 'fill' +} as const; +export type ImageSizeResizeEnum = typeof ImageSizeResizeEnum[keyof typeof ImageSizeResizeEnum]; + +/** + * + * @export + * @interface ImageUploadRequest + */ +export interface ImageUploadRequest { /** * - * @type {boolean} - * @memberof HLSSettings + * @type {string} + * @memberof ImageUploadRequest */ - enabled: boolean; + file?: string; /** - * - * @type {LayoutSettings} - * @memberof HLSSettings + * field with JSON-encoded array of image size configurations + * @type {Array} + * @memberof ImageUploadRequest */ - layout?: LayoutSettings; + upload_sizes?: Array; /** * - * @type {Array} - * @memberof HLSSettings + * @type {OnlyUserID} + * @memberof ImageUploadRequest */ - quality_tracks: Array; + user?: OnlyUserID; } /** * * @export - * @interface HMSCall + * @interface ImageUploadResponse */ -export interface HMSCall { +export interface ImageUploadResponse { /** * * @type {string} - * @memberof HMSCall + * @memberof ImageUploadResponse */ - room_id: string; + duration: string; /** - * + * URL to the uploaded asset. Should be used to put to `asset_url` attachment field * @type {string} - * @memberof HMSCall + * @memberof ImageUploadResponse */ - room_name: string; + file?: string; + /** + * URL of the file thumbnail for supported file formats. Should be put to `thumb_url` attachment field + * @type {string} + * @memberof ImageUploadResponse + */ + thumb_url?: string; + /** + * + * @type {Array} + * @memberof ImageUploadResponse + */ + upload_sizes?: Array; } /** * * @export - * @interface HealthCheckEvent + * @interface Images */ -export interface HealthCheckEvent { +export interface Images { /** * - * @type {string} - * @memberof HealthCheckEvent + * @type {ImageData} + * @memberof Images */ - cid: string; + fixed_height: ImageData; /** * - * @type {string} - * @memberof HealthCheckEvent + * @type {ImageData} + * @memberof Images */ - created_at: string; + fixed_height_downsampled: ImageData; /** * - * @type {OwnUser} - * @memberof HealthCheckEvent + * @type {ImageData} + * @memberof Images */ - me?: OwnUser; + fixed_height_still: ImageData; /** * - * @type {string} - * @memberof HealthCheckEvent + * @type {ImageData} + * @memberof Images */ - type: string; -} -/** - * - * @export - * @interface HideChannelRequest - */ -export interface HideChannelRequest { + fixed_width: ImageData; /** - * Whether to clear message history of the channel or not - * @type {boolean} - * @memberof HideChannelRequest + * + * @type {ImageData} + * @memberof Images */ - clear_history?: boolean; + fixed_width_downsampled: ImageData; /** * - * @type {UserObjectRequest} - * @memberof HideChannelRequest + * @type {ImageData} + * @memberof Images */ - user?: UserObjectRequest; + fixed_width_still: ImageData; /** * - * @type {string} - * @memberof HideChannelRequest + * @type {ImageData} + * @memberof Images */ - user_id?: string; + original: ImageData; } /** * * @export - * @interface HideChannelResponse + * @interface ImportTask */ -export interface HideChannelResponse { +export interface ImportTask { /** - * Duration of the request in human-readable format + * * @type {string} - * @memberof HideChannelResponse + * @memberof ImportTask */ - duration: string; -} -/** - * - * @export - * @interface HuaweiConfigFields - */ -export interface HuaweiConfigFields { + created_at: string; /** * - * @type {boolean} - * @memberof HuaweiConfigFields + * @type {Array} + * @memberof ImportTask */ - enabled: boolean; + history: Array; /** * * @type {string} - * @memberof HuaweiConfigFields + * @memberof ImportTask */ - id?: string; + id: string; /** * * @type {string} - * @memberof HuaweiConfigFields + * @memberof ImportTask */ - secret?: string; -} -/** - * - * @export - * @interface HuaweiConfigRequest - */ -export interface HuaweiConfigRequest { + mode: string; /** * - * @type {boolean} - * @memberof HuaweiConfigRequest + * @type {string} + * @memberof ImportTask */ - Disabled?: boolean; + path: string; + /** + * + * @type {number} + * @memberof ImportTask + */ + size?: number; /** * * @type {string} - * @memberof HuaweiConfigRequest + * @memberof ImportTask */ - id?: string; + state: string; /** * * @type {string} - * @memberof HuaweiConfigRequest + * @memberof ImportTask */ - secret?: string; + updated_at: string; } /** * * @export - * @interface ImageData + * @interface ImportTaskHistory */ -export interface ImageData { - /** - * - * @type {string} - * @memberof ImageData - */ - frames: string; - /** - * - * @type {string} - * @memberof ImageData - */ - height: string; +export interface ImportTaskHistory { /** * * @type {string} - * @memberof ImageData + * @memberof ImportTaskHistory */ - size: string; + created_at: string; /** * * @type {string} - * @memberof ImageData + * @memberof ImportTaskHistory */ - url: string; + next_state: string; /** * * @type {string} - * @memberof ImageData + * @memberof ImportTaskHistory */ - width: string; + prev_state: string; } /** * * @export - * @interface ImageDataRequest + * @interface Label */ -export interface ImageDataRequest { +export interface Label { /** * - * @type {string} - * @memberof ImageDataRequest + * @type {Array} + * @memberof Label */ - frames?: string; + harm_labels?: Array; /** * * @type {string} - * @memberof ImageDataRequest + * @memberof Label */ - height?: string; + name: string; /** * - * @type {string} - * @memberof ImageDataRequest + * @type {Array} + * @memberof Label */ - size?: string; + phrase_list_ids?: Array; +} +/** + * + * @export + * @interface LabelThresholds + */ +export interface LabelThresholds { /** - * - * @type {string} - * @memberof ImageDataRequest + * Threshold for automatic message block + * @type {number} + * @memberof LabelThresholds */ - url?: string; + block?: number; /** - * - * @type {string} - * @memberof ImageDataRequest + * Threshold for automatic message flag + * @type {number} + * @memberof LabelThresholds */ - width?: string; + flag?: number; } /** * * @export - * @interface ImageSize + * @interface LayoutSettings */ -export interface ImageSize { +export interface LayoutSettings { /** - * Crop mode + * * @type {string} - * @memberof ImageSize + * @memberof LayoutSettings */ - crop: ImageSizeCropEnum; + external_app_url: string; /** - * Target image height - * @type {number} - * @memberof ImageSize + * + * @type {string} + * @memberof LayoutSettings */ - height: number; + external_css_url: string; /** - * Resize method + * * @type {string} - * @memberof ImageSize + * @memberof LayoutSettings */ - resize: ImageSizeResizeEnum; + name: LayoutSettingsNameEnum; /** - * Target image width - * @type {number} - * @memberof ImageSize + * + * @type {{ [key: string]: any; }} + * @memberof LayoutSettings */ - width: number; + options?: { [key: string]: any; }; } /** * @export */ -export const ImageSizeCropEnum = { - TOP: 'top', - BOTTOM: 'bottom', - LEFT: 'left', - RIGHT: 'right', - CENTER: 'center' -} as const; -export type ImageSizeCropEnum = typeof ImageSizeCropEnum[keyof typeof ImageSizeCropEnum]; - -/** - * @export - */ -export const ImageSizeResizeEnum = { - CLIP: 'clip', - CROP: 'crop', - SCALE: 'scale', - FILL: 'fill' +export const LayoutSettingsNameEnum = { + SPOTLIGHT: 'spotlight', + GRID: 'grid', + SINGLE_PARTICIPANT: 'single-participant', + MOBILE: 'mobile', + CUSTOM: 'custom' } as const; -export type ImageSizeResizeEnum = typeof ImageSizeResizeEnum[keyof typeof ImageSizeResizeEnum]; +export type LayoutSettingsNameEnum = typeof LayoutSettingsNameEnum[keyof typeof LayoutSettingsNameEnum]; /** * * @export - * @interface ImageUploadResponse + * @interface LimitInfo */ -export interface ImageUploadResponse { - /** - * - * @type {string} - * @memberof ImageUploadResponse - */ - duration: string; +export interface LimitInfo { /** - * URL to the uploaded asset. Should be used to put to `asset_url` attachment field - * @type {string} - * @memberof ImageUploadResponse + * The maximum number of calls allowed for the time window + * @type {number} + * @memberof LimitInfo */ - file?: string; + limit: number; /** - * URL of the file thumbnail for supported file formats. Should be put to `thumb_url` attachment field - * @type {string} - * @memberof ImageUploadResponse + * The number of remaining calls in the current window + * @type {number} + * @memberof LimitInfo */ - thumb_url?: string; + remaining: number; /** - * - * @type {Array} - * @memberof ImageUploadResponse + * The Unix timestamp of the next window + * @type {number} + * @memberof LimitInfo */ - upload_sizes?: Array; + reset: number; } /** * * @export - * @interface Images + * @interface LimitsSettings */ -export interface Images { - /** - * - * @type {ImageData} - * @memberof Images - */ - fixed_height: ImageData; +export interface LimitsSettings { /** * - * @type {ImageData} - * @memberof Images + * @type {number} + * @memberof LimitsSettings */ - fixed_height_downsampled: ImageData; + max_duration_seconds?: number; /** * - * @type {ImageData} - * @memberof Images + * @type {number} + * @memberof LimitsSettings */ - fixed_height_still: ImageData; + max_participants?: number; +} +/** + * + * @export + * @interface ListBlockListResponse + */ +export interface ListBlockListResponse { /** * - * @type {ImageData} - * @memberof Images + * @type {Array} + * @memberof ListBlockListResponse */ - fixed_width: ImageData; + blocklists: Array; /** - * - * @type {ImageData} - * @memberof Images + * Duration of the request in human-readable format + * @type {string} + * @memberof ListBlockListResponse */ - fixed_width_downsampled: ImageData; + duration: string; +} +/** + * + * @export + * @interface ListChannelTypesResponse + */ +export interface ListChannelTypesResponse { /** - * - * @type {ImageData} - * @memberof Images + * Object with all channel types + * @type {{ [key: string]: ChannelTypeConfig; }} + * @memberof ListChannelTypesResponse */ - fixed_width_still: ImageData; + channel_types: { [key: string]: ChannelTypeConfig; }; /** * - * @type {ImageData} - * @memberof Images + * @type {string} + * @memberof ListChannelTypesResponse */ - original: ImageData; + duration: string; } /** * * @export - * @interface ImagesRequest + * @interface ListCommandsResponse */ -export interface ImagesRequest { +export interface ListCommandsResponse { /** * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * @type {Array} + * @memberof ListCommandsResponse */ - fixed_height?: ImageDataRequest; + commands: Array; /** - * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * Duration of the request in human-readable format + * @type {string} + * @memberof ListCommandsResponse */ - fixed_height_downsampled?: ImageDataRequest; + duration: string; +} +/** + * + * @export + * @interface ListDevicesResponse + */ +export interface ListDevicesResponse { /** - * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * List of devices + * @type {Array} + * @memberof ListDevicesResponse */ - fixed_height_still?: ImageDataRequest; + devices: Array; /** * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * @type {string} + * @memberof ListDevicesResponse */ - fixed_width?: ImageDataRequest; + duration: string; +} +/** + * + * @export + * @interface ListExternalStorageResponse + */ +export interface ListExternalStorageResponse { /** - * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * Duration of the request in human-readable format + * @type {string} + * @memberof ListExternalStorageResponse */ - fixed_width_downsampled?: ImageDataRequest; + duration: string; /** * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * @type {{ [key: string]: ExternalStorageResponse; }} + * @memberof ListExternalStorageResponse + */ + external_storages: { [key: string]: ExternalStorageResponse; }; +} +/** + * + * @export + * @interface ListImportsResponse + */ +export interface ListImportsResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof ListImportsResponse */ - fixed_width_still?: ImageDataRequest; + duration: string; /** * - * @type {ImageDataRequest} - * @memberof ImagesRequest + * @type {Array} + * @memberof ListImportsResponse */ - original?: ImageDataRequest; + import_tasks: Array; } /** * * @export - * @interface ImportTask + * @interface ListPermissionsResponse */ -export interface ImportTask { +export interface ListPermissionsResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof ImportTask + * @memberof ListPermissionsResponse */ - created_at: string; + duration: string; /** * - * @type {Array} - * @memberof ImportTask + * @type {Array} + * @memberof ListPermissionsResponse */ - history: Array; + permissions: Array; +} +/** + * + * @export + * @interface ListPushProvidersResponse + */ +export interface ListPushProvidersResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof ImportTask + * @memberof ListPushProvidersResponse */ - id: string; + duration: string; /** * - * @type {string} - * @memberof ImportTask + * @type {Array} + * @memberof ListPushProvidersResponse */ - mode: string; + push_providers: Array; +} +/** + * + * @export + * @interface ListRolesResponse + */ +export interface ListRolesResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof ImportTask + * @memberof ListRolesResponse */ - path: string; + duration: string; /** * - * @type {any} - * @memberof ImportTask + * @type {Array} + * @memberof ListRolesResponse */ - result?: any | null; + roles: Array; +} +/** + * + * @export + * @interface MarkChannelsReadRequest + */ +export interface MarkChannelsReadRequest { /** * - * @type {number} - * @memberof ImportTask + * @type {{ [key: string]: string; }} + * @memberof MarkChannelsReadRequest */ - size?: number; + read_by_channel?: { [key: string]: string; }; /** * - * @type {string} - * @memberof ImportTask + * @type {UserRequest} + * @memberof MarkChannelsReadRequest */ - state: string; + user?: UserRequest; /** * * @type {string} - * @memberof ImportTask + * @memberof MarkChannelsReadRequest */ - updated_at: string; + user_id?: string; } /** * * @export - * @interface ImportTaskHistory + * @interface MarkReadRequest */ -export interface ImportTaskHistory { +export interface MarkReadRequest { /** - * + * ID of the message that is considered last read by client * @type {string} - * @memberof ImportTaskHistory + * @memberof MarkReadRequest */ - created_at: string; + message_id?: string; + /** + * Optional Thread ID to specifically mark a given thread as read + * @type {string} + * @memberof MarkReadRequest + */ + thread_id?: string; + /** + * + * @type {UserRequest} + * @memberof MarkReadRequest + */ + user?: UserRequest; /** * * @type {string} - * @memberof ImportTaskHistory + * @memberof MarkReadRequest */ - next_state: string; + user_id?: string; +} +/** + * + * @export + * @interface MarkReadResponse + */ +export interface MarkReadResponse { /** * * @type {string} - * @memberof ImportTaskHistory + * @memberof MarkReadResponse + */ + duration: string; + /** + * + * @type {MessageReadEvent} + * @memberof MarkReadResponse */ - prev_state: string; + event?: MessageReadEvent; } /** * * @export - * @interface Label + * @interface MarkUnreadRequest */ -export interface Label { +export interface MarkUnreadRequest { /** - * + * ID of the message from where the channel is marked unread * @type {string} - * @memberof Label + * @memberof MarkUnreadRequest */ - name: string; + message_id?: string; + /** + * Mark a thread unread, specify both the thread and message id + * @type {string} + * @memberof MarkUnreadRequest + */ + thread_id?: string; /** * - * @type {Array} - * @memberof Label + * @type {UserRequest} + * @memberof MarkUnreadRequest */ - phrase_list_ids?: Array; + user?: UserRequest; + /** + * + * @type {string} + * @memberof MarkUnreadRequest + */ + user_id?: string; } /** * * @export - * @interface LabelThresholds + * @interface MembersResponse */ -export interface LabelThresholds { +export interface MembersResponse { /** - * Threshold for automatic message block - * @type {number} - * @memberof LabelThresholds + * + * @type {string} + * @memberof MembersResponse */ - block?: number; + duration: string; /** - * Threshold for automatic message flag - * @type {number} - * @memberof LabelThresholds + * List of found members + * @type {Array} + * @memberof MembersResponse */ - flag?: number; + members: Array; } /** - * + * Represents any chat message * @export - * @interface LabelThresholdsRequest + * @interface Message */ -export interface LabelThresholdsRequest { +export interface Message { /** - * Threshold for automatic message block - * @type {number} - * @memberof LabelThresholdsRequest + * Array of message attachments + * @type {Array} + * @memberof Message */ - block?: number; + attachments: Array; /** - * Threshold for automatic message flag - * @type {number} - * @memberof LabelThresholdsRequest + * Whether `before_message_send webhook` failed or not. Field is only accessible in push webhook + * @type {boolean} + * @memberof Message */ - flag?: number; -} -/** - * - * @export - * @interface LayoutSettings - */ -export interface LayoutSettings { + before_message_send_failed?: boolean; /** - * + * Channel unique identifier in : format * @type {string} - * @memberof LayoutSettings + * @memberof Message */ - external_app_url: string; + cid: string; /** - * + * Contains provided slash command * @type {string} - * @memberof LayoutSettings + * @memberof Message */ - external_css_url: string; + command?: string; /** - * + * Date/time of creation * @type {string} - * @memberof LayoutSettings + * @memberof Message */ - name: LayoutSettingsNameEnum; + created_at: string; /** * * @type {{ [key: string]: any; }} - * @memberof LayoutSettings + * @memberof Message */ - options?: { [key: string]: any; }; -} - - -/** - * @export - */ -export const LayoutSettingsNameEnum = { - SPOTLIGHT: 'spotlight', - GRID: 'grid', - SINGLE_PARTICIPANT: 'single-participant', - MOBILE: 'mobile', - CUSTOM: 'custom' -} as const; -export type LayoutSettingsNameEnum = typeof LayoutSettingsNameEnum[keyof typeof LayoutSettingsNameEnum]; - -/** - * - * @export - * @interface LimitInfo - */ -export interface LimitInfo { + custom: { [key: string]: any; }; /** - * The maximum number of calls allowed for the time window - * @type {number} - * @memberof LimitInfo + * Date/time of deletion + * @type {string} + * @memberof Message */ - limit: number; + deleted_at?: string; /** - * The number of remaining calls in the current window + * * @type {number} - * @memberof LimitInfo + * @memberof Message */ - remaining: number; + deleted_reply_count: number; /** - * The Unix timestamp of the next window - * @type {number} - * @memberof LimitInfo + * Contains HTML markup of the message. Can only be set when using server-side API + * @type {string} + * @memberof Message */ - reset: number; -} -/** - * - * @export - * @interface ListBlockListResponse - */ -export interface ListBlockListResponse { + html: string; /** - * - * @type {Array} - * @memberof ListBlockListResponse + * Object with translations. Key `language` contains the original language key. Other keys contain translations + * @type {{ [key: string]: string; }} + * @memberof Message */ - blocklists: Array; + i18n?: { [key: string]: string; }; /** - * Duration of the request in human-readable format + * Message ID is unique string identifier of the message * @type {string} - * @memberof ListBlockListResponse + * @memberof Message */ - duration: string; -} -/** - * - * @export - * @interface ListChannelTypesResponse - */ -export interface ListChannelTypesResponse { + id: string; /** - * Object with all channel types - * @type {{ [key: string]: ChannelTypeConfig; }} - * @memberof ListChannelTypesResponse + * Contains image moderation information + * @type {{ [key: string]: Array; }} + * @memberof Message */ - channel_types: { [key: string]: ChannelTypeConfig; }; + image_labels?: { [key: string]: Array; }; /** - * - * @type {string} - * @memberof ListChannelTypesResponse + * List of 10 latest reactions to this message + * @type {Array} + * @memberof Message */ - duration: string; -} -/** - * - * @export - * @interface ListCommandsResponse - */ -export interface ListCommandsResponse { + latest_reactions: Array; + /** + * List of mentioned users + * @type {Array} + * @memberof Message + */ + mentioned_users: Array; /** * - * @type {Array} - * @memberof ListCommandsResponse + * @type {string} + * @memberof Message */ - commands: Array; + message_text_updated_at?: string; /** - * Duration of the request in human-readable format + * Should be empty if `text` is provided. Can only be set when using server-side API * @type {string} - * @memberof ListCommandsResponse + * @memberof Message */ - duration: string; -} -/** - * - * @export - * @interface ListDevicesResponse - */ -export interface ListDevicesResponse { + mml?: string; /** - * List of devices - * @type {Array} - * @memberof ListDevicesResponse + * List of 10 latest reactions of authenticated user to this message + * @type {Array} + * @memberof Message */ - devices: Array; + own_reactions: Array; /** - * + * ID of parent message (thread) * @type {string} - * @memberof ListDevicesResponse + * @memberof Message */ - duration: string; -} -/** - * - * @export - * @interface ListImportsResponse - */ -export interface ListImportsResponse { + parent_id?: string; /** - * Duration of the request in human-readable format + * Date when pinned message expires * @type {string} - * @memberof ListImportsResponse + * @memberof Message */ - duration: string; + pin_expires?: string; /** - * - * @type {Array} - * @memberof ListImportsResponse + * Whether message is pinned or not + * @type {boolean} + * @memberof Message */ - import_tasks: Array; -} -/** - * - * @export - * @interface ListPermissionsResponse - */ -export interface ListPermissionsResponse { + pinned: boolean; /** - * Duration of the request in human-readable format + * Date when message got pinned * @type {string} - * @memberof ListPermissionsResponse + * @memberof Message */ - duration: string; + pinned_at?: string; /** * - * @type {Array} - * @memberof ListPermissionsResponse + * @type {UserObject} + * @memberof Message */ - permissions: Array; -} -/** - * - * @export - * @interface ListPushProvidersResponse - */ -export interface ListPushProvidersResponse { + pinned_by?: UserObject; /** - * Duration of the request in human-readable format + * + * @type {Poll} + * @memberof Message + */ + poll?: Poll; + /** + * Identifier of the poll to include in the message * @type {string} - * @memberof ListPushProvidersResponse + * @memberof Message */ - duration: string; + poll_id?: string; /** * - * @type {Array} - * @memberof ListPushProvidersResponse + * @type {Message} + * @memberof Message */ - push_providers: Array; -} -/** - * - * @export - * @interface ListRolesResponse - */ -export interface ListRolesResponse { + quoted_message?: Message; /** - * Duration of the request in human-readable format + * * @type {string} - * @memberof ListRolesResponse + * @memberof Message */ - duration: string; + quoted_message_id?: string; /** - * - * @type {Array} - * @memberof ListRolesResponse + * An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int) + * @type {{ [key: string]: number; }} + * @memberof Message */ - roles: Array; -} -/** - * - * @export - * @interface MarkChannelsReadRequest - */ -export interface MarkChannelsReadRequest { + reaction_counts: { [key: string]: number; }; /** * - * @type {UserObjectRequest} - * @memberof MarkChannelsReadRequest + * @type {{ [key: string]: ReactionGroupResponse; }} + * @memberof Message */ - user?: UserObjectRequest; + reaction_groups: { [key: string]: ReactionGroupResponse; }; /** - * - * @type {string} - * @memberof MarkChannelsReadRequest + * An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) + * @type {{ [key: string]: number; }} + * @memberof Message */ - user_id?: string; -} -/** - * - * @export - * @interface MarkReadRequest - */ -export interface MarkReadRequest { + reaction_scores: { [key: string]: number; }; /** - * ID of the message that is considered last read by client + * Number of replies to this message + * @type {number} + * @memberof Message + */ + reply_count: number; + /** + * Whether the message was shadowed or not + * @type {boolean} + * @memberof Message + */ + shadowed: boolean; + /** + * Whether thread reply should be shown in the channel as well + * @type {boolean} + * @memberof Message + */ + show_in_channel?: boolean; + /** + * Whether message is silent or not + * @type {boolean} + * @memberof Message + */ + silent: boolean; + /** + * Text of the message. Should be empty if `mml` is provided * @type {string} - * @memberof MarkReadRequest + * @memberof Message */ - message_id?: string; + text: string; /** - * - * @type {UserObjectRequest} - * @memberof MarkReadRequest + * List of users who participate in thread + * @type {Array} + * @memberof Message */ - user?: UserObjectRequest; + thread_participants?: Array; /** - * + * Contains type of the message * @type {string} - * @memberof MarkReadRequest + * @memberof Message */ - user_id?: string; -} -/** - * - * @export - * @interface MarkReadResponse - */ -export interface MarkReadResponse { + type: MessageTypeEnum; /** - * + * Date/time of the last update * @type {string} - * @memberof MarkReadResponse + * @memberof Message */ - duration: string; + updated_at: string; /** * - * @type {MessageReadEvent} - * @memberof MarkReadResponse + * @type {UserObject} + * @memberof Message */ - event?: MessageReadEvent; + user?: UserObject; } + + +/** + * @export + */ +export const MessageTypeEnum = { + REGULAR: 'regular', + EPHEMERAL: 'ephemeral', + ERROR: 'error', + REPLY: 'reply', + SYSTEM: 'system', + DELETED: 'deleted' +} as const; +export type MessageTypeEnum = typeof MessageTypeEnum[keyof typeof MessageTypeEnum]; + /** * * @export - * @interface MarkUnreadRequest + * @interface MessageActionRequest */ -export interface MarkUnreadRequest { +export interface MessageActionRequest { /** - * ID of the message from where the channel is marked unread - * @type {string} - * @memberof MarkUnreadRequest + * ReadOnlyData to execute command with + * @type {{ [key: string]: string; }} + * @memberof MessageActionRequest */ - message_id: string; + form_data: { [key: string]: string; }; /** * - * @type {UserObjectRequest} - * @memberof MarkUnreadRequest + * @type {UserRequest} + * @memberof MessageActionRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} - * @memberof MarkUnreadRequest + * @memberof MessageActionRequest */ user_id?: string; } /** * * @export - * @interface MemberAddedEvent + * @interface MessageChangeSet */ -export interface MemberAddedEvent { +export interface MessageChangeSet { /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - channel_id: string; + attachments: boolean; /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - channel_type: string; + custom: boolean; /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - cid: string; + html: boolean; /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - created_at: string; + mentioned_user_ids: boolean; /** * - * @type {ChannelMember} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - member?: ChannelMember | null; + mml: boolean; /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - team?: string; + pin: boolean; /** * - * @type {string} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - type: string; + quoted_message_id: boolean; /** * - * @type {UserObject} - * @memberof MemberAddedEvent + * @type {boolean} + * @memberof MessageChangeSet */ - user?: UserObject; + silent: boolean; + /** + * + * @type {boolean} + * @memberof MessageChangeSet + */ + text: boolean; } /** * * @export - * @interface MemberRemovedEvent + * @interface MessageFlag */ -export interface MemberRemovedEvent { - /** - * - * @type {string} - * @memberof MemberRemovedEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof MemberRemovedEvent - */ - channel_type: string; +export interface MessageFlag { /** * * @type {string} - * @memberof MemberRemovedEvent + * @memberof MessageFlag */ - cid: string; + approved_at?: string; /** * * @type {string} - * @memberof MemberRemovedEvent + * @memberof MessageFlag */ created_at: string; /** * - * @type {ChannelMember} - * @memberof MemberRemovedEvent + * @type {boolean} + * @memberof MessageFlag */ - member?: ChannelMember | null; + created_by_automod: boolean; /** * - * @type {string} - * @memberof MemberRemovedEvent + * @type {{ [key: string]: any; }} + * @memberof MessageFlag */ - type: string; + custom?: { [key: string]: any; }; /** * - * @type {UserObject} - * @memberof MemberRemovedEvent + * @type {FlagDetails} + * @memberof MessageFlag */ - user?: UserObject; -} -/** - * - * @export - * @interface MemberUpdatedEvent - */ -export interface MemberUpdatedEvent { + details?: FlagDetails; /** * - * @type {string} - * @memberof MemberUpdatedEvent + * @type {Message} + * @memberof MessageFlag */ - channel_id: string; + message?: Message; /** * - * @type {string} - * @memberof MemberUpdatedEvent + * @type {FlagFeedback} + * @memberof MessageFlag */ - channel_type: string; + moderation_feedback?: FlagFeedback; /** * - * @type {string} - * @memberof MemberUpdatedEvent + * @type {MessageModerationResult} + * @memberof MessageFlag */ - cid: string; + moderation_result?: MessageModerationResult; /** * * @type {string} - * @memberof MemberUpdatedEvent + * @memberof MessageFlag */ - created_at: string; + reason?: string; /** * - * @type {ChannelMember} - * @memberof MemberUpdatedEvent + * @type {string} + * @memberof MessageFlag */ - member?: ChannelMember | null; + rejected_at?: string; /** * * @type {string} - * @memberof MemberUpdatedEvent + * @memberof MessageFlag */ - team?: string; + reviewed_at?: string; + /** + * + * @type {UserObject} + * @memberof MessageFlag + */ + reviewed_by?: UserObject; /** * * @type {string} - * @memberof MemberUpdatedEvent + * @memberof MessageFlag */ - type: string; + updated_at: string; /** * * @type {UserObject} - * @memberof MemberUpdatedEvent + * @memberof MessageFlag */ user?: UserObject; } /** * * @export - * @interface MembersResponse + * @interface MessageHistoryEntry */ -export interface MembersResponse { +export interface MessageHistoryEntry { /** * - * @type {string} - * @memberof MembersResponse - */ - duration: string; - /** - * List of found members - * @type {Array} - * @memberof MembersResponse + * @type {{ [key: string]: any; }} + * @memberof MessageHistoryEntry */ - members: Array; -} -/** - * Represents any chat message - * @export - * @interface Message - */ -export interface Message { - [key: string]: any | any; + Custom: { [key: string]: any; }; /** - * Array of message attachments + * * @type {Array} - * @memberof Message + * @memberof MessageHistoryEntry */ attachments: Array; /** - * Whether `before_message_send webhook` failed or not. Field is only accessible in push webhook - * @type {boolean} - * @memberof Message - */ - before_message_send_failed?: boolean; - /** - * Channel unique identifier in : format + * * @type {string} - * @memberof Message + * @memberof MessageHistoryEntry */ - cid: string; + message_id: string; /** - * Contains provided slash command + * * @type {string} - * @memberof Message + * @memberof MessageHistoryEntry */ - command?: string; + message_updated_at: string; /** - * Date/time of creation + * * @type {string} - * @memberof Message + * @memberof MessageHistoryEntry */ - created_at: string; + message_updated_by_id: string; /** - * Date/time of deletion + * * @type {string} - * @memberof Message + * @memberof MessageHistoryEntry */ - deleted_at?: string; + text: string; +} +/** + * + * @export + * @interface MessageModerationResult + */ +export interface MessageModerationResult { /** * - * @type {number} - * @memberof Message - */ - deleted_reply_count: number; - /** - * Contains HTML markup of the message. Can only be set when using server-side API * @type {string} - * @memberof Message + * @memberof MessageModerationResult */ - html: string; + action: string; /** - * Object with translations. Key `language` contains the original language key. Other keys contain translations - * @type {{ [key: string]: string; }} - * @memberof Message + * + * @type {ModerationResponse} + * @memberof MessageModerationResult */ - i18n?: { [key: string]: string; }; + ai_moderation_response?: ModerationResponse; /** - * Message ID is unique string identifier of the message + * * @type {string} - * @memberof Message - */ - id: string; - /** - * Contains image moderation information - * @type {{ [key: string]: Array; }} - * @memberof Message - */ - image_labels?: { [key: string]: Array; }; - /** - * List of 10 latest reactions to this message - * @type {Array} - * @memberof Message - */ - latest_reactions: Array; - /** - * List of mentioned users - * @type {Array} - * @memberof Message + * @memberof MessageModerationResult */ - mentioned_users: Array; + blocked_word?: string; /** - * Should be empty if `text` is provided. Can only be set when using server-side API + * * @type {string} - * @memberof Message + * @memberof MessageModerationResult */ - mml?: string; + blocklist_name?: string; /** - * List of 10 latest reactions of authenticated user to this message - * @type {Array} - * @memberof Message + * + * @type {string} + * @memberof MessageModerationResult */ - own_reactions: Array; + created_at: string; /** - * ID of parent message (thread) + * * @type {string} - * @memberof Message + * @memberof MessageModerationResult */ - parent_id?: string; + message_id: string; /** - * Date when pinned message expires + * * @type {string} - * @memberof Message + * @memberof MessageModerationResult */ - pin_expires?: string; + moderated_by?: string; /** - * Whether message is pinned or not - * @type {boolean} - * @memberof Message + * + * @type {Thresholds} + * @memberof MessageModerationResult */ - pinned: boolean; + moderation_thresholds?: Thresholds; /** - * Date when message got pinned + * * @type {string} - * @memberof Message + * @memberof MessageModerationResult */ - pinned_at?: string; + updated_at: string; /** * - * @type {UserObject} - * @memberof Message + * @type {boolean} + * @memberof MessageModerationResult */ - pinned_by?: UserObject; + user_bad_karma: boolean; /** * - * @type {Message} - * @memberof Message + * @type {number} + * @memberof MessageModerationResult */ - quoted_message?: Message | null; + user_karma: number; +} +/** + * + * @export + * @interface MessageReadEvent + */ +export interface MessageReadEvent { /** * * @type {string} - * @memberof Message - */ - quoted_message_id?: string; - /** - * An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int) - * @type {{ [key: string]: number; }} - * @memberof Message - */ - reaction_counts: { [key: string]: number; }; - /** - * An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) - * @type {{ [key: string]: number; }} - * @memberof Message - */ - reaction_scores: { [key: string]: number; }; - /** - * Number of replies to this message - * @type {number} - * @memberof Message + * @memberof MessageReadEvent */ - reply_count: number; + channel_id: string; /** - * Whether the message was shadowed or not - * @type {boolean} - * @memberof Message + * + * @type {string} + * @memberof MessageReadEvent */ - shadowed: boolean; + channel_type: string; /** - * Whether thread reply should be shown in the channel as well - * @type {boolean} - * @memberof Message + * + * @type {string} + * @memberof MessageReadEvent */ - show_in_channel?: boolean; + cid: string; /** - * Whether message is silent or not - * @type {boolean} - * @memberof Message + * + * @type {string} + * @memberof MessageReadEvent */ - silent: boolean; + created_at: string; /** - * Text of the message. Should be empty if `mml` is provided + * * @type {string} - * @memberof Message + * @memberof MessageReadEvent */ - text: string; + last_read_message_id?: string; /** - * List of users who participate in thread - * @type {Array} - * @memberof Message + * + * @type {string} + * @memberof MessageReadEvent */ - thread_participants?: Array; + team?: string; /** - * Contains type of the message - * @type {string} - * @memberof Message + * + * @type {Thread} + * @memberof MessageReadEvent */ - type: MessageTypeEnum; + thread?: Thread; /** - * Date/time of the last update + * * @type {string} - * @memberof Message + * @memberof MessageReadEvent */ - updated_at: string; + type: string; /** * * @type {UserObject} - * @memberof Message + * @memberof MessageReadEvent */ user?: UserObject; -} - - -/** - * @export - */ -export const MessageTypeEnum = { - REGULAR: 'regular', - EPHEMERAL: 'ephemeral', - ERROR: 'error', - REPLY: 'reply', - SYSTEM: 'system', - DELETED: 'deleted' -} as const; -export type MessageTypeEnum = typeof MessageTypeEnum[keyof typeof MessageTypeEnum]; - +} /** * * @export - * @interface MessageActionRequest + * @interface MessageRequest */ -export interface MessageActionRequest { +export interface MessageRequest { /** * - * @type {string} - * @memberof MessageActionRequest + * @type {Array} + * @memberof MessageRequest */ - ID?: string; + attachments?: Array; /** - * Data to execute command with - * @type {{ [key: string]: string; }} - * @memberof MessageActionRequest + * + * @type {{ [key: string]: any; }} + * @memberof MessageRequest */ - form_data: { [key: string]: string; }; + custom?: { [key: string]: any; }; /** * - * @type {UserObjectRequest} - * @memberof MessageActionRequest + * @type {string} + * @memberof MessageRequest */ - user?: UserObjectRequest; + html?: string; /** * * @type {string} - * @memberof MessageActionRequest + * @memberof MessageRequest */ - user_id?: string; -} -/** - * - * @export - * @interface MessageDeletedEvent - */ -export interface MessageDeletedEvent { + id?: string; /** * - * @type {string} - * @memberof MessageDeletedEvent + * @type {Array} + * @memberof MessageRequest */ - channel_id: string; + mentioned_users?: Array; /** * * @type {string} - * @memberof MessageDeletedEvent + * @memberof MessageRequest */ - channel_type: string; + mml?: string; /** * * @type {string} - * @memberof MessageDeletedEvent + * @memberof MessageRequest */ - cid: string; + parent_id?: string; /** * * @type {string} - * @memberof MessageDeletedEvent + * @memberof MessageRequest */ - created_at: string; + pin_expires?: string; /** * * @type {boolean} - * @memberof MessageDeletedEvent + * @memberof MessageRequest */ - hard_delete: boolean; + pinned?: boolean; /** * - * @type {Message} - * @memberof MessageDeletedEvent + * @type {string} + * @memberof MessageRequest */ - message?: Message | null; + pinned_at?: string | null; /** * * @type {string} - * @memberof MessageDeletedEvent + * @memberof MessageRequest */ - team?: string; + poll_id?: string; /** * - * @type {Array} - * @memberof MessageDeletedEvent + * @type {string} + * @memberof MessageRequest */ - thread_participants?: Array; + quoted_message_id?: string; /** * - * @type {string} - * @memberof MessageDeletedEvent + * @type {boolean} + * @memberof MessageRequest */ - type: string; + show_in_channel?: boolean; /** * - * @type {UserObject} - * @memberof MessageDeletedEvent + * @type {boolean} + * @memberof MessageRequest */ - user?: UserObject; -} -/** - * - * @export - * @interface MessageFlag - */ -export interface MessageFlag { + silent?: boolean; /** * * @type {string} - * @memberof MessageFlag + * @memberof MessageRequest */ - approved_at?: string; + text?: string; /** * * @type {string} - * @memberof MessageFlag + * @memberof MessageRequest */ - created_at: string; + type?: MessageRequestTypeEnum; /** * - * @type {boolean} - * @memberof MessageFlag + * @type {UserRequest} + * @memberof MessageRequest */ - created_by_automod: boolean; + user?: UserRequest; /** * - * @type {Message} - * @memberof MessageFlag + * @type {string} + * @memberof MessageRequest */ - message?: Message | null; + user_id?: string; +} + + +/** + * @export + */ +export const MessageRequestTypeEnum = { + REGULAR: '\'\'regular', + SYSTEM: 'system' +} as const; +export type MessageRequestTypeEnum = typeof MessageRequestTypeEnum[keyof typeof MessageRequestTypeEnum]; + +/** + * + * @export + * @interface MessageResponse + */ +export interface MessageResponse { /** * - * @type {FlagFeedback} - * @memberof MessageFlag + * @type {Array} + * @memberof MessageResponse */ - moderation_feedback?: FlagFeedback; + attachments: Array; /** * - * @type {MessageModerationResult} - * @memberof MessageFlag + * @type {string} + * @memberof MessageResponse */ - moderation_result?: MessageModerationResult; + cid: string; /** * * @type {string} - * @memberof MessageFlag + * @memberof MessageResponse */ - rejected_at?: string; + command?: string; /** * * @type {string} - * @memberof MessageFlag + * @memberof MessageResponse */ - reviewed_at?: string; + created_at: string; /** * - * @type {UserObject} - * @memberof MessageFlag + * @type {{ [key: string]: any; }} + * @memberof MessageResponse */ - reviewed_by?: UserObject; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof MessageFlag + * @memberof MessageResponse */ - updated_at: string; + deleted_at?: string; /** * - * @type {UserObject} - * @memberof MessageFlag + * @type {number} + * @memberof MessageResponse */ - user?: UserObject; -} -/** - * - * @export - * @interface MessageFlaggedEvent - */ -export interface MessageFlaggedEvent { + deleted_reply_count: number; /** * * @type {string} - * @memberof MessageFlaggedEvent + * @memberof MessageResponse */ - cid: string; + html: string; /** * - * @type {string} - * @memberof MessageFlaggedEvent + * @type {{ [key: string]: string; }} + * @memberof MessageResponse */ - created_at: string; + i18n?: { [key: string]: string; }; /** * - * @type {Flag} - * @memberof MessageFlaggedEvent + * @type {string} + * @memberof MessageResponse */ - flag?: Flag; + id: string; /** * - * @type {Message} - * @memberof MessageFlaggedEvent + * @type {{ [key: string]: Array; }} + * @memberof MessageResponse */ - message?: Message | null; + image_labels?: { [key: string]: Array; }; /** * - * @type {Array} - * @memberof MessageFlaggedEvent + * @type {Array} + * @memberof MessageResponse */ - thread_participants?: Array; + latest_reactions: Array; /** * - * @type {string} - * @memberof MessageFlaggedEvent + * @type {Array} + * @memberof MessageResponse */ - type: string; + mentioned_users: Array; /** * - * @type {UserObject} - * @memberof MessageFlaggedEvent + * @type {string} + * @memberof MessageResponse */ - user?: UserObject; -} -/** - * - * @export - * @interface MessageModerationResult - */ -export interface MessageModerationResult { + message_text_updated_at?: string; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - action: string; + mml?: string; /** * - * @type {ModerationResponse} - * @memberof MessageModerationResult + * @type {Array} + * @memberof MessageResponse */ - ai_moderation_response?: ModerationResponse; + own_reactions: Array; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - blocked_word?: string; + parent_id?: string; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - blocklist_name?: string; + pin_expires?: string; /** * - * @type {string} - * @memberof MessageModerationResult + * @type {boolean} + * @memberof MessageResponse */ - created_at: string; + pinned: boolean; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - message_id: string; + pinned_at?: string; + /** + * + * @type {UserResponse} + * @memberof MessageResponse + */ + pinned_by?: UserResponse; + /** + * + * @type {Poll} + * @memberof MessageResponse + */ + poll?: Poll; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - moderated_by?: string; + poll_id?: string; /** * - * @type {Thresholds} - * @memberof MessageModerationResult + * @type {Message} + * @memberof MessageResponse */ - moderation_thresholds?: Thresholds; + quoted_message?: Message; /** * * @type {string} - * @memberof MessageModerationResult + * @memberof MessageResponse */ - updated_at: string; + quoted_message_id?: string; /** * - * @type {boolean} - * @memberof MessageModerationResult + * @type {{ [key: string]: number; }} + * @memberof MessageResponse */ - user_bad_karma: boolean; + reaction_counts: { [key: string]: number; }; /** * - * @type {number} - * @memberof MessageModerationResult + * @type {{ [key: string]: ReactionGroupResponse; }} + * @memberof MessageResponse */ - user_karma: number; -} -/** - * - * @export - * @interface MessageNewEvent - */ -export interface MessageNewEvent { + reaction_groups?: { [key: string]: ReactionGroupResponse; }; /** * - * @type {string} - * @memberof MessageNewEvent + * @type {{ [key: string]: number; }} + * @memberof MessageResponse */ - channel_id: string; + reaction_scores: { [key: string]: number; }; /** * - * @type {string} - * @memberof MessageNewEvent + * @type {number} + * @memberof MessageResponse */ - channel_type: string; + reply_count: number; /** * - * @type {string} - * @memberof MessageNewEvent + * @type {boolean} + * @memberof MessageResponse */ - cid: string; + shadowed: boolean; /** * - * @type {string} - * @memberof MessageNewEvent + * @type {boolean} + * @memberof MessageResponse */ - created_at: string; + show_in_channel?: boolean; /** * - * @type {Message} - * @memberof MessageNewEvent + * @type {boolean} + * @memberof MessageResponse */ - message?: Message | null; + silent: boolean; /** * * @type {string} - * @memberof MessageNewEvent + * @memberof MessageResponse */ - team?: string; + text: string; /** * - * @type {Array} - * @memberof MessageNewEvent + * @type {Array} + * @memberof MessageResponse */ - thread_participants?: Array; + thread_participants?: Array; /** * * @type {string} - * @memberof MessageNewEvent + * @memberof MessageResponse */ type: string; /** * - * @type {UserObject} - * @memberof MessageNewEvent + * @type {string} + * @memberof MessageResponse */ - user?: UserObject; + updated_at: string; /** * - * @type {number} - * @memberof MessageNewEvent + * @type {UserResponse} + * @memberof MessageResponse */ - watcher_count: number; + user: UserResponse; } /** * * @export - * @interface MessagePaginationParamsRequest + * @interface MessageUpdate */ -export interface MessagePaginationParamsRequest { - /** - * - * @type {string} - * @memberof MessagePaginationParamsRequest - */ - created_at_after?: string; +export interface MessageUpdate { /** * - * @type {string} - * @memberof MessagePaginationParamsRequest + * @type {MessageChangeSet} + * @memberof MessageUpdate */ - created_at_after_or_equal?: string; + change_set?: MessageChangeSet; /** * * @type {string} - * @memberof MessagePaginationParamsRequest + * @memberof MessageUpdate */ - created_at_around?: string; + old_text?: string; +} +/** + * + * @export + * @interface MessageWithChannelResponse + */ +export interface MessageWithChannelResponse { /** * - * @type {string} - * @memberof MessagePaginationParamsRequest + * @type {Array} + * @memberof MessageWithChannelResponse */ - created_at_before?: string; + attachments: Array; /** * - * @type {string} - * @memberof MessagePaginationParamsRequest + * @type {ChannelResponse} + * @memberof MessageWithChannelResponse */ - created_at_before_or_equal?: string; + channel: ChannelResponse; /** * * @type {string} - * @memberof MessagePaginationParamsRequest + * @memberof MessageWithChannelResponse */ - id_around?: string; + cid: string; /** * * @type {string} - * @memberof MessagePaginationParamsRequest + * @memberof MessageWithChannelResponse */ - id_gt?: string; + command?: string; /** * * @type {string} - * @memberof MessagePaginationParamsRequest + * @memberof MessageWithChannelResponse */ - id_gte?: string; + created_at: string; /** * - * @type {string} - * @memberof MessagePaginationParamsRequest + * @type {{ [key: string]: any; }} + * @memberof MessageWithChannelResponse */ - id_lt?: string; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof MessagePaginationParamsRequest - */ - id_lte?: string; - /** - * - * @type {number} - * @memberof MessagePaginationParamsRequest + * @memberof MessageWithChannelResponse */ - limit?: number; + deleted_at?: string; /** * * @type {number} - * @memberof MessagePaginationParamsRequest + * @memberof MessageWithChannelResponse */ - offset?: number; -} -/** - * - * @export - * @interface MessageReadEvent - */ -export interface MessageReadEvent { + deleted_reply_count: number; /** * * @type {string} - * @memberof MessageReadEvent + * @memberof MessageWithChannelResponse */ - channel_id: string; + html: string; /** * - * @type {string} - * @memberof MessageReadEvent + * @type {{ [key: string]: string; }} + * @memberof MessageWithChannelResponse */ - channel_type: string; + i18n?: { [key: string]: string; }; /** * * @type {string} - * @memberof MessageReadEvent + * @memberof MessageWithChannelResponse */ - cid: string; + id: string; /** * - * @type {string} - * @memberof MessageReadEvent + * @type {{ [key: string]: Array; }} + * @memberof MessageWithChannelResponse */ - created_at: string; + image_labels?: { [key: string]: Array; }; /** * - * @type {string} - * @memberof MessageReadEvent + * @type {Array} + * @memberof MessageWithChannelResponse */ - last_read_message_id?: string; + latest_reactions: Array; /** * - * @type {string} - * @memberof MessageReadEvent + * @type {Array} + * @memberof MessageWithChannelResponse */ - team?: string; + mentioned_users: Array; /** * * @type {string} - * @memberof MessageReadEvent + * @memberof MessageWithChannelResponse */ - type: string; + message_text_updated_at?: string; /** * - * @type {UserObject} - * @memberof MessageReadEvent - */ - user?: UserObject; -} -/** - * Represents any chat message - * @export - * @interface MessageRequest - */ -export interface MessageRequest { - [key: string]: any | any; - /** - * Array of message attachments - * @type {Array} - * @memberof MessageRequest - */ - attachments: Array; - /** - * Channel unique identifier in : format - * @type {Array} - * @memberof MessageRequest - */ - cid?: Array; - /** - * Contains HTML markup of the message. Can only be set when using server-side API - * @type {string} - * @memberof MessageRequest - */ - html?: string; - /** - * Message ID is unique string identifier of the message - * @type {string} - * @memberof MessageRequest - */ - id?: string; - /** - * List of mentioned users - * @type {Array} - * @memberof MessageRequest - */ - mentioned_users?: Array; - /** - * Should be empty if `text` is provided. Can only be set when using server-side API * @type {string} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ mml?: string; /** * - * @type {Array} - * @memberof MessageRequest + * @type {Array} + * @memberof MessageWithChannelResponse */ - parent?: Array; + own_reactions: Array; /** - * ID of parent message (thread) + * * @type {string} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ parent_id?: string; /** - * Date when pinned message expires + * * @type {string} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ pin_expires?: string; /** - * Whether message is pinned or not + * * @type {boolean} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ - pinned?: boolean; + pinned: boolean; /** - * Date when message got pinned + * * @type {string} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ - pinned_at?: string | null; - /** - * Contains user who pinned the message - * @type {Array} - * @memberof MessageRequest - */ - pinned_by?: Array; + pinned_at?: string; /** * - * @type {string} - * @memberof MessageRequest + * @type {UserResponse} + * @memberof MessageWithChannelResponse */ - quoted_message_id?: string; + pinned_by?: UserResponse; /** - * An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) - * @type {Array} - * @memberof MessageRequest + * + * @type {Poll} + * @memberof MessageWithChannelResponse */ - reaction_scores?: Array; + poll?: Poll; /** - * Whether thread reply should be shown in the channel as well - * @type {boolean} - * @memberof MessageRequest + * + * @type {string} + * @memberof MessageWithChannelResponse */ - show_in_channel?: boolean; + poll_id?: string; /** - * Whether message is silent or not - * @type {boolean} - * @memberof MessageRequest + * + * @type {Message} + * @memberof MessageWithChannelResponse */ - silent?: boolean; + quoted_message?: Message; /** - * Text of the message. Should be empty if `mml` is provided + * * @type {string} - * @memberof MessageRequest + * @memberof MessageWithChannelResponse */ - text?: string; + quoted_message_id?: string; /** - * Contains type of the message - * @type {string} - * @memberof MessageRequest + * + * @type {{ [key: string]: number; }} + * @memberof MessageWithChannelResponse */ - type?: MessageRequestTypeEnum; + reaction_counts: { [key: string]: number; }; /** * - * @type {UserObjectRequest} - * @memberof MessageRequest + * @type {{ [key: string]: ReactionGroupResponse; }} + * @memberof MessageWithChannelResponse */ - user?: UserObjectRequest; + reaction_groups?: { [key: string]: ReactionGroupResponse; }; /** * - * @type {string} - * @memberof MessageRequest + * @type {{ [key: string]: number; }} + * @memberof MessageWithChannelResponse */ - user_id?: string; -} - - -/** - * @export - */ -export const MessageRequestTypeEnum = { - REGULAR: 'regular', - EPHEMERAL: 'ephemeral', - ERROR: 'error', - REPLY: 'reply', - SYSTEM: 'system', - DELETED: 'deleted' -} as const; -export type MessageRequestTypeEnum = typeof MessageRequestTypeEnum[keyof typeof MessageRequestTypeEnum]; - -/** - * Represents any chat message - * @export - * @interface MessageRequest1 - */ -export interface MessageRequest1 { - [key: string]: any | any; + reaction_scores: { [key: string]: number; }; /** - * Array of message attachments - * @type {Array} - * @memberof MessageRequest1 + * + * @type {number} + * @memberof MessageWithChannelResponse */ - attachments?: Array; + reply_count: number; /** - * Whether `before_message_send webhook` failed or not. Field is only accessible in push webhook + * * @type {boolean} - * @memberof MessageRequest1 - */ - before_message_send_failed?: boolean; - /** - * Channel unique identifier in : format - * @type {string} - * @memberof MessageRequest1 + * @memberof MessageWithChannelResponse */ - cid?: string; + shadowed: boolean; /** - * Contains provided slash command - * @type {string} - * @memberof MessageRequest1 + * + * @type {boolean} + * @memberof MessageWithChannelResponse */ - command?: string; + show_in_channel?: boolean; /** - * Date/time of creation - * @type {string} - * @memberof MessageRequest1 + * + * @type {boolean} + * @memberof MessageWithChannelResponse */ - created_at?: string; + silent: boolean; /** - * Date/time of deletion + * * @type {string} - * @memberof MessageRequest1 + * @memberof MessageWithChannelResponse */ - deleted_at?: string; + text: string; /** * - * @type {number} - * @memberof MessageRequest1 + * @type {Array} + * @memberof MessageWithChannelResponse */ - deleted_reply_count?: number; + thread_participants?: Array; /** - * Contains HTML markup of the message. Can only be set when using server-side API + * * @type {string} - * @memberof MessageRequest1 + * @memberof MessageWithChannelResponse */ - html?: string; - /** - * Object with translations. Key `language` contains the original language key. Other keys contain translations - * @type {{ [key: string]: string; }} - * @memberof MessageRequest1 - */ - i18n?: { [key: string]: string; }; + type: string; /** - * Message ID is unique string identifier of the message + * * @type {string} - * @memberof MessageRequest1 + * @memberof MessageWithChannelResponse */ - id?: string; + updated_at: string; /** - * Contains image moderation information - * @type {{ [key: string]: Array; }} - * @memberof MessageRequest1 + * + * @type {UserResponse} + * @memberof MessageWithChannelResponse */ - image_labels?: { [key: string]: Array; }; + user: UserResponse; +} +/** + * + * @export + * @interface ModerationResponse + */ +export interface ModerationResponse { /** - * List of 10 latest reactions to this message - * @type {Array} - * @memberof MessageRequest1 + * + * @type {string} + * @memberof ModerationResponse */ - latest_reactions?: Array; + action: string; /** - * List of mentioned users - * @type {Array} - * @memberof MessageRequest1 + * + * @type {number} + * @memberof ModerationResponse */ - mentioned_users?: Array; + explicit: number; /** - * Should be empty if `text` is provided. Can only be set when using server-side API - * @type {string} - * @memberof MessageRequest1 + * + * @type {number} + * @memberof ModerationResponse */ - mml: string; + spam: number; /** - * List of 10 latest reactions of authenticated user to this message - * @type {Array} - * @memberof MessageRequest1 + * + * @type {number} + * @memberof ModerationResponse */ - own_reactions?: Array; + toxic: number; +} +/** + * + * @export + * @interface MuteChannelRequest + */ +export interface MuteChannelRequest { /** - * ID of parent message (thread) - * @type {string} - * @memberof MessageRequest1 + * Channel CIDs to mute (if multiple channels) + * @type {Array} + * @memberof MuteChannelRequest */ - parent_id?: string; + channel_cids?: Array; /** - * Date when pinned message expires - * @type {string} - * @memberof MessageRequest1 + * Duration of mute in milliseconds + * @type {number} + * @memberof MuteChannelRequest */ - pin_expires?: string; + expiration?: number; /** - * Whether message is pinned or not - * @type {boolean} - * @memberof MessageRequest1 + * + * @type {UserRequest} + * @memberof MuteChannelRequest */ - pinned?: boolean; + user?: UserRequest; /** - * Date when message got pinned + * * @type {string} - * @memberof MessageRequest1 + * @memberof MuteChannelRequest */ - pinned_at?: string; + user_id?: string; +} +/** + * + * @export + * @interface MuteChannelResponse + */ +export interface MuteChannelResponse { /** * - * @type {UserObjectRequest} - * @memberof MessageRequest1 + * @type {ChannelMute} + * @memberof MuteChannelResponse */ - pinned_by?: UserObjectRequest; + channel_mute?: ChannelMute | null; /** - * - * @type {MessageRequest1} - * @memberof MessageRequest1 + * Object with mutes (if multiple channels were muted) + * @type {Array} + * @memberof MuteChannelResponse */ - quoted_message?: MessageRequest1; + channel_mutes?: Array; /** * * @type {string} - * @memberof MessageRequest1 + * @memberof MuteChannelResponse */ - quoted_message_id?: string; + duration: string; /** - * An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int) - * @type {{ [key: string]: number; }} - * @memberof MessageRequest1 + * + * @type {OwnUser} + * @memberof MuteChannelResponse */ - reaction_counts?: { [key: string]: number; }; + own_user?: OwnUser; +} +/** + * + * @export + * @interface MuteUserRequest + */ +export interface MuteUserRequest { /** - * An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int) - * @type {{ [key: string]: number; }} - * @memberof MessageRequest1 + * User IDs to mute (if multiple users) + * @type {Array} + * @memberof MuteUserRequest */ - reaction_scores?: { [key: string]: number; }; + target_ids?: Array; /** - * Number of replies to this message + * Duration of mute in minutes * @type {number} - * @memberof MessageRequest1 + * @memberof MuteUserRequest */ - reply_count?: number; + timeout: number; /** - * Whether the message was shadowed or not - * @type {boolean} - * @memberof MessageRequest1 + * + * @type {UserRequest} + * @memberof MuteUserRequest */ - shadowed?: boolean; + user?: UserRequest; /** - * Whether thread reply should be shown in the channel as well - * @type {boolean} - * @memberof MessageRequest1 + * + * @type {string} + * @memberof MuteUserRequest */ - show_in_channel?: boolean; + user_id?: string; +} +/** + * + * @export + * @interface MuteUserResponse + */ +export interface MuteUserResponse { /** - * Whether message is silent or not - * @type {boolean} - * @memberof MessageRequest1 + * + * @type {string} + * @memberof MuteUserResponse */ - silent?: boolean; + duration: string; /** - * Text of the message. Should be empty if `mml` is provided - * @type {string} - * @memberof MessageRequest1 + * + * @type {UserMute} + * @memberof MuteUserResponse */ - text: string; + mute?: UserMute | null; /** - * List of users who participate in thread - * @type {Array} - * @memberof MessageRequest1 + * Object with mutes (if multiple users were muted) + * @type {Array} + * @memberof MuteUserResponse */ - thread_participants?: Array; + mutes?: Array; /** - * Contains type of the message - * @type {string} - * @memberof MessageRequest1 + * + * @type {Array} + * @memberof MuteUserResponse */ - type?: MessageRequest1TypeEnum; + non_existing_users?: Array; /** - * Date/time of the last update - * @type {string} - * @memberof MessageRequest1 + * + * @type {OwnUser} + * @memberof MuteUserResponse */ - updated_at?: string; + own_user?: OwnUser; +} +/** + * + * @export + * @interface NoiseCancellationSettings + */ +export interface NoiseCancellationSettings { /** * - * @type {UserObjectRequest} - * @memberof MessageRequest1 + * @type {string} + * @memberof NoiseCancellationSettings */ - user?: UserObjectRequest; + mode: NoiseCancellationSettingsModeEnum; } /** * @export */ -export const MessageRequest1TypeEnum = { - REGULAR: 'regular', - EPHEMERAL: 'ephemeral', - ERROR: 'error', - REPLY: 'reply', - SYSTEM: 'system', - DELETED: 'deleted' +export const NoiseCancellationSettingsModeEnum = { + AVAILABLE: 'available', + DISABLED: 'disabled', + AUTO_ON: 'auto-on' } as const; -export type MessageRequest1TypeEnum = typeof MessageRequest1TypeEnum[keyof typeof MessageRequest1TypeEnum]; +export type NoiseCancellationSettingsModeEnum = typeof NoiseCancellationSettingsModeEnum[keyof typeof NoiseCancellationSettingsModeEnum]; /** * * @export - * @interface MessageResponse + * @interface NotificationSettings */ -export interface MessageResponse { +export interface NotificationSettings { /** - * Duration of the request in human-readable format - * @type {string} - * @memberof MessageResponse + * + * @type {EventNotificationSettings} + * @memberof NotificationSettings */ - duration: string; + call_live_started: EventNotificationSettings; /** * - * @type {Message} - * @memberof MessageResponse + * @type {EventNotificationSettings} + * @memberof NotificationSettings */ - message?: Message | null; -} -/** - * - * @export - * @interface MessageUnblockedEvent - */ -export interface MessageUnblockedEvent { + call_missed: EventNotificationSettings; /** * - * @type {string} - * @memberof MessageUnblockedEvent + * @type {EventNotificationSettings} + * @memberof NotificationSettings */ - cid: string; + call_notification: EventNotificationSettings; /** * - * @type {string} - * @memberof MessageUnblockedEvent + * @type {EventNotificationSettings} + * @memberof NotificationSettings */ - created_at: string; + call_ring: EventNotificationSettings; /** * - * @type {Message} - * @memberof MessageUnblockedEvent + * @type {boolean} + * @memberof NotificationSettings */ - message?: Message | null; + enabled: boolean; /** * - * @type {Array} - * @memberof MessageUnblockedEvent + * @type {EventNotificationSettings} + * @memberof NotificationSettings */ - thread_participants?: Array; + session_started: EventNotificationSettings; +} +/** + * + * @export + * @interface NullBool + */ +export interface NullBool { /** * - * @type {string} - * @memberof MessageUnblockedEvent + * @type {boolean} + * @memberof NullBool */ - type: string; + HasValue?: boolean; /** * - * @type {UserObject} - * @memberof MessageUnblockedEvent + * @type {boolean} + * @memberof NullBool */ - user?: UserObject; + Value?: boolean; } /** * * @export - * @interface MessageUpdatedEvent + * @interface NullTime */ -export interface MessageUpdatedEvent { +export interface NullTime { /** * - * @type {string} - * @memberof MessageUpdatedEvent + * @type {boolean} + * @memberof NullTime */ - channel_id: string; + HasValue?: boolean; /** * * @type {string} - * @memberof MessageUpdatedEvent + * @memberof NullTime */ - channel_type: string; + Value?: string; +} +/** + * + * @export + * @interface OnlyUserID + */ +export interface OnlyUserID { /** * * @type {string} - * @memberof MessageUpdatedEvent + * @memberof OnlyUserID */ - cid: string; + id: string; +} +/** + * + * @export + * @interface OwnUser + */ +export interface OwnUser { /** * - * @type {string} - * @memberof MessageUpdatedEvent + * @type {boolean} + * @memberof OwnUser */ - created_at: string; + banned: boolean; /** * - * @type {Message} - * @memberof MessageUpdatedEvent + * @type {Array} + * @memberof OwnUser + */ + blocked_user_ids?: Array; + /** + * + * @type {Array} + * @memberof OwnUser */ - message?: Message | null; + channel_mutes: Array; /** * * @type {string} - * @memberof MessageUpdatedEvent + * @memberof OwnUser + */ + created_at: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof OwnUser */ - team?: string; + custom: { [key: string]: any; }; /** * - * @type {Array} - * @memberof MessageUpdatedEvent + * @type {string} + * @memberof OwnUser */ - thread_participants?: Array; + deactivated_at?: string; /** * * @type {string} - * @memberof MessageUpdatedEvent + * @memberof OwnUser */ - type: string; + deleted_at?: string; /** * - * @type {UserObject} - * @memberof MessageUpdatedEvent + * @type {Array} + * @memberof OwnUser */ - user?: UserObject; -} -/** - * - * @export - * @interface MessageWithPendingMetadataResponse - */ -export interface MessageWithPendingMetadataResponse { + devices: Array; /** * * @type {string} - * @memberof MessageWithPendingMetadataResponse + * @memberof OwnUser */ - duration: string; + id: string; /** * - * @type {Message} - * @memberof MessageWithPendingMetadataResponse + * @type {boolean} + * @memberof OwnUser */ - message?: Message | null; + invisible?: boolean; /** - * Metadata attached to a message while it is pending - * @type {{ [key: string]: string; }} - * @memberof MessageWithPendingMetadataResponse + * + * @type {string} + * @memberof OwnUser */ - pending_message_metadata?: { [key: string]: string; }; -} -/** - * - * @export - * @interface ModerationResponse - */ -export interface ModerationResponse { + language: string; /** * * @type {string} - * @memberof ModerationResponse + * @memberof OwnUser */ - action: string; + last_active?: string; /** * - * @type {any} - * @memberof ModerationResponse + * @type {Array} + * @memberof OwnUser */ - automod_response: any | null; + latest_hidden_channels?: Array; /** * - * @type {number} - * @memberof ModerationResponse + * @type {Array} + * @memberof OwnUser */ - explicit: number; + mutes: Array; /** * - * @type {number} - * @memberof ModerationResponse + * @type {boolean} + * @memberof OwnUser */ - spam: number; + online: boolean; /** * - * @type {number} - * @memberof ModerationResponse + * @type {PrivacySettings} + * @memberof OwnUser */ - toxic: number; -} -/** - * - * @export - * @interface ModerationResponseRequest - */ -export interface ModerationResponseRequest { + privacy_settings?: PrivacySettings; /** * - * @type {string} - * @memberof ModerationResponseRequest + * @type {PushNotificationSettings} + * @memberof OwnUser */ - action?: string; + push_notifications?: PushNotificationSettings; /** * - * @type {any} - * @memberof ModerationResponseRequest + * @type {string} + * @memberof OwnUser */ - automod_response?: any | null; + role: string; /** * - * @type {number} - * @memberof ModerationResponseRequest + * @type {Array} + * @memberof OwnUser */ - explicit?: number; + teams?: Array; /** * * @type {number} - * @memberof ModerationResponseRequest + * @memberof OwnUser */ - spam?: number; + total_unread_count: number; /** * * @type {number} - * @memberof ModerationResponseRequest - */ - toxic?: number; -} -/** - * - * @export - * @interface MuteChannelRequest - */ -export interface MuteChannelRequest { - /** - * Channel CIDs to mute (if multiple channels) - * @type {Array} - * @memberof MuteChannelRequest + * @memberof OwnUser */ - channel_cids: Array; + unread_channels: number; /** - * Duration of mute in milliseconds + * * @type {number} - * @memberof MuteChannelRequest + * @memberof OwnUser */ - expiration?: number; + unread_count: number; /** * - * @type {UserObjectRequest} - * @memberof MuteChannelRequest + * @type {number} + * @memberof OwnUser */ - user?: UserObjectRequest; + unread_threads: number; /** * * @type {string} - * @memberof MuteChannelRequest + * @memberof OwnUser */ - user_id?: string; + updated_at: string; } /** * * @export - * @interface MuteChannelResponse + * @interface PaginationParams */ -export interface MuteChannelResponse { - /** - * - * @type {ChannelMute} - * @memberof MuteChannelResponse - */ - channel_mute?: ChannelMute | null; - /** - * Object with mutes (if multiple channels were muted) - * @type {Array} - * @memberof MuteChannelResponse - */ - channel_mutes?: Array; +export interface PaginationParams { /** * - * @type {string} - * @memberof MuteChannelResponse + * @type {number} + * @memberof PaginationParams */ - duration: string; + limit?: number; /** * - * @type {OwnUser} - * @memberof MuteChannelResponse + * @type {number} + * @memberof PaginationParams */ - own_user?: OwnUser; + offset?: number; } /** * * @export - * @interface MuteUserRequest + * @interface PendingMessage */ -export interface MuteUserRequest { +export interface PendingMessage { /** - * User IDs to mute (if multiple users) - * @type {Array} - * @memberof MuteUserRequest + * + * @type {Channel} + * @memberof PendingMessage */ - target_ids: Array; + channel?: Channel; /** - * Duration of mute in minutes - * @type {number} - * @memberof MuteUserRequest + * + * @type {Message} + * @memberof PendingMessage */ - timeout?: number; + message?: Message; /** - * - * @type {UserObjectRequest} - * @memberof MuteUserRequest + * Additional data attached to the pending message. This data is discarded once the pending message is committed. + * @type {{ [key: string]: string; }} + * @memberof PendingMessage */ - user?: UserObjectRequest; + metadata?: { [key: string]: string; }; /** * - * @type {string} - * @memberof MuteUserRequest + * @type {UserObject} + * @memberof PendingMessage */ - user_id?: string; + user?: UserObject; } /** * * @export - * @interface MuteUserResponse + * @interface Permission */ -export interface MuteUserResponse { +export interface Permission { /** - * + * Action name this permission is for (e.g. SendMessage) * @type {string} - * @memberof MuteUserResponse - */ - duration: string; - /** - * - * @type {UserMute} - * @memberof MuteUserResponse - */ - mute?: UserMute | null; - /** - * Object with mutes (if multiple users were muted) - * @type {Array} - * @memberof MuteUserResponse + * @memberof Permission */ - mutes?: Array; + action: string; /** - * - * @type {Array} - * @memberof MuteUserResponse + * MongoDB style condition which decides whether or not the permission is granted + * @type {{ [key: string]: any; }} + * @memberof Permission */ - non_existing_users?: Array; + condition?: { [key: string]: any; }; /** - * - * @type {OwnUser} - * @memberof MuteUserResponse + * Whether this is a custom permission or built-in + * @type {boolean} + * @memberof Permission */ - own_user?: OwnUser; -} -/** - * - * @export - * @interface NotificationAddedToChannelEvent - */ -export interface NotificationAddedToChannelEvent { + custom: boolean; /** - * - * @type {ChannelResponse} - * @memberof NotificationAddedToChannelEvent + * Description of the permission + * @type {string} + * @memberof Permission */ - channel?: ChannelResponse; + description: string; /** - * + * Unique permission ID * @type {string} - * @memberof NotificationAddedToChannelEvent + * @memberof Permission */ - channel_id: string; + id: string; /** - * + * Level at which permission could be applied (app or channel) * @type {string} - * @memberof NotificationAddedToChannelEvent + * @memberof Permission */ - channel_type: string; + level: PermissionLevelEnum; /** - * + * Name of the permission * @type {string} - * @memberof NotificationAddedToChannelEvent + * @memberof Permission */ - cid: string; + name: string; /** - * - * @type {string} - * @memberof NotificationAddedToChannelEvent + * Whether this permission applies to resource owner or not + * @type {boolean} + * @memberof Permission */ - created_at: string; + owner: boolean; /** - * - * @type {ChannelMember} - * @memberof NotificationAddedToChannelEvent + * Whether this permission applies to teammates (multi-tenancy mode only) + * @type {boolean} + * @memberof Permission */ - member?: ChannelMember | null; + same_team: boolean; /** - * - * @type {string} - * @memberof NotificationAddedToChannelEvent + * List of tags of the permission + * @type {Array} + * @memberof Permission */ - type: string; + tags: Array; } + + +/** + * @export + */ +export const PermissionLevelEnum = { + APP: 'app', + CHANNEL: 'channel' +} as const; +export type PermissionLevelEnum = typeof PermissionLevelEnum[keyof typeof PermissionLevelEnum]; + /** * * @export - * @interface NotificationChannelDeletedEvent + * @interface Policy */ -export interface NotificationChannelDeletedEvent { +export interface Policy { /** * - * @type {ChannelResponse} - * @memberof NotificationChannelDeletedEvent + * @type {number} + * @memberof Policy */ - channel?: ChannelResponse; + action: number; /** * * @type {string} - * @memberof NotificationChannelDeletedEvent + * @memberof Policy */ - channel_id: string; + created_at: string; /** * * @type {string} - * @memberof NotificationChannelDeletedEvent + * @memberof Policy */ - channel_type: string; + name: string; /** * - * @type {string} - * @memberof NotificationChannelDeletedEvent + * @type {boolean} + * @memberof Policy */ - cid: string; + owner: boolean; /** * - * @type {string} - * @memberof NotificationChannelDeletedEvent + * @type {number} + * @memberof Policy */ - created_at: string; + priority: number; /** * - * @type {string} - * @memberof NotificationChannelDeletedEvent + * @type {Array} + * @memberof Policy */ - team?: string; + resources: Array; + /** + * + * @type {Array} + * @memberof Policy + */ + roles: Array; /** * * @type {string} - * @memberof NotificationChannelDeletedEvent + * @memberof Policy */ - type: string; + updated_at: string; } /** * * @export - * @interface NotificationChannelMutesUpdatedEvent + * @interface PolicyRequest */ -export interface NotificationChannelMutesUpdatedEvent { +export interface PolicyRequest { /** * * @type {string} - * @memberof NotificationChannelMutesUpdatedEvent + * @memberof PolicyRequest */ - created_at: string; + action: PolicyRequestActionEnum; /** - * - * @type {OwnUser} - * @memberof NotificationChannelMutesUpdatedEvent + * User-friendly policy name + * @type {string} + * @memberof PolicyRequest */ - me: OwnUser; + name: string; /** - * - * @type {string} - * @memberof NotificationChannelMutesUpdatedEvent + * Whether policy applies to resource owner or not + * @type {boolean} + * @memberof PolicyRequest */ - type: string; + owner: boolean; + /** + * Policy priority + * @type {number} + * @memberof PolicyRequest + */ + priority: number; + /** + * List of resources to apply policy to + * @type {Array} + * @memberof PolicyRequest + */ + resources: Array; + /** + * List of roles to apply policy to + * @type {Array} + * @memberof PolicyRequest + */ + roles: Array; } + + +/** + * @export + */ +export const PolicyRequestActionEnum = { + DENY: 'Deny', + ALLOW: 'Allow' +} as const; +export type PolicyRequestActionEnum = typeof PolicyRequestActionEnum[keyof typeof PolicyRequestActionEnum]; + /** * * @export - * @interface NotificationChannelTruncatedEvent + * @interface Poll */ -export interface NotificationChannelTruncatedEvent { +export interface Poll { /** * - * @type {ChannelResponse} - * @memberof NotificationChannelTruncatedEvent + * @type {{ [key: string]: any; }} + * @memberof Poll */ - channel?: ChannelResponse; + Custom: { [key: string]: any; }; /** * - * @type {string} - * @memberof NotificationChannelTruncatedEvent + * @type {boolean} + * @memberof Poll */ - channel_id: string; + allow_answers: boolean; /** * - * @type {string} - * @memberof NotificationChannelTruncatedEvent + * @type {boolean} + * @memberof Poll */ - channel_type: string; + allow_user_suggested_options: boolean; /** * - * @type {string} - * @memberof NotificationChannelTruncatedEvent + * @type {number} + * @memberof Poll */ - cid: string; + answers_count: number; /** * * @type {string} - * @memberof NotificationChannelTruncatedEvent + * @memberof Poll */ created_at: string; /** * - * @type {string} - * @memberof NotificationChannelTruncatedEvent - */ - type: string; -} -/** - * - * @export - * @interface NotificationInviteAcceptedEvent - */ -export interface NotificationInviteAcceptedEvent { - /** - * - * @type {ChannelResponse} - * @memberof NotificationInviteAcceptedEvent + * @type {UserObject} + * @memberof Poll */ - channel?: ChannelResponse; + created_by?: UserObject; /** * * @type {string} - * @memberof NotificationInviteAcceptedEvent + * @memberof Poll */ - channel_id: string; + created_by_id: string; /** * * @type {string} - * @memberof NotificationInviteAcceptedEvent + * @memberof Poll */ - channel_type: string; + description: string; /** * - * @type {string} - * @memberof NotificationInviteAcceptedEvent + * @type {boolean} + * @memberof Poll */ - cid: string; + enforce_unique_vote: boolean; /** * * @type {string} - * @memberof NotificationInviteAcceptedEvent + * @memberof Poll */ - created_at: string; + id: string; /** * - * @type {ChannelMember} - * @memberof NotificationInviteAcceptedEvent + * @type {boolean} + * @memberof Poll */ - member?: ChannelMember | null; + is_closed?: boolean; /** * - * @type {string} - * @memberof NotificationInviteAcceptedEvent + * @type {Array} + * @memberof Poll */ - type: string; + latest_answers: Array; /** * - * @type {UserObject} - * @memberof NotificationInviteAcceptedEvent + * @type {{ [key: string]: Array; }} + * @memberof Poll */ - user?: UserObject; -} -/** - * - * @export - * @interface NotificationInviteRejectedEvent - */ -export interface NotificationInviteRejectedEvent { + latest_votes_by_option: { [key: string]: Array; }; /** * - * @type {ChannelResponse} - * @memberof NotificationInviteRejectedEvent + * @type {number} + * @memberof Poll */ - channel?: ChannelResponse; + max_votes_allowed?: number; /** * * @type {string} - * @memberof NotificationInviteRejectedEvent + * @memberof Poll */ - channel_id: string; + name: string; /** * - * @type {string} - * @memberof NotificationInviteRejectedEvent + * @type {Array} + * @memberof Poll */ - channel_type: string; + options: Array; /** * - * @type {string} - * @memberof NotificationInviteRejectedEvent + * @type {Array} + * @memberof Poll */ - cid: string; + own_votes: Array; /** * * @type {string} - * @memberof NotificationInviteRejectedEvent + * @memberof Poll */ - created_at: string; + updated_at: string; /** * - * @type {ChannelMember} - * @memberof NotificationInviteRejectedEvent + * @type {number} + * @memberof Poll */ - member?: ChannelMember | null; + vote_count: number; /** * - * @type {string} - * @memberof NotificationInviteRejectedEvent + * @type {{ [key: string]: number; }} + * @memberof Poll */ - type: string; + vote_counts_by_option: { [key: string]: number; }; /** * - * @type {UserObject} - * @memberof NotificationInviteRejectedEvent + * @type {string} + * @memberof Poll */ - user?: UserObject; + voting_visibility?: string; } /** * * @export - * @interface NotificationInvitedEvent + * @interface PollOption */ -export interface NotificationInvitedEvent { +export interface PollOption { /** * - * @type {ChannelResponse} - * @memberof NotificationInvitedEvent + * @type {{ [key: string]: any; }} + * @memberof PollOption */ - channel?: ChannelResponse; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof NotificationInvitedEvent + * @memberof PollOption */ - channel_id: string; + id: string; /** * * @type {string} - * @memberof NotificationInvitedEvent + * @memberof PollOption */ - channel_type: string; + text: string; +} +/** + * + * @export + * @interface PollOptionInput + */ +export interface PollOptionInput { /** * - * @type {string} - * @memberof NotificationInvitedEvent + * @type {{ [key: string]: any; }} + * @memberof PollOptionInput */ - cid: string; + custom?: { [key: string]: any; }; /** * * @type {string} - * @memberof NotificationInvitedEvent - */ - created_at: string; - /** - * - * @type {ChannelMember} - * @memberof NotificationInvitedEvent + * @memberof PollOptionInput */ - member?: ChannelMember | null; + text?: string; +} +/** + * + * @export + * @interface PollOptionResponse + */ +export interface PollOptionResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof NotificationInvitedEvent + * @memberof PollOptionResponse */ - type: string; + duration: string; /** * - * @type {UserObject} - * @memberof NotificationInvitedEvent + * @type {PollOptionResponseData} + * @memberof PollOptionResponse */ - user?: UserObject; + poll_option: PollOptionResponseData | null; } /** * * @export - * @interface NotificationMarkReadEvent + * @interface PollOptionResponseData */ -export interface NotificationMarkReadEvent { +export interface PollOptionResponseData { /** * - * @type {ChannelResponse} - * @memberof NotificationMarkReadEvent + * @type {{ [key: string]: any; }} + * @memberof PollOptionResponseData */ - channel?: ChannelResponse; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof NotificationMarkReadEvent + * @memberof PollOptionResponseData */ - channel_id: string; + id: string; /** * * @type {string} - * @memberof NotificationMarkReadEvent + * @memberof PollOptionResponseData */ - channel_type: string; + text: string; +} +/** + * + * @export + * @interface PollResponse + */ +export interface PollResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof NotificationMarkReadEvent + * @memberof PollResponse */ - cid: string; + duration: string; /** * - * @type {string} - * @memberof NotificationMarkReadEvent + * @type {PollResponseData} + * @memberof PollResponse */ - created_at: string; + poll: PollResponseData; +} +/** + * + * @export + * @interface PollResponseData + */ +export interface PollResponseData { /** * - * @type {string} - * @memberof NotificationMarkReadEvent + * @type {{ [key: string]: any; }} + * @memberof PollResponseData */ - team?: string; + Custom: { [key: string]: any; }; /** * - * @type {number} - * @memberof NotificationMarkReadEvent + * @type {boolean} + * @memberof PollResponseData */ - total_unread_count: number; + allow_answers: boolean; /** * - * @type {string} - * @memberof NotificationMarkReadEvent + * @type {boolean} + * @memberof PollResponseData */ - type: string; + allow_user_suggested_options: boolean; /** * * @type {number} - * @memberof NotificationMarkReadEvent + * @memberof PollResponseData */ - unread_channels: number; + answers_count: number; /** * - * @type {number} - * @memberof NotificationMarkReadEvent + * @type {string} + * @memberof PollResponseData */ - unread_count: number; + created_at: string; /** * * @type {UserObject} - * @memberof NotificationMarkReadEvent + * @memberof PollResponseData */ - user?: UserObject; -} -/** - * - * @export - * @interface NotificationMarkUnreadEvent - */ -export interface NotificationMarkUnreadEvent { - /** - * - * @type {ChannelResponse} - * @memberof NotificationMarkUnreadEvent - */ - channel?: ChannelResponse; + created_by?: UserObject; /** * * @type {string} - * @memberof NotificationMarkUnreadEvent + * @memberof PollResponseData */ - channel_id: string; + created_by_id: string; /** * * @type {string} - * @memberof NotificationMarkUnreadEvent + * @memberof PollResponseData */ - channel_type: string; + description: string; /** * - * @type {string} - * @memberof NotificationMarkUnreadEvent + * @type {boolean} + * @memberof PollResponseData */ - cid: string; + enforce_unique_vote: boolean; /** * * @type {string} - * @memberof NotificationMarkUnreadEvent + * @memberof PollResponseData */ - created_at: string; + id: string; /** * - * @type {string} - * @memberof NotificationMarkUnreadEvent + * @type {boolean} + * @memberof PollResponseData */ - first_unread_message_id: string; + is_closed?: boolean; /** * - * @type {string} - * @memberof NotificationMarkUnreadEvent + * @type {{ [key: string]: Array; }} + * @memberof PollResponseData */ - last_read_at: string; + latest_votes_by_option: { [key: string]: Array; }; /** * - * @type {string} - * @memberof NotificationMarkUnreadEvent + * @type {number} + * @memberof PollResponseData */ - last_read_message_id?: string; + max_votes_allowed?: number; /** * * @type {string} - * @memberof NotificationMarkUnreadEvent + * @memberof PollResponseData */ - team?: string; + name: string; /** * - * @type {number} - * @memberof NotificationMarkUnreadEvent + * @type {Array} + * @memberof PollResponseData */ - total_unread_count: number; + options: Array; /** * - * @type {string} - * @memberof NotificationMarkUnreadEvent + * @type {Array} + * @memberof PollResponseData */ - type: string; + own_votes: Array; /** * - * @type {number} - * @memberof NotificationMarkUnreadEvent + * @type {string} + * @memberof PollResponseData */ - unread_channels: number; + updated_at: string; /** * * @type {number} - * @memberof NotificationMarkUnreadEvent + * @memberof PollResponseData */ - unread_count: number; + vote_count: number; /** * - * @type {number} - * @memberof NotificationMarkUnreadEvent + * @type {{ [key: string]: number; }} + * @memberof PollResponseData */ - unread_messages: number; + vote_counts_by_option: { [key: string]: number; }; /** * - * @type {UserObject} - * @memberof NotificationMarkUnreadEvent + * @type {string} + * @memberof PollResponseData */ - user?: UserObject; + voting_visibility: string; } /** * * @export - * @interface NotificationMutesUpdatedEvent + * @interface PollVote */ -export interface NotificationMutesUpdatedEvent { +export interface PollVote { /** * * @type {string} - * @memberof NotificationMutesUpdatedEvent + * @memberof PollVote */ - created_at: string; + answer_text?: string; /** * - * @type {OwnUser} - * @memberof NotificationMutesUpdatedEvent + * @type {string} + * @memberof PollVote */ - me: OwnUser; + created_at: string; /** * * @type {string} - * @memberof NotificationMutesUpdatedEvent + * @memberof PollVote */ - type: string; -} -/** - * - * @export - * @interface NotificationNewMessageEvent - */ -export interface NotificationNewMessageEvent { + id: string; /** * - * @type {ChannelResponse} - * @memberof NotificationNewMessageEvent + * @type {boolean} + * @memberof PollVote */ - channel?: ChannelResponse; + is_answer?: boolean; /** * * @type {string} - * @memberof NotificationNewMessageEvent + * @memberof PollVote */ - channel_id: string; + option_id: string; /** * * @type {string} - * @memberof NotificationNewMessageEvent + * @memberof PollVote */ - channel_type: string; + poll_id: string; /** * * @type {string} - * @memberof NotificationNewMessageEvent + * @memberof PollVote */ - cid: string; + updated_at: string; /** * - * @type {string} - * @memberof NotificationNewMessageEvent + * @type {UserObject} + * @memberof PollVote */ - created_at: string; + user?: UserObject; /** * - * @type {Message} - * @memberof NotificationNewMessageEvent + * @type {string} + * @memberof PollVote */ - message: Message | null; + user_id?: string; +} +/** + * + * @export + * @interface PollVoteResponse + */ +export interface PollVoteResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof NotificationNewMessageEvent + * @memberof PollVoteResponse */ - team?: string; + duration: string; /** * - * @type {string} - * @memberof NotificationNewMessageEvent + * @type {PollVoteResponseData} + * @memberof PollVoteResponse */ - type: string; + vote?: PollVoteResponseData | null; } /** * * @export - * @interface NotificationRemovedFromChannelEvent + * @interface PollVoteResponseData */ -export interface NotificationRemovedFromChannelEvent { +export interface PollVoteResponseData { /** * - * @type {ChannelResponse} - * @memberof NotificationRemovedFromChannelEvent + * @type {string} + * @memberof PollVoteResponseData */ - channel?: ChannelResponse; + answer_text?: string; /** * * @type {string} - * @memberof NotificationRemovedFromChannelEvent + * @memberof PollVoteResponseData */ - channel_id: string; + created_at: string; /** * * @type {string} - * @memberof NotificationRemovedFromChannelEvent + * @memberof PollVoteResponseData */ - channel_type: string; + id: string; /** * - * @type {string} - * @memberof NotificationRemovedFromChannelEvent + * @type {boolean} + * @memberof PollVoteResponseData */ - cid: string; + is_answer?: boolean; /** * * @type {string} - * @memberof NotificationRemovedFromChannelEvent + * @memberof PollVoteResponseData */ - created_at: string; + option_id: string; /** * - * @type {ChannelMember} - * @memberof NotificationRemovedFromChannelEvent + * @type {string} + * @memberof PollVoteResponseData */ - member?: ChannelMember | null; + poll_id: string; /** * * @type {string} - * @memberof NotificationRemovedFromChannelEvent + * @memberof PollVoteResponseData */ - type: string; + updated_at: string; /** * * @type {UserObject} - * @memberof NotificationRemovedFromChannelEvent + * @memberof PollVoteResponseData */ user?: UserObject; + /** + * + * @type {string} + * @memberof PollVoteResponseData + */ + user_id?: string; } /** * * @export - * @interface NotificationSettings + * @interface PollVotesResponse */ -export interface NotificationSettings { +export interface PollVotesResponse { + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof PollVotesResponse + */ + duration: string; /** * - * @type {EventNotificationSettings} - * @memberof NotificationSettings + * @type {string} + * @memberof PollVotesResponse */ - call_live_started: EventNotificationSettings; + next?: string; /** * - * @type {EventNotificationSettings} - * @memberof NotificationSettings + * @type {string} + * @memberof PollVotesResponse */ - call_notification: EventNotificationSettings; + prev?: string; /** * - * @type {EventNotificationSettings} - * @memberof NotificationSettings + * @type {Array} + * @memberof PollVotesResponse */ - call_ring: EventNotificationSettings; + votes: Array; +} +/** + * + * @export + * @interface PrivacySettings + */ +export interface PrivacySettings { /** * - * @type {boolean} - * @memberof NotificationSettings + * @type {ReadReceipts} + * @memberof PrivacySettings */ - enabled: boolean; + read_receipts?: ReadReceipts; /** * - * @type {EventNotificationSettings} - * @memberof NotificationSettings + * @type {TypingIndicators} + * @memberof PrivacySettings */ - session_started: EventNotificationSettings; + typing_indicators?: TypingIndicators; } /** * * @export - * @interface OwnUser + * @interface PushConfig */ -export interface OwnUser { - [key: string]: any | any; +export interface PushConfig { /** * * @type {boolean} - * @memberof OwnUser - */ - banned: boolean; - /** - * - * @type {Array} - * @memberof OwnUser + * @memberof PushConfig */ - channel_mutes: Array; + offline_only?: boolean; /** * * @type {string} - * @memberof OwnUser + * @memberof PushConfig */ - created_at: string; + version: PushConfigVersionEnum; +} + + +/** + * @export + */ +export const PushConfigVersionEnum = { + V1: 'v1', + V2: 'v2' +} as const; +export type PushConfigVersionEnum = typeof PushConfigVersionEnum[keyof typeof PushConfigVersionEnum]; + +/** + * + * @export + * @interface PushNotificationFields + */ +export interface PushNotificationFields { /** * - * @type {string} - * @memberof OwnUser + * @type {APNConfigFields} + * @memberof PushNotificationFields */ - deactivated_at?: string; + apn: APNConfigFields; /** * - * @type {string} - * @memberof OwnUser + * @type {FirebaseConfigFields} + * @memberof PushNotificationFields */ - deleted_at?: string; + firebase: FirebaseConfigFields; /** * - * @type {Array} - * @memberof OwnUser + * @type {HuaweiConfigFields} + * @memberof PushNotificationFields */ - devices: Array; + huawei: HuaweiConfigFields; /** * - * @type {string} - * @memberof OwnUser + * @type {boolean} + * @memberof PushNotificationFields */ - id: string; + offline_only: boolean; /** * - * @type {boolean} - * @memberof OwnUser + * @type {Array} + * @memberof PushNotificationFields */ - invisible?: boolean; + providers?: Array; /** * * @type {string} - * @memberof OwnUser + * @memberof PushNotificationFields */ - language: string; + version: string; /** * - * @type {string} - * @memberof OwnUser + * @type {XiaomiConfigFields} + * @memberof PushNotificationFields */ - last_active?: string; + xiaomi: XiaomiConfigFields; +} +/** + * + * @export + * @interface PushNotificationSettings + */ +export interface PushNotificationSettings { /** * - * @type {Array} - * @memberof OwnUser + * @type {boolean} + * @memberof PushNotificationSettings */ - latest_hidden_channels?: Array; + disabled?: boolean; /** * - * @type {Array} - * @memberof OwnUser + * @type {string} + * @memberof PushNotificationSettings */ - mutes: Array; + disabled_until?: string; +} +/** + * + * @export + * @interface PushNotificationSettingsInput + */ +export interface PushNotificationSettingsInput { /** * - * @type {boolean} - * @memberof OwnUser + * @type {NullBool} + * @memberof PushNotificationSettingsInput */ - online: boolean; + disabled?: NullBool; /** * - * @type {PushNotificationSettings} - * @memberof OwnUser + * @type {NullTime} + * @memberof PushNotificationSettingsInput */ - push_notifications?: PushNotificationSettings; + disabled_until?: NullTime; +} +/** + * + * @export + * @interface PushProvider + */ +export interface PushProvider { /** * * @type {string} - * @memberof OwnUser + * @memberof PushProvider */ - role: string; + apn_auth_key?: string; /** * - * @type {Array} - * @memberof OwnUser + * @type {string} + * @memberof PushProvider */ - teams?: Array; + apn_auth_type?: string; /** * - * @type {number} - * @memberof OwnUser + * @type {boolean} + * @memberof PushProvider */ - total_unread_count: number; + apn_development?: boolean; /** * - * @type {number} - * @memberof OwnUser + * @type {string} + * @memberof PushProvider */ - unread_channels: number; + apn_host?: string; /** * - * @type {number} - * @memberof OwnUser + * @type {string} + * @memberof PushProvider */ - unread_count: number; + apn_key_id?: string; /** * * @type {string} - * @memberof OwnUser + * @memberof PushProvider */ - updated_at: string; -} -/** - * - * @export - * @interface OwnUserRequest - */ -export interface OwnUserRequest { - [key: string]: any | any; + apn_notification_template?: string; /** * - * @type {boolean} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - banned?: boolean; + apn_p12_cert?: string; /** * - * @type {Array} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - channel_mutes?: Array; + apn_team_id?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - created_at?: string; + apn_topic?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - deactivated_at?: string; + created_at: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - deleted_at?: string; + description?: string; /** * - * @type {Array} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - devices?: Array; + disabled_at?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - id?: string; + disabled_reason?: string; /** * - * @type {boolean} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - invisible?: boolean; + firebase_apn_template?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - language?: string; + firebase_credentials?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - last_active?: string; + firebase_data_template?: string; /** * - * @type {Array} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - latest_hidden_channels?: Array; + firebase_host?: string; /** * - * @type {Array} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - mutes?: Array; + firebase_notification_template?: string; /** * - * @type {boolean} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - online?: boolean; + firebase_server_key?: string; /** * - * @type {PushNotificationSettingsRequest} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - push_notifications?: PushNotificationSettingsRequest; + huawei_app_id?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - role?: string; + huawei_app_secret?: string; /** * - * @type {Array} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - teams?: Array; + name: string; /** * - * @type {number} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - total_unread_count?: number; + type: string; /** * - * @type {number} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - unread_channels?: number; + updated_at: string; /** * - * @type {number} - * @memberof OwnUserRequest + * @type {string} + * @memberof PushProvider */ - unread_count?: number; + xiaomi_app_secret?: string; /** * * @type {string} - * @memberof OwnUserRequest + * @memberof PushProvider */ - updated_at?: string; + xiaomi_package_name?: string; } /** * * @export - * @interface PaginationParamsRequest + * @interface PushProviderResponse */ -export interface PaginationParamsRequest { +export interface PushProviderResponse { /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {string} + * @memberof PushProviderResponse */ - id_gt?: number; + apn_auth_key?: string; /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {string} + * @memberof PushProviderResponse */ - id_gte?: number; + apn_auth_type?: string; /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {boolean} + * @memberof PushProviderResponse */ - id_lt?: number; + apn_development?: boolean; /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {string} + * @memberof PushProviderResponse */ - id_lte?: number; + apn_host?: string; /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {string} + * @memberof PushProviderResponse */ - limit?: number; + apn_key_id?: string; /** * - * @type {number} - * @memberof PaginationParamsRequest + * @type {string} + * @memberof PushProviderResponse */ - offset?: number; -} -/** - * - * @export - * @interface PendingMessage - */ -export interface PendingMessage { + apn_p12_cert?: string; /** * - * @type {Channel} - * @memberof PendingMessage + * @type {boolean} + * @memberof PushProviderResponse */ - channel?: Channel; + apn_sandbox_certificate?: boolean; /** * - * @type {Message} - * @memberof PendingMessage - */ - message?: Message | null; - /** - * Additional data attached to the pending message. This data is discarded once the pending message is committed. - * @type {{ [key: string]: string; }} - * @memberof PendingMessage + * @type {boolean} + * @memberof PushProviderResponse */ - metadata?: { [key: string]: string; }; + apn_supports_remote_notifications?: boolean; /** * - * @type {UserObject} - * @memberof PendingMessage - */ - user?: UserObject; -} -/** - * - * @export - * @interface Permission - */ -export interface Permission { - /** - * Action name this permission is for (e.g. SendMessage) - * @type {string} - * @memberof Permission - */ - action: string; - /** - * MongoDB style condition which decides whether or not the permission is granted - * @type {{ [key: string]: any; }} - * @memberof Permission - */ - condition?: { [key: string]: any; }; - /** - * Whether this is a custom permission or built-in * @type {boolean} - * @memberof Permission + * @memberof PushProviderResponse */ - custom: boolean; + apn_supports_voip_notifications?: boolean; /** - * Description of the permission + * * @type {string} - * @memberof Permission + * @memberof PushProviderResponse */ - description: string; + apn_team_id?: string; /** - * Unique permission ID + * * @type {string} - * @memberof Permission + * @memberof PushProviderResponse */ - id: string; + apn_topic?: string; /** - * Level at which permission could be applied (app or channel) + * * @type {string} - * @memberof Permission + * @memberof PushProviderResponse */ - level: PermissionLevelEnum; + created_at: string; /** - * Name of the permission + * * @type {string} - * @memberof Permission - */ - name: string; - /** - * Whether this permission applies to resource owner or not - * @type {boolean} - * @memberof Permission - */ - owner: boolean; - /** - * Whether this permission applies to teammates (multi-tenancy mode only) - * @type {boolean} - * @memberof Permission + * @memberof PushProviderResponse */ - same_team: boolean; + description?: string; /** - * List of tags of the permission - * @type {Array} - * @memberof Permission + * + * @type {string} + * @memberof PushProviderResponse */ - tags: Array; -} - - -/** - * @export - */ -export const PermissionLevelEnum = { - APP: 'app', - CHANNEL: 'channel' -} as const; -export type PermissionLevelEnum = typeof PermissionLevelEnum[keyof typeof PermissionLevelEnum]; - -/** - * - * @export - * @interface Policy - */ -export interface Policy { + disabled_at?: string; /** * - * @type {number} - * @memberof Policy + * @type {string} + * @memberof PushProviderResponse */ - action: number; + disabled_reason?: string; /** * * @type {string} - * @memberof Policy + * @memberof PushProviderResponse */ - created_at: string; + firebase_apn_template?: string; /** * * @type {string} - * @memberof Policy + * @memberof PushProviderResponse */ - name: string; + firebase_credentials?: string; /** * - * @type {boolean} - * @memberof Policy + * @type {string} + * @memberof PushProviderResponse */ - owner: boolean; + firebase_data_template?: string; /** * - * @type {number} - * @memberof Policy + * @type {string} + * @memberof PushProviderResponse */ - priority: number; + firebase_host?: string; /** * - * @type {Array} - * @memberof Policy + * @type {string} + * @memberof PushProviderResponse */ - resources: Array; + firebase_notification_template?: string; /** * - * @type {Array} - * @memberof Policy + * @type {string} + * @memberof PushProviderResponse */ - roles: Array; + firebase_server_key?: string; /** * * @type {string} - * @memberof Policy + * @memberof PushProviderResponse */ - updated_at: string; -} -/** - * - * @export - * @interface PolicyRequest - */ -export interface PolicyRequest { + huawei_app_id?: string; /** * * @type {string} - * @memberof PolicyRequest + * @memberof PushProviderResponse */ - action?: PolicyRequestActionEnum; + huawei_app_secret?: string; /** - * User-friendly policy name + * * @type {string} - * @memberof PolicyRequest + * @memberof PushProviderResponse */ name: string; /** - * Whether policy applies to resource owner or not - * @type {boolean} - * @memberof PolicyRequest + * + * @type {string} + * @memberof PushProviderResponse */ - owner?: boolean; + type: string; /** - * Policy priority - * @type {number} - * @memberof PolicyRequest + * + * @type {string} + * @memberof PushProviderResponse */ - priority: number; + updated_at: string; /** - * List of resources to apply policy to - * @type {Array} - * @memberof PolicyRequest + * + * @type {string} + * @memberof PushProviderResponse */ - resources?: Array; + xiaomi_app_secret?: string; /** - * List of roles to apply policy to - * @type {Array} - * @memberof PolicyRequest + * + * @type {string} + * @memberof PushProviderResponse */ - roles?: Array; + xiaomi_package_name?: string; } - - -/** - * @export - */ -export const PolicyRequestActionEnum = { - DENY: 'Deny', - ALLOW: 'Allow' -} as const; -export type PolicyRequestActionEnum = typeof PolicyRequestActionEnum[keyof typeof PolicyRequestActionEnum]; - /** * * @export - * @interface PolicyRequest1 + * @interface QueryBannedUsersRequest */ -export interface PolicyRequest1 { +export interface QueryBannedUsersRequest { /** * - * @type {string} - * @memberof PolicyRequest1 + * @type {boolean} + * @memberof QueryBannedUsersRequest */ - action: PolicyRequest1ActionEnum; + exclude_expired_bans?: boolean; /** - * User-friendly policy name - * @type {string} - * @memberof PolicyRequest1 + * + * @type {{ [key: string]: any; }} + * @memberof QueryBannedUsersRequest */ - name: string; + filter_conditions: { [key: string]: any; }; /** - * Whether policy applies to resource owner or not - * @type {boolean} - * @memberof PolicyRequest1 + * + * @type {number} + * @memberof QueryBannedUsersRequest */ - owner: boolean; + limit?: number; /** - * Policy priority + * * @type {number} - * @memberof PolicyRequest1 + * @memberof QueryBannedUsersRequest */ - priority: number; + offset?: number; /** - * List of resources to apply policy to - * @type {Array} - * @memberof PolicyRequest1 + * + * @type {Array} + * @memberof QueryBannedUsersRequest */ - resources: Array; + sort?: Array; /** - * List of roles to apply policy to - * @type {Array} - * @memberof PolicyRequest1 + * + * @type {UserRequest} + * @memberof QueryBannedUsersRequest */ - roles: Array; + user?: UserRequest; + /** + * + * @type {string} + * @memberof QueryBannedUsersRequest + */ + user_id?: string; } - - -/** - * @export - */ -export const PolicyRequest1ActionEnum = { - DENY: 'Deny', - ALLOW: 'Allow' -} as const; -export type PolicyRequest1ActionEnum = typeof PolicyRequest1ActionEnum[keyof typeof PolicyRequest1ActionEnum]; - /** * * @export - * @interface PushConfigRequest + * @interface QueryBannedUsersResponse */ -export interface PushConfigRequest { +export interface QueryBannedUsersResponse { /** * - * @type {boolean} - * @memberof PushConfigRequest + * @type {Array} + * @memberof QueryBannedUsersResponse */ - offline_only?: boolean; + bans: Array; /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushConfigRequest + * @memberof QueryBannedUsersResponse */ - version?: PushConfigRequestVersionEnum; + duration: string; } - - -/** - * @export - */ -export const PushConfigRequestVersionEnum = { - V1: 'v1', - V2: 'v2' -} as const; -export type PushConfigRequestVersionEnum = typeof PushConfigRequestVersionEnum[keyof typeof PushConfigRequestVersionEnum]; - /** * * @export - * @interface PushNotificationFields + * @interface QueryChannelsRequest */ -export interface PushNotificationFields { +export interface QueryChannelsRequest { /** * - * @type {APNConfigFields} - * @memberof PushNotificationFields + * @type {{ [key: string]: any; }} + * @memberof QueryChannelsRequest */ - apn: APNConfigFields; + filter_conditions?: { [key: string]: any; }; /** - * - * @type {FirebaseConfigFields} - * @memberof PushNotificationFields + * Number of channels to limit + * @type {number} + * @memberof QueryChannelsRequest */ - firebase: FirebaseConfigFields; + limit?: number; /** - * - * @type {HuaweiConfigFields} - * @memberof PushNotificationFields + * Number of members to limit + * @type {number} + * @memberof QueryChannelsRequest */ - huawei: HuaweiConfigFields; + member_limit?: number; /** - * - * @type {boolean} - * @memberof PushNotificationFields + * Number of messages to limit + * @type {number} + * @memberof QueryChannelsRequest */ - offline_only: boolean; + message_limit?: number; /** - * - * @type {Array} - * @memberof PushNotificationFields + * Channel pagination offset + * @type {number} + * @memberof QueryChannelsRequest */ - providers?: Array; + offset?: number; /** - * - * @type {string} - * @memberof PushNotificationFields + * List of sort parameters + * @type {Array} + * @memberof QueryChannelsRequest */ - version: string; + sort?: Array; /** - * - * @type {XiaomiConfigFields} - * @memberof PushNotificationFields + * Whether to update channel state or not + * @type {boolean} + * @memberof QueryChannelsRequest */ - xiaomi: XiaomiConfigFields; -} -/** - * - * @export - * @interface PushNotificationSettings - */ -export interface PushNotificationSettings { + state?: boolean; /** * - * @type {boolean} - * @memberof PushNotificationSettings + * @type {UserRequest} + * @memberof QueryChannelsRequest */ - disabled?: boolean; + user?: UserRequest; /** * * @type {string} - * @memberof PushNotificationSettings + * @memberof QueryChannelsRequest */ - disabled_until?: string; + user_id?: string; } /** * * @export - * @interface PushNotificationSettingsRequest + * @interface QueryChannelsResponse */ -export interface PushNotificationSettingsRequest { +export interface QueryChannelsResponse { /** - * - * @type {boolean} - * @memberof PushNotificationSettingsRequest + * List of channels + * @type {Array} + * @memberof QueryChannelsResponse */ - disabled?: boolean; + channels: Array; /** * * @type {string} - * @memberof PushNotificationSettingsRequest + * @memberof QueryChannelsResponse */ - disabled_until?: string; + duration: string; } /** * * @export - * @interface PushProvider + * @interface QueryMembersRequest */ -export interface PushProvider { +export interface QueryMembersRequest { /** - * + * Filter to apply to members + * @type {{ [key: string]: any; }} + * @memberof QueryMembersRequest + */ + filter_conditions: { [key: string]: any; }; + /** + * Channel ID to interact with * @type {string} - * @memberof PushProvider + * @memberof QueryMembersRequest */ - apn_auth_key?: string; + id?: string; /** - * + * Number of records to return + * @type {number} + * @memberof QueryMembersRequest + */ + limit?: number; + /** + * List of members to search in distinct channels + * @type {Array} + * @memberof QueryMembersRequest + */ + members?: Array; + /** + * Number of records to offset + * @type {number} + * @memberof QueryMembersRequest + */ + offset?: number; + /** + * Array of sort parameters + * @type {Array} + * @memberof QueryMembersRequest + */ + sort?: Array; + /** + * Channel type to interact with * @type {string} - * @memberof PushProvider + * @memberof QueryMembersRequest */ - apn_auth_type?: string; + type: string; /** * - * @type {boolean} - * @memberof PushProvider + * @type {UserRequest} + * @memberof QueryMembersRequest */ - apn_development?: boolean; + user?: UserRequest; + /** + * + * @type {string} + * @memberof QueryMembersRequest + */ + user_id?: string; +} +/** + * + * @export + * @interface QueryMessageFlagsRequest + */ +export interface QueryMessageFlagsRequest { /** * - * @type {string} - * @memberof PushProvider + * @type {{ [key: string]: any; }} + * @memberof QueryMessageFlagsRequest */ - apn_host?: string; + filter_conditions?: { [key: string]: any; }; /** * - * @type {string} - * @memberof PushProvider + * @type {number} + * @memberof QueryMessageFlagsRequest */ - apn_key_id?: string; + limit?: number; /** * - * @type {string} - * @memberof PushProvider + * @type {number} + * @memberof QueryMessageFlagsRequest */ - apn_notification_template?: string; + offset?: number; /** * - * @type {string} - * @memberof PushProvider + * @type {boolean} + * @memberof QueryMessageFlagsRequest */ - apn_p12_cert?: string; + show_deleted_messages?: boolean; /** * - * @type {string} - * @memberof PushProvider + * @type {Array} + * @memberof QueryMessageFlagsRequest */ - apn_team_id?: string; + sort?: Array; /** * - * @type {string} - * @memberof PushProvider + * @type {UserRequest} + * @memberof QueryMessageFlagsRequest */ - apn_topic?: string; + user?: UserRequest; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryMessageFlagsRequest */ - created_at: string; + user_id?: string; +} +/** + * + * @export + * @interface QueryMessageFlagsResponse + */ +export interface QueryMessageFlagsResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushProvider + * @memberof QueryMessageFlagsResponse */ - description?: string; + duration: string; /** * - * @type {string} - * @memberof PushProvider + * @type {Array} + * @memberof QueryMessageFlagsResponse */ - disabled_at?: string; + flags: Array; +} +/** + * + * @export + * @interface QueryMessageHistoryRequest + */ +export interface QueryMessageHistoryRequest { /** * - * @type {string} - * @memberof PushProvider + * @type {{ [key: string]: any; }} + * @memberof QueryMessageHistoryRequest */ - disabled_reason?: string; + filter: { [key: string]: any; }; /** * - * @type {string} - * @memberof PushProvider + * @type {number} + * @memberof QueryMessageHistoryRequest */ - firebase_apn_template?: string; + limit?: number; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryMessageHistoryRequest */ - firebase_credentials?: string; + next?: string; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryMessageHistoryRequest */ - firebase_data_template?: string; + prev?: string; /** * - * @type {string} - * @memberof PushProvider + * @type {Array} + * @memberof QueryMessageHistoryRequest */ - firebase_host?: string; + sort?: Array; +} +/** + * + * @export + * @interface QueryMessageHistoryResponse + */ +export interface QueryMessageHistoryResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushProvider + * @memberof QueryMessageHistoryResponse */ - firebase_notification_template?: string; + duration: string; /** * - * @type {string} - * @memberof PushProvider + * @type {Array} + * @memberof QueryMessageHistoryResponse */ - firebase_server_key?: string; + message_history: Array; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryMessageHistoryResponse */ - huawei_app_id?: string; + next?: string; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryMessageHistoryResponse */ - huawei_app_secret?: string; + prev?: string; +} +/** + * + * @export + * @interface QueryPollVotesRequest + */ +export interface QueryPollVotesRequest { /** * - * @type {string} - * @memberof PushProvider + * @type {{ [key: string]: any; }} + * @memberof QueryPollVotesRequest */ - name: string; + filter?: { [key: string]: any; }; /** * * @type {number} - * @memberof PushProvider + * @memberof QueryPollVotesRequest */ - type: number; + limit?: number; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryPollVotesRequest */ - updated_at: string; + next?: string; /** * * @type {string} - * @memberof PushProvider + * @memberof QueryPollVotesRequest */ - xiaomi_app_secret?: string; + prev?: string; /** * - * @type {string} - * @memberof PushProvider + * @type {Array} + * @memberof QueryPollVotesRequest */ - xiaomi_package_name?: string; + sort?: Array; } /** * * @export - * @interface PushProviderRequest + * @interface QueryPollsRequest */ -export interface PushProviderRequest { +export interface QueryPollsRequest { /** * - * @type {string} - * @memberof PushProviderRequest + * @type {{ [key: string]: any; }} + * @memberof QueryPollsRequest */ - apn_auth_key?: string; + filter?: { [key: string]: any; }; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {number} + * @memberof QueryPollsRequest */ - apn_auth_type?: string; + limit?: number; /** * - * @type {boolean} - * @memberof PushProviderRequest + * @type {string} + * @memberof QueryPollsRequest */ - apn_development?: boolean; + next?: string; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryPollsRequest */ - apn_host?: string; + prev?: string; /** * + * @type {Array} + * @memberof QueryPollsRequest + */ + sort?: Array; +} +/** + * + * @export + * @interface QueryPollsResponse + */ +export interface QueryPollsResponse { + /** + * Duration of the request in human-readable format * @type {string} - * @memberof PushProviderRequest + * @memberof QueryPollsResponse */ - apn_key_id?: string; + duration: string; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryPollsResponse */ - apn_notification_template?: string; + next?: string; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {Array} + * @memberof QueryPollsResponse */ - apn_p12_cert?: string; + polls: Array; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryPollsResponse */ - apn_team_id?: string; + prev?: string; +} +/** + * + * @export + * @interface QueryReactionsRequest + */ +export interface QueryReactionsRequest { /** * - * @type {string} - * @memberof PushProviderRequest + * @type {{ [key: string]: any; }} + * @memberof QueryReactionsRequest */ - apn_topic?: string; + filter?: { [key: string]: any; }; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {number} + * @memberof QueryReactionsRequest */ - created_at?: string; + limit?: number; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsRequest */ - description?: string; + next?: string; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsRequest */ - disabled_at?: string; + prev?: string; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {Array} + * @memberof QueryReactionsRequest */ - disabled_reason?: string; + sort?: Array; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {UserRequest} + * @memberof QueryReactionsRequest */ - firebase_apn_template?: string; + user?: UserRequest; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsRequest */ - firebase_credentials?: string; + user_id?: string; +} +/** + * + * @export + * @interface QueryReactionsResponse + */ +export interface QueryReactionsResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsResponse */ - firebase_data_template?: string; + duration: string; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsResponse */ - firebase_host?: string; + next?: string; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryReactionsResponse */ - firebase_notification_template?: string; + prev?: string; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {Array} + * @memberof QueryReactionsResponse */ - firebase_server_key?: string; + reactions: Array; +} +/** + * + * @export + * @interface QueryThreadsRequest + */ +export interface QueryThreadsRequest { /** * - * @type {string} - * @memberof PushProviderRequest + * @type {number} + * @memberof QueryThreadsRequest */ - huawei_app_id?: string; + limit?: number; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {number} + * @memberof QueryThreadsRequest */ - huawei_app_secret?: string; + member_limit?: number; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryThreadsRequest */ - name: string; + next?: string; /** - * + * Limit the number of participants returned per each thread * @type {number} - * @memberof PushProviderRequest + * @memberof QueryThreadsRequest */ - type?: number; + participant_limit?: number; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryThreadsRequest */ - updated_at?: string; + prev?: string; + /** + * Limit the number of replies returned per each thread + * @type {number} + * @memberof QueryThreadsRequest + */ + reply_limit?: number; /** * - * @type {string} - * @memberof PushProviderRequest + * @type {UserRequest} + * @memberof QueryThreadsRequest */ - xiaomi_app_secret?: string; + user?: UserRequest; /** * * @type {string} - * @memberof PushProviderRequest + * @memberof QueryThreadsRequest */ - xiaomi_package_name?: string; + user_id?: string; } /** * * @export - * @interface PushProviderResponse + * @interface QueryThreadsResponse */ -export interface PushProviderResponse { +export interface QueryThreadsResponse { /** * * @type {string} - * @memberof PushProviderResponse + * @memberof QueryThreadsResponse */ - apn_auth_key?: string; + duration: string; /** * * @type {string} - * @memberof PushProviderResponse + * @memberof QueryThreadsResponse */ - apn_auth_type?: string; + next?: string; /** * - * @type {boolean} - * @memberof PushProviderResponse + * @type {string} + * @memberof QueryThreadsResponse */ - apn_development?: boolean; + prev?: string; + /** + * List of enriched thread states + * @type {Array} + * @memberof QueryThreadsResponse + */ + threads: Array; +} +/** + * + * @export + * @interface QueryUsersPayload + */ +export interface QueryUsersPayload { /** * - * @type {string} - * @memberof PushProviderResponse + * @type {{ [key: string]: any; }} + * @memberof QueryUsersPayload */ - apn_host?: string; + filter_conditions: { [key: string]: any; }; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {boolean} + * @memberof QueryUsersPayload */ - apn_key_id?: string; + include_deactivated_users?: boolean; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {number} + * @memberof QueryUsersPayload */ - apn_p12_cert?: string; + limit?: number; /** * - * @type {boolean} - * @memberof PushProviderResponse + * @type {number} + * @memberof QueryUsersPayload */ - apn_sandbox_certificate?: boolean; + offset?: number; /** * * @type {boolean} - * @memberof PushProviderResponse + * @memberof QueryUsersPayload */ - apn_supports_remote_notifications?: boolean; + presence?: boolean; /** * - * @type {boolean} - * @memberof PushProviderResponse + * @type {Array} + * @memberof QueryUsersPayload */ - apn_supports_voip_notifications?: boolean; + sort?: Array; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {UserRequest} + * @memberof QueryUsersPayload */ - apn_team_id?: string; + user?: UserRequest; /** * * @type {string} - * @memberof PushProviderResponse + * @memberof QueryUsersPayload */ - apn_topic?: string; + user_id?: string; +} +/** + * + * @export + * @interface QueryUsersResponse + */ +export interface QueryUsersResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushProviderResponse + * @memberof QueryUsersResponse */ - created_at: string; + duration: string; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {Array} + * @memberof QueryUsersResponse */ - description?: string; + users: Array; +} +/** + * Represents user reaction to a message + * @export + * @interface Reaction + */ +export interface Reaction { /** - * + * Date/time of creation * @type {string} - * @memberof PushProviderResponse + * @memberof Reaction */ - disabled_at?: string; + readonly created_at: string; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {{ [key: string]: any; }} + * @memberof Reaction */ - disabled_reason?: string; + custom: { [key: string]: any; }; /** - * + * ID of a message user reacted to * @type {string} - * @memberof PushProviderResponse + * @memberof Reaction */ - firebase_apn_template?: string; + message_id: string; /** - * - * @type {string} - * @memberof PushProviderResponse + * Reaction score. If not specified reaction has score of 1 + * @type {number} + * @memberof Reaction */ - firebase_credentials?: string; + score: number; /** - * + * The type of reaction (e.g. 'like', 'laugh', 'wow') * @type {string} - * @memberof PushProviderResponse + * @memberof Reaction */ - firebase_data_template?: string; + type: string; /** - * + * Date/time of the last update * @type {string} - * @memberof PushProviderResponse + * @memberof Reaction */ - firebase_host?: string; + readonly updated_at: string; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {UserObject} + * @memberof Reaction */ - firebase_notification_template?: string; + user?: UserObject; /** - * + * ID of a user who reacted to a message * @type {string} - * @memberof PushProviderResponse + * @memberof Reaction */ - firebase_server_key?: string; + user_id?: string; +} +/** + * + * @export + * @interface ReactionGroupResponse + */ +export interface ReactionGroupResponse { /** * - * @type {string} - * @memberof PushProviderResponse + * @type {number} + * @memberof ReactionGroupResponse */ - huawei_app_id?: string; + count: number; /** * * @type {string} - * @memberof PushProviderResponse + * @memberof ReactionGroupResponse */ - huawei_app_secret?: string; + first_reaction_at: string; /** * * @type {string} - * @memberof PushProviderResponse + * @memberof ReactionGroupResponse */ - name: string; + last_reaction_at: string; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {number} + * @memberof ReactionGroupResponse */ - type: string; + sum_scores: number; +} +/** + * + * @export + * @interface ReactionRemovalResponse + */ +export interface ReactionRemovalResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof PushProviderResponse + * @memberof ReactionRemovalResponse */ - updated_at: string; + duration: string; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {Message} + * @memberof ReactionRemovalResponse */ - xiaomi_app_secret?: string; + message?: Message; /** * - * @type {string} - * @memberof PushProviderResponse + * @type {Reaction} + * @memberof ReactionRemovalResponse */ - xiaomi_package_name?: string; + reaction?: Reaction | null; } /** * * @export - * @interface QueryBannedUsersRequest + * @interface ReactionRequest */ -export interface QueryBannedUsersRequest { +export interface ReactionRequest { /** * * @type {string} - * @memberof QueryBannedUsersRequest + * @memberof ReactionRequest + */ + created_at?: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof ReactionRequest + */ + custom?: { [key: string]: any; }; + /** + * + * @type {number} + * @memberof ReactionRequest */ - created_at_after?: string; + score?: number; /** * * @type {string} - * @memberof QueryBannedUsersRequest + * @memberof ReactionRequest */ - created_at_after_or_equal?: string; + type: string; /** * * @type {string} - * @memberof QueryBannedUsersRequest + * @memberof ReactionRequest + */ + updated_at?: string; + /** + * + * @type {UserRequest} + * @memberof ReactionRequest */ - created_at_before?: string; + user?: UserRequest; /** * * @type {string} - * @memberof QueryBannedUsersRequest + * @memberof ReactionRequest */ - created_at_before_or_equal?: string; + user_id?: string; +} +/** + * + * @export + * @interface ReactionResponse + */ +export interface ReactionResponse { /** * - * @type {boolean} - * @memberof QueryBannedUsersRequest + * @type {string} + * @memberof ReactionResponse */ - exclude_expired_bans?: boolean; + created_at: string; /** * * @type {{ [key: string]: any; }} - * @memberof QueryBannedUsersRequest + * @memberof ReactionResponse */ - filter_conditions: { [key: string]: any; }; + custom: { [key: string]: any; }; /** * - * @type {number} - * @memberof QueryBannedUsersRequest + * @type {string} + * @memberof ReactionResponse */ - limit?: number; + message_id: string; /** * * @type {number} - * @memberof QueryBannedUsersRequest + * @memberof ReactionResponse */ - offset?: number; + score: number; /** * - * @type {Array} - * @memberof QueryBannedUsersRequest + * @type {string} + * @memberof ReactionResponse */ - sort?: Array; + type: string; /** * - * @type {UserObject} - * @memberof QueryBannedUsersRequest - */ - user?: UserObject; - /** - * **Server-side only**. User ID which server acts upon * @type {string} - * @memberof QueryBannedUsersRequest + * @memberof ReactionResponse */ - user_id?: string; -} -/** - * - * @export - * @interface QueryBannedUsersResponse - */ -export interface QueryBannedUsersResponse { + updated_at: string; /** * - * @type {Array} - * @memberof QueryBannedUsersResponse + * @type {UserResponse} + * @memberof ReactionResponse */ - bans: Array; + user: UserResponse; /** - * Duration of the request in human-readable format + * * @type {string} - * @memberof QueryBannedUsersResponse + * @memberof ReactionResponse */ - duration: string; + user_id: string; } /** * * @export - * @interface QueryChannelsRequest + * @interface ReactivateUserRequest */ -export interface QueryChannelsRequest { - /** - * - * @type {{ [key: string]: any; }} - * @memberof QueryChannelsRequest - */ - filter_conditions?: { [key: string]: any; }; - /** - * Number of channels to limit - * @type {number} - * @memberof QueryChannelsRequest - */ - limit?: number; - /** - * Number of members to limit - * @type {number} - * @memberof QueryChannelsRequest - */ - member_limit?: number; +export interface ReactivateUserRequest { /** - * Number of messages to limit - * @type {number} - * @memberof QueryChannelsRequest + * ID of the user who's reactivating the user + * @type {string} + * @memberof ReactivateUserRequest */ - message_limit?: number; + created_by_id?: string; /** - * Channel pagination offset - * @type {number} - * @memberof QueryChannelsRequest + * Set this field to put new name for the user + * @type {string} + * @memberof ReactivateUserRequest */ - offset?: number; + name?: string; /** - * + * Restore previously deleted messages * @type {boolean} - * @memberof QueryChannelsRequest + * @memberof ReactivateUserRequest */ - presence?: boolean; + restore_messages?: boolean; +} +/** + * + * @export + * @interface ReactivateUserResponse + */ +export interface ReactivateUserResponse { /** - * List of sort parameters - * @type {Array} - * @memberof QueryChannelsRequest + * Duration of the request in human-readable format + * @type {string} + * @memberof ReactivateUserResponse */ - sort?: Array; + duration: string; /** - * Whether to update channel state or not - * @type {boolean} - * @memberof QueryChannelsRequest + * + * @type {UserObject} + * @memberof ReactivateUserResponse */ - state?: boolean; + user?: UserObject; +} +/** + * + * @export + * @interface ReactivateUsersRequest + */ +export interface ReactivateUsersRequest { /** - * - * @type {UserObjectRequest} - * @memberof QueryChannelsRequest + * ID of the user who's reactivating the users + * @type {string} + * @memberof ReactivateUsersRequest */ - user?: UserObjectRequest; + created_by_id?: string; /** * - * @type {string} - * @memberof QueryChannelsRequest + * @type {boolean} + * @memberof ReactivateUsersRequest */ - user_id?: string; + restore_channels?: boolean; /** - * Whether to start watching found channels or not + * Restore previously deleted messages * @type {boolean} - * @memberof QueryChannelsRequest + * @memberof ReactivateUsersRequest + */ + restore_messages?: boolean; + /** + * User IDs to reactivate + * @type {Array} + * @memberof ReactivateUsersRequest */ - watch?: boolean; + user_ids: Array; } /** * * @export - * @interface QueryMembersRequest + * @interface ReactivateUsersResponse */ -export interface QueryMembersRequest { +export interface ReactivateUsersResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof QueryMembersRequest + * @memberof ReactivateUsersResponse */ - created_at_after?: string; + duration: string; /** * * @type {string} - * @memberof QueryMembersRequest + * @memberof ReactivateUsersResponse */ - created_at_after_or_equal?: string; + task_id: string; +} +/** + * + * @export + * @interface Read + */ +export interface Read { /** * * @type {string} - * @memberof QueryMembersRequest + * @memberof Read */ - created_at_before?: string; + last_read: string; /** * * @type {string} - * @memberof QueryMembersRequest - */ - created_at_before_or_equal?: string; - /** - * Filter to apply to members - * @type {{ [key: string]: any; }} - * @memberof QueryMembersRequest - */ - filter_conditions: { [key: string]: any; }; - /** - * Channel ID to interact with - * @type {string} - * @memberof QueryMembersRequest + * @memberof Read */ - id?: string; + last_read_message_id?: string; /** - * Number of records to return + * * @type {number} - * @memberof QueryMembersRequest + * @memberof Read */ - limit?: number; + unread_messages: number; /** - * List of members to search in distinct channels - * @type {Array} - * @memberof QueryMembersRequest + * + * @type {UserObject} + * @memberof Read */ - members?: Array; + user?: UserObject; +} +/** + * + * @export + * @interface ReadReceipts + */ +export interface ReadReceipts { /** - * Number of records to offset - * @type {number} - * @memberof QueryMembersRequest + * + * @type {boolean} + * @memberof ReadReceipts */ - offset?: number; + enabled: boolean; +} +/** + * + * @export + * @interface ReadStateResponse + */ +export interface ReadStateResponse { /** - * Array of sort parameters - * @type {Array} - * @memberof QueryMembersRequest + * + * @type {string} + * @memberof ReadStateResponse */ - sort?: Array; + last_read: string; /** - * Channel type to interact with + * * @type {string} - * @memberof QueryMembersRequest + * @memberof ReadStateResponse */ - type: string; + last_read_message_id?: string; /** * - * @type {UserObject} - * @memberof QueryMembersRequest + * @type {number} + * @memberof ReadStateResponse */ - user?: UserObject; + unread_messages: number; /** * - * @type {string} - * @memberof QueryMembersRequest + * @type {UserResponse} + * @memberof ReadStateResponse */ - user_id?: string; + user: UserResponse; +} +/** + * + * @export + * @interface RecordSettings + */ +export interface RecordSettings { /** * - * @type {string} - * @memberof QueryMembersRequest + * @type {boolean} + * @memberof RecordSettings */ - user_id_gt?: string; + audio_only: boolean; /** * - * @type {string} - * @memberof QueryMembersRequest + * @type {LayoutSettings} + * @memberof RecordSettings */ - user_id_gte?: string; + layout?: LayoutSettings; /** * * @type {string} - * @memberof QueryMembersRequest + * @memberof RecordSettings */ - user_id_lt?: string; + mode: string; /** * * @type {string} - * @memberof QueryMembersRequest + * @memberof RecordSettings */ - user_id_lte?: string; + quality: string; } /** * * @export - * @interface QueryMessageFlagsRequest + * @interface Response */ -export interface QueryMessageFlagsRequest { +export interface Response { /** - * - * @type {{ [key: string]: any; }} - * @memberof QueryMessageFlagsRequest + * Duration of the request in human-readable format + * @type {string} + * @memberof Response */ - filter_conditions?: { [key: string]: any; }; + duration: string; +} +/** + * + * @export + * @interface RestoreUsersRequest + */ +export interface RestoreUsersRequest { /** * - * @type {number} - * @memberof QueryMessageFlagsRequest + * @type {Array} + * @memberof RestoreUsersRequest */ - limit?: number; + user_ids: Array; +} +/** + * + * @export + * @interface RingSettings + */ +export interface RingSettings { /** * * @type {number} - * @memberof QueryMessageFlagsRequest + * @memberof RingSettings */ - offset?: number; + auto_cancel_timeout_ms: number; /** * - * @type {boolean} - * @memberof QueryMessageFlagsRequest + * @type {number} + * @memberof RingSettings */ - show_deleted_messages?: boolean; + incoming_call_timeout_ms: number; /** * - * @type {UserObject} - * @memberof QueryMessageFlagsRequest - */ - user?: UserObject; - /** - * **Server-side only**. User ID which server acts upon - * @type {string} - * @memberof QueryMessageFlagsRequest + * @type {number} + * @memberof RingSettings */ - user_id?: string; + missed_call_timeout_ms: number; } /** * * @export - * @interface QueryMessageFlagsResponse + * @interface Role */ -export interface QueryMessageFlagsResponse { +export interface Role { /** - * Duration of the request in human-readable format + * Date/time of creation * @type {string} - * @memberof QueryMessageFlagsResponse + * @memberof Role */ - duration: string; + created_at: string; /** - * - * @type {Array} - * @memberof QueryMessageFlagsResponse + * Whether this is a custom role or built-in + * @type {boolean} + * @memberof Role + */ + custom: boolean; + /** + * Unique role name + * @type {string} + * @memberof Role + */ + name: string; + /** + * List of scopes where this role is currently present. `.app` means that role is present in app-level grants + * @type {Array} + * @memberof Role + */ + scopes: Array; + /** + * Date/time of the last update + * @type {string} + * @memberof Role */ - flags: Array; + updated_at: string; } /** * * @export - * @interface QueryUsersRequest + * @interface S3Request */ -export interface QueryUsersRequest { - /** - * User filters - * @type {{ [key: string]: any; }} - * @memberof QueryUsersRequest - */ - filter_conditions: { [key: string]: any; }; +export interface S3Request { /** * * @type {string} - * @memberof QueryUsersRequest + * @memberof S3Request */ - id_gt?: string; + s3_api_key?: string; /** * * @type {string} - * @memberof QueryUsersRequest + * @memberof S3Request */ - id_gte?: string; + s3_region: string; /** * * @type {string} - * @memberof QueryUsersRequest + * @memberof S3Request */ - id_lt?: string; + s3_secret?: string; +} +/** + * + * @export + * @interface ScreensharingSettings + */ +export interface ScreensharingSettings { /** * - * @type {string} - * @memberof QueryUsersRequest + * @type {boolean} + * @memberof ScreensharingSettings */ - id_lte?: string; + access_request_enabled: boolean; /** * - * @type {number} - * @memberof QueryUsersRequest + * @type {boolean} + * @memberof ScreensharingSettings */ - limit?: number; + enabled: boolean; /** * + * @type {TargetResolution} + * @memberof ScreensharingSettings + */ + target_resolution?: TargetResolution; +} +/** + * + * @export + * @interface SearchRequest + */ +export interface SearchRequest { + /** + * Channel filter conditions + * @type {{ [key: string]: any; }} + * @memberof SearchRequest + */ + filter_conditions: { [key: string]: any; }; + /** + * Number of messages to return * @type {number} - * @memberof QueryUsersRequest + * @memberof SearchRequest */ - offset?: number; + limit?: number; /** - * Request user presence status - * @type {boolean} - * @memberof QueryUsersRequest + * Message filter conditions + * @type {{ [key: string]: any; }} + * @memberof SearchRequest */ - presence?: boolean; + message_filter_conditions?: { [key: string]: any; }; /** - * Array of sort parameters - * @type {Array} - * @memberof QueryUsersRequest + * Pagination parameter. Cannot be used with non-zero offset. + * @type {string} + * @memberof SearchRequest */ - sort?: Array; + next?: string; /** - * - * @type {UserObject} - * @memberof QueryUsersRequest + * Pagination offset. Cannot be used with sort or next. + * @type {number} + * @memberof SearchRequest */ - user?: UserObject; + offset?: number; /** - * + * Search phrase * @type {string} - * @memberof QueryUsersRequest + * @memberof SearchRequest */ - user_id?: string; + query?: string; + /** + * Sort parameters. Cannot be used with non-zero offset + * @type {Array} + * @memberof SearchRequest + */ + sort?: Array; } /** - * Represents user reaction to a message + * * @export - * @interface Reaction + * @interface SearchResponse */ -export interface Reaction { - [key: string]: any | any; +export interface SearchResponse { /** - * Date/time of creation + * * @type {string} - * @memberof Reaction + * @memberof SearchResponse */ - readonly created_at: string; + duration: string; /** - * ID of a message user reacted to + * Value to pass to the next search query in order to paginate * @type {string} - * @memberof Reaction - */ - message_id: string; - /** - * Reaction score. If not specified reaction has score of 1 - * @type {number} - * @memberof Reaction + * @memberof SearchResponse */ - score: number; + next?: string; /** - * The type of reaction (e.g. 'like', 'laugh', 'wow') + * Value that points to the previous page. Pass as the next value in a search query to paginate backwards * @type {string} - * @memberof Reaction + * @memberof SearchResponse */ - type: string; + previous?: string; /** - * Date/time of the last update - * @type {string} - * @memberof Reaction + * Search results + * @type {Array} + * @memberof SearchResponse */ - readonly updated_at: string; + results: Array; /** * - * @type {UserObject} - * @memberof Reaction - */ - user?: UserObject; - /** - * ID of a user who reacted to a message - * @type {string} - * @memberof Reaction + * @type {SearchWarning} + * @memberof SearchResponse */ - user_id?: string; + results_warning?: SearchWarning; } /** * * @export - * @interface ReactionDeletedEvent + * @interface SearchResult */ -export interface ReactionDeletedEvent { - /** - * - * @type {string} - * @memberof ReactionDeletedEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof ReactionDeletedEvent - */ - channel_type: string; +export interface SearchResult { /** * - * @type {string} - * @memberof ReactionDeletedEvent + * @type {SearchResultMessage} + * @memberof SearchResult */ - cid: string; + message?: SearchResultMessage; +} +/** + * + * @export + * @interface SearchResultMessage + */ +export interface SearchResultMessage { /** * - * @type {string} - * @memberof ReactionDeletedEvent + * @type {Array} + * @memberof SearchResultMessage */ - created_at: string; + attachments: Array; /** * - * @type {Message} - * @memberof ReactionDeletedEvent + * @type {boolean} + * @memberof SearchResultMessage */ - message?: Message | null; + before_message_send_failed?: boolean; /** * - * @type {Reaction} - * @memberof ReactionDeletedEvent + * @type {ChannelResponse} + * @memberof SearchResultMessage */ - reaction?: Reaction | null; + channel?: ChannelResponse; /** * * @type {string} - * @memberof ReactionDeletedEvent + * @memberof SearchResultMessage */ - team?: string; + cid: string; /** * - * @type {Array} - * @memberof ReactionDeletedEvent + * @type {string} + * @memberof SearchResultMessage */ - thread_participants?: Array; + command?: string; /** * * @type {string} - * @memberof ReactionDeletedEvent + * @memberof SearchResultMessage */ - type: string; + created_at: string; /** * - * @type {UserObject} - * @memberof ReactionDeletedEvent + * @type {{ [key: string]: any; }} + * @memberof SearchResultMessage */ - user?: UserObject; -} -/** - * - * @export - * @interface ReactionNewEvent - */ -export interface ReactionNewEvent { + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof ReactionNewEvent + * @memberof SearchResultMessage */ - channel_id: string; + deleted_at?: string; /** * - * @type {string} - * @memberof ReactionNewEvent + * @type {number} + * @memberof SearchResultMessage */ - channel_type: string; + deleted_reply_count: number; /** * * @type {string} - * @memberof ReactionNewEvent + * @memberof SearchResultMessage */ - cid: string; + html: string; /** * - * @type {string} - * @memberof ReactionNewEvent + * @type {{ [key: string]: string; }} + * @memberof SearchResultMessage */ - created_at: string; + i18n?: { [key: string]: string; }; /** * - * @type {Message} - * @memberof ReactionNewEvent + * @type {string} + * @memberof SearchResultMessage */ - message?: Message | null; + id: string; /** * - * @type {Reaction} - * @memberof ReactionNewEvent + * @type {{ [key: string]: Array; }} + * @memberof SearchResultMessage */ - reaction?: Reaction | null; + image_labels?: { [key: string]: Array; }; /** * - * @type {string} - * @memberof ReactionNewEvent + * @type {Array} + * @memberof SearchResultMessage */ - team?: string; + latest_reactions: Array; /** * * @type {Array} - * @memberof ReactionNewEvent + * @memberof SearchResultMessage */ - thread_participants?: Array; + mentioned_users: Array; /** * * @type {string} - * @memberof ReactionNewEvent + * @memberof SearchResultMessage */ - type: string; + message_text_updated_at?: string; /** * - * @type {UserObject} - * @memberof ReactionNewEvent - */ - user?: UserObject; -} -/** - * - * @export - * @interface ReactionRemovalResponse - */ -export interface ReactionRemovalResponse { - /** - * Duration of the request in human-readable format * @type {string} - * @memberof ReactionRemovalResponse + * @memberof SearchResultMessage */ - duration: string; + mml?: string; /** * - * @type {Message} - * @memberof ReactionRemovalResponse + * @type {Array} + * @memberof SearchResultMessage */ - message?: Message | null; + own_reactions: Array; /** * - * @type {Reaction} - * @memberof ReactionRemovalResponse + * @type {string} + * @memberof SearchResultMessage */ - reaction?: Reaction | null; -} -/** - * Represents user reaction to a message - * @export - * @interface ReactionRequest - */ -export interface ReactionRequest { - [key: string]: any | any; + parent_id?: string; /** - * ID of a message user reacted to + * * @type {string} - * @memberof ReactionRequest + * @memberof SearchResultMessage */ - message_id?: string; + pin_expires?: string; /** - * Reaction score. If not specified reaction has score of 1 - * @type {number} - * @memberof ReactionRequest + * + * @type {boolean} + * @memberof SearchResultMessage */ - score?: number; + pinned: boolean; /** - * The type of reaction (e.g. 'like', 'laugh', 'wow') + * * @type {string} - * @memberof ReactionRequest + * @memberof SearchResultMessage */ - type: string; + pinned_at?: string; /** * - * @type {UserObjectRequest} - * @memberof ReactionRequest + * @type {UserObject} + * @memberof SearchResultMessage */ - user?: UserObjectRequest; + pinned_by?: UserObject; /** - * ID of a user who reacted to a message - * @type {string} - * @memberof ReactionRequest + * + * @type {Poll} + * @memberof SearchResultMessage */ - user_id?: string; -} -/** - * - * @export - * @interface ReactionResponse - */ -export interface ReactionResponse { + poll?: Poll; /** - * Duration of the request in human-readable format + * * @type {string} - * @memberof ReactionResponse + * @memberof SearchResultMessage */ - duration: string; + poll_id?: string; /** * * @type {Message} - * @memberof ReactionResponse + * @memberof SearchResultMessage */ - message?: Message | null; + quoted_message?: Message; /** * - * @type {Reaction} - * @memberof ReactionResponse + * @type {string} + * @memberof SearchResultMessage */ - reaction?: Reaction | null; -} -/** - * - * @export - * @interface ReactionUpdatedEvent - */ -export interface ReactionUpdatedEvent { + quoted_message_id?: string; /** * - * @type {string} - * @memberof ReactionUpdatedEvent + * @type {{ [key: string]: number; }} + * @memberof SearchResultMessage */ - channel_id: string; + reaction_counts: { [key: string]: number; }; /** * - * @type {string} - * @memberof ReactionUpdatedEvent + * @type {{ [key: string]: ReactionGroupResponse; }} + * @memberof SearchResultMessage */ - channel_type: string; + reaction_groups: { [key: string]: ReactionGroupResponse; }; /** * - * @type {string} - * @memberof ReactionUpdatedEvent + * @type {{ [key: string]: number; }} + * @memberof SearchResultMessage */ - cid: string; + reaction_scores: { [key: string]: number; }; /** * - * @type {string} - * @memberof ReactionUpdatedEvent + * @type {number} + * @memberof SearchResultMessage */ - created_at: string; + reply_count: number; /** * - * @type {Message} - * @memberof ReactionUpdatedEvent + * @type {boolean} + * @memberof SearchResultMessage */ - message: Message | null; + shadowed: boolean; /** * - * @type {Reaction} - * @memberof ReactionUpdatedEvent + * @type {boolean} + * @memberof SearchResultMessage + */ + show_in_channel?: boolean; + /** + * + * @type {boolean} + * @memberof SearchResultMessage */ - reaction: Reaction | null; + silent: boolean; /** * * @type {string} - * @memberof ReactionUpdatedEvent + * @memberof SearchResultMessage */ - team?: string; + text: string; + /** + * + * @type {Array} + * @memberof SearchResultMessage + */ + thread_participants?: Array; /** * * @type {string} - * @memberof ReactionUpdatedEvent + * @memberof SearchResultMessage */ type: string; + /** + * + * @type {string} + * @memberof SearchResultMessage + */ + updated_at: string; /** * * @type {UserObject} - * @memberof ReactionUpdatedEvent + * @memberof SearchResultMessage */ user?: UserObject; } /** * * @export - * @interface ReactivateUserRequest + * @interface SearchWarning */ -export interface ReactivateUserRequest { +export interface SearchWarning { /** - * ID of the user who's reactivating the user - * @type {string} - * @memberof ReactivateUserRequest + * Channel CIDs for the searched channels + * @type {Array} + * @memberof SearchWarning */ - created_by_id?: string; + channel_search_cids?: Array; /** - * Set this field to put new name for the user - * @type {string} - * @memberof ReactivateUserRequest + * Number of channels searched + * @type {number} + * @memberof SearchWarning */ - name?: string; + channel_search_count?: number; /** - * Restore previously deleted messages - * @type {boolean} - * @memberof ReactivateUserRequest + * Code corresponding to the warning + * @type {number} + * @memberof SearchWarning */ - restore_messages?: boolean; + warning_code: number; /** - * + * Description of the warning * @type {string} - * @memberof ReactivateUserRequest + * @memberof SearchWarning */ - user_id: string; + warning_description: string; } /** * * @export - * @interface ReactivateUserResponse + * @interface SendEventRequest */ -export interface ReactivateUserResponse { - /** - * Duration of the request in human-readable format - * @type {string} - * @memberof ReactivateUserResponse - */ - duration: string; +export interface SendEventRequest { /** * - * @type {UserObject} - * @memberof ReactivateUserResponse + * @type {EventRequest} + * @memberof SendEventRequest */ - user?: UserObject; + event: EventRequest; } /** * * @export - * @interface ReactivateUsersRequest + * @interface SendMessageRequest */ -export interface ReactivateUsersRequest { +export interface SendMessageRequest { /** - * ID of the user who's reactivating the users - * @type {string} - * @memberof ReactivateUsersRequest + * + * @type {boolean} + * @memberof SendMessageRequest */ - created_by_id?: string; + force_moderation?: boolean; /** - * Restore previously deleted messages + * * @type {boolean} - * @memberof ReactivateUsersRequest + * @memberof SendMessageRequest */ - restore_messages?: boolean; + keep_channel_hidden?: boolean; /** - * User IDs to reactivate - * @type {Array} - * @memberof ReactivateUsersRequest + * + * @type {MessageRequest} + * @memberof SendMessageRequest */ - user_ids: Array; -} -/** - * - * @export - * @interface ReactivateUsersResponse - */ -export interface ReactivateUsersResponse { + message: MessageRequest; /** - * Duration of the request in human-readable format - * @type {string} - * @memberof ReactivateUsersResponse + * + * @type {boolean} + * @memberof SendMessageRequest */ - duration: string; + pending?: boolean; /** * - * @type {string} - * @memberof ReactivateUsersResponse + * @type {{ [key: string]: string; }} + * @memberof SendMessageRequest */ - task_id: string; + pending_message_metadata?: { [key: string]: string; }; + /** + * + * @type {boolean} + * @memberof SendMessageRequest + */ + skip_enrich_url?: boolean; + /** + * + * @type {boolean} + * @memberof SendMessageRequest + */ + skip_push?: boolean; } /** * * @export - * @interface Read + * @interface SendMessageResponse */ -export interface Read { - /** - * - * @type {string} - * @memberof Read - */ - last_read: string; +export interface SendMessageResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof Read + * @memberof SendMessageResponse */ - last_read_message_id?: string; + duration: string; /** * - * @type {number} - * @memberof Read + * @type {MessageResponse} + * @memberof SendMessageResponse */ - unread_messages: number; + message: MessageResponse; /** * - * @type {UserObject} - * @memberof Read + * @type {{ [key: string]: string; }} + * @memberof SendMessageResponse */ - user?: UserObject; + pending_message_metadata?: { [key: string]: string; }; } /** * * @export - * @interface RecordSettings + * @interface SendReactionRequest */ -export interface RecordSettings { +export interface SendReactionRequest { /** - * + * Whether to replace all existing user reactions * @type {boolean} - * @memberof RecordSettings - */ - audio_only: boolean; - /** - * - * @type {LayoutSettings} - * @memberof RecordSettings - */ - layout?: LayoutSettings; - /** - * - * @type {string} - * @memberof RecordSettings + * @memberof SendReactionRequest */ - mode: string; + enforce_unique?: boolean; /** * - * @type {string} - * @memberof RecordSettings + * @type {ReactionRequest} + * @memberof SendReactionRequest */ - quality: string; + reaction: ReactionRequest; + /** + * Skips any mobile push notifications + * @type {boolean} + * @memberof SendReactionRequest + */ + skip_push?: boolean; } /** * * @export - * @interface Response + * @interface SendReactionResponse */ -export interface Response { +export interface SendReactionResponse { /** * Duration of the request in human-readable format * @type {string} - * @memberof Response + * @memberof SendReactionResponse */ duration: string; + /** + * + * @type {MessageResponse} + * @memberof SendReactionResponse + */ + message: MessageResponse; + /** + * + * @type {ReactionResponse} + * @memberof SendReactionResponse + */ + reaction: ReactionResponse; } /** * * @export - * @interface RestoreUsersRequest + * @interface SendUserCustomEventRequest */ -export interface RestoreUsersRequest { +export interface SendUserCustomEventRequest { /** * - * @type {Array} - * @memberof RestoreUsersRequest + * @type {UserCustomEventRequest} + * @memberof SendUserCustomEventRequest */ - user_ids: Array; + event: UserCustomEventRequest; } /** * * @export - * @interface RingSettings + * @interface ShowChannelRequest */ -export interface RingSettings { +export interface ShowChannelRequest { /** * - * @type {number} - * @memberof RingSettings + * @type {UserRequest} + * @memberof ShowChannelRequest */ - auto_cancel_timeout_ms: number; + user?: UserRequest; /** * - * @type {number} - * @memberof RingSettings + * @type {string} + * @memberof ShowChannelRequest */ - incoming_call_timeout_ms: number; + user_id?: string; } /** * * @export - * @interface Role + * @interface ShowChannelResponse */ -export interface Role { - /** - * Date/time of creation - * @type {string} - * @memberof Role - */ - created_at: string; - /** - * Whether this is a custom role or built-in - * @type {boolean} - * @memberof Role - */ - custom: boolean; +export interface ShowChannelResponse { /** - * Unique role name + * Duration of the request in human-readable format * @type {string} - * @memberof Role + * @memberof ShowChannelResponse */ - name: string; + duration: string; +} +/** + * + * @export + * @interface SortParam + */ +export interface SortParam { /** - * List of scopes where this role is currently present. `.app` means that role is present in app-level grants - * @type {Array} - * @memberof Role + * Direction of sorting, -1 for descending, 1 for ascending + * @type {number} + * @memberof SortParam */ - scopes: Array; + direction?: number; /** - * Date/time of the last update + * Name of field to sort by * @type {string} - * @memberof Role + * @memberof SortParam */ - updated_at: string; + field?: string; } /** * * @export - * @interface ScreensharingSettings + * @interface TargetResolution */ -export interface ScreensharingSettings { +export interface TargetResolution { /** * - * @type {boolean} - * @memberof ScreensharingSettings + * @type {number} + * @memberof TargetResolution */ - access_request_enabled: boolean; + bitrate: number; /** * - * @type {boolean} - * @memberof ScreensharingSettings + * @type {number} + * @memberof TargetResolution */ - enabled: boolean; + height: number; + /** + * + * @type {number} + * @memberof TargetResolution + */ + width: number; } /** - * + * Represents a conversation thread linked to a specific message in a channel. * @export - * @interface SearchRequest + * @interface Thread */ -export interface SearchRequest { +export interface Thread { /** - * Channel filter conditions - * @type {{ [key: string]: any; }} - * @memberof SearchRequest + * + * @type {Channel} + * @memberof Thread */ - filter_conditions: { [key: string]: any; }; + channel?: Channel; /** - * Number of messages to return - * @type {number} - * @memberof SearchRequest + * Channel CID is unique string identifier of the channel + * @type {string} + * @memberof Thread */ - limit?: number; + channel_cid: string; /** - * Message filter conditions - * @type {{ [key: string]: any; }} - * @memberof SearchRequest + * Date/time of creation + * @type {string} + * @memberof Thread */ - message_filter_conditions?: { [key: string]: any; }; + created_at: string; /** - * Pagination parameter. Cannot be used with non-zero offset. - * @type {string} - * @memberof SearchRequest + * + * @type {UserObject} + * @memberof Thread */ - next?: string; + created_by?: UserObject; /** - * Pagination offset. Cannot be used with sort or next. - * @type {number} - * @memberof SearchRequest + * Custom is the custom data of the thread + * @type {{ [key: string]: any; }} + * @memberof Thread */ - offset?: number; + custom: { [key: string]: any; }; /** - * Search phrase + * Date/time of deletion * @type {string} - * @memberof SearchRequest + * @memberof Thread */ - query?: string; + deleted_at?: string; /** - * Sort parameters. Cannot be used with non-zero offset - * @type {Array} - * @memberof SearchRequest + * Last Message At is the time of the last message in the thread + * @type {string} + * @memberof Thread */ - sort?: Array; -} -/** - * - * @export - * @interface SearchResponse - */ -export interface SearchResponse { + last_message_at?: string; /** * - * @type {string} - * @memberof SearchResponse + * @type {Message} + * @memberof Thread */ - duration: string; + parent_message?: Message; /** - * Value to pass to the next search query in order to paginate + * Parent Message ID is unique string identifier of the parent message * @type {string} - * @memberof SearchResponse + * @memberof Thread */ - next?: string; + parent_message_id: string; /** - * Value that points to the previous page. Pass as the next value in a search query to paginate backwards - * @type {string} - * @memberof SearchResponse + * The number of participants in the thread + * @type {number} + * @memberof Thread */ - previous?: string; + participant_count?: number; /** - * Search results - * @type {Array} - * @memberof SearchResponse + * The number of replies in the thread + * @type {number} + * @memberof Thread */ - results: Array; + reply_count?: number; /** * - * @type {SearchWarning} - * @memberof SearchResponse + * @type {Array} + * @memberof Thread */ - results_warning?: SearchWarning; -} -/** - * - * @export - * @interface SearchResult - */ -export interface SearchResult { + thread_participants?: Array; /** - * - * @type {SearchResultMessage} - * @memberof SearchResult + * Title is the title of the thread + * @type {string} + * @memberof Thread */ - message?: SearchResultMessage; + title: string; + /** + * Date/time of the last update + * @type {string} + * @memberof Thread + */ + updated_at: string; } /** - * + * Represents a user that is participating in a thread. * @export - * @interface SearchResultMessage + * @interface ThreadParticipant */ -export interface SearchResultMessage { - [key: string]: any | any; - /** - * - * @type {Array} - * @memberof SearchResultMessage - */ - attachments: Array; +export interface ThreadParticipant { /** * - * @type {boolean} - * @memberof SearchResultMessage - */ - before_message_send_failed?: boolean; - /** - * - * @type {ChannelResponse} - * @memberof SearchResultMessage - */ - channel?: ChannelResponse; - /** - * - * @type {string} - * @memberof SearchResultMessage + * @type {number} + * @memberof ThreadParticipant */ - cid: string; + readonly app_pk: number; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadParticipant */ - command?: string; + channel_cid: string; /** - * + * Date/time of creation * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadParticipant */ created_at: string; /** * - * @type {string} - * @memberof SearchResultMessage - */ - deleted_at?: string; - /** - * - * @type {number} - * @memberof SearchResultMessage + * @type {{ [key: string]: any; }} + * @memberof ThreadParticipant */ - deleted_reply_count: number; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof SearchResultMessage - */ - html: string; - /** - * - * @type {{ [key: string]: string; }} - * @memberof SearchResultMessage + * @memberof ThreadParticipant */ - i18n?: { [key: string]: string; }; + last_read_at: string; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadParticipant */ - id: string; + last_thread_message_at?: string; /** - * - * @type {{ [key: string]: Array; }} - * @memberof SearchResultMessage + * Left Thread At is the time when the user left the thread + * @type {string} + * @memberof ThreadParticipant */ - image_labels?: { [key: string]: Array; }; + left_thread_at?: string; /** - * - * @type {Array} - * @memberof SearchResultMessage + * Thead ID is unique string identifier of the thread + * @type {string} + * @memberof ThreadParticipant */ - latest_reactions: Array; + thread_id?: string; /** * - * @type {Array} - * @memberof SearchResultMessage + * @type {UserObject} + * @memberof ThreadParticipant */ - mentioned_users: Array; + user?: UserObject; /** - * + * User ID is unique string identifier of the user * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadParticipant */ - mml?: string; + user_id?: string; +} +/** + * + * @export + * @interface ThreadResponse + */ +export interface ThreadResponse { /** * - * @type {Array} - * @memberof SearchResultMessage + * @type {ChannelResponse} + * @memberof ThreadResponse */ - own_reactions: Array; + channel?: ChannelResponse; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - parent_id?: string; + channel_cid: string; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - pin_expires?: string; + created_at: string; /** * - * @type {boolean} - * @memberof SearchResultMessage + * @type {UserObject} + * @memberof ThreadResponse */ - pinned: boolean; + created_by?: UserObject; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - pinned_at?: string; + created_by_user_id: string; /** * - * @type {UserObject} - * @memberof SearchResultMessage + * @type {{ [key: string]: any; }} + * @memberof ThreadResponse */ - pinned_by?: UserObject; + custom: { [key: string]: any; }; /** * - * @type {Message} - * @memberof SearchResultMessage + * @type {string} + * @memberof ThreadResponse */ - quoted_message?: Message | null; + deleted_at?: string; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - quoted_message_id?: string; + last_message_at?: string; /** * - * @type {{ [key: string]: number; }} - * @memberof SearchResultMessage + * @type {Message} + * @memberof ThreadResponse */ - reaction_counts: { [key: string]: number; }; + parent_message?: Message; /** * - * @type {{ [key: string]: number; }} - * @memberof SearchResultMessage + * @type {string} + * @memberof ThreadResponse */ - reaction_scores: { [key: string]: number; }; + parent_message_id: string; /** * * @type {number} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - reply_count: number; + participant_count?: number; /** * - * @type {boolean} - * @memberof SearchResultMessage + * @type {number} + * @memberof ThreadResponse */ - shadowed: boolean; + reply_count?: number; /** * - * @type {boolean} - * @memberof SearchResultMessage + * @type {Array} + * @memberof ThreadResponse */ - show_in_channel?: boolean; + thread_participants?: Array; /** * - * @type {boolean} - * @memberof SearchResultMessage + * @type {string} + * @memberof ThreadResponse */ - silent: boolean; + title: string; /** * * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadResponse */ - text: string; + updated_at: string; +} +/** + * Represents a conversation thread linked to a specific message in a channel. + * @export + * @interface ThreadState + */ +export interface ThreadState { /** * - * @type {Array} - * @memberof SearchResultMessage + * @type {Channel} + * @memberof ThreadState */ - thread_participants?: Array; + channel?: Channel; /** - * + * Channel CID is unique string identifier of the channel * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadState */ - type: string; + channel_cid: string; /** - * + * Date/time of creation * @type {string} - * @memberof SearchResultMessage + * @memberof ThreadState */ - updated_at: string; + created_at: string; /** * * @type {UserObject} - * @memberof SearchResultMessage - */ - user?: UserObject; -} -/** - * - * @export - * @interface SearchWarning - */ -export interface SearchWarning { - /** - * Channel CIDs for the searched channels - * @type {Array} - * @memberof SearchWarning + * @memberof ThreadState */ - channel_search_cids?: Array; + created_by?: UserObject; /** - * Number of channels searched - * @type {number} - * @memberof SearchWarning + * Custom is the custom data of the thread + * @type {{ [key: string]: any; }} + * @memberof ThreadState */ - channel_search_count?: number; + custom: { [key: string]: any; }; /** - * Code corresponding to the warning - * @type {number} - * @memberof SearchWarning + * Date/time of deletion + * @type {string} + * @memberof ThreadState */ - warning_code: number; + deleted_at?: string; /** - * Description of the warning + * Last Message At is the time of the last message in the thread * @type {string} - * @memberof SearchWarning + * @memberof ThreadState */ - warning_description: string; -} -/** - * - * @export - * @interface SendEventRequest - */ -export interface SendEventRequest { + last_message_at?: string; /** * - * @type {EventRequest} - * @memberof SendEventRequest + * @type {Array} + * @memberof ThreadState */ - event: EventRequest; -} -/** - * Contains all information needed to send new message - * @export - * @interface SendMessageRequest - */ -export interface SendMessageRequest { + latest_replies: Array; /** - * Enable moderation on server-side requests - * @type {boolean} - * @memberof SendMessageRequest + * + * @type {Message} + * @memberof ThreadState */ - force_moderation?: boolean; + parent_message?: Message; /** - * - * @type {boolean} - * @memberof SendMessageRequest + * Parent Message ID is unique string identifier of the parent message + * @type {string} + * @memberof ThreadState */ - is_pending_message?: boolean; + parent_message_id: string; /** - * Keeps the channel hidden for the sender - * @type {boolean} - * @memberof SendMessageRequest + * The number of participants in the thread + * @type {number} + * @memberof ThreadState */ - keep_channel_hidden?: boolean; + participant_count?: number; /** * - * @type {MessageRequest} - * @memberof SendMessageRequest + * @type {Array} + * @memberof ThreadState */ - message: MessageRequest; + read?: Array; /** - * Make the message a pending message. This message will not be viewable to others until it is committed. - * @type {boolean} - * @memberof SendMessageRequest + * The number of replies in the thread + * @type {number} + * @memberof ThreadState */ - pending?: boolean; + reply_count?: number; /** * - * @type {{ [key: string]: string; }} - * @memberof SendMessageRequest + * @type {Array} + * @memberof ThreadState */ - pending_message_metadata?: { [key: string]: string; }; + thread_participants?: Array; /** - * Do not try to enrich the links within message - * @type {boolean} - * @memberof SendMessageRequest + * Title is the title of the thread + * @type {string} + * @memberof ThreadState */ - skip_enrich_url?: boolean; + title: string; /** - * Disables all push notifications for this message - * @type {boolean} - * @memberof SendMessageRequest + * Date/time of the last update + * @type {string} + * @memberof ThreadState */ - skip_push?: boolean; + updated_at: string; } /** * * @export - * @interface SendReactionRequest + * @interface ThreadStateResponse */ -export interface SendReactionRequest { +export interface ThreadStateResponse { /** * - * @type {string} - * @memberof SendReactionRequest + * @type {ChannelResponse} + * @memberof ThreadStateResponse */ - ID?: string; + channel?: ChannelResponse; /** - * Whether to replace all existing user reactions - * @type {boolean} - * @memberof SendReactionRequest + * + * @type {string} + * @memberof ThreadStateResponse */ - enforce_unique?: boolean; + channel_cid: string; /** * - * @type {ReactionRequest} - * @memberof SendReactionRequest + * @type {string} + * @memberof ThreadStateResponse */ - reaction: ReactionRequest | null; + created_at: string; /** - * Skips any mobile push notifications - * @type {boolean} - * @memberof SendReactionRequest + * + * @type {UserObject} + * @memberof ThreadStateResponse */ - skip_push?: boolean; -} -/** - * - * @export - * @interface SendUserCustomEventRequest - */ -export interface SendUserCustomEventRequest { + created_by?: UserObject; /** * - * @type {UserCustomEventRequest} - * @memberof SendUserCustomEventRequest + * @type {string} + * @memberof ThreadStateResponse */ - event: UserCustomEventRequest; -} -/** - * - * @export - * @interface ShowChannelRequest - */ -export interface ShowChannelRequest { + created_by_user_id: string; /** * - * @type {UserObjectRequest} - * @memberof ShowChannelRequest + * @type {{ [key: string]: any; }} + * @memberof ThreadStateResponse */ - user?: UserObjectRequest; + custom: { [key: string]: any; }; /** * * @type {string} - * @memberof ShowChannelRequest + * @memberof ThreadStateResponse */ - user_id?: string; -} -/** - * - * @export - * @interface ShowChannelResponse - */ -export interface ShowChannelResponse { + deleted_at?: string; /** - * Duration of the request in human-readable format + * * @type {string} - * @memberof ShowChannelResponse + * @memberof ThreadStateResponse */ - duration: string; -} -/** - * - * @export - * @interface SortParam - */ -export interface SortParam { + last_message_at?: string; /** - * Direction of sorting, -1 for descending, 1 for ascending - * @type {number} - * @memberof SortParam + * + * @type {Array} + * @memberof ThreadStateResponse */ - direction?: number; + latest_replies: Array; /** - * Name of field to sort by + * + * @type {Message} + * @memberof ThreadStateResponse + */ + parent_message?: Message; + /** + * * @type {string} - * @memberof SortParam + * @memberof ThreadStateResponse */ - field?: string; -} -/** - * - * @export - * @interface SortParamRequest - */ -export interface SortParamRequest { + parent_message_id: string; /** - * Direction of sorting, -1 for descending, 1 for ascending + * * @type {number} - * @memberof SortParamRequest + * @memberof ThreadStateResponse */ - direction?: number; + participant_count?: number; /** - * Name of field to sort by - * @type {string} - * @memberof SortParamRequest + * + * @type {Array} + * @memberof ThreadStateResponse */ - field?: string; -} -/** - * - * @export - * @interface TargetResolution - */ -export interface TargetResolution { + read?: Array; /** * * @type {number} - * @memberof TargetResolution + * @memberof ThreadStateResponse */ - bitrate: number; + reply_count?: number; /** * - * @type {number} - * @memberof TargetResolution + * @type {Array} + * @memberof ThreadStateResponse */ - height: number; + thread_participants?: Array; /** * - * @type {number} - * @memberof TargetResolution + * @type {string} + * @memberof ThreadStateResponse */ - width: number; + title: string; + /** + * + * @type {string} + * @memberof ThreadStateResponse + */ + updated_at: string; } /** * Sets thresholds for AI moderation @@ -12944,31 +12140,6 @@ export interface Thresholds { */ toxic?: LabelThresholds; } -/** - * Sets thresholds for AI moderation - * @export - * @interface ThresholdsRequest - */ -export interface ThresholdsRequest { - /** - * - * @type {LabelThresholdsRequest} - * @memberof ThresholdsRequest - */ - explicit?: LabelThresholdsRequest; - /** - * - * @type {LabelThresholdsRequest} - * @memberof ThresholdsRequest - */ - spam?: LabelThresholdsRequest; - /** - * - * @type {LabelThresholdsRequest} - * @memberof ThresholdsRequest - */ - toxic?: LabelThresholdsRequest; -} /** * * @export @@ -12995,7 +12166,13 @@ export interface TranscriptionSettings { */ closed_caption_mode: string; /** - * + * the languages to transcribe to + * @type {Array} + * @memberof TranscriptionSettings + */ + languages: Array; + /** + * oneof=available disabled auto-on * @type {string} * @memberof TranscriptionSettings */ @@ -13122,10 +12299,10 @@ export interface TruncateChannelRequest { truncated_at?: string; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof TruncateChannelRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -13156,105 +12333,58 @@ export interface TruncateChannelResponse { * @type {Message} * @memberof TruncateChannelResponse */ - message?: Message | null; + message?: Message; } /** * * @export - * @interface TypingStartEvent + * @interface TypingIndicators */ -export interface TypingStartEvent { - /** - * - * @type {string} - * @memberof TypingStartEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof TypingStartEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof TypingStartEvent - */ - cid: string; - /** - * - * @type {string} - * @memberof TypingStartEvent - */ - created_at: string; +export interface TypingIndicators { /** * - * @type {string} - * @memberof TypingStartEvent - */ - parent_id?: string; - /** - * - * @type {string} - * @memberof TypingStartEvent - */ - type: string; - /** - * - * @type {UserObject} - * @memberof TypingStartEvent + * @type {boolean} + * @memberof TypingIndicators */ - user?: UserObject; + enabled: boolean; } /** * * @export - * @interface TypingStopEvent + * @interface UnblockUsersRequest */ -export interface TypingStopEvent { - /** - * - * @type {string} - * @memberof TypingStopEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof TypingStopEvent - */ - channel_type: string; +export interface UnblockUsersRequest { /** * * @type {string} - * @memberof TypingStopEvent + * @memberof UnblockUsersRequest */ - cid: string; + blocked_user_id: string; /** * - * @type {string} - * @memberof TypingStopEvent + * @type {UserRequest} + * @memberof UnblockUsersRequest */ - created_at: string; + user?: UserRequest; /** * * @type {string} - * @memberof TypingStopEvent + * @memberof UnblockUsersRequest */ - parent_id?: string; + user_id?: string; +} +/** + * + * @export + * @interface UnblockUsersResponse + */ +export interface UnblockUsersResponse { /** * * @type {string} - * @memberof TypingStopEvent - */ - type: string; - /** - * - * @type {UserObject} - * @memberof TypingStopEvent + * @memberof UnblockUsersResponse */ - user?: UserObject; + duration: string; } /** * @@ -13263,29 +12393,23 @@ export interface TypingStopEvent { */ export interface UnmuteChannelRequest { /** - * - * @type {string} - * @memberof UnmuteChannelRequest - */ - channel_cid: string; - /** - * + * Channel CIDs to mute (if multiple channels) * @type {Array} * @memberof UnmuteChannelRequest */ - channel_cids: Array; + channel_cids?: Array; /** - * + * Duration of mute in milliseconds * @type {number} * @memberof UnmuteChannelRequest */ expiration?: number; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof UnmuteChannelRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -13319,29 +12443,23 @@ export interface UnmuteResponse { */ export interface UnmuteUserRequest { /** - * - * @type {string} - * @memberof UnmuteUserRequest - */ - target_id: string; - /** - * + * User IDs to mute (if multiple users) * @type {Array} * @memberof UnmuteUserRequest */ - target_ids: Array; + target_ids?: Array; /** - * + * Duration of mute in minutes * @type {number} * @memberof UnmuteUserRequest */ - timeout?: number; + timeout: number; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof UnmuteUserRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -13349,6 +12467,38 @@ export interface UnmuteUserRequest { */ user_id?: string; } +/** + * + * @export + * @interface UnreadCountsBatchRequest + */ +export interface UnreadCountsBatchRequest { + /** + * + * @type {Array} + * @memberof UnreadCountsBatchRequest + */ + user_ids: Array; +} +/** + * + * @export + * @interface UnreadCountsBatchResponse + */ +export interface UnreadCountsBatchResponse { + /** + * + * @type {{ [key: string]: UnreadCountsResponse; }} + * @memberof UnreadCountsBatchResponse + */ + counts_by_user: { [key: string]: UnreadCountsResponse; }; + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof UnreadCountsBatchResponse + */ + duration: string; +} /** * * @export @@ -13418,17 +12568,54 @@ export interface UnreadCountsResponse { */ channels: Array; /** - * Duration of the request in human-readable format - * @type {string} + * + * @type {Array} * @memberof UnreadCountsResponse */ - duration: string; + threads: Array; /** * * @type {number} * @memberof UnreadCountsResponse */ total_unread_count: number; + /** + * + * @type {number} + * @memberof UnreadCountsResponse + */ + total_unread_threads_count: number; +} +/** + * + * @export + * @interface UnreadCountsThread + */ +export interface UnreadCountsThread { + /** + * + * @type {string} + * @memberof UnreadCountsThread + */ + last_read: string; + /** + * + * @type {string} + * @memberof UnreadCountsThread + */ + last_read_message_id: string; + /** + * + * @type {string} + * @memberof UnreadCountsThread + */ + parent_message_id: string; + /** + * + * @type {number} + * @memberof UnreadCountsThread + */ + unread_count: number; } /** * @@ -13438,22 +12625,22 @@ export interface UnreadCountsResponse { export interface UpdateAppRequest { /** * - * @type {ConfigRequest} + * @type {Config} * @memberof UpdateAppRequest */ - agora_options?: ConfigRequest; + agora_options?: Config; /** * - * @type {APNConfigRequest} + * @type {APNConfig} * @memberof UpdateAppRequest */ - apn_config?: APNConfigRequest; + apn_config?: APNConfig; /** * - * @type {AsyncModerationConfigurationRequest} + * @type {AsyncModerationConfiguration} * @memberof UpdateAppRequest */ - async_moderation_config?: AsyncModerationConfigurationRequest; + async_moderation_config?: AsyncModerationConfiguration; /** * * @type {boolean} @@ -13492,10 +12679,10 @@ export interface UpdateAppRequest { custom_action_handler_url?: string; /** * - * @type {DataDogInfoRequest} + * @type {DataDogInfo} * @memberof UpdateAppRequest */ - datadog_info?: DataDogInfoRequest; + datadog_info?: DataDogInfo; /** * * @type {boolean} @@ -13516,16 +12703,16 @@ export interface UpdateAppRequest { enforce_unique_usernames?: UpdateAppRequestEnforceUniqueUsernamesEnum; /** * - * @type {FileUploadConfigRequest} + * @type {FileUploadConfig} * @memberof UpdateAppRequest */ - file_upload_config?: FileUploadConfigRequest; + file_upload_config?: FileUploadConfig; /** * - * @type {FirebaseConfigRequest} + * @type {FirebaseConfig} * @memberof UpdateAppRequest */ - firebase_config?: FirebaseConfigRequest; + firebase_config?: FirebaseConfig; /** * * @type {{ [key: string]: Array; }} @@ -13534,16 +12721,16 @@ export interface UpdateAppRequest { grants?: { [key: string]: Array; }; /** * - * @type {ConfigRequest} + * @type {Config} * @memberof UpdateAppRequest */ - hms_options?: ConfigRequest; + hms_options?: Config; /** * - * @type {HuaweiConfigRequest} + * @type {HuaweiConfig} * @memberof UpdateAppRequest */ - huawei_config?: HuaweiConfigRequest; + huawei_config?: HuaweiConfig; /** * * @type {Array} @@ -13564,10 +12751,10 @@ export interface UpdateAppRequest { image_moderation_labels?: Array; /** * - * @type {FileUploadConfigRequest} + * @type {FileUploadConfig} * @memberof UpdateAppRequest */ - image_upload_config?: FileUploadConfigRequest; + image_upload_config?: FileUploadConfig; /** * * @type {boolean} @@ -13588,10 +12775,10 @@ export interface UpdateAppRequest { permission_version?: UpdateAppRequestPermissionVersionEnum; /** * - * @type {PushConfigRequest} + * @type {PushConfig} * @memberof UpdateAppRequest */ - push_config?: PushConfigRequest; + push_config?: PushConfig; /** * * @type {number} @@ -13672,10 +12859,10 @@ export interface UpdateAppRequest { webhook_url?: string; /** * - * @type {XiaomiConfigRequest} + * @type {XiaomiConfig} * @memberof UpdateAppRequest */ - xiaomi_config?: XiaomiConfigRequest; + xiaomi_config?: XiaomiConfig; } @@ -13714,13 +12901,7 @@ export type UpdateAppRequestVideoProviderEnum = typeof UpdateAppRequestVideoProv */ export interface UpdateBlockListRequest { /** - * - * @type {string} - * @memberof UpdateBlockListRequest - */ - Name?: string; - /** - * + * List of words to block * @type {Array} * @memberof UpdateBlockListRequest */ @@ -13737,19 +12918,19 @@ export interface UpdateChannelPartialRequest { * @type {{ [key: string]: any; }} * @memberof UpdateChannelPartialRequest */ - set: { [key: string]: any; }; + set?: { [key: string]: any; }; /** * * @type {Array} * @memberof UpdateChannelPartialRequest */ - unset: Array; + unset?: Array; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof UpdateChannelPartialRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -13796,22 +12977,22 @@ export interface UpdateChannelRequest { accept_invite?: boolean; /** * List of user IDs to add to the channel - * @type {Array} + * @type {Array} * @memberof UpdateChannelRequest */ - add_members?: Array; + add_members?: Array>; /** * List of user IDs to make channel moderators * @type {Array} * @memberof UpdateChannelRequest */ - add_moderators: Array; + add_moderators?: Array; /** * List of channel member role assignments. If any specified user is not part of the channel, the request will fail - * @type {Array} + * @type {Array} * @memberof UpdateChannelRequest */ - assign_roles?: Array; + assign_roles?: Array>; /** * Sets cool down period for the channel in seconds * @type {number} @@ -13820,16 +13001,16 @@ export interface UpdateChannelRequest { cooldown?: number; /** * - * @type {ChannelRequest} + * @type {ChannelInput} * @memberof UpdateChannelRequest */ - data?: ChannelRequest; + data?: ChannelInput; /** * List of user IDs to take away moderators status from * @type {Array} * @memberof UpdateChannelRequest */ - demote_moderators: Array; + demote_moderators?: Array; /** * Set to `true` to hide channel's history when adding new members * @type {boolean} @@ -13838,10 +13019,10 @@ export interface UpdateChannelRequest { hide_history?: boolean; /** * List of user IDs to invite to the channel - * @type {Array} + * @type {Array} * @memberof UpdateChannelRequest */ - invites?: Array; + invites?: Array>; /** * * @type {MessageRequest} @@ -13859,7 +13040,7 @@ export interface UpdateChannelRequest { * @type {Array} * @memberof UpdateChannelRequest */ - remove_members: Array; + remove_members?: Array; /** * When `message` is set disables all push notifications for it * @type {boolean} @@ -13868,10 +13049,10 @@ export interface UpdateChannelRequest { skip_push?: boolean; /** * - * @type {UserObjectRequest} + * @type {UserRequest} * @memberof UpdateChannelRequest */ - user?: UserObjectRequest; + user?: UserRequest; /** * * @type {string} @@ -13908,7 +13089,7 @@ export interface UpdateChannelResponse { * @type {Message} * @memberof UpdateChannelResponse */ - message?: Message | null; + message?: Message; } /** * @@ -13918,10 +13099,10 @@ export interface UpdateChannelResponse { export interface UpdateChannelTypeRequest { /** * - * @type {string} + * @type {Array} * @memberof UpdateChannelTypeRequest */ - NameFromPath?: string; + allowed_flag_reasons?: Array; /** * * @type {string} @@ -13933,13 +13114,13 @@ export interface UpdateChannelTypeRequest { * @type {string} * @memberof UpdateChannelTypeRequest */ - automod_behavior?: UpdateChannelTypeRequestAutomodBehaviorEnum; + automod_behavior: UpdateChannelTypeRequestAutomodBehaviorEnum; /** * - * @type {ThresholdsRequest} + * @type {Thresholds} * @memberof UpdateChannelTypeRequest */ - automod_thresholds?: ThresholdsRequest; + automod_thresholds?: Thresholds; /** * * @type {string} @@ -13954,10 +13135,10 @@ export interface UpdateChannelTypeRequest { blocklist_behavior?: UpdateChannelTypeRequestBlocklistBehaviorEnum; /** * - * @type {Array} + * @type {Array} * @memberof UpdateChannelTypeRequest */ - blocklists?: Array; + blocklists?: Array; /** * List of commands that channel supports * @type {Array} @@ -13993,13 +13174,7 @@ export interface UpdateChannelTypeRequest { * @type {number} * @memberof UpdateChannelTypeRequest */ - max_message_length?: number; - /** - * - * @type {string} - * @memberof UpdateChannelTypeRequest - */ - message_retention?: string; + max_message_length: number; /** * * @type {boolean} @@ -14012,6 +13187,12 @@ export interface UpdateChannelTypeRequest { * @memberof UpdateChannelTypeRequest */ permissions?: Array; + /** + * + * @type {boolean} + * @memberof UpdateChannelTypeRequest + */ + polls?: boolean; /** * * @type {boolean} @@ -14090,7 +13271,8 @@ export type UpdateChannelTypeRequestAutomodEnum = typeof UpdateChannelTypeReques */ export const UpdateChannelTypeRequestAutomodBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type UpdateChannelTypeRequestAutomodBehaviorEnum = typeof UpdateChannelTypeRequestAutomodBehaviorEnum[keyof typeof UpdateChannelTypeRequestAutomodBehaviorEnum]; @@ -14099,7 +13281,8 @@ export type UpdateChannelTypeRequestAutomodBehaviorEnum = typeof UpdateChannelTy */ export const UpdateChannelTypeRequestBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type UpdateChannelTypeRequestBlocklistBehaviorEnum = typeof UpdateChannelTypeRequestBlocklistBehaviorEnum[keyof typeof UpdateChannelTypeRequestBlocklistBehaviorEnum]; @@ -14109,6 +13292,12 @@ export type UpdateChannelTypeRequestBlocklistBehaviorEnum = typeof UpdateChannel * @interface UpdateChannelTypeResponse */ export interface UpdateChannelTypeResponse { + /** + * + * @type {Array} + * @memberof UpdateChannelTypeResponse + */ + allowed_flag_reasons?: Array; /** * * @type {string} @@ -14186,19 +13375,13 @@ export interface UpdateChannelTypeResponse { * @type {boolean} * @memberof UpdateChannelTypeResponse */ - mark_messages_pending: boolean; - /** - * - * @type {number} - * @memberof UpdateChannelTypeResponse - */ - max_message_length: number; + mark_messages_pending: boolean; /** * - * @type {string} + * @type {number} * @memberof UpdateChannelTypeResponse */ - message_retention: string; + max_message_length: number; /** * * @type {boolean} @@ -14213,10 +13396,16 @@ export interface UpdateChannelTypeResponse { name: string; /** * - * @type {Array} + * @type {Array} + * @memberof UpdateChannelTypeResponse + */ + permissions: Array; + /** + * + * @type {boolean} * @memberof UpdateChannelTypeResponse */ - permissions: Array; + polls: boolean; /** * * @type {boolean} @@ -14301,7 +13490,8 @@ export type UpdateChannelTypeResponseAutomodEnum = typeof UpdateChannelTypeRespo */ export const UpdateChannelTypeResponseAutomodBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type UpdateChannelTypeResponseAutomodBehaviorEnum = typeof UpdateChannelTypeResponseAutomodBehaviorEnum[keyof typeof UpdateChannelTypeResponseAutomodBehaviorEnum]; @@ -14310,7 +13500,8 @@ export type UpdateChannelTypeResponseAutomodBehaviorEnum = typeof UpdateChannelT */ export const UpdateChannelTypeResponseBlocklistBehaviorEnum = { FLAG: 'flag', - BLOCK: 'block' + BLOCK: 'block', + SHADOW_BLOCK: 'shadow_block' } as const; export type UpdateChannelTypeResponseBlocklistBehaviorEnum = typeof UpdateChannelTypeResponseBlocklistBehaviorEnum[keyof typeof UpdateChannelTypeResponseBlocklistBehaviorEnum]; @@ -14320,12 +13511,6 @@ export type UpdateChannelTypeResponseBlocklistBehaviorEnum = typeof UpdateChanne * @interface UpdateCommandRequest */ export interface UpdateCommandRequest { - /** - * - * @type {string} - * @memberof UpdateCommandRequest - */ - Name?: string; /** * Arguments help text, shown in commands auto-completion * @type {string} @@ -14367,466 +13552,588 @@ export interface UpdateCommandResponse { /** * * @export - * @interface UpdateMessagePartialRequest + * @interface UpdateExternalStorageRequest */ -export interface UpdateMessagePartialRequest { +export interface UpdateExternalStorageRequest { /** - * Sets new field values - * @type {{ [key: string]: any; }} - * @memberof UpdateMessagePartialRequest + * + * @type {S3Request} + * @memberof UpdateExternalStorageRequest */ - set: { [key: string]: any; }; + aws_s3?: S3Request; /** - * Do not try to enrich the links within message - * @type {boolean} - * @memberof UpdateMessagePartialRequest + * + * @type {AzureRequest} + * @memberof UpdateExternalStorageRequest */ - skip_enrich_url?: boolean; + azure_blob?: AzureRequest; /** - * Array of field names to unset - * @type {Array} - * @memberof UpdateMessagePartialRequest + * + * @type {string} + * @memberof UpdateExternalStorageRequest */ - unset: Array; + bucket: string; /** * - * @type {UserObjectRequest} - * @memberof UpdateMessagePartialRequest + * @type {string} + * @memberof UpdateExternalStorageRequest */ - user?: UserObjectRequest; + gcs_credentials?: string; /** * * @type {string} - * @memberof UpdateMessagePartialRequest + * @memberof UpdateExternalStorageRequest */ - user_id?: string; + path?: string; + /** + * + * @type {string} + * @memberof UpdateExternalStorageRequest + */ + storage_type: UpdateExternalStorageRequestStorageTypeEnum; } + + /** - * Contains all information needed to update a message * @export - * @interface UpdateMessageRequest */ -export interface UpdateMessageRequest { +export const UpdateExternalStorageRequestStorageTypeEnum = { + S3: 's3', + GCS: 'gcs', + ABS: 'abs' +} as const; +export type UpdateExternalStorageRequestStorageTypeEnum = typeof UpdateExternalStorageRequestStorageTypeEnum[keyof typeof UpdateExternalStorageRequestStorageTypeEnum]; + +/** + * + * @export + * @interface UpdateExternalStorageResponse + */ +export interface UpdateExternalStorageResponse { /** * - * @type {MessageRequest} - * @memberof UpdateMessageRequest + * @type {string} + * @memberof UpdateExternalStorageResponse */ - message: MessageRequest; + bucket: string; + /** + * Duration of the request in human-readable format + * @type {string} + * @memberof UpdateExternalStorageResponse + */ + duration: string; /** * - * @type {{ [key: string]: string; }} - * @memberof UpdateMessageRequest + * @type {string} + * @memberof UpdateExternalStorageResponse */ - pending_message_metadata?: { [key: string]: string; }; + name: string; /** - * Do not try to enrich the links within message - * @type {boolean} - * @memberof UpdateMessageRequest + * + * @type {string} + * @memberof UpdateExternalStorageResponse */ - skip_enrich_url?: boolean; + path: string; + /** + * + * @type {string} + * @memberof UpdateExternalStorageResponse + */ + type: UpdateExternalStorageResponseTypeEnum; } + + +/** + * @export + */ +export const UpdateExternalStorageResponseTypeEnum = { + S3: 's3', + GCS: 'gcs', + ABS: 'abs' +} as const; +export type UpdateExternalStorageResponseTypeEnum = typeof UpdateExternalStorageResponseTypeEnum[keyof typeof UpdateExternalStorageResponseTypeEnum]; + /** * * @export - * @interface UpdateUserPartialRequest + * @interface UpdateMessagePartialRequest */ -export interface UpdateUserPartialRequest { +export interface UpdateMessagePartialRequest { /** - * User ID to update - * @type {string} - * @memberof UpdateUserPartialRequest + * Sets new field values + * @type {{ [key: string]: any; }} + * @memberof UpdateMessagePartialRequest */ - id: string; + set?: { [key: string]: any; }; /** * - * @type {{ [key: string]: any; }} - * @memberof UpdateUserPartialRequest + * @type {boolean} + * @memberof UpdateMessagePartialRequest */ - set: { [key: string]: any; }; + skip_enrich_url?: boolean; /** - * + * Array of field names to unset * @type {Array} - * @memberof UpdateUserPartialRequest + * @memberof UpdateMessagePartialRequest */ - unset: Array; -} -/** - * - * @export - * @interface UpdateUsersRequest - */ -export interface UpdateUsersRequest { + unset?: Array; /** - * Object containing users - * @type {{ [key: string]: UserObjectRequest; }} - * @memberof UpdateUsersRequest + * + * @type {UserRequest} + * @memberof UpdateMessagePartialRequest + */ + user?: UserRequest; + /** + * + * @type {string} + * @memberof UpdateMessagePartialRequest */ - users: { [key: string]: UserObjectRequest; }; + user_id?: string; } /** * * @export - * @interface UpdateUsersResponse + * @interface UpdateMessagePartialResponse */ -export interface UpdateUsersResponse { +export interface UpdateMessagePartialResponse { /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof UpdateUsersResponse + * @memberof UpdateMessagePartialResponse */ duration: string; /** - * Object containing users - * @type {{ [key: string]: UserObject; }} - * @memberof UpdateUsersResponse + * + * @type {Message} + * @memberof UpdateMessagePartialResponse + */ + message?: Message; + /** + * + * @type {{ [key: string]: string; }} + * @memberof UpdateMessagePartialResponse */ - users: { [key: string]: UserObject; }; + pending_message_metadata?: { [key: string]: string; }; } /** * * @export - * @interface UpsertPushProviderRequest + * @interface UpdateMessageRequest */ -export interface UpsertPushProviderRequest { +export interface UpdateMessageRequest { /** * - * @type {PushProviderRequest} - * @memberof UpsertPushProviderRequest + * @type {MessageRequest} + * @memberof UpdateMessageRequest + */ + message: MessageRequest; + /** + * + * @type {boolean} + * @memberof UpdateMessageRequest */ - push_provider?: PushProviderRequest; + skip_enrich_url?: boolean; } /** * * @export - * @interface UpsertPushProviderResponse + * @interface UpdateMessageResponse */ -export interface UpsertPushProviderResponse { +export interface UpdateMessageResponse { /** * Duration of the request in human-readable format * @type {string} - * @memberof UpsertPushProviderResponse + * @memberof UpdateMessageResponse */ duration: string; /** * - * @type {PushProviderResponse} - * @memberof UpsertPushProviderResponse + * @type {Message} + * @memberof UpdateMessageResponse */ - push_provider: PushProviderResponse; + message: Message; + /** + * + * @type {{ [key: string]: string; }} + * @memberof UpdateMessageResponse + */ + pending_message_metadata?: { [key: string]: string; }; } /** * * @export - * @interface UserBannedEvent + * @interface UpdatePollOptionRequest */ -export interface UserBannedEvent { +export interface UpdatePollOptionRequest { /** * - * @type {string} - * @memberof UserBannedEvent + * @type {{ [key: string]: any; }} + * @memberof UpdatePollOptionRequest */ - channel_id: string; + Custom?: { [key: string]: any; }; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollOptionRequest */ - channel_type: string; + id: string; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollOptionRequest */ - cid: string; + text: string; + /** + * + * @type {UserRequest} + * @memberof UpdatePollOptionRequest + */ + user?: UserRequest; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollOptionRequest */ - created_at: string; + user_id?: string; +} +/** + * + * @export + * @interface UpdatePollPartialRequest + */ +export interface UpdatePollPartialRequest { + /** + * Sets new field values + * @type {{ [key: string]: any; }} + * @memberof UpdatePollPartialRequest + */ + set?: { [key: string]: any; }; + /** + * Array of field names to unset + * @type {Array} + * @memberof UpdatePollPartialRequest + */ + unset?: Array; /** * - * @type {UserObject} - * @memberof UserBannedEvent + * @type {UserRequest} + * @memberof UpdatePollPartialRequest */ - created_by: UserObject; + user?: UserRequest; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollPartialRequest + */ + user_id?: string; +} +/** + * + * @export + * @interface UpdatePollRequest + */ +export interface UpdatePollRequest { + /** + * + * @type {{ [key: string]: any; }} + * @memberof UpdatePollRequest */ - expiration?: string; + Custom?: { [key: string]: any; }; /** * - * @type {string} - * @memberof UserBannedEvent + * @type {boolean} + * @memberof UpdatePollRequest */ - reason?: string; + allow_answers?: boolean; /** * * @type {boolean} - * @memberof UserBannedEvent + * @memberof UpdatePollRequest */ - shadow: boolean; + allow_user_suggested_options?: boolean; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollRequest */ - team?: string; + description?: string; + /** + * + * @type {boolean} + * @memberof UpdatePollRequest + */ + enforce_unique_vote?: boolean; /** * * @type {string} - * @memberof UserBannedEvent + * @memberof UpdatePollRequest */ - type: string; + id: string; /** * - * @type {UserObject} - * @memberof UserBannedEvent + * @type {boolean} + * @memberof UpdatePollRequest */ - user?: UserObject; -} -/** - * - * @export - * @interface UserCustomEventRequest - */ -export interface UserCustomEventRequest { - [key: string]: any | any; + is_closed?: boolean; /** * - * @type {string} - * @memberof UserCustomEventRequest + * @type {number} + * @memberof UpdatePollRequest */ - created_at?: string; + max_votes_allowed?: number; /** * * @type {string} - * @memberof UserCustomEventRequest + * @memberof UpdatePollRequest */ - type: string; -} -/** - * - * @export - * @interface UserDeactivatedEvent - */ -export interface UserDeactivatedEvent { + name: string; /** * - * @type {string} - * @memberof UserDeactivatedEvent + * @type {Array} + * @memberof UpdatePollRequest */ - created_at: string; + options?: Array; /** * - * @type {UserObject} - * @memberof UserDeactivatedEvent + * @type {UserRequest} + * @memberof UpdatePollRequest */ - created_by: UserObject; + user?: UserRequest; /** * * @type {string} - * @memberof UserDeactivatedEvent + * @memberof UpdatePollRequest */ - type: string; + user_id?: string; /** * - * @type {UserObject} - * @memberof UserDeactivatedEvent + * @type {string} + * @memberof UpdatePollRequest */ - user?: UserObject; + voting_visibility?: UpdatePollRequestVotingVisibilityEnum; } + + +/** + * @export + */ +export const UpdatePollRequestVotingVisibilityEnum = { + ANONYMOUS: 'anonymous', + PUBLIC: 'public' +} as const; +export type UpdatePollRequestVotingVisibilityEnum = typeof UpdatePollRequestVotingVisibilityEnum[keyof typeof UpdatePollRequestVotingVisibilityEnum]; + /** * * @export - * @interface UserDeletedEvent + * @interface UpdateThreadPartialRequest */ -export interface UserDeletedEvent { - /** - * - * @type {string} - * @memberof UserDeletedEvent - */ - created_at: string; +export interface UpdateThreadPartialRequest { /** * - * @type {boolean} - * @memberof UserDeletedEvent + * @type {{ [key: string]: any; }} + * @memberof UpdateThreadPartialRequest */ - delete_conversation_channels: boolean; + set?: { [key: string]: any; }; /** * - * @type {boolean} - * @memberof UserDeletedEvent + * @type {Array} + * @memberof UpdateThreadPartialRequest */ - hard_delete: boolean; + unset?: Array; /** * - * @type {boolean} - * @memberof UserDeletedEvent + * @type {UserRequest} + * @memberof UpdateThreadPartialRequest */ - mark_messages_deleted: boolean; + user?: UserRequest; /** * * @type {string} - * @memberof UserDeletedEvent - */ - type: string; - /** - * - * @type {UserObject} - * @memberof UserDeletedEvent + * @memberof UpdateThreadPartialRequest */ - user?: UserObject; + user_id?: string; } /** * * @export - * @interface UserFlaggedEvent + * @interface UpdateThreadPartialResponse */ -export interface UserFlaggedEvent { +export interface UpdateThreadPartialResponse { /** * * @type {string} - * @memberof UserFlaggedEvent + * @memberof UpdateThreadPartialResponse */ - created_at: string; + duration: string; /** * + * @type {ThreadResponse} + * @memberof UpdateThreadPartialResponse + */ + thread: ThreadResponse; +} +/** + * + * @export + * @interface UpdateUserPartialRequest + */ +export interface UpdateUserPartialRequest { + /** + * User ID to update * @type {string} - * @memberof UserFlaggedEvent + * @memberof UpdateUserPartialRequest */ - target_user?: string; + id: string; /** * - * @type {Array} - * @memberof UserFlaggedEvent + * @type {{ [key: string]: any; }} + * @memberof UpdateUserPartialRequest */ - target_users?: Array; + set?: { [key: string]: any; }; /** * - * @type {string} - * @memberof UserFlaggedEvent + * @type {Array} + * @memberof UpdateUserPartialRequest */ - type: string; + unset?: Array; +} +/** + * + * @export + * @interface UpdateUsersPartialRequest + */ +export interface UpdateUsersPartialRequest { /** * - * @type {UserObject} - * @memberof UserFlaggedEvent + * @type {Array} + * @memberof UpdateUsersPartialRequest */ - user?: UserObject; + users: Array; } /** * * @export - * @interface UserMute + * @interface UpdateUsersRequest */ -export interface UserMute { +export interface UpdateUsersRequest { /** - * Date/time of creation - * @type {string} - * @memberof UserMute + * Object containing users + * @type {{ [key: string]: UserRequest; }} + * @memberof UpdateUsersRequest */ - created_at: string; + users: { [key: string]: UserRequest; }; +} +/** + * + * @export + * @interface UpdateUsersResponse + */ +export interface UpdateUsersResponse { /** - * Date/time of mute expiration + * * @type {string} - * @memberof UserMute + * @memberof UpdateUsersResponse */ - expires?: string; + duration: string; /** * - * @type {UserObject} - * @memberof UserMute - */ - target?: UserObject; - /** - * Date/time of the last update * @type {string} - * @memberof UserMute + * @memberof UpdateUsersResponse */ - updated_at: string; + membership_deletion_task_id: string; /** - * - * @type {UserObject} - * @memberof UserMute + * Object containing users + * @type {{ [key: string]: FullUserResponse; }} + * @memberof UpdateUsersResponse */ - user?: UserObject; + users: { [key: string]: FullUserResponse; }; } /** * * @export - * @interface UserMuteRequest + * @interface UpsertPushProviderRequest */ -export interface UserMuteRequest { +export interface UpsertPushProviderRequest { /** - * Date/time of creation - * @type {string} - * @memberof UserMuteRequest + * + * @type {PushProvider} + * @memberof UpsertPushProviderRequest */ - created_at?: string; + push_provider?: PushProvider | null; +} +/** + * + * @export + * @interface UpsertPushProviderResponse + */ +export interface UpsertPushProviderResponse { /** - * Date/time of mute expiration + * Duration of the request in human-readable format * @type {string} - * @memberof UserMuteRequest + * @memberof UpsertPushProviderResponse */ - expires?: string; + duration: string; /** * - * @type {UserObjectRequest} - * @memberof UserMuteRequest + * @type {PushProviderResponse} + * @memberof UpsertPushProviderResponse */ - target?: UserObjectRequest; + push_provider: PushProviderResponse; +} +/** + * + * @export + * @interface UserCustomEventRequest + */ +export interface UserCustomEventRequest { /** - * Date/time of the last update - * @type {string} - * @memberof UserMuteRequest + * + * @type {{ [key: string]: any; }} + * @memberof UserCustomEventRequest */ - updated_at?: string; + custom?: { [key: string]: any; }; /** * - * @type {UserObjectRequest} - * @memberof UserMuteRequest + * @type {string} + * @memberof UserCustomEventRequest */ - user?: UserObjectRequest; + type: string; } /** * * @export - * @interface UserMutedEvent + * @interface UserMute */ -export interface UserMutedEvent { +export interface UserMute { /** - * + * Date/time of creation * @type {string} - * @memberof UserMutedEvent + * @memberof UserMute */ created_at: string; /** - * + * Date/time of mute expiration * @type {string} - * @memberof UserMutedEvent + * @memberof UserMute */ - target_user?: string; + expires?: string; /** * - * @type {Array} - * @memberof UserMutedEvent + * @type {UserObject} + * @memberof UserMute */ - target_users?: Array; + target?: UserObject; /** - * + * Date/time of the last update * @type {string} - * @memberof UserMutedEvent + * @memberof UserMute */ - type: string; + updated_at: string; /** * * @type {UserObject} - * @memberof UserMutedEvent + * @memberof UserMute */ user?: UserObject; } @@ -14836,7 +14143,6 @@ export interface UserMutedEvent { * @interface UserObject */ export interface UserObject { - [key: string]: any | any; /** * Expiration date of the ban * @type {string} @@ -14848,13 +14154,19 @@ export interface UserObject { * @type {boolean} * @memberof UserObject */ - banned: boolean; + banned?: boolean; /** * Date/time of creation * @type {string} * @memberof UserObject */ readonly created_at?: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof UserObject + */ + custom?: { [key: string]: any; }; /** * Date of deactivation * @type {string} @@ -14896,7 +14208,13 @@ export interface UserObject { * @type {boolean} * @memberof UserObject */ - readonly online: boolean; + readonly online?: boolean; + /** + * + * @type {PrivacySettings} + * @memberof UserObject + */ + privacy_settings?: PrivacySettings; /** * * @type {PushNotificationSettings} @@ -14914,7 +14232,7 @@ export interface UserObject { * @type {string} * @memberof UserObject */ - role: string; + role?: string; /** * List of teams user is a part of * @type {Array} @@ -14928,148 +14246,60 @@ export interface UserObject { */ readonly updated_at?: string; } -/** - * Represents chat user - * @export - * @interface UserObjectRequest - */ -export interface UserObjectRequest { - [key: string]: any | any; - /** - * Expiration date of the ban - * @type {string} - * @memberof UserObjectRequest - */ - ban_expires?: string; - /** - * Whether a user is banned or not - * @type {boolean} - * @memberof UserObjectRequest - */ - banned?: boolean; - /** - * Unique user identifier - * @type {string} - * @memberof UserObjectRequest - */ - id: string; - /** - * - * @type {boolean} - * @memberof UserObjectRequest - */ - invisible?: boolean; - /** - * Preferred language of a user - * @type {string} - * @memberof UserObjectRequest - */ - language?: string; - /** - * - * @type {PushNotificationSettingsRequest} - * @memberof UserObjectRequest - */ - push_notifications?: PushNotificationSettingsRequest; - /** - * Revocation date for tokens - * @type {string} - * @memberof UserObjectRequest - */ - revoke_tokens_issued_before?: string; - /** - * Determines the set of user permissions - * @type {string} - * @memberof UserObjectRequest - */ - role?: string; - /** - * List of teams user is a part of - * @type {Array} - * @memberof UserObjectRequest - */ - teams?: Array; -} /** * * @export - * @interface UserPresenceChangedEvent + * @interface UserRequest */ -export interface UserPresenceChangedEvent { - /** - * - * @type {string} - * @memberof UserPresenceChangedEvent - */ - created_at: string; - /** - * - * @type {string} - * @memberof UserPresenceChangedEvent - */ - type: string; +export interface UserRequest { /** * - * @type {UserObject} - * @memberof UserPresenceChangedEvent + * @type {{ [key: string]: any; }} + * @memberof UserRequest */ - user?: UserObject; -} -/** - * - * @export - * @interface UserReactivatedEvent - */ -export interface UserReactivatedEvent { + custom?: { [key: string]: any; }; /** - * + * User ID * @type {string} - * @memberof UserReactivatedEvent + * @memberof UserRequest */ - created_at: string; + id: string; /** * * @type {string} - * @memberof UserReactivatedEvent + * @memberof UserRequest */ - type: string; + image?: string; /** * - * @type {UserObject} - * @memberof UserReactivatedEvent + * @type {boolean} + * @memberof UserRequest */ - user?: UserObject; -} -/** - * - * @export - * @interface UserRequest - */ -export interface UserRequest { + invisible?: boolean; /** * - * @type {{ [key: string]: any; }} + * @type {string} * @memberof UserRequest */ - custom?: { [key: string]: any; }; + language?: string; /** - * User ID + * Optional name of user * @type {string} * @memberof UserRequest */ - id: string; + name?: string; /** * - * @type {string} + * @type {PrivacySettings} * @memberof UserRequest */ - image?: string; + privacy_settings?: PrivacySettings; /** - * Optional name of user - * @type {string} + * + * @type {PushNotificationSettingsInput} * @memberof UserRequest */ - name?: string; + push_notifications?: PushNotificationSettingsInput; /** * * @type {string} @@ -15089,67 +14319,90 @@ export interface UserRequest { * @interface UserResponse */ export interface UserResponse { - [key: string]: any | any; /** * + * @type {boolean} + * @memberof UserResponse + */ + banned: boolean; + /** + * + * @type {Array} + * @memberof UserResponse + */ + blocked_user_ids: Array; + /** + * Date/time of creation * @type {string} * @memberof UserResponse */ - ban_expires?: string; + created_at: string; /** * - * @type {boolean} + * @type {{ [key: string]: any; }} * @memberof UserResponse */ - banned: boolean; + custom: { [key: string]: any; }; /** * * @type {string} * @memberof UserResponse */ - readonly created_at?: string; + deactivated_at?: string; /** - * + * Date/time of deletion * @type {string} * @memberof UserResponse */ - readonly deactivated_at?: string; + deleted_at?: string; /** * - * @type {string} + * @type {Array} * @memberof UserResponse */ - readonly deleted_at?: string; + devices: Array; /** * * @type {string} * @memberof UserResponse */ id: string; + /** + * + * @type {string} + * @memberof UserResponse + */ + image?: string; /** * * @type {boolean} * @memberof UserResponse */ - invisible?: boolean; + invisible: boolean; /** * * @type {string} * @memberof UserResponse */ - language?: string; + language: string; /** * * @type {string} * @memberof UserResponse */ - readonly last_active?: string; + last_active?: string; + /** + * + * @type {string} + * @memberof UserResponse + */ + name?: string; /** * * @type {boolean} * @memberof UserResponse */ - readonly online: boolean; + online: boolean; /** * * @type {PushNotificationSettings} @@ -15169,7 +14422,7 @@ export interface UserResponse { */ role: string; /** - * Whether user is shadow banned or not + * * @type {boolean} * @memberof UserResponse */ @@ -15179,394 +14432,335 @@ export interface UserResponse { * @type {Array} * @memberof UserResponse */ - teams?: Array; + teams: Array; /** - * + * Date/time of the last update * @type {string} * @memberof UserResponse */ - readonly updated_at?: string; + updated_at: string; } /** * * @export - * @interface UserUnbannedEvent + * @interface VideoSettings */ -export interface UserUnbannedEvent { - /** - * - * @type {string} - * @memberof UserUnbannedEvent - */ - channel_id: string; - /** - * - * @type {string} - * @memberof UserUnbannedEvent - */ - channel_type: string; - /** - * - * @type {string} - * @memberof UserUnbannedEvent - */ - cid: string; +export interface VideoSettings { /** * - * @type {string} - * @memberof UserUnbannedEvent + * @type {boolean} + * @memberof VideoSettings */ - created_at: string; + access_request_enabled: boolean; /** * * @type {boolean} - * @memberof UserUnbannedEvent + * @memberof VideoSettings */ - shadow: boolean; + camera_default_on: boolean; /** * * @type {string} - * @memberof UserUnbannedEvent + * @memberof VideoSettings */ - team?: string; + camera_facing: VideoSettingsCameraFacingEnum; /** * - * @type {string} - * @memberof UserUnbannedEvent + * @type {boolean} + * @memberof VideoSettings */ - type: string; + enabled: boolean; /** * - * @type {UserObject} - * @memberof UserUnbannedEvent + * @type {TargetResolution} + * @memberof VideoSettings */ - user?: UserObject; + target_resolution: TargetResolution; } + + +/** + * @export + */ +export const VideoSettingsCameraFacingEnum = { + FRONT: 'front', + BACK: 'back', + EXTERNAL: 'external' +} as const; +export type VideoSettingsCameraFacingEnum = typeof VideoSettingsCameraFacingEnum[keyof typeof VideoSettingsCameraFacingEnum]; + /** * * @export - * @interface UserUnmutedEvent + * @interface VoteData */ -export interface UserUnmutedEvent { +export interface VoteData { /** * - * @type {string} - * @memberof UserUnmutedEvent + * @type {PollOption} + * @memberof VoteData */ - created_at: string; + Option?: PollOption | null; /** * * @type {string} - * @memberof UserUnmutedEvent + * @memberof VoteData */ - target_user?: string; + answer_text?: string; /** * - * @type {Array} - * @memberof UserUnmutedEvent + * @type {string} + * @memberof VoteData */ - target_users?: Array; + option_id?: string; +} +/** + * Represents an BaseEvent that happened in Stream Chat + * @export + * @interface WSEvent + */ +export interface WSEvent { /** * - * @type {string} - * @memberof UserUnmutedEvent + * @type {boolean} + * @memberof WSEvent */ - type: string; + automoderation?: boolean; /** * - * @type {UserObject} - * @memberof UserUnmutedEvent + * @type {ModerationResponse} + * @memberof WSEvent */ - user?: UserObject; -} -/** - * - * @export - * @interface UserUnreadReminderEvent - */ -export interface UserUnreadReminderEvent { + automoderation_scores?: ModerationResponse; /** * - * @type {{ [key: string]: ChannelMessages; }} - * @memberof UserUnreadReminderEvent + * @type {ChannelResponse} + * @memberof WSEvent */ - channels: { [key: string]: ChannelMessages; }; + channel?: ChannelResponse; /** * * @type {string} - * @memberof UserUnreadReminderEvent + * @memberof WSEvent */ - created_at: string; + channel_id?: string; /** * * @type {string} - * @memberof UserUnreadReminderEvent + * @memberof WSEvent */ - type: string; + channel_type?: string; /** * - * @type {UserObject} - * @memberof UserUnreadReminderEvent + * @type {string} + * @memberof WSEvent */ - user?: UserObject; -} -/** - * - * @export - * @interface UserUpdatedEvent - */ -export interface UserUpdatedEvent { + cid?: string; /** * * @type {string} - * @memberof UserUpdatedEvent + * @memberof WSEvent */ - created_at: string; + connection_id?: string; /** * * @type {string} - * @memberof UserUpdatedEvent + * @memberof WSEvent */ - type: string; + created_at: string; /** * * @type {UserObject} - * @memberof UserUpdatedEvent + * @memberof WSEvent */ - user?: UserObject; -} -/** - * - * @export - * @interface UserWatchingStartEvent - */ -export interface UserWatchingStartEvent { + created_by?: UserObject; /** * - * @type {string} - * @memberof UserWatchingStartEvent + * @type {{ [key: string]: any; }} + * @memberof WSEvent */ - channel_id: string; + custom: { [key: string]: any; }; /** * - * @type {string} - * @memberof UserWatchingStartEvent + * @type {OwnUser} + * @memberof WSEvent */ - channel_type: string; + me?: OwnUser; /** * - * @type {string} - * @memberof UserWatchingStartEvent + * @type {ChannelMember} + * @memberof WSEvent */ - cid: string; + member?: ChannelMember | null; /** * - * @type {string} - * @memberof UserWatchingStartEvent + * @type {Message} + * @memberof WSEvent */ - created_at: string; + message?: Message; /** * - * @type {string} - * @memberof UserWatchingStartEvent + * @type {MessageUpdate} + * @memberof WSEvent */ - team?: string; + message_update?: MessageUpdate; /** * * @type {string} - * @memberof UserWatchingStartEvent + * @memberof WSEvent */ - type: string; + parent_id?: string; /** * - * @type {UserObject} - * @memberof UserWatchingStartEvent + * @type {Poll} + * @memberof WSEvent */ - user?: UserObject; + poll?: Poll; /** * - * @type {number} - * @memberof UserWatchingStartEvent + * @type {PollVote} + * @memberof WSEvent */ - watcher_count: number; -} -/** - * - * @export - * @interface UserWatchingStopEvent - */ -export interface UserWatchingStopEvent { + poll_vote?: PollVote | null; /** * - * @type {string} - * @memberof UserWatchingStopEvent + * @type {Reaction} + * @memberof WSEvent */ - channel_id: string; + reaction?: Reaction | null; /** * * @type {string} - * @memberof UserWatchingStopEvent + * @memberof WSEvent */ - channel_type: string; + reason?: string; /** * * @type {string} - * @memberof UserWatchingStopEvent + * @memberof WSEvent */ - cid: string; + team?: string; /** * - * @type {string} - * @memberof UserWatchingStopEvent + * @type {Thread} + * @memberof WSEvent */ - created_at: string; + thread?: Thread; /** * * @type {string} - * @memberof UserWatchingStopEvent + * @memberof WSEvent */ type: string; /** * * @type {UserObject} - * @memberof UserWatchingStopEvent + * @memberof WSEvent */ user?: UserObject; - /** - * - * @type {number} - * @memberof UserWatchingStopEvent - */ - watcher_count: number; -} -/** - * - * @export - * @interface UsersResponse - */ -export interface UsersResponse { /** * * @type {string} - * @memberof UsersResponse + * @memberof WSEvent */ - duration: string; + user_id?: string; /** - * List of found users - * @type {Array} - * @memberof UsersResponse + * + * @type {number} + * @memberof WSEvent */ - users: Array; + watcher_count?: number; } /** * * @export - * @interface VideoSettings + * @interface WrappedUnreadCountsResponse */ -export interface VideoSettings { +export interface WrappedUnreadCountsResponse { /** * - * @type {boolean} - * @memberof VideoSettings + * @type {Array} + * @memberof WrappedUnreadCountsResponse */ - access_request_enabled: boolean; + channel_type: Array; /** * - * @type {boolean} - * @memberof VideoSettings + * @type {Array} + * @memberof WrappedUnreadCountsResponse */ - camera_default_on: boolean; + channels: Array; /** - * + * Duration of the request in human-readable format * @type {string} - * @memberof VideoSettings + * @memberof WrappedUnreadCountsResponse */ - camera_facing: VideoSettingsCameraFacingEnum; + duration: string; /** * - * @type {boolean} - * @memberof VideoSettings + * @type {Array} + * @memberof WrappedUnreadCountsResponse */ - enabled: boolean; + threads: Array; /** * - * @type {TargetResolution} - * @memberof VideoSettings + * @type {number} + * @memberof WrappedUnreadCountsResponse */ - target_resolution: TargetResolution; -} - - -/** - * @export - */ -export const VideoSettingsCameraFacingEnum = { - FRONT: 'front', - BACK: 'back', - EXTERNAL: 'external' -} as const; -export type VideoSettingsCameraFacingEnum = typeof VideoSettingsCameraFacingEnum[keyof typeof VideoSettingsCameraFacingEnum]; - -/** - * This is just a placeholder for all client events - * @export - * @interface WSClientEvent - */ -export interface WSClientEvent { + total_unread_count: number; /** * - * @type {string} - * @memberof WSClientEvent + * @type {number} + * @memberof WrappedUnreadCountsResponse */ - connection_id?: string; + total_unread_threads_count: number; } /** * * @export - * @interface XiaomiConfigFields + * @interface XiaomiConfig */ -export interface XiaomiConfigFields { +export interface XiaomiConfig { /** * * @type {boolean} - * @memberof XiaomiConfigFields + * @memberof XiaomiConfig */ - enabled: boolean; + Disabled?: boolean; /** * * @type {string} - * @memberof XiaomiConfigFields + * @memberof XiaomiConfig */ package_name?: string; /** * * @type {string} - * @memberof XiaomiConfigFields + * @memberof XiaomiConfig */ secret?: string; } /** * * @export - * @interface XiaomiConfigRequest + * @interface XiaomiConfigFields */ -export interface XiaomiConfigRequest { +export interface XiaomiConfigFields { /** * * @type {boolean} - * @memberof XiaomiConfigRequest + * @memberof XiaomiConfigFields */ - Disabled?: boolean; + enabled: boolean; /** * * @type {string} - * @memberof XiaomiConfigRequest + * @memberof XiaomiConfigFields */ package_name?: string; /** * * @type {string} - * @memberof XiaomiConfigRequest + * @memberof XiaomiConfigFields */ secret?: string; } diff --git a/src/gen/chat/runtime.ts b/src/gen/chat/runtime.ts index c6ff583..0fc2272 100644 --- a/src/gen/chat/runtime.ts +++ b/src/gen/chat/runtime.ts @@ -1,10 +1,10 @@ /* tslint:disable */ /* eslint-disable */ /** - * Stream Chat API + * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v92.7.0 + * The version of the OpenAPI document: v122.3.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ */ -export const BASE_PATH = "https://chat.stream-io-api.com".replace(/\/+$/, ""); +export const BASE_PATH = "https://stream-io-api.com".replace(/\/+$/, ""); export interface ConfigurationParameters { basePath?: string; // override base path diff --git a/src/gen/video/apis/ProductvideoApi.ts b/src/gen/video/apis/ProductvideoApi.ts index 81606be..1ba3487 100644 --- a/src/gen/video/apis/ProductvideoApi.ts +++ b/src/gen/video/apis/ProductvideoApi.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v120.0.0 + * The version of the OpenAPI document: v122.3.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/gen/video/models/index.ts b/src/gen/video/models/index.ts index f3568c8..29a95ee 100644 --- a/src/gen/video/models/index.ts +++ b/src/gen/video/models/index.ts @@ -68,6 +68,31 @@ export interface VideoAPNS { */ title?: string; } +/** + * + * @export + * @interface VideoAggregatedStats + */ +export interface VideoAggregatedStats { + /** + * + * @type {{ [key: string]: VideoCountrywiseAggregateStats; }} + * @memberof VideoAggregatedStats + */ + countrywise_aggregate_stats?: { [key: string]: VideoCountrywiseAggregateStats; }; + /** + * + * @type {VideoPublisherAggregateStats} + * @memberof VideoAggregatedStats + */ + publisher_aggregate_stats?: VideoPublisherAggregateStats; + /** + * + * @type {VideoTURNAggregatedStats} + * @memberof VideoAggregatedStats + */ + turn?: VideoTURNAggregatedStats; +} /** * * @export @@ -327,6 +352,18 @@ export interface VideoBroadcastSettingsResponse { * @interface VideoCallEvent */ export interface VideoCallEvent { + /** + * + * @type {{ [key: string]: any; }} + * @memberof VideoCallEvent + */ + additional?: { [key: string]: any; }; + /** + * + * @type {string} + * @memberof VideoCallEvent + */ + component?: string; /** * * @type {string} @@ -1095,6 +1132,62 @@ export interface VideoCoordinates { */ longitude: number; } +/** + * + * @export + * @interface VideoCount + */ +export interface VideoCount { + /** + * + * @type {boolean} + * @memberof VideoCount + */ + approximate: boolean; + /** + * + * @type {number} + * @memberof VideoCount + */ + value: number; +} +/** + * + * @export + * @interface VideoCountrywiseAggregateStats + */ +export interface VideoCountrywiseAggregateStats { + /** + * + * @type {VideoCount} + * @memberof VideoCountrywiseAggregateStats + */ + participant_count?: VideoCount; + /** + * + * @type {VideoTimeStats} + * @memberof VideoCountrywiseAggregateStats + */ + publisher_jitter?: VideoTimeStats; + /** + * + * @type {VideoTimeStats} + * @memberof VideoCountrywiseAggregateStats + */ + publisher_latency?: VideoTimeStats; + /** + * + * @type {VideoTimeStats} + * @memberof VideoCountrywiseAggregateStats + */ + subscriber_jitter?: VideoTimeStats; + /** + * + * @type {VideoTimeStats} + * @memberof VideoCountrywiseAggregateStats + */ + subscriber_latency?: VideoTimeStats; +} /** * * @export @@ -1835,6 +1928,12 @@ export interface VideoGetCallResponse { * @interface VideoGetCallStatsResponse */ export interface VideoGetCallStatsResponse { + /** + * + * @type {VideoAggregatedStats} + * @memberof VideoGetCallStatsResponse + */ + aggregated?: VideoAggregatedStats; /** * * @type {number} @@ -1861,16 +1960,16 @@ export interface VideoGetCallStatsResponse { duration: string; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoGetCallStatsResponse */ - jitter?: VideoStats; + jitter?: VideoTimeStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoGetCallStatsResponse */ - latency?: VideoStats; + latency?: VideoTimeStats; /** * * @type {number} @@ -2849,6 +2948,25 @@ export interface VideoPublishedTrackInfo { */ track_type?: string; } +/** + * + * @export + * @interface VideoPublisherAggregateStats + */ +export interface VideoPublisherAggregateStats { + /** + * + * @type {{ [key: string]: VideoCount; }} + * @memberof VideoPublisherAggregateStats + */ + by_track_type?: { [key: string]: VideoCount; }; + /** + * + * @type {VideoCount} + * @memberof VideoPublisherAggregateStats + */ + total?: VideoCount; +} /** * * @export @@ -3180,7 +3298,12 @@ export const VideoRecordSettingsRequestQualityEnum = { _480P: '480p', _720P: '720p', _1080P: '1080p', - _1440P: '1440p' + _1440P: '1440p', + PORTRAIT_360X640: 'portrait-360x640', + PORTRAIT_480X854: 'portrait-480x854', + PORTRAIT_720X1280: 'portrait-720x1280', + PORTRAIT_1080X1920: 'portrait-1080x1920', + PORTRAIT_1440X2560: 'portrait-1440x2560' } as const; export type VideoRecordSettingsRequestQualityEnum = typeof VideoRecordSettingsRequestQualityEnum[keyof typeof VideoRecordSettingsRequestQualityEnum]; @@ -3512,25 +3635,6 @@ export interface VideoStartTranscriptionResponse { */ duration: string; } -/** - * - * @export - * @interface VideoStats - */ -export interface VideoStats { - /** - * - * @type {number} - * @memberof VideoStats - */ - average_seconds: number; - /** - * - * @type {number} - * @memberof VideoStats - */ - max_seconds: number; -} /** * * @export @@ -3620,6 +3724,25 @@ export interface VideoSubsession { */ sfu_id: string; } +/** + * + * @export + * @interface VideoTURNAggregatedStats + */ +export interface VideoTURNAggregatedStats { + /** + * + * @type {VideoCount} + * @memberof VideoTURNAggregatedStats + */ + tcp?: VideoCount; + /** + * + * @type {VideoCount} + * @memberof VideoTURNAggregatedStats + */ + total?: VideoCount; +} /** * * @export @@ -3684,6 +3807,25 @@ export interface VideoThumbnailsSettingsResponse { */ enabled: boolean; } +/** + * + * @export + * @interface VideoTimeStats + */ +export interface VideoTimeStats { + /** + * + * @type {number} + * @memberof VideoTimeStats + */ + average_seconds: number; + /** + * + * @type {number} + * @memberof VideoTimeStats + */ + max_seconds: number; +} /** * * @export @@ -4438,16 +4580,16 @@ export interface VideoUserSessionStats { geolocation?: VideoGeolocationResult; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - jitter?: VideoStats; + jitter?: VideoTimeStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - latency?: VideoStats; + latency?: VideoTimeStats; /** * * @type {number} @@ -4534,16 +4676,16 @@ export interface VideoUserSessionStats { publisher_audio_mos?: VideoMOSStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - publisher_jitter?: VideoStats; + publisher_jitter?: VideoTimeStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - publisher_latency?: VideoStats; + publisher_latency?: VideoTimeStats; /** * * @type {number} @@ -4636,16 +4778,16 @@ export interface VideoUserSessionStats { subscriber_audio_mos?: VideoMOSStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - subscriber_jitter?: VideoStats; + subscriber_jitter?: VideoTimeStats; /** * - * @type {VideoStats} + * @type {VideoTimeStats} * @memberof VideoUserSessionStats */ - subscriber_latency?: VideoStats; + subscriber_latency?: VideoTimeStats; /** * * @type {number} @@ -4676,6 +4818,12 @@ export interface VideoUserSessionStats { * @memberof VideoUserSessionStats */ total_pixels_out: number; + /** + * + * @type {boolean} + * @memberof VideoUserSessionStats + */ + truncated?: boolean; /** * * @type {string} diff --git a/src/gen/video/runtime.ts b/src/gen/video/runtime.ts index 8ae6774..0fc2272 100644 --- a/src/gen/video/runtime.ts +++ b/src/gen/video/runtime.ts @@ -4,7 +4,7 @@ * Stream API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v120.0.0 + * The version of the OpenAPI document: v122.3.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/test-cleanup.js b/test-cleanup.js index 2aff8ba..19776ca 100644 --- a/test-cleanup.js +++ b/test-cleanup.js @@ -24,6 +24,19 @@ const cleanupBlockLists = async () => { ); }; +const cleanupCalls = async () => { + const calls = (await client.video.queryCalls()).calls; + const testCalls = Object.keys(calls).filter((t) => + t.startsWith("callnodetest"), + ); + + await Promise.all( + testCalls.map((t) => + client.video.call(t.call.type, t.call.id).delete({ hard: true }), + ), + ); +}; + const cleanupCallTypes = async () => { const callTypes = (await client.video.listCallTypes()).call_types; const customCallTypes = Object.keys(callTypes).filter( @@ -127,6 +140,7 @@ const cleanup = async () => { await cleanUpRoles(); await cleanUpUsers(); await cleanupExternalStorage(); + await cleanupCalls(); }; cleanup().then(() => {