From 34df607ea35bfe19c162b3ede18586b3f076d782 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Sat, 3 Aug 2024 11:44:33 +0200 Subject: [PATCH] remove unnecessary encoding --- src/gen/chat/ChatApi.ts | 956 +-- src/gen/common/CommonApi.ts | 423 +- src/gen/models-transform/index.ts | 10803 +------------------------- src/gen/moderation/ModerationApi.ts | 263 +- src/gen/video/VideoApi.ts | 383 +- 5 files changed, 1109 insertions(+), 11719 deletions(-) diff --git a/src/gen/chat/ChatApi.ts b/src/gen/chat/ChatApi.ts index 6231176..ff48f42 100644 --- a/src/gen/chat/ChatApi.ts +++ b/src/gen/chat/ChatApi.ts @@ -104,25 +104,15 @@ import { WrappedUnreadCountsResponse, } from '../models'; import { - encodeCastPollVoteRequest, - encodeChannelGetOrCreateRequest, decodeChannelStateResponse, - encodeCommitMessageRequest, - encodeCreateChannelTypeRequest, decodeCreateChannelTypeResponse, - encodeCreateCommandRequest, decodeCreateCommandResponse, - encodeCreatePollOptionRequest, - encodeCreatePollRequest, decodeDeleteChannelResponse, - encodeDeleteChannelsRequest, decodeDeleteChannelsResponse, decodeDeleteCommandResponse, decodeDeleteMessageResponse, decodeEventResponse, - encodeExportChannelsRequest, decodeExportChannelsResponse, - encodeFileUploadRequest, decodeFileUploadResponse, decodeGetChannelTypeResponse, decodeGetCommandResponse, @@ -132,76 +122,40 @@ import { decodeGetReactionsResponse, decodeGetRepliesResponse, decodeGetThreadResponse, - encodeHideChannelRequest, decodeHideChannelResponse, - encodeImageUploadRequest, decodeImageUploadResponse, decodeListChannelTypesResponse, decodeListCommandsResponse, - encodeMarkChannelsReadRequest, - encodeMarkReadRequest, decodeMarkReadResponse, - encodeMarkUnreadRequest, decodeMembersResponse, - encodeMessageActionRequest, decodeMessageResponse, - encodeMuteChannelRequest, decodeMuteChannelResponse, decodePollOptionResponse, decodePollResponse, decodePollVoteResponse, decodePollVotesResponse, - encodeQueryBannedUsersRequest, decodeQueryBannedUsersResponse, - encodeQueryChannelsRequest, decodeQueryChannelsResponse, - encodeQueryMembersRequest, - encodeQueryMessageFlagsRequest, decodeQueryMessageFlagsResponse, - encodeQueryMessageHistoryRequest, decodeQueryMessageHistoryResponse, - encodeQueryPollVotesRequest, - encodeQueryPollsRequest, decodeQueryPollsResponse, - encodeQueryReactionsRequest, decodeQueryReactionsResponse, - encodeQueryThreadsRequest, decodeQueryThreadsResponse, decodeReactionRemovalResponse, decodeResponse, - encodeSearchRequest, decodeSearchResponse, - encodeSendEventRequest, - encodeSendMessageRequest, decodeSendMessageResponse, - encodeSendReactionRequest, decodeSendReactionResponse, - encodeSendUserCustomEventRequest, - encodeShowChannelRequest, decodeShowChannelResponse, - encodeTranslateMessageRequest, - encodeTruncateChannelRequest, decodeTruncateChannelResponse, - encodeUnmuteChannelRequest, decodeUnmuteResponse, - encodeUnreadCountsBatchRequest, decodeUnreadCountsBatchResponse, - encodeUpdateChannelPartialRequest, decodeUpdateChannelPartialResponse, - encodeUpdateChannelRequest, decodeUpdateChannelResponse, - encodeUpdateChannelTypeRequest, decodeUpdateChannelTypeResponse, - encodeUpdateCommandRequest, decodeUpdateCommandResponse, - encodeUpdateMessagePartialRequest, decodeUpdateMessagePartialResponse, - encodeUpdateMessageRequest, decodeUpdateMessageResponse, - encodeUpdatePollOptionRequest, - encodeUpdatePollPartialRequest, - encodeUpdatePollRequest, - encodeUpdateThreadPartialRequest, decodeUpdateThreadPartialResponse, decodeWrappedUnreadCountsResponse, } from '../models-transform'; @@ -210,20 +164,17 @@ export class ChatApi extends BaseApi { queryChannels = async ( request?: QueryChannelsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - member_limit: requestCopy.member_limit, - message_limit: requestCopy.message_limit, - offset: requestCopy.offset, - state: requestCopy.state, - user_id: requestCopy.user_id, - sort: requestCopy.sort, - filter_conditions: requestCopy.filter_conditions, - user: requestCopy.user, - }; - encodeQueryChannelsRequest(body); + limit: request?.limit, + member_limit: request?.member_limit, + message_limit: request?.message_limit, + offset: request?.offset, + state: request?.state, + user_id: request?.user_id, + sort: request?.sort, + filter_conditions: request?.filter_conditions, + user: request?.user, + }; const response = await this.sendRequest< StreamResponse @@ -237,13 +188,10 @@ export class ChatApi extends BaseApi { deleteChannels = async ( request: DeleteChannelsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - cids: requestCopy.cids, - hard_delete: requestCopy.hard_delete, + cids: request?.cids, + hard_delete: request?.hard_delete, }; - encodeDeleteChannelsRequest(body); const response = await this.sendRequest< StreamResponse @@ -257,14 +205,11 @@ export class ChatApi extends BaseApi { markChannelsRead = async ( request?: MarkChannelsReadRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_id: requestCopy.user_id, - read_by_channel: requestCopy.read_by_channel, - user: requestCopy.user, + user_id: request?.user_id, + read_by_channel: request?.read_by_channel, + user: request?.user, }; - encodeMarkChannelsReadRequest(body); const response = await this.sendRequest>( 'POST', @@ -282,21 +227,18 @@ export class ChatApi extends BaseApi { getOrCreateDistinctChannel = async ( request: ChannelGetOrCreateRequest & { type: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, + type: request?.type, }; const body = { - hide_for_creator: requestCopy.hide_for_creator, - state: requestCopy.state, - thread_unread_counts: requestCopy.thread_unread_counts, - data: requestCopy.data, - members: requestCopy.members, - messages: requestCopy.messages, - watchers: requestCopy.watchers, + hide_for_creator: request?.hide_for_creator, + state: request?.state, + thread_unread_counts: request?.thread_unread_counts, + data: request?.data, + members: request?.members, + messages: request?.messages, + watchers: request?.watchers, }; - encodeChannelGetOrCreateRequest(body); const response = await this.sendRequest< StreamResponse @@ -318,14 +260,12 @@ export class ChatApi extends BaseApi { id: string; hard_delete?: boolean; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - hard_delete: requestCopy.hard_delete, + hard_delete: request?.hard_delete, }; const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -340,19 +280,16 @@ export class ChatApi extends BaseApi { updateChannelPartial = async ( request: UpdateChannelPartialRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, - unset: requestCopy.unset, - set: requestCopy.set, - user: requestCopy.user, + user_id: request?.user_id, + unset: request?.unset, + set: request?.set, + user: request?.user, }; - encodeUpdateChannelPartialRequest(body); const response = await this.sendRequest< StreamResponse @@ -372,30 +309,27 @@ export class ChatApi extends BaseApi { updateChannel = async ( request: UpdateChannelRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - accept_invite: requestCopy.accept_invite, - cooldown: requestCopy.cooldown, - hide_history: requestCopy.hide_history, - reject_invite: requestCopy.reject_invite, - skip_push: requestCopy.skip_push, - user_id: requestCopy.user_id, - add_members: requestCopy.add_members, - add_moderators: requestCopy.add_moderators, - assign_roles: requestCopy.assign_roles, - demote_moderators: requestCopy.demote_moderators, - invites: requestCopy.invites, - remove_members: requestCopy.remove_members, - data: requestCopy.data, - message: requestCopy.message, - user: requestCopy.user, - }; - encodeUpdateChannelRequest(body); + accept_invite: request?.accept_invite, + cooldown: request?.cooldown, + hide_history: request?.hide_history, + reject_invite: request?.reject_invite, + skip_push: request?.skip_push, + user_id: request?.user_id, + add_members: request?.add_members, + add_moderators: request?.add_moderators, + assign_roles: request?.assign_roles, + demote_moderators: request?.demote_moderators, + invites: request?.invites, + remove_members: request?.remove_members, + data: request?.data, + message: request?.message, + user: request?.user, + }; const response = await this.sendRequest< StreamResponse @@ -409,16 +343,13 @@ export class ChatApi extends BaseApi { sendEvent = async ( request: SendEventRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - event: requestCopy.event, + event: request?.event, }; - encodeSendEventRequest(body); const response = await this.sendRequest>( 'POST', @@ -438,14 +369,12 @@ export class ChatApi extends BaseApi { id: string; url?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - url: requestCopy.url, + url: request?.url, }; const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest>( @@ -463,17 +392,14 @@ export class ChatApi extends BaseApi { uploadFile = async ( request: FileUploadRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - file: requestCopy.file, - user: requestCopy.user, + file: request?.file, + user: request?.user, }; - encodeFileUploadRequest(body); const response = await this.sendRequest>( 'POST', @@ -491,18 +417,15 @@ export class ChatApi extends BaseApi { hideChannel = async ( request: HideChannelRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - clear_history: requestCopy.clear_history, - user_id: requestCopy.user_id, - user: requestCopy.user, + clear_history: request?.clear_history, + user_id: request?.user_id, + user: request?.user, }; - encodeHideChannelRequest(body); const response = await this.sendRequest< StreamResponse @@ -524,14 +447,12 @@ export class ChatApi extends BaseApi { id: string; url?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - url: requestCopy.url, + url: request?.url, }; const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest>( @@ -549,18 +470,15 @@ export class ChatApi extends BaseApi { uploadImage = async ( request: ImageUploadRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - file: requestCopy.file, - upload_sizes: requestCopy.upload_sizes, - user: requestCopy.user, + file: request?.file, + upload_sizes: request?.upload_sizes, + user: request?.user, }; - encodeImageUploadRequest(body); const response = await this.sendRequest< StreamResponse @@ -580,22 +498,19 @@ export class ChatApi extends BaseApi { sendMessage = async ( request: SendMessageRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - message: requestCopy.message, - force_moderation: requestCopy.force_moderation, - keep_channel_hidden: requestCopy.keep_channel_hidden, - pending: requestCopy.pending, - skip_enrich_url: requestCopy.skip_enrich_url, - skip_push: requestCopy.skip_push, - pending_message_metadata: requestCopy.pending_message_metadata, + message: request?.message, + force_moderation: request?.force_moderation, + keep_channel_hidden: request?.keep_channel_hidden, + pending: request?.pending, + skip_enrich_url: request?.skip_enrich_url, + skip_push: request?.skip_push, + pending_message_metadata: request?.pending_message_metadata, }; - encodeSendMessageRequest(body); const response = await this.sendRequest< StreamResponse @@ -617,14 +532,12 @@ export class ChatApi extends BaseApi { id: string; ids: string[]; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - ids: requestCopy.ids, + ids: request?.ids, }; const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -644,22 +557,19 @@ export class ChatApi extends BaseApi { getOrCreateChannel = async ( request: ChannelGetOrCreateRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - hide_for_creator: requestCopy.hide_for_creator, - state: requestCopy.state, - thread_unread_counts: requestCopy.thread_unread_counts, - data: requestCopy.data, - members: requestCopy.members, - messages: requestCopy.messages, - watchers: requestCopy.watchers, + hide_for_creator: request?.hide_for_creator, + state: request?.state, + thread_unread_counts: request?.thread_unread_counts, + data: request?.data, + members: request?.members, + messages: request?.messages, + watchers: request?.watchers, }; - encodeChannelGetOrCreateRequest(body); const response = await this.sendRequest< StreamResponse @@ -679,19 +589,16 @@ export class ChatApi extends BaseApi { markRead = async ( request: MarkReadRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - message_id: requestCopy.message_id, - thread_id: requestCopy.thread_id, - user_id: requestCopy.user_id, - user: requestCopy.user, + message_id: request?.message_id, + thread_id: request?.thread_id, + user_id: request?.user_id, + user: request?.user, }; - encodeMarkReadRequest(body); const response = await this.sendRequest>( 'POST', @@ -709,17 +616,14 @@ export class ChatApi extends BaseApi { showChannel = async ( request: ShowChannelRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, - user: requestCopy.user, + user_id: request?.user_id, + user: request?.user, }; - encodeShowChannelRequest(body); const response = await this.sendRequest< StreamResponse @@ -739,21 +643,18 @@ export class ChatApi extends BaseApi { truncateChannel = async ( request: TruncateChannelRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - hard_delete: requestCopy.hard_delete, - skip_push: requestCopy.skip_push, - truncated_at: requestCopy.truncated_at, - user_id: requestCopy.user_id, - message: requestCopy.message, - user: requestCopy.user, + hard_delete: request?.hard_delete, + skip_push: request?.skip_push, + truncated_at: request?.truncated_at, + user_id: request?.user_id, + message: request?.message, + user: request?.user, }; - encodeTruncateChannelRequest(body); const response = await this.sendRequest< StreamResponse @@ -773,19 +674,16 @@ export class ChatApi extends BaseApi { markUnread = async ( request: MarkUnreadRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - message_id: requestCopy.message_id, - thread_id: requestCopy.thread_id, - user_id: requestCopy.user_id, - user: requestCopy.user, + message_id: request?.message_id, + thread_id: request?.thread_id, + user_id: request?.user_id, + user: request?.user, }; - encodeMarkUnreadRequest(body); const response = await this.sendRequest>( 'POST', @@ -815,35 +713,32 @@ export class ChatApi extends BaseApi { createChannelType = async ( request: CreateChannelTypeRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - automod: requestCopy.automod, - automod_behavior: requestCopy.automod_behavior, - max_message_length: requestCopy.max_message_length, - name: requestCopy.name, - blocklist: requestCopy.blocklist, - blocklist_behavior: requestCopy.blocklist_behavior, - connect_events: requestCopy.connect_events, - custom_events: requestCopy.custom_events, - mark_messages_pending: requestCopy.mark_messages_pending, - message_retention: requestCopy.message_retention, - mutes: requestCopy.mutes, - polls: requestCopy.polls, - push_notifications: requestCopy.push_notifications, - reactions: requestCopy.reactions, - read_events: requestCopy.read_events, - replies: requestCopy.replies, - search: requestCopy.search, - typing_events: requestCopy.typing_events, - uploads: requestCopy.uploads, - url_enrichment: requestCopy.url_enrichment, - blocklists: requestCopy.blocklists, - commands: requestCopy.commands, - permissions: requestCopy.permissions, - grants: requestCopy.grants, - }; - encodeCreateChannelTypeRequest(body); + automod: request?.automod, + automod_behavior: request?.automod_behavior, + max_message_length: request?.max_message_length, + name: request?.name, + blocklist: request?.blocklist, + blocklist_behavior: request?.blocklist_behavior, + connect_events: request?.connect_events, + custom_events: request?.custom_events, + mark_messages_pending: request?.mark_messages_pending, + message_retention: request?.message_retention, + mutes: request?.mutes, + polls: request?.polls, + push_notifications: request?.push_notifications, + reactions: request?.reactions, + read_events: request?.read_events, + replies: request?.replies, + search: request?.search, + typing_events: request?.typing_events, + uploads: request?.uploads, + url_enrichment: request?.url_enrichment, + blocklists: request?.blocklists, + commands: request?.commands, + permissions: request?.permissions, + grants: request?.grants, + }; const response = await this.sendRequest< StreamResponse @@ -857,10 +752,8 @@ export class ChatApi extends BaseApi { deleteChannelType = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest>( @@ -878,10 +771,8 @@ export class ChatApi extends BaseApi { getChannelType = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -896,40 +787,37 @@ export class ChatApi extends BaseApi { updateChannelType = async ( request: UpdateChannelTypeRequest & { name: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const body = { - automod: requestCopy.automod, - automod_behavior: requestCopy.automod_behavior, - max_message_length: requestCopy.max_message_length, - blocklist: requestCopy.blocklist, - blocklist_behavior: requestCopy.blocklist_behavior, - connect_events: requestCopy.connect_events, - custom_events: requestCopy.custom_events, - mark_messages_pending: requestCopy.mark_messages_pending, - mutes: requestCopy.mutes, - polls: requestCopy.polls, - push_notifications: requestCopy.push_notifications, - quotes: requestCopy.quotes, - reactions: requestCopy.reactions, - read_events: requestCopy.read_events, - reminders: requestCopy.reminders, - replies: requestCopy.replies, - search: requestCopy.search, - typing_events: requestCopy.typing_events, - uploads: requestCopy.uploads, - url_enrichment: requestCopy.url_enrichment, - allowed_flag_reasons: requestCopy.allowed_flag_reasons, - blocklists: requestCopy.blocklists, - commands: requestCopy.commands, - permissions: requestCopy.permissions, - automod_thresholds: requestCopy.automod_thresholds, - grants: requestCopy.grants, - }; - encodeUpdateChannelTypeRequest(body); + automod: request?.automod, + automod_behavior: request?.automod_behavior, + max_message_length: request?.max_message_length, + blocklist: request?.blocklist, + blocklist_behavior: request?.blocklist_behavior, + connect_events: request?.connect_events, + custom_events: request?.custom_events, + mark_messages_pending: request?.mark_messages_pending, + mutes: request?.mutes, + polls: request?.polls, + push_notifications: request?.push_notifications, + quotes: request?.quotes, + reactions: request?.reactions, + read_events: request?.read_events, + reminders: request?.reminders, + replies: request?.replies, + search: request?.search, + typing_events: request?.typing_events, + uploads: request?.uploads, + url_enrichment: request?.url_enrichment, + allowed_flag_reasons: request?.allowed_flag_reasons, + blocklists: request?.blocklists, + commands: request?.commands, + permissions: request?.permissions, + automod_thresholds: request?.automod_thresholds, + grants: request?.grants, + }; const response = await this.sendRequest< StreamResponse @@ -953,15 +841,12 @@ export class ChatApi extends BaseApi { createCommand = async ( request: CreateCommandRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - description: requestCopy.description, - name: requestCopy.name, - args: requestCopy.args, - set: requestCopy.set, + description: request?.description, + name: request?.name, + args: request?.args, + set: request?.set, }; - encodeCreateCommandRequest(body); const response = await this.sendRequest< StreamResponse @@ -975,10 +860,8 @@ export class ChatApi extends BaseApi { deleteCommand = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -993,10 +876,8 @@ export class ChatApi extends BaseApi { getCommand = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest>( @@ -1014,17 +895,14 @@ export class ChatApi extends BaseApi { updateCommand = async ( request: UpdateCommandRequest & { name: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const body = { - description: requestCopy.description, - args: requestCopy.args, - set: requestCopy.set, + description: request?.description, + args: request?.args, + set: request?.set, }; - encodeUpdateCommandRequest(body); const response = await this.sendRequest< StreamResponse @@ -1038,17 +916,14 @@ export class ChatApi extends BaseApi { exportChannels = async ( request: ExportChannelsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - channels: requestCopy.channels, - clear_deleted_message_text: requestCopy.clear_deleted_message_text, - export_users: requestCopy.export_users, - include_soft_deleted_channels: requestCopy.include_soft_deleted_channels, - include_truncated_messages: requestCopy.include_truncated_messages, - version: requestCopy.version, + channels: request?.channels, + clear_deleted_message_text: request?.clear_deleted_message_text, + export_users: request?.export_users, + include_soft_deleted_channels: request?.include_soft_deleted_channels, + include_truncated_messages: request?.include_truncated_messages, + version: request?.version, }; - encodeExportChannelsRequest(body); const response = await this.sendRequest< StreamResponse @@ -1062,10 +937,8 @@ export class ChatApi extends BaseApi { getExportChannelsStatus = async (request: { id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest< @@ -1080,12 +953,8 @@ export class ChatApi extends BaseApi { queryMembers = async (request?: { payload?: QueryMembersRequest; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - - encodeQueryMembersRequest(requestCopy.payload); - const queryParams = { - payload: requestCopy.payload, + payload: request?.payload, }; const response = await this.sendRequest>( @@ -1103,16 +972,13 @@ export class ChatApi extends BaseApi { queryMessageHistory = async ( request: QueryMessageHistoryRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - filter: requestCopy.filter, - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, + filter: request?.filter, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, }; - encodeQueryMessageHistoryRequest(body); const response = await this.sendRequest< StreamResponse @@ -1128,14 +994,12 @@ export class ChatApi extends BaseApi { hard?: boolean; deleted_by?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - hard: requestCopy.hard, - deleted_by: requestCopy.deleted_by, + hard: request?.hard, + deleted_by: request?.deleted_by, }; const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest< @@ -1151,13 +1015,11 @@ export class ChatApi extends BaseApi { id: string; show_deleted_message?: boolean; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - show_deleted_message: requestCopy.show_deleted_message, + show_deleted_message: request?.show_deleted_message, }; const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest>( @@ -1175,16 +1037,13 @@ export class ChatApi extends BaseApi { updateMessage = async ( request: UpdateMessageRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - message: requestCopy.message, - skip_enrich_url: requestCopy.skip_enrich_url, + message: request?.message, + skip_enrich_url: request?.skip_enrich_url, }; - encodeUpdateMessageRequest(body); const response = await this.sendRequest< StreamResponse @@ -1198,19 +1057,16 @@ export class ChatApi extends BaseApi { updateMessagePartial = async ( request: UpdateMessagePartialRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - skip_enrich_url: requestCopy.skip_enrich_url, - user_id: requestCopy.user_id, - unset: requestCopy.unset, - set: requestCopy.set, - user: requestCopy.user, + skip_enrich_url: request?.skip_enrich_url, + user_id: request?.user_id, + unset: request?.unset, + set: request?.set, + user: request?.user, }; - encodeUpdateMessagePartialRequest(body); const response = await this.sendRequest< StreamResponse @@ -1224,17 +1080,14 @@ export class ChatApi extends BaseApi { runMessageAction = async ( request: MessageActionRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - form_data: requestCopy.form_data, - user_id: requestCopy.user_id, - user: requestCopy.user, + form_data: request?.form_data, + user_id: request?.user_id, + user: request?.user, }; - encodeMessageActionRequest(body); const response = await this.sendRequest>( 'POST', @@ -1252,13 +1105,10 @@ export class ChatApi extends BaseApi { commitMessage = async ( request: CommitMessageRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = {}; - encodeCommitMessageRequest(body); const response = await this.sendRequest>( 'POST', @@ -1276,17 +1126,14 @@ export class ChatApi extends BaseApi { sendReaction = async ( request: SendReactionRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - reaction: requestCopy.reaction, - enforce_unique: requestCopy.enforce_unique, - skip_push: requestCopy.skip_push, + reaction: request?.reaction, + enforce_unique: request?.enforce_unique, + skip_push: request?.skip_push, }; - encodeSendReactionRequest(body); const response = await this.sendRequest< StreamResponse @@ -1308,14 +1155,12 @@ export class ChatApi extends BaseApi { type: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - id: requestCopy.id, - type: requestCopy.type, + id: request?.id, + type: request?.type, }; const response = await this.sendRequest< @@ -1337,14 +1182,12 @@ export class ChatApi extends BaseApi { limit?: number; offset?: number; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - limit: requestCopy.limit, - offset: requestCopy.offset, + limit: request?.limit, + offset: request?.offset, }; const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest< @@ -1359,21 +1202,18 @@ export class ChatApi extends BaseApi { queryReactions = async ( request: QueryReactionsRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - user_id: requestCopy.user_id, - sort: requestCopy.sort, - filter: requestCopy.filter, - user: requestCopy.user, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + user_id: request?.user_id, + sort: request?.sort, + filter: request?.filter, + user: request?.user, }; - encodeQueryReactionsRequest(body); const response = await this.sendRequest< StreamResponse @@ -1393,15 +1233,12 @@ export class ChatApi extends BaseApi { translateMessage = async ( request: TranslateMessageRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - language: requestCopy.language, + language: request?.language, }; - encodeTranslateMessageRequest(body); const response = await this.sendRequest>( 'POST', @@ -1419,16 +1256,13 @@ export class ChatApi extends BaseApi { undeleteMessage = async ( request: UpdateMessageRequest & { id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const body = { - message: requestCopy.message, - skip_enrich_url: requestCopy.skip_enrich_url, + message: request?.message, + skip_enrich_url: request?.skip_enrich_url, }; - encodeUpdateMessageRequest(body); const response = await this.sendRequest< StreamResponse @@ -1448,18 +1282,15 @@ export class ChatApi extends BaseApi { castPollVote = async ( request: CastPollVoteRequest & { message_id: string; poll_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - message_id: requestCopy.message_id, - poll_id: requestCopy.poll_id, + message_id: request?.message_id, + poll_id: request?.poll_id, }; const body = { - user_id: requestCopy.user_id, - user: requestCopy.user, - vote: requestCopy.vote, + user_id: request?.user_id, + user: request?.user, + vote: request?.vote, }; - encodeCastPollVoteRequest(body); const response = await this.sendRequest>( 'POST', @@ -1480,15 +1311,13 @@ export class ChatApi extends BaseApi { vote_id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - message_id: requestCopy.message_id, - poll_id: requestCopy.poll_id, - vote_id: requestCopy.vote_id, + message_id: request?.message_id, + poll_id: request?.poll_id, + vote_id: request?.vote_id, }; const response = await this.sendRequest>( @@ -1519,25 +1348,23 @@ export class ChatApi extends BaseApi { created_at_around?: Date; sort?: SortParamRequest[]; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - limit: requestCopy.limit, - offset: requestCopy.offset, - id_gte: requestCopy.id_gte, - id_gt: requestCopy.id_gt, - id_lte: requestCopy.id_lte, - id_lt: requestCopy.id_lt, - created_at_after_or_equal: requestCopy.created_at_after_or_equal, - created_at_after: requestCopy.created_at_after, - created_at_before_or_equal: requestCopy.created_at_before_or_equal, - created_at_before: requestCopy.created_at_before, - id_around: requestCopy.id_around, - created_at_around: requestCopy.created_at_around, - sort: requestCopy.sort, + limit: request?.limit, + offset: request?.offset, + id_gte: request?.id_gte, + id_gt: request?.id_gt, + id_lte: request?.id_lte, + id_lt: request?.id_lt, + created_at_after_or_equal: request?.created_at_after_or_equal, + created_at_after: request?.created_at_after, + created_at_before_or_equal: request?.created_at_before_or_equal, + created_at_before: request?.created_at_before, + id_around: request?.id_around, + created_at_around: request?.created_at_around, + sort: request?.sort, }; const pathParams = { - parent_id: requestCopy.parent_id, + parent_id: request?.parent_id, }; const response = await this.sendRequest>( @@ -1555,12 +1382,8 @@ export class ChatApi extends BaseApi { queryMessageFlags = async (request?: { payload?: QueryMessageFlagsRequest; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - - encodeQueryMessageFlagsRequest(requestCopy.payload); - const queryParams = { - payload: requestCopy.payload, + payload: request?.payload, }; const response = await this.sendRequest< @@ -1575,15 +1398,12 @@ export class ChatApi extends BaseApi { muteChannel = async ( request?: MuteChannelRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - expiration: requestCopy.expiration, - user_id: requestCopy.user_id, - channel_cids: requestCopy.channel_cids, - user: requestCopy.user, + expiration: request?.expiration, + user_id: request?.user_id, + channel_cids: request?.channel_cids, + user: request?.user, }; - encodeMuteChannelRequest(body); const response = await this.sendRequest< StreamResponse @@ -1603,15 +1423,12 @@ export class ChatApi extends BaseApi { unmuteChannel = async ( request?: UnmuteChannelRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - expiration: requestCopy.expiration, - user_id: requestCopy.user_id, - channel_cids: requestCopy.channel_cids, - user: requestCopy.user, + expiration: request?.expiration, + user_id: request?.user_id, + channel_cids: request?.channel_cids, + user: request?.user, }; - encodeUnmuteChannelRequest(body); const response = await this.sendRequest>( 'POST', @@ -1629,24 +1446,21 @@ export class ChatApi extends BaseApi { createPoll = async ( request: CreatePollRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - name: requestCopy.name, - allow_answers: requestCopy.allow_answers, - allow_user_suggested_options: requestCopy.allow_user_suggested_options, - description: requestCopy.description, - enforce_unique_vote: requestCopy.enforce_unique_vote, - id: requestCopy.id, - is_closed: requestCopy.is_closed, - max_votes_allowed: requestCopy.max_votes_allowed, - user_id: requestCopy.user_id, - voting_visibility: requestCopy.voting_visibility, - options: requestCopy.options, - custom: requestCopy.custom, - user: requestCopy.user, - }; - encodeCreatePollRequest(body); + name: request?.name, + allow_answers: request?.allow_answers, + allow_user_suggested_options: request?.allow_user_suggested_options, + description: request?.description, + enforce_unique_vote: request?.enforce_unique_vote, + id: request?.id, + is_closed: request?.is_closed, + max_votes_allowed: request?.max_votes_allowed, + user_id: request?.user_id, + voting_visibility: request?.voting_visibility, + options: request?.options, + custom: request?.custom, + user: request?.user, + }; const response = await this.sendRequest>( 'POST', @@ -1664,24 +1478,21 @@ export class ChatApi extends BaseApi { updatePoll = async ( request: UpdatePollRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - id: requestCopy.id, - name: requestCopy.name, - allow_answers: requestCopy.allow_answers, - allow_user_suggested_options: requestCopy.allow_user_suggested_options, - description: requestCopy.description, - enforce_unique_vote: requestCopy.enforce_unique_vote, - is_closed: requestCopy.is_closed, - max_votes_allowed: requestCopy.max_votes_allowed, - user_id: requestCopy.user_id, - voting_visibility: requestCopy.voting_visibility, - options: requestCopy.options, - custom: requestCopy.custom, - user: requestCopy.user, - }; - encodeUpdatePollRequest(body); + id: request?.id, + name: request?.name, + allow_answers: request?.allow_answers, + allow_user_suggested_options: request?.allow_user_suggested_options, + description: request?.description, + enforce_unique_vote: request?.enforce_unique_vote, + is_closed: request?.is_closed, + max_votes_allowed: request?.max_votes_allowed, + user_id: request?.user_id, + voting_visibility: request?.voting_visibility, + options: request?.options, + custom: request?.custom, + user: request?.user, + }; const response = await this.sendRequest>( 'PUT', @@ -1699,19 +1510,16 @@ export class ChatApi extends BaseApi { queryPolls = async ( request?: QueryPollsRequest & { user_id?: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, - filter: requestCopy.filter, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter: request?.filter, }; - encodeQueryPollsRequest(body); const response = await this.sendRequest>( 'POST', @@ -1730,13 +1538,11 @@ export class ChatApi extends BaseApi { poll_id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const response = await this.sendRequest>( @@ -1755,13 +1561,11 @@ export class ChatApi extends BaseApi { poll_id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const response = await this.sendRequest>( @@ -1779,18 +1583,15 @@ export class ChatApi extends BaseApi { updatePollPartial = async ( request: UpdatePollPartialRequest & { poll_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const body = { - user_id: requestCopy.user_id, - unset: requestCopy.unset, - set: requestCopy.set, - user: requestCopy.user, + user_id: request?.user_id, + unset: request?.unset, + set: request?.set, + user: request?.user, }; - encodeUpdatePollPartialRequest(body); const response = await this.sendRequest>( 'PATCH', @@ -1808,19 +1609,16 @@ export class ChatApi extends BaseApi { createPollOption = async ( request: CreatePollOptionRequest & { poll_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const body = { - text: requestCopy.text, - position: requestCopy.position, - user_id: requestCopy.user_id, - custom: requestCopy.custom, - user: requestCopy.user, + text: request?.text, + position: request?.position, + user_id: request?.user_id, + custom: request?.custom, + user: request?.user, }; - encodeCreatePollOptionRequest(body); const response = await this.sendRequest>( 'POST', @@ -1838,19 +1636,16 @@ export class ChatApi extends BaseApi { updatePollOption = async ( request: UpdatePollOptionRequest & { poll_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const body = { - id: requestCopy.id, - text: requestCopy.text, - user_id: requestCopy.user_id, - custom: requestCopy.custom, - user: requestCopy.user, + id: request?.id, + text: request?.text, + user_id: request?.user_id, + custom: request?.custom, + user: request?.user, }; - encodeUpdatePollOptionRequest(body); const response = await this.sendRequest>( 'PUT', @@ -1870,14 +1665,12 @@ export class ChatApi extends BaseApi { option_id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - poll_id: requestCopy.poll_id, - option_id: requestCopy.option_id, + poll_id: request?.poll_id, + option_id: request?.option_id, }; const response = await this.sendRequest>( @@ -1897,14 +1690,12 @@ export class ChatApi extends BaseApi { option_id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - poll_id: requestCopy.poll_id, - option_id: requestCopy.option_id, + poll_id: request?.poll_id, + option_id: request?.option_id, }; const response = await this.sendRequest>( @@ -1922,22 +1713,19 @@ export class ChatApi extends BaseApi { queryPollVotes = async ( request: QueryPollVotesRequest & { poll_id: string; user_id?: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const pathParams = { - poll_id: requestCopy.poll_id, + poll_id: request?.poll_id, }; const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, - filter: requestCopy.filter, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter: request?.filter, }; - encodeQueryPollVotesRequest(body); const response = await this.sendRequest>( 'POST', @@ -1955,12 +1743,8 @@ export class ChatApi extends BaseApi { queryBannedUsers = async (request?: { payload?: QueryBannedUsersRequest; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - - encodeQueryBannedUsersRequest(requestCopy.payload); - const queryParams = { - payload: requestCopy.payload, + payload: request?.payload, }; const response = await this.sendRequest< @@ -1975,12 +1759,8 @@ export class ChatApi extends BaseApi { search = async (request?: { payload?: SearchRequest; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - - encodeSearchRequest(requestCopy.payload); - const queryParams = { - payload: requestCopy.payload, + payload: request?.payload, }; const response = await this.sendRequest>( @@ -1998,19 +1778,16 @@ export class ChatApi extends BaseApi { queryThreads = async ( request?: QueryThreadsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - member_limit: requestCopy.member_limit, - next: requestCopy.next, - participant_limit: requestCopy.participant_limit, - prev: requestCopy.prev, - reply_limit: requestCopy.reply_limit, - user_id: requestCopy.user_id, - user: requestCopy.user, + limit: request?.limit, + member_limit: request?.member_limit, + next: request?.next, + participant_limit: request?.participant_limit, + prev: request?.prev, + reply_limit: request?.reply_limit, + user_id: request?.user_id, + user: request?.user, }; - encodeQueryThreadsRequest(body); const response = await this.sendRequest< StreamResponse @@ -2028,16 +1805,14 @@ export class ChatApi extends BaseApi { participant_limit?: number; member_limit?: number; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - connection_id: requestCopy.connection_id, - reply_limit: requestCopy.reply_limit, - participant_limit: requestCopy.participant_limit, - member_limit: requestCopy.member_limit, + connection_id: request?.connection_id, + reply_limit: request?.reply_limit, + participant_limit: request?.participant_limit, + member_limit: request?.member_limit, }; const pathParams = { - message_id: requestCopy.message_id, + message_id: request?.message_id, }; const response = await this.sendRequest>( @@ -2055,18 +1830,15 @@ export class ChatApi extends BaseApi { updateThreadPartial = async ( request: UpdateThreadPartialRequest & { message_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - message_id: requestCopy.message_id, + message_id: request?.message_id, }; const body = { - user_id: requestCopy.user_id, - unset: requestCopy.unset, - set: requestCopy.set, - user: requestCopy.user, + user_id: request?.user_id, + unset: request?.unset, + set: request?.set, + user: request?.user, }; - encodeUpdateThreadPartialRequest(body); const response = await this.sendRequest< StreamResponse @@ -2098,12 +1870,9 @@ export class ChatApi extends BaseApi { unreadCountsBatch = async ( request: UnreadCountsBatchRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, + user_ids: request?.user_ids, }; - encodeUnreadCountsBatchRequest(body); const response = await this.sendRequest< StreamResponse @@ -2117,15 +1886,12 @@ export class ChatApi extends BaseApi { sendUserCustomEvent = async ( request: SendUserCustomEventRequest & { user_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const body = { - event: requestCopy.event, + event: request?.event, }; - encodeSendUserCustomEventRequest(body); const response = await this.sendRequest>( 'POST', diff --git a/src/gen/common/CommonApi.ts b/src/gen/common/CommonApi.ts index bdd7b6f..a4d323a 100644 --- a/src/gen/common/CommonApi.ts +++ b/src/gen/common/CommonApi.ts @@ -68,36 +68,21 @@ import { UpsertPushProviderResponse, } from '../models'; import { - encodeBlockUsersRequest, decodeBlockUsersResponse, decodeCheckExternalStorageResponse, - encodeCheckPushRequest, decodeCheckPushResponse, - encodeCheckSNSRequest, decodeCheckSNSResponse, - encodeCheckSQSRequest, decodeCheckSQSResponse, - encodeCreateBlockListRequest, - encodeCreateDeviceRequest, - encodeCreateExternalStorageRequest, decodeCreateExternalStorageResponse, - encodeCreateGuestRequest, decodeCreateGuestResponse, - encodeCreateImportRequest, decodeCreateImportResponse, - encodeCreateImportURLRequest, decodeCreateImportURLResponse, - encodeCreateRoleRequest, decodeCreateRoleResponse, - encodeDeactivateUserRequest, decodeDeactivateUserResponse, - encodeDeactivateUsersRequest, decodeDeactivateUsersResponse, decodeDeleteExternalStorageResponse, - encodeDeleteUsersRequest, decodeDeleteUsersResponse, decodeExportUserResponse, - encodeExportUsersRequest, decodeExportUsersResponse, decodeGetApplicationResponse, decodeGetBlockListResponse, @@ -114,24 +99,13 @@ import { decodeListPermissionsResponse, decodeListPushProvidersResponse, decodeListRolesResponse, - encodeQueryUsersPayload, decodeQueryUsersResponse, - encodeReactivateUserRequest, decodeReactivateUserResponse, - encodeReactivateUsersRequest, decodeReactivateUsersResponse, decodeResponse, - encodeRestoreUsersRequest, - encodeUnblockUsersRequest, decodeUnblockUsersResponse, - encodeUpdateAppRequest, - encodeUpdateBlockListRequest, - encodeUpdateExternalStorageRequest, decodeUpdateExternalStorageResponse, - encodeUpdateUsersPartialRequest, - encodeUpdateUsersRequest, decodeUpdateUsersResponse, - encodeUpsertPushProviderRequest, decodeUpsertPushProviderResponse, } from '../models-transform'; @@ -149,55 +123,52 @@ export class CommonApi extends BaseApi { updateApp = async ( request?: UpdateAppRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - async_url_enrich_enabled: requestCopy.async_url_enrich_enabled, - auto_translation_enabled: requestCopy.auto_translation_enabled, - before_message_send_hook_url: requestCopy.before_message_send_hook_url, - cdn_expiration_seconds: requestCopy.cdn_expiration_seconds, - channel_hide_members_only: requestCopy.channel_hide_members_only, - custom_action_handler_url: requestCopy.custom_action_handler_url, - disable_auth_checks: requestCopy.disable_auth_checks, - disable_permissions_checks: requestCopy.disable_permissions_checks, - enforce_unique_usernames: requestCopy.enforce_unique_usernames, - feeds_moderation_enabled: requestCopy.feeds_moderation_enabled, - feeds_v2_region: requestCopy.feeds_v2_region, - image_moderation_enabled: requestCopy.image_moderation_enabled, - migrate_permissions_to_v2: requestCopy.migrate_permissions_to_v2, - moderation_webhook_url: requestCopy.moderation_webhook_url, - multi_tenant_enabled: requestCopy.multi_tenant_enabled, - permission_version: requestCopy.permission_version, - reminders_interval: requestCopy.reminders_interval, - reminders_max_members: requestCopy.reminders_max_members, - revoke_tokens_issued_before: requestCopy.revoke_tokens_issued_before, - sns_key: requestCopy.sns_key, - sns_secret: requestCopy.sns_secret, - sns_topic_arn: requestCopy.sns_topic_arn, - sqs_key: requestCopy.sqs_key, - sqs_secret: requestCopy.sqs_secret, - sqs_url: requestCopy.sqs_url, - video_provider: requestCopy.video_provider, - webhook_url: requestCopy.webhook_url, - allowed_flag_reasons: requestCopy.allowed_flag_reasons, - image_moderation_block_labels: requestCopy.image_moderation_block_labels, - image_moderation_labels: requestCopy.image_moderation_labels, - user_search_disallowed_roles: requestCopy.user_search_disallowed_roles, - webhook_events: requestCopy.webhook_events, - agora_options: requestCopy.agora_options, - apn_config: requestCopy.apn_config, - async_moderation_config: requestCopy.async_moderation_config, - datadog_info: requestCopy.datadog_info, - file_upload_config: requestCopy.file_upload_config, - firebase_config: requestCopy.firebase_config, - grants: requestCopy.grants, - hms_options: requestCopy.hms_options, - huawei_config: requestCopy.huawei_config, - image_upload_config: requestCopy.image_upload_config, - push_config: requestCopy.push_config, - xiaomi_config: requestCopy.xiaomi_config, + async_url_enrich_enabled: request?.async_url_enrich_enabled, + auto_translation_enabled: request?.auto_translation_enabled, + before_message_send_hook_url: request?.before_message_send_hook_url, + cdn_expiration_seconds: request?.cdn_expiration_seconds, + channel_hide_members_only: request?.channel_hide_members_only, + custom_action_handler_url: request?.custom_action_handler_url, + disable_auth_checks: request?.disable_auth_checks, + disable_permissions_checks: request?.disable_permissions_checks, + enforce_unique_usernames: request?.enforce_unique_usernames, + feeds_moderation_enabled: request?.feeds_moderation_enabled, + feeds_v2_region: request?.feeds_v2_region, + image_moderation_enabled: request?.image_moderation_enabled, + migrate_permissions_to_v2: request?.migrate_permissions_to_v2, + moderation_webhook_url: request?.moderation_webhook_url, + multi_tenant_enabled: request?.multi_tenant_enabled, + permission_version: request?.permission_version, + reminders_interval: request?.reminders_interval, + reminders_max_members: request?.reminders_max_members, + revoke_tokens_issued_before: request?.revoke_tokens_issued_before, + sns_key: request?.sns_key, + sns_secret: request?.sns_secret, + sns_topic_arn: request?.sns_topic_arn, + sqs_key: request?.sqs_key, + sqs_secret: request?.sqs_secret, + sqs_url: request?.sqs_url, + video_provider: request?.video_provider, + webhook_url: request?.webhook_url, + allowed_flag_reasons: request?.allowed_flag_reasons, + image_moderation_block_labels: request?.image_moderation_block_labels, + image_moderation_labels: request?.image_moderation_labels, + user_search_disallowed_roles: request?.user_search_disallowed_roles, + webhook_events: request?.webhook_events, + agora_options: request?.agora_options, + apn_config: request?.apn_config, + async_moderation_config: request?.async_moderation_config, + datadog_info: request?.datadog_info, + file_upload_config: request?.file_upload_config, + firebase_config: request?.firebase_config, + grants: request?.grants, + hms_options: request?.hms_options, + huawei_config: request?.huawei_config, + image_upload_config: request?.image_upload_config, + push_config: request?.push_config, + xiaomi_config: request?.xiaomi_config, }; - encodeUpdateAppRequest(body); const response = await this.sendRequest>( 'PATCH', @@ -225,14 +196,11 @@ export class CommonApi extends BaseApi { createBlockList = async ( request: CreateBlockListRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - name: requestCopy.name, - words: requestCopy.words, - type: requestCopy.type, + name: request?.name, + words: request?.words, + type: request?.type, }; - encodeCreateBlockListRequest(body); const response = await this.sendRequest>( 'POST', @@ -250,10 +218,8 @@ export class CommonApi extends BaseApi { deleteBlockList = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest>( @@ -271,10 +237,8 @@ export class CommonApi extends BaseApi { getBlockList = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -289,15 +253,12 @@ export class CommonApi extends BaseApi { updateBlockList = async ( request: UpdateBlockListRequest & { name: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const body = { - words: requestCopy.words, + words: request?.words, }; - encodeUpdateBlockListRequest(body); const response = await this.sendRequest>( 'PUT', @@ -315,20 +276,17 @@ export class CommonApi extends BaseApi { checkPush = async ( request?: CheckPushRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - apn_template: requestCopy.apn_template, - firebase_data_template: requestCopy.firebase_data_template, - firebase_template: requestCopy.firebase_template, - message_id: requestCopy.message_id, - push_provider_name: requestCopy.push_provider_name, - push_provider_type: requestCopy.push_provider_type, - skip_devices: requestCopy.skip_devices, - user_id: requestCopy.user_id, - user: requestCopy.user, + apn_template: request?.apn_template, + firebase_data_template: request?.firebase_data_template, + firebase_template: request?.firebase_template, + message_id: request?.message_id, + push_provider_name: request?.push_provider_name, + push_provider_type: request?.push_provider_type, + skip_devices: request?.skip_devices, + user_id: request?.user_id, + user: request?.user, }; - encodeCheckPushRequest(body); const response = await this.sendRequest>( 'POST', @@ -346,14 +304,11 @@ export class CommonApi extends BaseApi { checkSNS = async ( request?: CheckSNSRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - sns_key: requestCopy.sns_key, - sns_secret: requestCopy.sns_secret, - sns_topic_arn: requestCopy.sns_topic_arn, + sns_key: request?.sns_key, + sns_secret: request?.sns_secret, + sns_topic_arn: request?.sns_topic_arn, }; - encodeCheckSNSRequest(body); const response = await this.sendRequest>( 'POST', @@ -371,14 +326,11 @@ export class CommonApi extends BaseApi { checkSQS = async ( request?: CheckSQSRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - sqs_key: requestCopy.sqs_key, - sqs_secret: requestCopy.sqs_secret, - sqs_url: requestCopy.sqs_url, + sqs_key: request?.sqs_key, + sqs_secret: request?.sqs_secret, + sqs_url: request?.sqs_url, }; - encodeCheckSQSRequest(body); const response = await this.sendRequest>( 'POST', @@ -397,11 +349,9 @@ export class CommonApi extends BaseApi { id: string; user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - id: requestCopy.id, - user_id: requestCopy.user_id, + id: request?.id, + user_id: request?.user_id, }; const response = await this.sendRequest>( @@ -419,10 +369,8 @@ export class CommonApi extends BaseApi { listDevices = async (request?: { user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const response = await this.sendRequest< @@ -437,17 +385,14 @@ export class CommonApi extends BaseApi { createDevice = async ( request: CreateDeviceRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - id: requestCopy.id, - push_provider: requestCopy.push_provider, - push_provider_name: requestCopy.push_provider_name, - user_id: requestCopy.user_id, - voip_token: requestCopy.voip_token, - user: requestCopy.user, + id: request?.id, + push_provider: request?.push_provider, + push_provider_name: request?.push_provider_name, + user_id: request?.user_id, + voip_token: request?.voip_token, + user: request?.user, }; - encodeCreateDeviceRequest(body); const response = await this.sendRequest>( 'POST', @@ -465,12 +410,9 @@ export class CommonApi extends BaseApi { exportUsers = async ( request: ExportUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, + user_ids: request?.user_ids, }; - encodeExportUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -496,18 +438,15 @@ export class CommonApi extends BaseApi { createExternalStorage = async ( request: CreateExternalStorageRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - bucket: requestCopy.bucket, - name: requestCopy.name, - storage_type: requestCopy.storage_type, - gcs_credentials: requestCopy.gcs_credentials, - path: requestCopy.path, - aws_s3: requestCopy.aws_s3, - azure_blob: requestCopy.azure_blob, + bucket: request?.bucket, + name: request?.name, + storage_type: request?.storage_type, + gcs_credentials: request?.gcs_credentials, + path: request?.path, + aws_s3: request?.aws_s3, + azure_blob: request?.azure_blob, }; - encodeCreateExternalStorageRequest(body); const response = await this.sendRequest< StreamResponse @@ -521,10 +460,8 @@ export class CommonApi extends BaseApi { deleteExternalStorage = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -539,20 +476,17 @@ export class CommonApi extends BaseApi { updateExternalStorage = async ( request: UpdateExternalStorageRequest & { name: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const body = { - bucket: requestCopy.bucket, - storage_type: requestCopy.storage_type, - gcs_credentials: requestCopy.gcs_credentials, - path: requestCopy.path, - aws_s3: requestCopy.aws_s3, - azure_blob: requestCopy.azure_blob, + bucket: request?.bucket, + storage_type: request?.storage_type, + gcs_credentials: request?.gcs_credentials, + path: request?.path, + aws_s3: request?.aws_s3, + azure_blob: request?.azure_blob, }; - encodeUpdateExternalStorageRequest(body); const response = await this.sendRequest< StreamResponse @@ -566,10 +500,8 @@ export class CommonApi extends BaseApi { checkExternalStorage = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -584,12 +516,9 @@ export class CommonApi extends BaseApi { createGuest = async ( request: CreateGuestRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user: requestCopy.user, + user: request?.user, }; - encodeCreateGuestRequest(body); const response = await this.sendRequest< StreamResponse @@ -603,12 +532,9 @@ export class CommonApi extends BaseApi { createImportURL = async ( request?: CreateImportURLRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - filename: requestCopy.filename, + filename: request?.filename, }; - encodeCreateImportURLRequest(body); const response = await this.sendRequest< StreamResponse @@ -632,13 +558,10 @@ export class CommonApi extends BaseApi { createImport = async ( request: CreateImportRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - mode: requestCopy.mode, - path: requestCopy.path, + mode: request?.mode, + path: request?.path, }; - encodeCreateImportRequest(body); const response = await this.sendRequest< StreamResponse @@ -652,10 +575,8 @@ export class CommonApi extends BaseApi { getImport = async (request: { id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest>( @@ -673,10 +594,8 @@ export class CommonApi extends BaseApi { getOG = async (request: { url: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - url: requestCopy.url, + url: request?.url, }; const response = await this.sendRequest>( @@ -706,10 +625,8 @@ export class CommonApi extends BaseApi { getPermission = async (request: { id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest< @@ -736,12 +653,9 @@ export class CommonApi extends BaseApi { upsertPushProvider = async ( request?: UpsertPushProviderRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - push_provider: requestCopy.push_provider, + push_provider: request?.push_provider, }; - encodeUpsertPushProviderRequest(body); const response = await this.sendRequest< StreamResponse @@ -756,11 +670,9 @@ export class CommonApi extends BaseApi { type: string; name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - name: requestCopy.name, + type: request?.type, + name: request?.name, }; const response = await this.sendRequest>( @@ -782,14 +694,12 @@ export class CommonApi extends BaseApi { web?: boolean; endpoints?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - server_side: requestCopy.server_side, - android: requestCopy.android, - ios: requestCopy.ios, - web: requestCopy.web, - endpoints: requestCopy.endpoints, + server_side: request?.server_side, + android: request?.android, + ios: request?.ios, + web: request?.web, + endpoints: request?.endpoints, }; const response = await this.sendRequest< @@ -817,12 +727,9 @@ export class CommonApi extends BaseApi { createRole = async ( request: CreateRoleRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - name: requestCopy.name, + name: request?.name, }; - encodeCreateRoleRequest(body); const response = await this.sendRequest>( 'POST', @@ -840,10 +747,8 @@ export class CommonApi extends BaseApi { deleteRole = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest>( @@ -861,10 +766,8 @@ export class CommonApi extends BaseApi { getTask = async (request: { id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest>( @@ -882,12 +785,8 @@ export class CommonApi extends BaseApi { queryUsers = async (request?: { payload?: QueryUsersPayload; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - - encodeQueryUsersPayload(requestCopy.payload); - const queryParams = { - payload: requestCopy.payload, + payload: request?.payload, }; const response = await this.sendRequest>( @@ -905,12 +804,9 @@ export class CommonApi extends BaseApi { updateUsersPartial = async ( request: UpdateUsersPartialRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - users: requestCopy.users, + users: request?.users, }; - encodeUpdateUsersPartialRequest(body); const response = await this.sendRequest< StreamResponse @@ -924,12 +820,9 @@ export class CommonApi extends BaseApi { updateUsers = async ( request: UpdateUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - users: requestCopy.users, + users: request?.users, }; - encodeUpdateUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -943,10 +836,8 @@ export class CommonApi extends BaseApi { getBlockedUsers = async (request?: { user_id?: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const response = await this.sendRequest< @@ -961,14 +852,11 @@ export class CommonApi extends BaseApi { blockUsers = async ( request: BlockUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - blocked_user_id: requestCopy.blocked_user_id, - user_id: requestCopy.user_id, - user: requestCopy.user, + blocked_user_id: request?.blocked_user_id, + user_id: request?.user_id, + user: request?.user, }; - encodeBlockUsersRequest(body); const response = await this.sendRequest>( 'POST', @@ -986,15 +874,12 @@ export class CommonApi extends BaseApi { deactivateUsers = async ( request: DeactivateUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, - created_by_id: requestCopy.created_by_id, - mark_channels_deleted: requestCopy.mark_channels_deleted, - mark_messages_deleted: requestCopy.mark_messages_deleted, + user_ids: request?.user_ids, + created_by_id: request?.created_by_id, + mark_channels_deleted: request?.mark_channels_deleted, + mark_messages_deleted: request?.mark_messages_deleted, }; - encodeDeactivateUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -1008,18 +893,15 @@ export class CommonApi extends BaseApi { deleteUsers = async ( request: DeleteUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, - calls: requestCopy.calls, - conversations: requestCopy.conversations, - messages: requestCopy.messages, - new_call_owner_id: requestCopy.new_call_owner_id, - new_channel_owner_id: requestCopy.new_channel_owner_id, - user: requestCopy.user, + user_ids: request?.user_ids, + calls: request?.calls, + conversations: request?.conversations, + messages: request?.messages, + new_call_owner_id: request?.new_call_owner_id, + new_channel_owner_id: request?.new_channel_owner_id, + user: request?.user, }; - encodeDeleteUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -1033,15 +915,12 @@ export class CommonApi extends BaseApi { reactivateUsers = async ( request: ReactivateUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, - created_by_id: requestCopy.created_by_id, - restore_channels: requestCopy.restore_channels, - restore_messages: requestCopy.restore_messages, + user_ids: request?.user_ids, + created_by_id: request?.created_by_id, + restore_channels: request?.restore_channels, + restore_messages: request?.restore_messages, }; - encodeReactivateUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -1055,12 +934,9 @@ export class CommonApi extends BaseApi { restoreUsers = async ( request: RestoreUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - user_ids: requestCopy.user_ids, + user_ids: request?.user_ids, }; - encodeRestoreUsersRequest(body); const response = await this.sendRequest>( 'POST', @@ -1078,14 +954,11 @@ export class CommonApi extends BaseApi { unblockUsers = async ( request: UnblockUsersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - blocked_user_id: requestCopy.blocked_user_id, - user_id: requestCopy.user_id, - user: requestCopy.user, + blocked_user_id: request?.blocked_user_id, + user_id: request?.user_id, + user: request?.user, }; - encodeUnblockUsersRequest(body); const response = await this.sendRequest< StreamResponse @@ -1099,16 +972,13 @@ export class CommonApi extends BaseApi { deactivateUser = async ( request: DeactivateUserRequest & { user_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const body = { - created_by_id: requestCopy.created_by_id, - mark_messages_deleted: requestCopy.mark_messages_deleted, + created_by_id: request?.created_by_id, + mark_messages_deleted: request?.mark_messages_deleted, }; - encodeDeactivateUserRequest(body); const response = await this.sendRequest< StreamResponse @@ -1128,10 +998,8 @@ export class CommonApi extends BaseApi { exportUser = async (request: { user_id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const response = await this.sendRequest>( @@ -1149,17 +1017,14 @@ export class CommonApi extends BaseApi { reactivateUser = async ( request: ReactivateUserRequest & { user_id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; const body = { - created_by_id: requestCopy.created_by_id, - name: requestCopy.name, - restore_messages: requestCopy.restore_messages, + created_by_id: request?.created_by_id, + name: request?.name, + restore_messages: request?.restore_messages, }; - encodeReactivateUserRequest(body); const response = await this.sendRequest< StreamResponse diff --git a/src/gen/models-transform/index.ts b/src/gen/models-transform/index.ts index 172675a..81e19dc 100644 --- a/src/gen/models-transform/index.ts +++ b/src/gen/models-transform/index.ts @@ -1,18 +1,3 @@ -const encodestring = (input?: string) => input; - -const encodenumber = (input?: number) => input; - -const encodeinteger = encodenumber; - -const encodeboolean = (input?: boolean) => input; - -const encodearray = (input?: any[]) => input; - -const encodeobject = (input?: object) => input; - -const encodeDatetimeType = (input?: Date | string) => - input ? new Date(input).toISOString() : input; - const decodestring = (input?: string) => input; const decodenumber = (input?: number) => input; @@ -28,33 +13,6 @@ const decodeobject = (input?: object) => input; const decodeDatetimeType = (input?: number) => input != null ? new Date(Math.floor(input / 1000000)) : input; -export const encodeAPIError = (input: Record) => { - if (!input) return input; - input.code = encodeinteger(input.code); - - input.duration = encodestring(input.duration); - - input.message = encodestring(input.message); - - input.more_info = encodestring(input.more_info); - - input.status_code = encodeinteger(input.status_code); - - if (input.details) { - Object.keys(input.details).forEach((key) => { - input.details[key] = encodeinteger(input.details[key]); - }); - } - - if (input.exception_fields) { - Object.keys(input.exception_fields).forEach((key) => { - input.exception_fields[key] = encodestring(input.exception_fields[key]); - }); - } - - return input; -}; - export const decodeAPIError = (input: Record) => { if (!input) return input; input.code = decodeinteger(input.code); @@ -82,31 +40,6 @@ export const decodeAPIError = (input: Record) => { return input; }; -export const encodeAPNConfig = (input: Record) => { - if (!input) return input; - input.auth_key = encodestring(input.auth_key); - - input.auth_type = encodestring(input.auth_type); - - input.bundle_id = encodestring(input.bundle_id); - - input.development = encodeboolean(input.development); - - input.disabled = encodeboolean(input.disabled); - - input.host = encodestring(input.host); - - input.key_id = encodestring(input.key_id); - - input.notification_template = encodestring(input.notification_template); - - input.p12_cert = encodestring(input.p12_cert); - - input.team_id = encodestring(input.team_id); - - return input; -}; - export const decodeAPNConfig = (input: Record) => { if (!input) return input; input.auth_key = decodestring(input.auth_key); @@ -132,31 +65,6 @@ export const decodeAPNConfig = (input: Record) => { return input; }; -export const encodeAPNConfigFields = (input: Record) => { - if (!input) return input; - input.development = encodeboolean(input.development); - - input.enabled = encodeboolean(input.enabled); - - input.notification_template = encodestring(input.notification_template); - - input.auth_key = encodestring(input.auth_key); - - input.auth_type = encodestring(input.auth_type); - - input.bundle_id = encodestring(input.bundle_id); - - input.host = encodestring(input.host); - - input.key_id = encodestring(input.key_id); - - input.p12_cert = encodestring(input.p12_cert); - - input.team_id = encodestring(input.team_id); - - return input; -}; - export const decodeAPNConfigFields = (input: Record) => { if (!input) return input; input.development = decodeboolean(input.development); @@ -182,15 +90,6 @@ export const decodeAPNConfigFields = (input: Record) => { return input; }; -export const encodeAPNS = (input: Record) => { - if (!input) return input; - input.body = encodestring(input.body); - - input.title = encodestring(input.title); - - return input; -}; - export const decodeAPNS = (input: Record) => { if (!input) return input; input.body = decodestring(input.body); @@ -200,19 +99,6 @@ export const decodeAPNS = (input: Record) => { return input; }; -export const encodeAWSRekognitionConfig = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - if (input.rules) { - Object.keys(input.rules).forEach((key) => { - input.rules[key] = encodeAWSRekognitionRule(input.rules[key]); - }); - } - - return input; -}; - export const decodeAWSRekognitionConfig = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -226,15 +112,6 @@ export const decodeAWSRekognitionConfig = (input: Record) => { return input; }; -export const encodeAWSRekognitionRule = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.label = encodestring(input.label); - - return input; -}; - export const decodeAWSRekognitionRule = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -244,21 +121,6 @@ export const decodeAWSRekognitionRule = (input: Record) => { return input; }; -export const encodeAction = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.text = encodestring(input.text); - - input.type = encodestring(input.type); - - input.style = encodestring(input.style); - - input.value = encodestring(input.value); - - return input; -}; - export const decodeAction = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -274,31 +136,6 @@ export const decodeAction = (input: Record) => { return input; }; -export const encodeActionLog = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.reason = encodestring(input.reason); - - input.review_queue_item_id = encodestring(input.review_queue_item_id); - - input.target_user_id = encodestring(input.target_user_id); - - input.type = encodestring(input.type); - - input.custom = encodeobject(input.custom); - - input.review_queue_item = encodeReviewQueueItem(input.review_queue_item); - - input.target_user = encodeUserObject(input.target_user); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeActionLog = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -324,27 +161,6 @@ export const decodeActionLog = (input: Record) => { return input; }; -export const encodeActionLogResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.reason = encodestring(input.reason); - - input.type = encodestring(input.type); - - input.custom = encodeobject(input.custom); - - input.review_queue_item = encodeReviewQueueItem(input.review_queue_item); - - input.target_user = encodeUserObject(input.target_user); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeActionLogResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -366,25 +182,6 @@ export const decodeActionLogResponse = (input: Record) => { return input; }; -export const encodeAggregatedStats = (input: Record) => { - if (!input) return input; - if (input.countrywise_aggregate_stats) { - Object.keys(input.countrywise_aggregate_stats).forEach((key) => { - input.countrywise_aggregate_stats[key] = encodeCountrywiseAggregateStats( - input.countrywise_aggregate_stats[key], - ); - }); - } - - input.publisher_aggregate_stats = encodePublisherAggregateStats( - input.publisher_aggregate_stats, - ); - - input.turn = encodeTURNAggregatedStats(input.turn); - - return input; -}; - export const decodeAggregatedStats = (input: Record) => { if (!input) return input; if (input.countrywise_aggregate_stats) { @@ -404,159 +201,6 @@ export const decodeAggregatedStats = (input: Record) => { return input; }; -export const encodeAppResponseFields = (input: Record) => { - if (!input) return input; - input.async_url_enrich_enabled = encodeboolean( - input.async_url_enrich_enabled, - ); - - input.auto_translation_enabled = encodeboolean( - input.auto_translation_enabled, - ); - - input.campaign_enabled = encodeboolean(input.campaign_enabled); - - input.cdn_expiration_seconds = encodeinteger(input.cdn_expiration_seconds); - - input.custom_action_handler_url = encodestring( - input.custom_action_handler_url, - ); - - input.disable_auth_checks = encodeboolean(input.disable_auth_checks); - - input.disable_permissions_checks = encodeboolean( - input.disable_permissions_checks, - ); - - input.enforce_unique_usernames = encodestring(input.enforce_unique_usernames); - - input.image_moderation_enabled = encodeboolean( - input.image_moderation_enabled, - ); - - input.moderation_enabled = encodeboolean(input.moderation_enabled); - - input.moderation_webhook_url = encodestring(input.moderation_webhook_url); - - input.multi_tenant_enabled = encodeboolean(input.multi_tenant_enabled); - - input.name = encodestring(input.name); - - input.organization = encodestring(input.organization); - - input.permission_version = encodestring(input.permission_version); - - input.polls_enabled = encodeboolean(input.polls_enabled); - - input.reminders_interval = encodeinteger(input.reminders_interval); - - input.sns_key = encodestring(input.sns_key); - - input.sns_secret = encodestring(input.sns_secret); - - input.sns_topic_arn = encodestring(input.sns_topic_arn); - - input.sqs_key = encodestring(input.sqs_key); - - input.sqs_secret = encodestring(input.sqs_secret); - - input.sqs_url = encodestring(input.sqs_url); - - input.suspended = encodeboolean(input.suspended); - - input.suspended_explanation = encodestring(input.suspended_explanation); - - input.video_provider = encodestring(input.video_provider); - - input.webhook_url = encodestring(input.webhook_url); - - if (input.user_search_disallowed_roles) { - Object.keys(input.user_search_disallowed_roles).forEach((key) => { - input.user_search_disallowed_roles[key] = encodestring( - input.user_search_disallowed_roles[key], - ); - }); - } - - if (input.webhook_events) { - Object.keys(input.webhook_events).forEach((key) => { - input.webhook_events[key] = encodestring(input.webhook_events[key]); - }); - } - - if (input.call_types) { - Object.keys(input.call_types).forEach((key) => { - input.call_types[key] = encodeCallType(input.call_types[key]); - }); - } - - if (input.channel_configs) { - Object.keys(input.channel_configs).forEach((key) => { - input.channel_configs[key] = encodeChannelConfig( - input.channel_configs[key], - ); - }); - } - - input.file_upload_config = encodeFileUploadConfig(input.file_upload_config); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.image_upload_config = encodeFileUploadConfig(input.image_upload_config); - - if (input.policies) { - Object.keys(input.policies).forEach((key) => { - input.policies[key] = encodearray(input.policies[key]); - }); - } - - input.push_notifications = encodePushNotificationFields( - input.push_notifications, - ); - - input.before_message_send_hook_url = encodestring( - input.before_message_send_hook_url, - ); - - input.revoke_tokens_issued_before = encodeDatetimeType( - input.revoke_tokens_issued_before, - ); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.geofences) { - Object.keys(input.geofences).forEach((key) => { - input.geofences[key] = encodeGeofenceResponse(input.geofences[key]); - }); - } - - if (input.image_moderation_labels) { - Object.keys(input.image_moderation_labels).forEach((key) => { - input.image_moderation_labels[key] = encodestring( - input.image_moderation_labels[key], - ); - }); - } - - input.agora_options = encodeConfig(input.agora_options); - - input.datadog_info = encodeDataDogInfo(input.datadog_info); - - input.hms_options = encodeConfig(input.hms_options); - - return input; -}; - export const decodeAppResponseFields = (input: Record) => { if (!input) return input; input.async_url_enrich_enabled = decodeboolean( @@ -710,17 +354,6 @@ export const decodeAppResponseFields = (input: Record) => { return input; }; -export const encodeAsyncModerationCallbackConfig = ( - input: Record, -) => { - if (!input) return input; - input.mode = encodestring(input.mode); - - input.server_url = encodestring(input.server_url); - - return input; -}; - export const decodeAsyncModerationCallbackConfig = ( input: Record, ) => { @@ -732,17 +365,6 @@ export const decodeAsyncModerationCallbackConfig = ( return input; }; -export const encodeAsyncModerationConfiguration = ( - input: Record, -) => { - if (!input) return input; - input.timeout_ms = encodeinteger(input.timeout_ms); - - input.callback = encodeAsyncModerationCallbackConfig(input.callback); - - return input; -}; - export const decodeAsyncModerationConfiguration = ( input: Record, ) => { @@ -754,74 +376,17 @@ export const decodeAsyncModerationConfiguration = ( return input; }; -export const encodeAttachment = (input: Record) => { +export const decodeAttachment = (input: Record) => { if (!input) return input; - input.custom = encodeobject(input.custom); + input.custom = decodeobject(input.custom); - input.asset_url = encodestring(input.asset_url); + input.asset_url = decodestring(input.asset_url); - input.author_icon = encodestring(input.author_icon); + input.author_icon = decodestring(input.author_icon); - input.author_link = encodestring(input.author_link); + input.author_link = decodestring(input.author_link); - input.author_name = encodestring(input.author_name); - - input.color = encodestring(input.color); - - input.fallback = encodestring(input.fallback); - - input.footer = encodestring(input.footer); - - input.footer_icon = encodestring(input.footer_icon); - - input.image_url = encodestring(input.image_url); - - input.og_scrape_url = encodestring(input.og_scrape_url); - - input.original_height = encodeinteger(input.original_height); - - input.original_width = encodeinteger(input.original_width); - - input.pretext = encodestring(input.pretext); - - input.text = encodestring(input.text); - - input.thumb_url = encodestring(input.thumb_url); - - input.title = encodestring(input.title); - - input.title_link = encodestring(input.title_link); - - input.type = encodestring(input.type); - - if (input.actions) { - Object.keys(input.actions).forEach((key) => { - input.actions[key] = encodeAction(input.actions[key]); - }); - } - - if (input.fields) { - Object.keys(input.fields).forEach((key) => { - input.fields[key] = encodeField(input.fields[key]); - }); - } - - input.giphy = encodeImages(input.giphy); - - return input; -}; - -export const decodeAttachment = (input: Record) => { - if (!input) return input; - input.custom = decodeobject(input.custom); - - input.asset_url = decodestring(input.asset_url); - - input.author_icon = decodestring(input.author_icon); - - input.author_link = decodestring(input.author_link); - - input.author_name = decodestring(input.author_name); + input.author_name = decodestring(input.author_name); input.color = decodestring(input.color); @@ -868,29 +433,6 @@ export const decodeAttachment = (input: Record) => { return input; }; -export const encodeAudioSettings = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.default_device = encodestring(input.default_device); - - input.mic_default_on = encodeboolean(input.mic_default_on); - - input.opus_dtx_enabled = encodeboolean(input.opus_dtx_enabled); - - input.redundant_coding_enabled = encodeboolean( - input.redundant_coding_enabled, - ); - - input.speaker_default_on = encodeboolean(input.speaker_default_on); - - input.noise_cancellation = encodeNoiseCancellationSettings( - input.noise_cancellation, - ); - - return input; -}; - export const decodeAudioSettings = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -914,29 +456,6 @@ export const decodeAudioSettings = (input: Record) => { return input; }; -export const encodeAudioSettingsRequest = (input: Record) => { - if (!input) return input; - input.default_device = encodestring(input.default_device); - - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.mic_default_on = encodeboolean(input.mic_default_on); - - input.opus_dtx_enabled = encodeboolean(input.opus_dtx_enabled); - - input.redundant_coding_enabled = encodeboolean( - input.redundant_coding_enabled, - ); - - input.speaker_default_on = encodeboolean(input.speaker_default_on); - - input.noise_cancellation = encodeNoiseCancellationSettings( - input.noise_cancellation, - ); - - return input; -}; - export const decodeAudioSettingsRequest = (input: Record) => { if (!input) return input; input.default_device = decodestring(input.default_device); @@ -960,29 +479,6 @@ export const decodeAudioSettingsRequest = (input: Record) => { return input; }; -export const encodeAudioSettingsResponse = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.default_device = encodestring(input.default_device); - - input.mic_default_on = encodeboolean(input.mic_default_on); - - input.opus_dtx_enabled = encodeboolean(input.opus_dtx_enabled); - - input.redundant_coding_enabled = encodeboolean( - input.redundant_coding_enabled, - ); - - input.speaker_default_on = encodeboolean(input.speaker_default_on); - - input.noise_cancellation = encodeNoiseCancellationSettings( - input.noise_cancellation, - ); - - return input; -}; - export const decodeAudioSettingsResponse = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -1006,25 +502,6 @@ export const decodeAudioSettingsResponse = (input: Record) => { return input; }; -export const encodeAutomodDetails = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.original_message_type = encodestring(input.original_message_type); - - if (input.image_labels) { - Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = encodestring(input.image_labels[key]); - }); - } - - input.message_details = encodeFlagMessageDetails(input.message_details); - - input.result = encodeMessageModerationResult(input.result); - - return input; -}; - export const decodeAutomodDetails = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -1044,21 +521,6 @@ export const decodeAutomodDetails = (input: Record) => { return input; }; -export const encodeAutomodPlatformCircumventionConfig = ( - input: Record, -) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - if (input.rules) { - Object.keys(input.rules).forEach((key) => { - input.rules[key] = encodeAutomodRule(input.rules[key]); - }); - } - - return input; -}; - export const decodeAutomodPlatformCircumventionConfig = ( input: Record, ) => { @@ -1074,17 +536,6 @@ export const decodeAutomodPlatformCircumventionConfig = ( return input; }; -export const encodeAutomodRule = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.label = encodestring(input.label); - - input.threshold = encodenumber(input.threshold); - - return input; -}; - export const decodeAutomodRule = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -1096,21 +547,6 @@ export const decodeAutomodRule = (input: Record) => { return input; }; -export const encodeAutomodSemanticFiltersConfig = ( - input: Record, -) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - if (input.rules) { - Object.keys(input.rules).forEach((key) => { - input.rules[key] = encodeAutomodSemanticFiltersRule(input.rules[key]); - }); - } - - return input; -}; - export const decodeAutomodSemanticFiltersConfig = ( input: Record, ) => { @@ -1126,19 +562,6 @@ export const decodeAutomodSemanticFiltersConfig = ( return input; }; -export const encodeAutomodSemanticFiltersRule = ( - input: Record, -) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.name = encodestring(input.name); - - input.threshold = encodenumber(input.threshold); - - return input; -}; - export const decodeAutomodSemanticFiltersRule = ( input: Record, ) => { @@ -1152,19 +575,6 @@ export const decodeAutomodSemanticFiltersRule = ( return input; }; -export const encodeAutomodToxicityConfig = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - if (input.rules) { - Object.keys(input.rules).forEach((key) => { - input.rules[key] = encodeAutomodRule(input.rules[key]); - }); - } - - return input; -}; - export const decodeAutomodToxicityConfig = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1178,19 +588,6 @@ export const decodeAutomodToxicityConfig = (input: Record) => { return input; }; -export const encodeAzureRequest = (input: Record) => { - if (!input) return input; - input.abs_account_name = encodestring(input.abs_account_name); - - input.abs_client_id = encodestring(input.abs_client_id); - - input.abs_client_secret = encodestring(input.abs_client_secret); - - input.abs_tenant_id = encodestring(input.abs_tenant_id); - - return input; -}; - export const decodeAzureRequest = (input: Record) => { if (!input) return input; input.abs_account_name = decodestring(input.abs_account_name); @@ -1204,15 +601,6 @@ export const decodeAzureRequest = (input: Record) => { return input; }; -export const encodeBackstageSettings = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.join_ahead_time_seconds = encodeinteger(input.join_ahead_time_seconds); - - return input; -}; - export const decodeBackstageSettings = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1222,15 +610,6 @@ export const decodeBackstageSettings = (input: Record) => { return input; }; -export const encodeBackstageSettingsRequest = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.join_ahead_time_seconds = encodeinteger(input.join_ahead_time_seconds); - - return input; -}; - export const decodeBackstageSettingsRequest = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1240,15 +619,6 @@ export const decodeBackstageSettingsRequest = (input: Record) => { return input; }; -export const encodeBackstageSettingsResponse = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.join_ahead_time_seconds = encodeinteger(input.join_ahead_time_seconds); - - return input; -}; - export const decodeBackstageSettingsResponse = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1258,25 +628,6 @@ export const decodeBackstageSettingsResponse = (input: Record) => { return input; }; -export const encodeBan = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.shadow = encodeboolean(input.shadow); - - input.expires = encodeDatetimeType(input.expires); - - input.reason = encodestring(input.reason); - - input.channel = encodeChannel(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.target = encodeUserObject(input.target); - - return input; -}; - export const decodeBan = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -1296,19 +647,6 @@ export const decodeBan = (input: Record) => { return input; }; -export const encodeBanActionRequest = (input: Record) => { - if (!input) return input; - input.channel_ban_only = encodeboolean(input.channel_ban_only); - - input.reason = encodestring(input.reason); - - input.shadow = encodeboolean(input.shadow); - - input.timeout = encodeinteger(input.timeout); - - return input; -}; - export const decodeBanActionRequest = (input: Record) => { if (!input) return input; input.channel_ban_only = decodeboolean(input.channel_ban_only); @@ -1322,27 +660,6 @@ export const decodeBanActionRequest = (input: Record) => { return input; }; -export const encodeBanRequest = (input: Record) => { - if (!input) return input; - input.target_user_id = encodestring(input.target_user_id); - - input.timeout = encodeinteger(input.timeout); - - input.banned_by_id = encodestring(input.banned_by_id); - - input.channel_cid = encodestring(input.channel_cid); - - input.ip_ban = encodeboolean(input.ip_ban); - - input.reason = encodestring(input.reason); - - input.shadow = encodeboolean(input.shadow); - - input.banned_by = encodeUserRequest(input.banned_by); - - return input; -}; - export const decodeBanRequest = (input: Record) => { if (!input) return input; input.target_user_id = decodestring(input.target_user_id); @@ -1364,25 +681,6 @@ export const decodeBanRequest = (input: Record) => { return input; }; -export const encodeBanResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.expires = encodeDatetimeType(input.expires); - - input.reason = encodestring(input.reason); - - input.shadow = encodeboolean(input.shadow); - - input.banned_by = encodeUserObject(input.banned_by); - - input.channel = encodeChannelResponse(input.channel); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeBanResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -1402,19 +700,6 @@ export const decodeBanResponse = (input: Record) => { return input; }; -export const encodeBlockListConfig = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - if (input.rules) { - Object.keys(input.rules).forEach((key) => { - input.rules[key] = encodeBlockListRule(input.rules[key]); - }); - } - - return input; -}; - export const decodeBlockListConfig = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1428,15 +713,6 @@ export const decodeBlockListConfig = (input: Record) => { return input; }; -export const encodeBlockListOptions = (input: Record) => { - if (!input) return input; - input.behavior = encodestring(input.behavior); - - input.blocklist = encodestring(input.blocklist); - - return input; -}; - export const decodeBlockListOptions = (input: Record) => { if (!input) return input; input.behavior = decodestring(input.behavior); @@ -1446,25 +722,6 @@ export const decodeBlockListOptions = (input: Record) => { return input; }; -export const encodeBlockListResponse = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.type = encodestring(input.type); - - if (input.words) { - Object.keys(input.words).forEach((key) => { - input.words[key] = encodestring(input.words[key]); - }); - } - - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - return input; -}; - export const decodeBlockListResponse = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -1484,15 +741,6 @@ export const decodeBlockListResponse = (input: Record) => { return input; }; -export const encodeBlockListRule = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.name = encodestring(input.name); - - return input; -}; - export const decodeBlockListRule = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -1502,35 +750,15 @@ export const decodeBlockListRule = (input: Record) => { return input; }; -export const encodeBlockRequest = (input: Record) => { +export const decodeBlockRequest = (input: Record) => { if (!input) return input; - input.blocked_user_id = encodestring(input.blocked_user_id); + input.blocked_user_id = decodestring(input.blocked_user_id); - input.user_id = encodestring(input.user_id); + input.user_id = decodestring(input.user_id); - input.options = encodeobject(input.options); + input.options = decodeobject(input.options); - input.user = encodeUserRequest(input.user); - - return input; -}; - -export const decodeBlockRequest = (input: Record) => { - if (!input) return input; - input.blocked_user_id = decodestring(input.blocked_user_id); - - input.user_id = decodestring(input.user_id); - - input.options = decodeobject(input.options); - - input.user = decodeUserRequest(input.user); - - return input; -}; - -export const encodeBlockResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); + input.user = decodeUserRequest(input.user); return input; }; @@ -1542,13 +770,6 @@ export const decodeBlockResponse = (input: Record) => { return input; }; -export const encodeBlockUserRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - return input; -}; - export const decodeBlockUserRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -1556,13 +777,6 @@ export const decodeBlockUserRequest = (input: Record) => { return input; }; -export const encodeBlockUserResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeBlockUserResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -1570,17 +784,6 @@ export const decodeBlockUserResponse = (input: Record) => { return input; }; -export const encodeBlockUsersRequest = (input: Record) => { - if (!input) return input; - input.blocked_user_id = encodestring(input.blocked_user_id); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeBlockUsersRequest = (input: Record) => { if (!input) return input; input.blocked_user_id = decodestring(input.blocked_user_id); @@ -1592,19 +795,6 @@ export const decodeBlockUsersRequest = (input: Record) => { return input; }; -export const encodeBlockUsersResponse = (input: Record) => { - if (!input) return input; - input.blocked_by_user_id = encodestring(input.blocked_by_user_id); - - input.blocked_user_id = encodestring(input.blocked_user_id); - - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeBlockUsersResponse = (input: Record) => { if (!input) return input; input.blocked_by_user_id = decodestring(input.blocked_by_user_id); @@ -1618,21 +808,6 @@ export const decodeBlockUsersResponse = (input: Record) => { return input; }; -export const encodeBlockedUserResponse = (input: Record) => { - if (!input) return input; - input.blocked_user_id = encodestring(input.blocked_user_id); - - input.created_at = encodeDatetimeType(input.created_at); - - input.user_id = encodestring(input.user_id); - - input.blocked_user = encodeUserResponse(input.blocked_user); - - input.user = encodeUserResponse(input.user); - - return input; -}; - export const decodeBlockedUserResponse = (input: Record) => { if (!input) return input; input.blocked_user_id = decodestring(input.blocked_user_id); @@ -1648,15 +823,6 @@ export const decodeBlockedUserResponse = (input: Record) => { return input; }; -export const encodeBodyguardConfig = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.profile = encodestring(input.profile); - - return input; -}; - export const decodeBodyguardConfig = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1666,15 +832,6 @@ export const decodeBodyguardConfig = (input: Record) => { return input; }; -export const encodeBroadcastSettings = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.hls = encodeHLSSettings(input.hls); - - return input; -}; - export const decodeBroadcastSettings = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1684,15 +841,6 @@ export const decodeBroadcastSettings = (input: Record) => { return input; }; -export const encodeBroadcastSettingsRequest = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.hls = encodeHLSSettingsRequest(input.hls); - - return input; -}; - export const decodeBroadcastSettingsRequest = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1702,15 +850,6 @@ export const decodeBroadcastSettingsRequest = (input: Record) => { return input; }; -export const encodeBroadcastSettingsResponse = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.hls = encodeHLSSettingsResponse(input.hls); - - return input; -}; - export const decodeBroadcastSettingsResponse = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -1720,25 +859,6 @@ export const decodeBroadcastSettingsResponse = (input: Record) => { return input; }; -export const encodeCallEvent = (input: Record) => { - if (!input) return input; - input.description = encodestring(input.description); - - input.end_timestamp = encodeinteger(input.end_timestamp); - - input.severity = encodeinteger(input.severity); - - input.timestamp = encodeinteger(input.timestamp); - - input.type = encodestring(input.type); - - input.component = encodestring(input.component); - - input.additional = encodeobject(input.additional); - - return input; -}; - export const decodeCallEvent = (input: Record) => { if (!input) return input; input.description = decodestring(input.description); @@ -1758,13 +878,6 @@ export const decodeCallEvent = (input: Record) => { return input; }; -export const encodeCallIngressResponse = (input: Record) => { - if (!input) return input; - input.rtmp = encodeRTMPIngress(input.rtmp); - - return input; -}; - export const decodeCallIngressResponse = (input: Record) => { if (!input) return input; input.rtmp = decodeRTMPIngress(input.rtmp); @@ -1772,19 +885,6 @@ export const decodeCallIngressResponse = (input: Record) => { return input; }; -export const encodeCallParticipantResponse = (input: Record) => { - if (!input) return input; - input.joined_at = encodeDatetimeType(input.joined_at); - - input.role = encodestring(input.role); - - input.user_session_id = encodestring(input.user_session_id); - - input.user = encodeUserResponse(input.user); - - return input; -}; - export const decodeCallParticipantResponse = (input: Record) => { if (!input) return input; input.joined_at = decodeDatetimeType(input.joined_at); @@ -1798,19 +898,6 @@ export const decodeCallParticipantResponse = (input: Record) => { return input; }; -export const encodeCallRecording = (input: Record) => { - if (!input) return input; - input.end_time = encodeDatetimeType(input.end_time); - - input.filename = encodestring(input.filename); - - input.start_time = encodeDatetimeType(input.start_time); - - input.url = encodestring(input.url); - - return input; -}; - export const decodeCallRecording = (input: Record) => { if (!input) return input; input.end_time = decodeDatetimeType(input.end_time); @@ -1824,31 +911,6 @@ export const decodeCallRecording = (input: Record) => { return input; }; -export const encodeCallRequest = (input: Record) => { - if (!input) return input; - input.created_by_id = encodestring(input.created_by_id); - - input.starts_at = encodeDatetimeType(input.starts_at); - - input.team = encodestring(input.team); - - input.video = encodeboolean(input.video); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberRequest(input.members[key]); - }); - } - - input.created_by = encodeUserRequest(input.created_by); - - input.custom = encodeobject(input.custom); - - input.settings_override = encodeCallSettingsRequest(input.settings_override); - - return input; -}; - export const decodeCallRequest = (input: Record) => { if (!input) return input; input.created_by_id = decodestring(input.created_by_id); @@ -1874,57 +936,6 @@ export const decodeCallRequest = (input: Record) => { return input; }; -export const encodeCallResponse = (input: Record) => { - if (!input) return input; - input.backstage = encodeboolean(input.backstage); - - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.current_session_id = encodestring(input.current_session_id); - - input.id = encodestring(input.id); - - input.recording = encodeboolean(input.recording); - - input.transcribing = encodeboolean(input.transcribing); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.blocked_user_ids) { - Object.keys(input.blocked_user_ids).forEach((key) => { - input.blocked_user_ids[key] = encodestring(input.blocked_user_ids[key]); - }); - } - - input.created_by = encodeUserResponse(input.created_by); - - input.custom = encodeobject(input.custom); - - input.egress = encodeEgressResponse(input.egress); - - input.ingress = encodeCallIngressResponse(input.ingress); - - input.settings = encodeCallSettingsResponse(input.settings); - - input.ended_at = encodeDatetimeType(input.ended_at); - - input.join_ahead_time_seconds = encodeinteger(input.join_ahead_time_seconds); - - input.starts_at = encodeDatetimeType(input.starts_at); - - input.team = encodestring(input.team); - - input.session = encodeCallSessionResponse(input.session); - - input.thumbnails = encodeThumbnailResponse(input.thumbnails); - - return input; -}; - export const decodeCallResponse = (input: Record) => { if (!input) return input; input.backstage = decodeboolean(input.backstage); @@ -1976,57 +987,6 @@ export const decodeCallResponse = (input: Record) => { return input; }; -export const encodeCallSessionResponse = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - if (input.participants) { - Object.keys(input.participants).forEach((key) => { - input.participants[key] = encodeCallParticipantResponse( - input.participants[key], - ); - }); - } - - if (input.accepted_by) { - Object.keys(input.accepted_by).forEach((key) => { - input.accepted_by[key] = encodeDatetimeType(input.accepted_by[key]); - }); - } - - if (input.missed_by) { - Object.keys(input.missed_by).forEach((key) => { - input.missed_by[key] = encodeDatetimeType(input.missed_by[key]); - }); - } - - if (input.participants_count_by_role) { - Object.keys(input.participants_count_by_role).forEach((key) => { - input.participants_count_by_role[key] = encodeinteger( - input.participants_count_by_role[key], - ); - }); - } - - if (input.rejected_by) { - Object.keys(input.rejected_by).forEach((key) => { - input.rejected_by[key] = encodeDatetimeType(input.rejected_by[key]); - }); - } - - input.ended_at = encodeDatetimeType(input.ended_at); - - input.live_ended_at = encodeDatetimeType(input.live_ended_at); - - input.live_started_at = encodeDatetimeType(input.live_started_at); - - input.started_at = encodeDatetimeType(input.started_at); - - input.timer_ends_at = encodeDatetimeType(input.timer_ends_at); - - return input; -}; - export const decodeCallSessionResponse = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -2078,33 +1038,6 @@ export const decodeCallSessionResponse = (input: Record) => { return input; }; -export const encodeCallSettings = (input: Record) => { - if (!input) return input; - input.audio = encodeAudioSettings(input.audio); - - input.backstage = encodeBackstageSettings(input.backstage); - - input.broadcasting = encodeBroadcastSettings(input.broadcasting); - - input.geofencing = encodeGeofenceSettings(input.geofencing); - - input.limits = encodeLimitsSettings(input.limits); - - input.recording = encodeRecordSettings(input.recording); - - input.ring = encodeRingSettings(input.ring); - - input.screensharing = encodeScreensharingSettings(input.screensharing); - - input.thumbnails = encodeThumbnailsSettings(input.thumbnails); - - input.transcription = encodeTranscriptionSettings(input.transcription); - - input.video = encodeVideoSettings(input.video); - - return input; -}; - export const decodeCallSettings = (input: Record) => { if (!input) return input; input.audio = decodeAudioSettings(input.audio); @@ -2132,33 +1065,6 @@ export const decodeCallSettings = (input: Record) => { return input; }; -export const encodeCallSettingsRequest = (input: Record) => { - if (!input) return input; - input.audio = encodeAudioSettingsRequest(input.audio); - - input.backstage = encodeBackstageSettingsRequest(input.backstage); - - input.broadcasting = encodeBroadcastSettingsRequest(input.broadcasting); - - input.geofencing = encodeGeofenceSettingsRequest(input.geofencing); - - input.limits = encodeLimitsSettingsRequest(input.limits); - - input.recording = encodeRecordSettingsRequest(input.recording); - - input.ring = encodeRingSettingsRequest(input.ring); - - input.screensharing = encodeScreensharingSettingsRequest(input.screensharing); - - input.thumbnails = encodeThumbnailsSettingsRequest(input.thumbnails); - - input.transcription = encodeTranscriptionSettingsRequest(input.transcription); - - input.video = encodeVideoSettingsRequest(input.video); - - return input; -}; - export const decodeCallSettingsRequest = (input: Record) => { if (!input) return input; input.audio = decodeAudioSettingsRequest(input.audio); @@ -2186,37 +1092,6 @@ export const decodeCallSettingsRequest = (input: Record) => { return input; }; -export const encodeCallSettingsResponse = (input: Record) => { - if (!input) return input; - input.audio = encodeAudioSettingsResponse(input.audio); - - input.backstage = encodeBackstageSettingsResponse(input.backstage); - - input.broadcasting = encodeBroadcastSettingsResponse(input.broadcasting); - - input.geofencing = encodeGeofenceSettingsResponse(input.geofencing); - - input.limits = encodeLimitsSettingsResponse(input.limits); - - input.recording = encodeRecordSettingsResponse(input.recording); - - input.ring = encodeRingSettingsResponse(input.ring); - - input.screensharing = encodeScreensharingSettingsResponse( - input.screensharing, - ); - - input.thumbnails = encodeThumbnailsSettingsResponse(input.thumbnails); - - input.transcription = encodeTranscriptionSettingsResponse( - input.transcription, - ); - - input.video = encodeVideoSettingsResponse(input.video); - - return input; -}; - export const decodeCallSettingsResponse = (input: Record) => { if (!input) return input; input.audio = decodeAudioSettingsResponse(input.audio); @@ -2248,74 +1123,32 @@ export const decodeCallSettingsResponse = (input: Record) => { return input; }; -export const encodeCallStateResponseFields = (input: Record) => { +export const decodeCallStateResponseFields = (input: Record) => { if (!input) return input; if (input.members) { Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); + input.members[key] = decodeMemberResponse(input.members[key]); }); } if (input.own_capabilities) { Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = encodeOwnCapability( + input.own_capabilities[key] = decodeOwnCapability( input.own_capabilities[key], ); }); } - input.call = encodeCallResponse(input.call); + input.call = decodeCallResponse(input.call); return input; }; -export const decodeCallStateResponseFields = (input: Record) => { +export const decodeCallStatsReportSummaryResponse = ( + input: Record, +) => { if (!input) return input; - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = decodeMemberResponse(input.members[key]); - }); - } - - if (input.own_capabilities) { - Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = decodeOwnCapability( - input.own_capabilities[key], - ); - }); - } - - input.call = decodeCallResponse(input.call); - - return input; -}; - -export const encodeCallStatsReportSummaryResponse = ( - input: Record, -) => { - if (!input) return input; - input.call_cid = encodestring(input.call_cid); - - input.call_duration_seconds = encodeinteger(input.call_duration_seconds); - - input.call_session_id = encodestring(input.call_session_id); - - input.call_status = encodestring(input.call_status); - - input.first_stats_time = encodeDatetimeType(input.first_stats_time); - - input.created_at = encodeDatetimeType(input.created_at); - - input.quality_score = encodeinteger(input.quality_score); - - return input; -}; - -export const decodeCallStatsReportSummaryResponse = ( - input: Record, -) => { - if (!input) return input; - input.call_cid = decodestring(input.call_cid); + input.call_cid = decodestring(input.call_cid); input.call_duration_seconds = decodeinteger(input.call_duration_seconds); @@ -2332,17 +1165,6 @@ export const decodeCallStatsReportSummaryResponse = ( return input; }; -export const encodeCallTimeline = (input: Record) => { - if (!input) return input; - if (input.events) { - Object.keys(input.events).forEach((key) => { - input.events[key] = encodeCallEvent(input.events[key]); - }); - } - - return input; -}; - export const decodeCallTimeline = (input: Record) => { if (!input) return input; if (input.events) { @@ -2354,19 +1176,6 @@ export const decodeCallTimeline = (input: Record) => { return input; }; -export const encodeCallTranscription = (input: Record) => { - if (!input) return input; - input.end_time = encodeDatetimeType(input.end_time); - - input.filename = encodestring(input.filename); - - input.start_time = encodeDatetimeType(input.start_time); - - input.url = encodestring(input.url); - - return input; -}; - export const decodeCallTranscription = (input: Record) => { if (!input) return input; input.end_time = decodeDatetimeType(input.end_time); @@ -2380,29 +1189,6 @@ export const decodeCallTranscription = (input: Record) => { return input; }; -export const encodeCallType = (input: Record) => { - if (!input) return input; - input.app_pk = encodeinteger(input.app_pk); - - input.created_at = encodeDatetimeType(input.created_at); - - input.external_storage = encodestring(input.external_storage); - - input.name = encodestring(input.name); - - input.pk = encodeinteger(input.pk); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettings(input.settings); - - return input; -}; - export const decodeCallType = (input: Record) => { if (!input) return input; input.app_pk = decodeinteger(input.app_pk); @@ -2426,31 +1212,6 @@ export const decodeCallType = (input: Record) => { return input; }; -export const encodeCallTypeResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsResponse(input.settings); - - input.external_storage = encodestring(input.external_storage); - - return input; -}; - export const decodeCallTypeResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -2476,17 +1237,6 @@ export const decodeCallTypeResponse = (input: Record) => { return input; }; -export const encodeCastPollVoteRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - input.vote = encodeVoteData(input.vote); - - return input; -}; - export const decodeCastPollVoteRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -2498,65 +1248,6 @@ export const decodeCastPollVoteRequest = (input: Record) => { return input; }; -export const encodeChannel = (input: Record) => { - if (!input) return input; - input.auto_translation_language = encodestring( - input.auto_translation_language, - ); - - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.disabled = encodeboolean(input.disabled); - - input.frozen = encodeboolean(input.frozen); - - input.id = encodestring(input.id); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.custom = encodeobject(input.custom); - - input.auto_translation_enabled = encodeboolean( - input.auto_translation_enabled, - ); - - input.cooldown = encodeinteger(input.cooldown); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.member_count = encodeinteger(input.member_count); - - input.team = encodestring(input.team); - - if (input.invites) { - Object.keys(input.invites).forEach((key) => { - input.invites[key] = encodeChannelMember(input.invites[key]); - }); - } - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - input.config = encodeChannelConfig(input.config); - - input.config_overrides = encodeChannelConfig(input.config_overrides); - - input.created_by = encodeUserObject(input.created_by); - - input.truncated_by = encodeUserObject(input.truncated_by); - - return input; -}; - export const decodeChannel = (input: Record) => { if (!input) return input; input.auto_translation_language = decodestring( @@ -2616,79 +1307,6 @@ export const decodeChannel = (input: Record) => { return input; }; -export const encodeChannelConfig = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.created_at = encodeDatetimeType(input.created_at); - - input.custom_events = encodeboolean(input.custom_events); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.mutes = encodeboolean(input.mutes); - - input.name = encodestring(input.name); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodestring(input.commands[key]); - }); - } - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - return input; -}; - export const decodeChannelConfig = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -2762,85 +1380,6 @@ export const decodeChannelConfig = (input: Record) => { return input; }; -export const encodeChannelConfigWithInfo = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.created_at = encodeDatetimeType(input.created_at); - - input.custom_events = encodeboolean(input.custom_events); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.mutes = encodeboolean(input.mutes); - - input.name = encodestring(input.name); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodeCommand(input.commands[key]); - }); - } - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - return input; -}; - export const decodeChannelConfigWithInfo = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -2920,21 +1459,6 @@ export const decodeChannelConfigWithInfo = (input: Record) => { return input; }; -export const encodeChannelExport = (input: Record) => { - if (!input) return input; - input.cid = encodestring(input.cid); - - input.id = encodestring(input.id); - - input.messages_since = encodeDatetimeType(input.messages_since); - - input.messages_until = encodeDatetimeType(input.messages_until); - - input.type = encodestring(input.type); - - return input; -}; - export const decodeChannelExport = (input: Record) => { if (!input) return input; input.cid = decodestring(input.cid); @@ -2950,25 +1474,6 @@ export const decodeChannelExport = (input: Record) => { return input; }; -export const encodeChannelGetOrCreateRequest = (input: Record) => { - if (!input) return input; - input.hide_for_creator = encodeboolean(input.hide_for_creator); - - input.state = encodeboolean(input.state); - - input.thread_unread_counts = encodeboolean(input.thread_unread_counts); - - input.data = encodeChannelInput(input.data); - - input.members = encodePaginationParams(input.members); - - input.messages = encodeMessagePaginationParams(input.messages); - - input.watchers = encodePaginationParams(input.watchers); - - return input; -}; - export const decodeChannelGetOrCreateRequest = (input: Record) => { if (!input) return input; input.hide_for_creator = decodeboolean(input.hide_for_creator); @@ -2988,124 +1493,48 @@ export const decodeChannelGetOrCreateRequest = (input: Record) => { return input; }; -export const encodeChannelInput = (input: Record) => { +export const decodeChannelInput = (input: Record) => { if (!input) return input; - input.auto_translation_enabled = encodeboolean( + input.auto_translation_enabled = decodeboolean( input.auto_translation_enabled, ); - input.auto_translation_language = encodestring( + input.auto_translation_language = decodestring( input.auto_translation_language, ); - input.created_by_id = encodestring(input.created_by_id); + input.created_by_id = decodestring(input.created_by_id); - input.disabled = encodeboolean(input.disabled); + input.disabled = decodeboolean(input.disabled); - input.frozen = encodeboolean(input.frozen); + input.frozen = decodeboolean(input.frozen); - input.team = encodestring(input.team); + input.team = decodestring(input.team); - input.truncated_by_id = encodestring(input.truncated_by_id); + input.truncated_by_id = decodestring(input.truncated_by_id); if (input.invites) { Object.keys(input.invites).forEach((key) => { - input.invites[key] = encodeChannelMember(input.invites[key]); + input.invites[key] = decodeChannelMember(input.invites[key]); }); } if (input.members) { Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); + input.members[key] = decodeChannelMember(input.members[key]); }); } - input.config_overrides = encodeChannelConfig(input.config_overrides); + input.config_overrides = decodeChannelConfig(input.config_overrides); - input.created_by = encodeUserObject(input.created_by); + input.created_by = decodeUserObject(input.created_by); - input.custom = encodeobject(input.custom); + input.custom = decodeobject(input.custom); return input; }; -export const decodeChannelInput = (input: Record) => { - if (!input) return input; - input.auto_translation_enabled = decodeboolean( - input.auto_translation_enabled, - ); - - input.auto_translation_language = decodestring( - input.auto_translation_language, - ); - - input.created_by_id = decodestring(input.created_by_id); - - input.disabled = decodeboolean(input.disabled); - - input.frozen = decodeboolean(input.frozen); - - input.team = decodestring(input.team); - - input.truncated_by_id = decodestring(input.truncated_by_id); - - if (input.invites) { - Object.keys(input.invites).forEach((key) => { - input.invites[key] = decodeChannelMember(input.invites[key]); - }); - } - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = decodeChannelMember(input.members[key]); - }); - } - - input.config_overrides = decodeChannelConfig(input.config_overrides); - - input.created_by = decodeUserObject(input.created_by); - - input.custom = decodeobject(input.custom); - - return input; -}; - -export const encodeChannelMember = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.channel_role = encodestring(input.channel_role); - - input.created_at = encodeDatetimeType(input.created_at); - - input.notifications_muted = encodeboolean(input.notifications_muted); - - input.shadow_banned = encodeboolean(input.shadow_banned); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.ban_expires = encodeDatetimeType(input.ban_expires); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.invite_accepted_at = encodeDatetimeType(input.invite_accepted_at); - - input.invite_rejected_at = encodeDatetimeType(input.invite_rejected_at); - - input.invited = encodeboolean(input.invited); - - input.is_moderator = encodeboolean(input.is_moderator); - - input.status = encodestring(input.status); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - -export const decodeChannelMember = (input: Record) => { +export const decodeChannelMember = (input: Record) => { if (!input) return input; input.banned = decodeboolean(input.banned); @@ -3140,43 +1569,6 @@ export const decodeChannelMember = (input: Record) => { return input; }; -export const encodeChannelMemberResponse = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.channel_role = encodestring(input.channel_role); - - input.created_at = encodeDatetimeType(input.created_at); - - input.notifications_muted = encodeboolean(input.notifications_muted); - - input.shadow_banned = encodeboolean(input.shadow_banned); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.ban_expires = encodeDatetimeType(input.ban_expires); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.invite_accepted_at = encodeDatetimeType(input.invite_accepted_at); - - input.invite_rejected_at = encodeDatetimeType(input.invite_rejected_at); - - input.invited = encodeboolean(input.invited); - - input.is_moderator = encodeboolean(input.is_moderator); - - input.role = encodestring(input.role); - - input.status = encodestring(input.status); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeChannelMemberResponse = (input: Record) => { if (!input) return input; input.banned = decodeboolean(input.banned); @@ -3214,21 +1606,6 @@ export const decodeChannelMemberResponse = (input: Record) => { return input; }; -export const encodeChannelMute = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.expires = encodeDatetimeType(input.expires); - - input.channel = encodeChannelResponse(input.channel); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeChannelMute = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -3244,75 +1621,6 @@ export const decodeChannelMute = (input: Record) => { return input; }; -export const encodeChannelResponse = (input: Record) => { - if (!input) return input; - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.disabled = encodeboolean(input.disabled); - - input.frozen = encodeboolean(input.frozen); - - input.id = encodestring(input.id); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.custom = encodeobject(input.custom); - - input.auto_translation_enabled = encodeboolean( - input.auto_translation_enabled, - ); - - input.auto_translation_language = encodestring( - input.auto_translation_language, - ); - - input.blocked = encodeboolean(input.blocked); - - input.cooldown = encodeinteger(input.cooldown); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.hidden = encodeboolean(input.hidden); - - input.hide_messages_before = encodeDatetimeType(input.hide_messages_before); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.member_count = encodeinteger(input.member_count); - - input.mute_expires_at = encodeDatetimeType(input.mute_expires_at); - - input.muted = encodeboolean(input.muted); - - input.team = encodestring(input.team); - - input.truncated_at = encodeDatetimeType(input.truncated_at); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - if (input.own_capabilities) { - Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = encodestring(input.own_capabilities[key]); - }); - } - - input.config = encodeChannelConfigWithInfo(input.config); - - input.created_by = encodeUserObject(input.created_by); - - input.truncated_by = encodeUserObject(input.truncated_by); - - return input; -}; - export const decodeChannelResponse = (input: Record) => { if (!input) return input; input.cid = decodestring(input.cid); @@ -3382,69 +1690,6 @@ export const decodeChannelResponse = (input: Record) => { return input; }; -export const encodeChannelStateResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - if (input.messages) { - Object.keys(input.messages).forEach((key) => { - input.messages[key] = encodeMessageResponse(input.messages[key]); - }); - } - - if (input.pinned_messages) { - Object.keys(input.pinned_messages).forEach((key) => { - input.pinned_messages[key] = encodeMessageResponse( - input.pinned_messages[key], - ); - }); - } - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = encodeThreadState(input.threads[key]); - }); - } - - input.hidden = encodeboolean(input.hidden); - - input.hide_messages_before = encodeDatetimeType(input.hide_messages_before); - - input.watcher_count = encodeinteger(input.watcher_count); - - if (input.pending_messages) { - Object.keys(input.pending_messages).forEach((key) => { - input.pending_messages[key] = encodePendingMessage( - input.pending_messages[key], - ); - }); - } - - if (input.read) { - Object.keys(input.read).forEach((key) => { - input.read[key] = encodeReadStateResponse(input.read[key]); - }); - } - - if (input.watchers) { - Object.keys(input.watchers).forEach((key) => { - input.watchers[key] = encodeUserResponse(input.watchers[key]); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - input.membership = encodeChannelMember(input.membership); - - return input; -}; - export const decodeChannelStateResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -3508,69 +1753,6 @@ export const decodeChannelStateResponse = (input: Record) => { return input; }; -export const encodeChannelStateResponseFields = ( - input: Record, -) => { - if (!input) return input; - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - if (input.messages) { - Object.keys(input.messages).forEach((key) => { - input.messages[key] = encodeMessageResponse(input.messages[key]); - }); - } - - if (input.pinned_messages) { - Object.keys(input.pinned_messages).forEach((key) => { - input.pinned_messages[key] = encodeMessageResponse( - input.pinned_messages[key], - ); - }); - } - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = encodeThreadState(input.threads[key]); - }); - } - - input.hidden = encodeboolean(input.hidden); - - input.hide_messages_before = encodeDatetimeType(input.hide_messages_before); - - input.watcher_count = encodeinteger(input.watcher_count); - - if (input.pending_messages) { - Object.keys(input.pending_messages).forEach((key) => { - input.pending_messages[key] = encodePendingMessage( - input.pending_messages[key], - ); - }); - } - - if (input.read) { - Object.keys(input.read).forEach((key) => { - input.read[key] = encodeReadStateResponse(input.read[key]); - }); - } - - if (input.watchers) { - Object.keys(input.watchers).forEach((key) => { - input.watchers[key] = encodeUserResponse(input.watchers[key]); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - input.membership = encodeChannelMember(input.membership); - - return input; -}; - export const decodeChannelStateResponseFields = ( input: Record, ) => { @@ -3634,75 +1816,75 @@ export const decodeChannelStateResponseFields = ( return input; }; -export const encodeChannelTypeConfig = (input: Record) => { +export const decodeChannelTypeConfig = (input: Record) => { if (!input) return input; - input.automod = encodestring(input.automod); + input.automod = decodestring(input.automod); - input.automod_behavior = encodestring(input.automod_behavior); + input.automod_behavior = decodestring(input.automod_behavior); - input.connect_events = encodeboolean(input.connect_events); + input.connect_events = decodeboolean(input.connect_events); - input.created_at = encodeDatetimeType(input.created_at); + input.created_at = decodeDatetimeType(input.created_at); - input.custom_events = encodeboolean(input.custom_events); + input.custom_events = decodeboolean(input.custom_events); - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); + input.mark_messages_pending = decodeboolean(input.mark_messages_pending); - input.max_message_length = encodeinteger(input.max_message_length); + input.max_message_length = decodeinteger(input.max_message_length); - input.mutes = encodeboolean(input.mutes); + input.mutes = decodeboolean(input.mutes); - input.name = encodestring(input.name); + input.name = decodestring(input.name); - input.polls = encodeboolean(input.polls); + input.polls = decodeboolean(input.polls); - input.push_notifications = encodeboolean(input.push_notifications); + input.push_notifications = decodeboolean(input.push_notifications); - input.quotes = encodeboolean(input.quotes); + input.quotes = decodeboolean(input.quotes); - input.reactions = encodeboolean(input.reactions); + input.reactions = decodeboolean(input.reactions); - input.read_events = encodeboolean(input.read_events); + input.read_events = decodeboolean(input.read_events); - input.reminders = encodeboolean(input.reminders); + input.reminders = decodeboolean(input.reminders); - input.replies = encodeboolean(input.replies); + input.replies = decodeboolean(input.replies); - input.search = encodeboolean(input.search); + input.search = decodeboolean(input.search); - input.typing_events = encodeboolean(input.typing_events); + input.typing_events = decodeboolean(input.typing_events); - input.updated_at = encodeDatetimeType(input.updated_at); + input.updated_at = decodeDatetimeType(input.updated_at); - input.uploads = encodeboolean(input.uploads); + input.uploads = decodeboolean(input.uploads); - input.url_enrichment = encodeboolean(input.url_enrichment); + input.url_enrichment = decodeboolean(input.url_enrichment); if (input.commands) { Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodeCommand(input.commands[key]); + input.commands[key] = decodeCommand(input.commands[key]); }); } if (input.permissions) { Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); + input.permissions[key] = decodePolicyRequest(input.permissions[key]); }); } if (input.grants) { Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); + input.grants[key] = decodearray(input.grants[key]); }); } - input.blocklist = encodestring(input.blocklist); + input.blocklist = decodestring(input.blocklist); - input.blocklist_behavior = encodestring(input.blocklist_behavior); + input.blocklist_behavior = decodestring(input.blocklist_behavior); if (input.allowed_flag_reasons) { Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( + input.allowed_flag_reasons[key] = decodestring( input.allowed_flag_reasons[key], ); }); @@ -3710,92 +1892,7 @@ export const encodeChannelTypeConfig = (input: Record) => { if (input.blocklists) { Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - return input; -}; - -export const decodeChannelTypeConfig = (input: Record) => { - if (!input) return input; - input.automod = decodestring(input.automod); - - input.automod_behavior = decodestring(input.automod_behavior); - - input.connect_events = decodeboolean(input.connect_events); - - input.created_at = decodeDatetimeType(input.created_at); - - input.custom_events = decodeboolean(input.custom_events); - - input.mark_messages_pending = decodeboolean(input.mark_messages_pending); - - input.max_message_length = decodeinteger(input.max_message_length); - - input.mutes = decodeboolean(input.mutes); - - input.name = decodestring(input.name); - - input.polls = decodeboolean(input.polls); - - input.push_notifications = decodeboolean(input.push_notifications); - - input.quotes = decodeboolean(input.quotes); - - input.reactions = decodeboolean(input.reactions); - - input.read_events = decodeboolean(input.read_events); - - input.reminders = decodeboolean(input.reminders); - - input.replies = decodeboolean(input.replies); - - input.search = decodeboolean(input.search); - - input.typing_events = decodeboolean(input.typing_events); - - input.updated_at = decodeDatetimeType(input.updated_at); - - input.uploads = decodeboolean(input.uploads); - - input.url_enrichment = decodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = decodeCommand(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = decodePolicyRequest(input.permissions[key]); - }); - } - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = decodearray(input.grants[key]); - }); - } - - input.blocklist = decodestring(input.blocklist); - - input.blocklist_behavior = decodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = decodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = decodeBlockListOptions(input.blocklists[key]); + input.blocklists[key] = decodeBlockListOptions(input.blocklists[key]); }); } @@ -3804,17 +1901,6 @@ export const decodeChannelTypeConfig = (input: Record) => { return input; }; -export const encodeCheckExternalStorageResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.file_url = encodestring(input.file_url); - - return input; -}; - export const decodeCheckExternalStorageResponse = ( input: Record, ) => { @@ -3826,29 +1912,6 @@ export const decodeCheckExternalStorageResponse = ( return input; }; -export const encodeCheckPushRequest = (input: Record) => { - if (!input) return input; - input.apn_template = encodestring(input.apn_template); - - input.firebase_data_template = encodestring(input.firebase_data_template); - - input.firebase_template = encodestring(input.firebase_template); - - input.message_id = encodestring(input.message_id); - - input.push_provider_name = encodestring(input.push_provider_name); - - input.push_provider_type = encodestring(input.push_provider_type); - - input.skip_devices = encodeboolean(input.skip_devices); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCheckPushRequest = (input: Record) => { if (!input) return input; input.apn_template = decodestring(input.apn_template); @@ -3872,41 +1935,6 @@ export const decodeCheckPushRequest = (input: Record) => { return input; }; -export const encodeCheckPushResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.rendered_apn_template = encodestring(input.rendered_apn_template); - - input.rendered_firebase_template = encodestring( - input.rendered_firebase_template, - ); - - input.skip_devices = encodeboolean(input.skip_devices); - - if (input.general_errors) { - Object.keys(input.general_errors).forEach((key) => { - input.general_errors[key] = encodestring(input.general_errors[key]); - }); - } - - if (input.device_errors) { - Object.keys(input.device_errors).forEach((key) => { - input.device_errors[key] = encodeDeviceErrorInfo( - input.device_errors[key], - ); - }); - } - - if (input.rendered_message) { - Object.keys(input.rendered_message).forEach((key) => { - input.rendered_message[key] = encodestring(input.rendered_message[key]); - }); - } - - return input; -}; - export const decodeCheckPushResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -3942,27 +1970,6 @@ export const decodeCheckPushResponse = (input: Record) => { return input; }; -export const encodeCheckRequest = (input: Record) => { - if (!input) return input; - input.config_key = encodestring(input.config_key); - - input.entity_creator_id = encodestring(input.entity_creator_id); - - input.entity_id = encodestring(input.entity_id); - - input.entity_type = encodestring(input.entity_type); - - input.user_id = encodestring(input.user_id); - - input.moderation_payload = encodeModerationPayload(input.moderation_payload); - - input.options = encodeobject(input.options); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCheckRequest = (input: Record) => { if (!input) return input; input.config_key = decodestring(input.config_key); @@ -3984,21 +1991,6 @@ export const decodeCheckRequest = (input: Record) => { return input; }; -export const encodeCheckResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.recommended_action = encodestring(input.recommended_action); - - input.status = encodestring(input.status); - - input.task_id = encodestring(input.task_id); - - input.item = encodeReviewQueueItem(input.item); - - return input; -}; - export const decodeCheckResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -4014,17 +2006,6 @@ export const decodeCheckResponse = (input: Record) => { return input; }; -export const encodeCheckSNSRequest = (input: Record) => { - if (!input) return input; - input.sns_key = encodestring(input.sns_key); - - input.sns_secret = encodestring(input.sns_secret); - - input.sns_topic_arn = encodestring(input.sns_topic_arn); - - return input; -}; - export const decodeCheckSNSRequest = (input: Record) => { if (!input) return input; input.sns_key = decodestring(input.sns_key); @@ -4036,19 +2017,6 @@ export const decodeCheckSNSRequest = (input: Record) => { return input; }; -export const encodeCheckSNSResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.status = encodestring(input.status); - - input.error = encodestring(input.error); - - input.data = encodeobject(input.data); - - return input; -}; - export const decodeCheckSNSResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -4062,17 +2030,6 @@ export const decodeCheckSNSResponse = (input: Record) => { return input; }; -export const encodeCheckSQSRequest = (input: Record) => { - if (!input) return input; - input.sqs_key = encodestring(input.sqs_key); - - input.sqs_secret = encodestring(input.sqs_secret); - - input.sqs_url = encodestring(input.sqs_url); - - return input; -}; - export const decodeCheckSQSRequest = (input: Record) => { if (!input) return input; input.sqs_key = decodestring(input.sqs_key); @@ -4084,19 +2041,6 @@ export const decodeCheckSQSRequest = (input: Record) => { return input; }; -export const encodeCheckSQSResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.status = encodestring(input.status); - - input.error = encodestring(input.error); - - input.data = encodeobject(input.data); - - return input; -}; - export const decodeCheckSQSResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -4110,25 +2054,6 @@ export const decodeCheckSQSResponse = (input: Record) => { return input; }; -export const encodeCollectUserFeedbackRequest = ( - input: Record, -) => { - if (!input) return input; - input.rating = encodeinteger(input.rating); - - input.sdk = encodestring(input.sdk); - - input.sdk_version = encodestring(input.sdk_version); - - input.user_session_id = encodestring(input.user_session_id); - - input.reason = encodestring(input.reason); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodeCollectUserFeedbackRequest = ( input: Record, ) => { @@ -4148,15 +2073,6 @@ export const decodeCollectUserFeedbackRequest = ( return input; }; -export const encodeCollectUserFeedbackResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeCollectUserFeedbackResponse = ( input: Record, ) => { @@ -4166,23 +2082,6 @@ export const decodeCollectUserFeedbackResponse = ( return input; }; -export const encodeCommand = (input: Record) => { - if (!input) return input; - input.args = encodestring(input.args); - - input.description = encodestring(input.description); - - input.name = encodestring(input.name); - - input.set = encodestring(input.set); - - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - return input; -}; - export const decodeCommand = (input: Record) => { if (!input) return input; input.args = decodestring(input.args); @@ -4200,33 +2099,11 @@ export const decodeCommand = (input: Record) => { return input; }; -export const encodeCommitMessageRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeCommitMessageRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeConfig = (input: Record) => { - if (!input) return input; - input.app_certificate = encodestring(input.app_certificate); - - input.app_id = encodestring(input.app_id); - - input.default_role = encodestring(input.default_role); - - if (input.role_map) { - Object.keys(input.role_map).forEach((key) => { - input.role_map[key] = encodestring(input.role_map[key]); - }); - } - - return input; -}; - export const decodeConfig = (input: Record) => { if (!input) return input; input.app_certificate = decodestring(input.app_certificate); @@ -4244,44 +2121,6 @@ export const decodeConfig = (input: Record) => { return input; }; -export const encodeConfigResponse = (input: Record) => { - if (!input) return input; - input.async = encodeboolean(input.async); - - input.created_at = encodeDatetimeType(input.created_at); - - input.key = encodestring(input.key); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.automod_platform_circumvention_config = - encodeAutomodPlatformCircumventionConfig( - input.automod_platform_circumvention_config, - ); - - input.automod_semantic_filters_config = encodeAutomodSemanticFiltersConfig( - input.automod_semantic_filters_config, - ); - - input.automod_toxicity_config = encodeAutomodToxicityConfig( - input.automod_toxicity_config, - ); - - input.aws_rek_og_nition_config = encodeAWSRekognitionConfig( - input.aws_rek_og_nition_config, - ); - - input.block_list_config = encodeBlockListConfig(input.block_list_config); - - input.bodyguard_config = encodeBodyguardConfig(input.bodyguard_config); - - input.go_og_le_vision_config = encodeGoogleVisionConfig( - input.go_og_le_vision_config, - ); - - return input; -}; - export const decodeConfigResponse = (input: Record) => { if (!input) return input; input.async = decodeboolean(input.async); @@ -4320,33 +2159,15 @@ export const decodeConfigResponse = (input: Record) => { return input; }; -export const encodeCoordinates = (input: Record) => { +export const decodeCoordinates = (input: Record) => { if (!input) return input; - input.latitude = encodenumber(input.latitude); - - input.longitude = encodenumber(input.longitude); - - return input; -}; - -export const decodeCoordinates = (input: Record) => { - if (!input) return input; - input.latitude = decodenumber(input.latitude); + input.latitude = decodenumber(input.latitude); input.longitude = decodenumber(input.longitude); return input; }; -export const encodeCount = (input: Record) => { - if (!input) return input; - input.app_roximate = encodeboolean(input.app_roximate); - - input.value = encodeinteger(input.value); - - return input; -}; - export const decodeCount = (input: Record) => { if (!input) return input; input.app_roximate = decodeboolean(input.app_roximate); @@ -4356,21 +2177,6 @@ export const decodeCount = (input: Record) => { return input; }; -export const encodeCountrywiseAggregateStats = (input: Record) => { - if (!input) return input; - input.participant_count = encodeCount(input.participant_count); - - input.publisher_jitter = encodeTimeStats(input.publisher_jitter); - - input.publisher_latency = encodeTimeStats(input.publisher_latency); - - input.subscriber_jitter = encodeTimeStats(input.subscriber_jitter); - - input.subscriber_latency = encodeTimeStats(input.subscriber_latency); - - return input; -}; - export const decodeCountrywiseAggregateStats = (input: Record) => { if (!input) return input; input.participant_count = decodeCount(input.participant_count); @@ -4386,21 +2192,6 @@ export const decodeCountrywiseAggregateStats = (input: Record) => { return input; }; -export const encodeCreateBlockListRequest = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - if (input.words) { - Object.keys(input.words).forEach((key) => { - input.words[key] = encodestring(input.words[key]); - }); - } - - input.type = encodestring(input.type); - - return input; -}; - export const decodeCreateBlockListRequest = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -4416,27 +2207,6 @@ export const decodeCreateBlockListRequest = (input: Record) => { return input; }; -export const encodeCreateCallTypeRequest = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.external_storage = encodestring(input.external_storage); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsRequest(input.settings); - - return input; -}; - export const decodeCreateCallTypeRequest = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -4458,33 +2228,6 @@ export const decodeCreateCallTypeRequest = (input: Record) => { return input; }; -export const encodeCreateCallTypeResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsResponse(input.settings); - - input.external_storage = encodestring(input.external_storage); - - return input; -}; - export const decodeCreateCallTypeResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -4512,75 +2255,6 @@ export const decodeCreateCallTypeResponse = (input: Record) => { return input; }; -export const encodeCreateChannelTypeRequest = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.name = encodestring(input.name); - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.custom_events = encodeboolean(input.custom_events); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.message_retention = encodestring(input.message_retention); - - input.mutes = encodeboolean(input.mutes); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodestring(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); - }); - } - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - return input; -}; - export const decodeCreateChannelTypeRequest = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -4650,93 +2324,6 @@ export const decodeCreateChannelTypeRequest = (input: Record) => { return input; }; -export const encodeCreateChannelTypeResponse = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.created_at = encodeDatetimeType(input.created_at); - - input.custom_events = encodeboolean(input.custom_events); - - input.duration = encodestring(input.duration); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.mutes = encodeboolean(input.mutes); - - input.name = encodestring(input.name); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodestring(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); - }); - } - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - return input; -}; - export const decodeCreateChannelTypeResponse = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -4824,19 +2411,6 @@ export const decodeCreateChannelTypeResponse = (input: Record) => { return input; }; -export const encodeCreateCommandRequest = (input: Record) => { - if (!input) return input; - input.description = encodestring(input.description); - - input.name = encodestring(input.name); - - input.args = encodestring(input.args); - - input.set = encodestring(input.set); - - return input; -}; - export const decodeCreateCommandRequest = (input: Record) => { if (!input) return input; input.description = decodestring(input.description); @@ -4850,15 +2424,6 @@ export const decodeCreateCommandRequest = (input: Record) => { return input; }; -export const encodeCreateCommandResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.command = encodeCommand(input.command); - - return input; -}; - export const decodeCreateCommandResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -4868,23 +2433,6 @@ export const decodeCreateCommandResponse = (input: Record) => { return input; }; -export const encodeCreateDeviceRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.push_provider = encodestring(input.push_provider); - - input.push_provider_name = encodestring(input.push_provider_name); - - input.user_id = encodestring(input.user_id); - - input.voip_token = encodeboolean(input.voip_token); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCreateDeviceRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -4902,27 +2450,6 @@ export const decodeCreateDeviceRequest = (input: Record) => { return input; }; -export const encodeCreateExternalStorageRequest = ( - input: Record, -) => { - if (!input) return input; - input.bucket = encodestring(input.bucket); - - input.name = encodestring(input.name); - - input.storage_type = encodestring(input.storage_type); - - input.gcs_credentials = encodestring(input.gcs_credentials); - - input.path = encodestring(input.path); - - input.aws_s3 = encodeS3Request(input.aws_s3); - - input.azure_blob = encodeAzureRequest(input.azure_blob); - - return input; -}; - export const decodeCreateExternalStorageRequest = ( input: Record, ) => { @@ -4944,15 +2471,6 @@ export const decodeCreateExternalStorageRequest = ( return input; }; -export const encodeCreateExternalStorageResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeCreateExternalStorageResponse = ( input: Record, ) => { @@ -4962,13 +2480,6 @@ export const decodeCreateExternalStorageResponse = ( return input; }; -export const encodeCreateGuestRequest = (input: Record) => { - if (!input) return input; - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCreateGuestRequest = (input: Record) => { if (!input) return input; input.user = decodeUserRequest(input.user); @@ -4976,17 +2487,6 @@ export const decodeCreateGuestRequest = (input: Record) => { return input; }; -export const encodeCreateGuestResponse = (input: Record) => { - if (!input) return input; - input.access_token = encodestring(input.access_token); - - input.duration = encodestring(input.duration); - - input.user = encodeUserResponse(input.user); - - return input; -}; - export const decodeCreateGuestResponse = (input: Record) => { if (!input) return input; input.access_token = decodestring(input.access_token); @@ -4998,15 +2498,6 @@ export const decodeCreateGuestResponse = (input: Record) => { return input; }; -export const encodeCreateImportRequest = (input: Record) => { - if (!input) return input; - input.mode = encodestring(input.mode); - - input.path = encodestring(input.path); - - return input; -}; - export const decodeCreateImportRequest = (input: Record) => { if (!input) return input; input.mode = decodestring(input.mode); @@ -5016,15 +2507,6 @@ export const decodeCreateImportRequest = (input: Record) => { return input; }; -export const encodeCreateImportResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.import_task = encodeImportTask(input.import_task); - - return input; -}; - export const decodeCreateImportResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5034,13 +2516,6 @@ export const decodeCreateImportResponse = (input: Record) => { return input; }; -export const encodeCreateImportURLRequest = (input: Record) => { - if (!input) return input; - input.filename = encodestring(input.filename); - - return input; -}; - export const decodeCreateImportURLRequest = (input: Record) => { if (!input) return input; input.filename = decodestring(input.filename); @@ -5048,17 +2523,6 @@ export const decodeCreateImportURLRequest = (input: Record) => { return input; }; -export const encodeCreateImportURLResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.path = encodestring(input.path); - - input.upload_url = encodestring(input.upload_url); - - return input; -}; - export const decodeCreateImportURLResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5070,21 +2534,6 @@ export const decodeCreateImportURLResponse = (input: Record) => { return input; }; -export const encodeCreatePollOptionRequest = (input: Record) => { - if (!input) return input; - input.text = encodestring(input.text); - - input.position = encodeinteger(input.position); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCreatePollOptionRequest = (input: Record) => { if (!input) return input; input.text = decodestring(input.text); @@ -5100,43 +2549,6 @@ export const decodeCreatePollOptionRequest = (input: Record) => { return input; }; -export const encodeCreatePollRequest = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.allow_answers = encodeboolean(input.allow_answers); - - input.allow_user_suggested_options = encodeboolean( - input.allow_user_suggested_options, - ); - - input.description = encodestring(input.description); - - input.enforce_unique_vote = encodeboolean(input.enforce_unique_vote); - - input.id = encodestring(input.id); - - input.is_closed = encodeboolean(input.is_closed); - - input.max_votes_allowed = encodeinteger(input.max_votes_allowed); - - input.user_id = encodestring(input.user_id); - - input.voting_visibility = encodestring(input.voting_visibility); - - if (input.options) { - Object.keys(input.options).forEach((key) => { - input.options[key] = encodePollOptionInput(input.options[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCreatePollRequest = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -5174,13 +2586,6 @@ export const decodeCreatePollRequest = (input: Record) => { return input; }; -export const encodeCreateRoleRequest = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - return input; -}; - export const decodeCreateRoleRequest = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -5188,15 +2593,6 @@ export const decodeCreateRoleRequest = (input: Record) => { return input; }; -export const encodeCreateRoleResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.role = encodeRole(input.role); - - return input; -}; - export const decodeCreateRoleResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5206,15 +2602,6 @@ export const decodeCreateRoleResponse = (input: Record) => { return input; }; -export const encodeCustomActionRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.options = encodeobject(input.options); - - return input; -}; - export const decodeCustomActionRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -5224,29 +2611,6 @@ export const decodeCustomActionRequest = (input: Record) => { return input; }; -export const encodeCustomCheckRequest = (input: Record) => { - if (!input) return input; - input.entity_creator_id = encodestring(input.entity_creator_id); - - input.entity_id = encodestring(input.entity_id); - - input.entity_type = encodestring(input.entity_type); - - input.name = encodestring(input.name); - - input.reason = encodestring(input.reason); - - input.recommended_action = encodestring(input.recommended_action); - - input.user_id = encodestring(input.user_id); - - input.moderation_payload = encodeModerationPayload(input.moderation_payload); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeCustomCheckRequest = (input: Record) => { if (!input) return input; input.entity_creator_id = decodestring(input.entity_creator_id); @@ -5270,27 +2634,6 @@ export const decodeCustomCheckRequest = (input: Record) => { return input; }; -export const encodeCustomCheckResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.id = encodestring(input.id); - - input.recommended_action = encodestring(input.recommended_action); - - input.scored_at = encodeDatetimeType(input.scored_at); - - input.status = encodestring(input.status); - - input.report = encodearray(input.report); - - input.moderator_action = encodestring(input.moderator_action); - - input.reviewed_at = encodeDatetimeType(input.reviewed_at); - - return input; -}; - export const decodeCustomCheckResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5312,13 +2655,6 @@ export const decodeCustomCheckResponse = (input: Record) => { return input; }; -export const encodeData = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - return input; -}; - export const decodeData = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -5326,17 +2662,6 @@ export const decodeData = (input: Record) => { return input; }; -export const encodeDataDogInfo = (input: Record) => { - if (!input) return input; - input.api_key = encodestring(input.api_key); - - input.enabled = encodeboolean(input.enabled); - - input.site = encodestring(input.site); - - return input; -}; - export const decodeDataDogInfo = (input: Record) => { if (!input) return input; input.api_key = decodestring(input.api_key); @@ -5348,15 +2673,6 @@ export const decodeDataDogInfo = (input: Record) => { return input; }; -export const encodeDeactivateUserRequest = (input: Record) => { - if (!input) return input; - input.created_by_id = encodestring(input.created_by_id); - - input.mark_messages_deleted = encodeboolean(input.mark_messages_deleted); - - return input; -}; - export const decodeDeactivateUserRequest = (input: Record) => { if (!input) return input; input.created_by_id = decodestring(input.created_by_id); @@ -5366,15 +2682,6 @@ export const decodeDeactivateUserRequest = (input: Record) => { return input; }; -export const encodeDeactivateUserResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeDeactivateUserResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5384,23 +2691,6 @@ export const decodeDeactivateUserResponse = (input: Record) => { return input; }; -export const encodeDeactivateUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - input.created_by_id = encodestring(input.created_by_id); - - input.mark_channels_deleted = encodeboolean(input.mark_channels_deleted); - - input.mark_messages_deleted = encodeboolean(input.mark_messages_deleted); - - return input; -}; - export const decodeDeactivateUsersRequest = (input: Record) => { if (!input) return input; if (input.user_ids) { @@ -5418,15 +2708,6 @@ export const decodeDeactivateUsersRequest = (input: Record) => { return input; }; -export const encodeDeactivateUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeDeactivateUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5436,23 +2717,11 @@ export const decodeDeactivateUsersResponse = (input: Record) => { return input; }; -export const encodeDeleteActivityRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeDeleteActivityRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeDeleteCallRequest = (input: Record) => { - if (!input) return input; - input.hard = encodeboolean(input.hard); - - return input; -}; - export const decodeDeleteCallRequest = (input: Record) => { if (!input) return input; input.hard = decodeboolean(input.hard); @@ -5460,17 +2729,6 @@ export const decodeDeleteCallRequest = (input: Record) => { return input; }; -export const encodeDeleteCallResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.call = encodeCallResponse(input.call); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeDeleteCallResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5482,15 +2740,6 @@ export const decodeDeleteCallResponse = (input: Record) => { return input; }; -export const encodeDeleteChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.channel = encodeChannelResponse(input.channel); - - return input; -}; - export const decodeDeleteChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5500,19 +2749,6 @@ export const decodeDeleteChannelResponse = (input: Record) => { return input; }; -export const encodeDeleteChannelsRequest = (input: Record) => { - if (!input) return input; - if (input.cids) { - Object.keys(input.cids).forEach((key) => { - input.cids[key] = encodestring(input.cids[key]); - }); - } - - input.hard_delete = encodeboolean(input.hard_delete); - - return input; -}; - export const decodeDeleteChannelsRequest = (input: Record) => { if (!input) return input; if (input.cids) { @@ -5526,21 +2762,6 @@ export const decodeDeleteChannelsRequest = (input: Record) => { return input; }; -export const encodeDeleteChannelsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - if (input.result) { - Object.keys(input.result).forEach((key) => { - input.result[key] = encodeDeleteChannelsResultResponse(input.result[key]); - }); - } - - return input; -}; - export const decodeDeleteChannelsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5556,17 +2777,6 @@ export const decodeDeleteChannelsResponse = (input: Record) => { return input; }; -export const encodeDeleteChannelsResultResponse = ( - input: Record, -) => { - if (!input) return input; - input.status = encodestring(input.status); - - input.error = encodestring(input.error); - - return input; -}; - export const decodeDeleteChannelsResultResponse = ( input: Record, ) => { @@ -5578,15 +2788,6 @@ export const decodeDeleteChannelsResultResponse = ( return input; }; -export const encodeDeleteCommandResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - return input; -}; - export const decodeDeleteCommandResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5596,15 +2797,6 @@ export const decodeDeleteCommandResponse = (input: Record) => { return input; }; -export const encodeDeleteExternalStorageResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeDeleteExternalStorageResponse = ( input: Record, ) => { @@ -5614,13 +2806,6 @@ export const decodeDeleteExternalStorageResponse = ( return input; }; -export const encodeDeleteMessageRequest = (input: Record) => { - if (!input) return input; - input.hard_delete = encodeboolean(input.hard_delete); - - return input; -}; - export const decodeDeleteMessageRequest = (input: Record) => { if (!input) return input; input.hard_delete = decodeboolean(input.hard_delete); @@ -5628,15 +2813,6 @@ export const decodeDeleteMessageRequest = (input: Record) => { return input; }; -export const encodeDeleteMessageResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessageResponse(input.message); - - return input; -}; - export const decodeDeleteMessageResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5646,13 +2822,6 @@ export const decodeDeleteMessageResponse = (input: Record) => { return input; }; -export const encodeDeleteReactionRequest = (input: Record) => { - if (!input) return input; - input.hard_delete = encodeboolean(input.hard_delete); - - return input; -}; - export const decodeDeleteReactionRequest = (input: Record) => { if (!input) return input; input.hard_delete = decodeboolean(input.hard_delete); @@ -5660,13 +2829,6 @@ export const decodeDeleteReactionRequest = (input: Record) => { return input; }; -export const encodeDeleteRecordingResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeDeleteRecordingResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5674,15 +2836,6 @@ export const decodeDeleteRecordingResponse = (input: Record) => { return input; }; -export const encodeDeleteTranscriptionResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeDeleteTranscriptionResponse = ( input: Record, ) => { @@ -5692,19 +2845,6 @@ export const decodeDeleteTranscriptionResponse = ( return input; }; -export const encodeDeleteUserRequest = (input: Record) => { - if (!input) return input; - input.delete_conversation_channels = encodeboolean( - input.delete_conversation_channels, - ); - - input.hard_delete = encodeboolean(input.hard_delete); - - input.mark_messages_deleted = encodeboolean(input.mark_messages_deleted); - - return input; -}; - export const decodeDeleteUserRequest = (input: Record) => { if (!input) return input; input.delete_conversation_channels = decodeboolean( @@ -5718,29 +2858,6 @@ export const decodeDeleteUserRequest = (input: Record) => { return input; }; -export const encodeDeleteUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - input.calls = encodestring(input.calls); - - input.conversations = encodestring(input.conversations); - - input.messages = encodestring(input.messages); - - input.new_call_owner_id = encodestring(input.new_call_owner_id); - - input.new_channel_owner_id = encodestring(input.new_channel_owner_id); - - input.user = encodestring(input.user); - - return input; -}; - export const decodeDeleteUsersRequest = (input: Record) => { if (!input) return input; if (input.user_ids) { @@ -5764,15 +2881,6 @@ export const decodeDeleteUsersRequest = (input: Record) => { return input; }; -export const encodeDeleteUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeDeleteUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5782,27 +2890,6 @@ export const decodeDeleteUsersResponse = (input: Record) => { return input; }; -export const encodeDevice = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.push_provider = encodestring(input.push_provider); - - input.user_id = encodestring(input.user_id); - - input.disabled = encodeboolean(input.disabled); - - input.disabled_reason = encodestring(input.disabled_reason); - - input.push_provider_name = encodestring(input.push_provider_name); - - input.voip = encodeboolean(input.voip); - - return input; -}; - export const decodeDevice = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -5824,17 +2911,6 @@ export const decodeDevice = (input: Record) => { return input; }; -export const encodeDeviceErrorInfo = (input: Record) => { - if (!input) return input; - input.error_message = encodestring(input.error_message); - - input.provider = encodestring(input.provider); - - input.provider_name = encodestring(input.provider_name); - - return input; -}; - export const decodeDeviceErrorInfo = (input: Record) => { if (!input) return input; input.error_message = decodestring(input.error_message); @@ -5846,46 +2922,21 @@ export const decodeDeviceErrorInfo = (input: Record) => { return input; }; -export const encodeEdgeResponse = (input: Record) => { +export const decodeEdgeResponse = (input: Record) => { if (!input) return input; - input.continent_code = encodestring(input.continent_code); + input.continent_code = decodestring(input.continent_code); - input.country_iso_code = encodestring(input.country_iso_code); + input.country_iso_code = decodestring(input.country_iso_code); - input.green = encodeinteger(input.green); + input.green = decodeinteger(input.green); - input.id = encodestring(input.id); + input.id = decodestring(input.id); - input.latency_test_url = encodestring(input.latency_test_url); + input.latency_test_url = decodestring(input.latency_test_url); - input.latitude = encodenumber(input.latitude); + input.latitude = decodenumber(input.latitude); - input.longitude = encodenumber(input.longitude); - - input.red = encodeinteger(input.red); - - input.subdivision_iso_code = encodestring(input.subdivision_iso_code); - - input.yellow = encodeinteger(input.yellow); - - return input; -}; - -export const decodeEdgeResponse = (input: Record) => { - if (!input) return input; - input.continent_code = decodestring(input.continent_code); - - input.country_iso_code = decodestring(input.country_iso_code); - - input.green = decodeinteger(input.green); - - input.id = decodestring(input.id); - - input.latency_test_url = decodestring(input.latency_test_url); - - input.latitude = decodenumber(input.latitude); - - input.longitude = decodenumber(input.longitude); + input.longitude = decodenumber(input.longitude); input.red = decodeinteger(input.red); @@ -5896,13 +2947,6 @@ export const decodeEdgeResponse = (input: Record) => { return input; }; -export const encodeEgressHLSResponse = (input: Record) => { - if (!input) return input; - input.playlist_url = encodestring(input.playlist_url); - - return input; -}; - export const decodeEgressHLSResponse = (input: Record) => { if (!input) return input; input.playlist_url = decodestring(input.playlist_url); @@ -5910,17 +2954,6 @@ export const decodeEgressHLSResponse = (input: Record) => { return input; }; -export const encodeEgressRTMPResponse = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.stream_key = encodestring(input.stream_key); - - input.url = encodestring(input.url); - - return input; -}; - export const decodeEgressRTMPResponse = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -5932,21 +2965,6 @@ export const decodeEgressRTMPResponse = (input: Record) => { return input; }; -export const encodeEgressResponse = (input: Record) => { - if (!input) return input; - input.broadcasting = encodeboolean(input.broadcasting); - - if (input.rtmp_s) { - Object.keys(input.rtmp_s).forEach((key) => { - input.rtmp_s[key] = encodeEgressRTMPResponse(input.rtmp_s[key]); - }); - } - - input.hls = encodeEgressHLSResponse(input.hls); - - return input; -}; - export const decodeEgressResponse = (input: Record) => { if (!input) return input; input.broadcasting = decodeboolean(input.broadcasting); @@ -5962,23 +2980,11 @@ export const decodeEgressResponse = (input: Record) => { return input; }; -export const encodeEndCallRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeEndCallRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeEndCallResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeEndCallResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -5986,51 +2992,6 @@ export const decodeEndCallResponse = (input: Record) => { return input; }; -export const encodeEnrichedActivity = (input: Record) => { - if (!input) return input; - input.foreign_id = encodestring(input.foreign_id); - - input.id = encodestring(input.id); - - input.score = encodenumber(input.score); - - input.verb = encodestring(input.verb); - - if (input.to) { - Object.keys(input.to).forEach((key) => { - input.to[key] = encodestring(input.to[key]); - }); - } - - input.actor = encodeData(input.actor); - - if (input.latest_reactions) { - Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = encodearray(input.latest_reactions[key]); - }); - } - - input.object = encodeData(input.object); - - input.origin = encodeData(input.origin); - - if (input.own_reactions) { - Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = encodearray(input.own_reactions[key]); - }); - } - - if (input.reaction_counts) { - Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = encodeinteger(input.reaction_counts[key]); - }); - } - - input.target = encodeData(input.target); - - return input; -}; - export const decodeEnrichedActivity = (input: Record) => { if (!input) return input; input.foreign_id = decodestring(input.foreign_id); @@ -6076,53 +3037,6 @@ export const decodeEnrichedActivity = (input: Record) => { return input; }; -export const encodeEnrichedReaction = (input: Record) => { - if (!input) return input; - input.activity_id = encodestring(input.activity_id); - - input.kind = encodestring(input.kind); - - input.user_id = encodestring(input.user_id); - - input.id = encodestring(input.id); - - input.parent = encodestring(input.parent); - - if (input.target_feeds) { - Object.keys(input.target_feeds).forEach((key) => { - input.target_feeds[key] = encodestring(input.target_feeds[key]); - }); - } - - if (input.children_counts) { - Object.keys(input.children_counts).forEach((key) => { - input.children_counts[key] = encodeinteger(input.children_counts[key]); - }); - } - - input.created_at = encodeTime(input.created_at); - - input.data = encodeobject(input.data); - - if (input.latest_children) { - Object.keys(input.latest_children).forEach((key) => { - input.latest_children[key] = encodearray(input.latest_children[key]); - }); - } - - if (input.own_children) { - Object.keys(input.own_children).forEach((key) => { - input.own_children[key] = encodearray(input.own_children[key]); - }); - } - - input.updated_at = encodeTime(input.updated_at); - - input.user = encodeData(input.user); - - return input; -}; - export const decodeEnrichedReaction = (input: Record) => { if (!input) return input; input.activity_id = decodestring(input.activity_id); @@ -6170,17 +3084,6 @@ export const decodeEnrichedReaction = (input: Record) => { return input; }; -export const encodeErrorResult = (input: Record) => { - if (!input) return input; - input.type = encodestring(input.type); - - input.stacktrace = encodestring(input.stacktrace); - - input.version = encodestring(input.version); - - return input; -}; - export const decodeErrorResult = (input: Record) => { if (!input) return input; input.type = decodestring(input.type); @@ -6192,15 +3095,6 @@ export const decodeErrorResult = (input: Record) => { return input; }; -export const encodeEventNotificationSettings = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.apns = encodeAPNS(input.apns); - - return input; -}; - export const decodeEventNotificationSettings = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -6210,21 +3104,6 @@ export const decodeEventNotificationSettings = (input: Record) => { return input; }; -export const encodeEventRequest = (input: Record) => { - if (!input) return input; - input.type = encodestring(input.type); - - input.parent_id = encodestring(input.parent_id); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeEventRequest = (input: Record) => { if (!input) return input; input.type = decodestring(input.type); @@ -6240,15 +3119,6 @@ export const decodeEventRequest = (input: Record) => { return input; }; -export const encodeEventResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.event = encodeWSEvent(input.event); - - return input; -}; - export const decodeEventResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -6258,33 +3128,6 @@ export const decodeEventResponse = (input: Record) => { return input; }; -export const encodeExportChannelsRequest = (input: Record) => { - if (!input) return input; - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = encodeChannelExport(input.channels[key]); - }); - } - - input.clear_deleted_message_text = encodeboolean( - input.clear_deleted_message_text, - ); - - input.export_users = encodeboolean(input.export_users); - - input.include_soft_deleted_channels = encodeboolean( - input.include_soft_deleted_channels, - ); - - input.include_truncated_messages = encodeboolean( - input.include_truncated_messages, - ); - - input.version = encodestring(input.version); - - return input; -}; - export const decodeExportChannelsRequest = (input: Record) => { if (!input) return input; if (input.channels) { @@ -6312,15 +3155,6 @@ export const decodeExportChannelsRequest = (input: Record) => { return input; }; -export const encodeExportChannelsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeExportChannelsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -6330,17 +3164,6 @@ export const decodeExportChannelsResponse = (input: Record) => { return input; }; -export const encodeExportChannelsResult = (input: Record) => { - if (!input) return input; - input.url = encodestring(input.url); - - input.path = encodestring(input.path); - - input.s3_bucket_name = encodestring(input.s3_bucket_name); - - return input; -}; - export const decodeExportChannelsResult = (input: Record) => { if (!input) return input; input.url = decodestring(input.url); @@ -6352,27 +3175,6 @@ export const decodeExportChannelsResult = (input: Record) => { return input; }; -export const encodeExportUserResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.messages) { - Object.keys(input.messages).forEach((key) => { - input.messages[key] = encodeMessage(input.messages[key]); - }); - } - - if (input.reactions) { - Object.keys(input.reactions).forEach((key) => { - input.reactions[key] = encodeReaction(input.reactions[key]); - }); - } - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeExportUserResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -6394,17 +3196,6 @@ export const decodeExportUserResponse = (input: Record) => { return input; }; -export const encodeExportUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - return input; -}; - export const decodeExportUsersRequest = (input: Record) => { if (!input) return input; if (input.user_ids) { @@ -6416,15 +3207,6 @@ export const decodeExportUsersRequest = (input: Record) => { return input; }; -export const encodeExportUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeExportUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -6434,19 +3216,6 @@ export const decodeExportUsersResponse = (input: Record) => { return input; }; -export const encodeExternalStorageResponse = (input: Record) => { - if (!input) return input; - input.bucket = encodestring(input.bucket); - - input.name = encodestring(input.name); - - input.path = encodestring(input.path); - - input.type = encodestring(input.type); - - return input; -}; - export const decodeExternalStorageResponse = (input: Record) => { if (!input) return input; input.bucket = decodestring(input.bucket); @@ -6460,21 +3229,6 @@ export const decodeExternalStorageResponse = (input: Record) => { return input; }; -export const encodeFeedsModerationTemplateConfig = ( - input: Record, -) => { - if (!input) return input; - input.config_key = encodestring(input.config_key); - - if (input.data_types) { - Object.keys(input.data_types).forEach((key) => { - input.data_types[key] = encodestring(input.data_types[key]); - }); - } - - return input; -}; - export const decodeFeedsModerationTemplateConfig = ( input: Record, ) => { @@ -6490,17 +3244,6 @@ export const decodeFeedsModerationTemplateConfig = ( return input; }; -export const encodeField = (input: Record) => { - if (!input) return input; - input.short = encodeboolean(input.short); - - input.title = encodestring(input.title); - - input.value = encodestring(input.value); - - return input; -}; - export const decodeField = (input: Record) => { if (!input) return input; input.short = decodeboolean(input.short); @@ -6512,13 +3255,13 @@ export const decodeField = (input: Record) => { return input; }; -export const encodeFileUploadConfig = (input: Record) => { +export const decodeFileUploadConfig = (input: Record) => { if (!input) return input; - input.size_limit = encodeinteger(input.size_limit); + input.size_limit = decodeinteger(input.size_limit); if (input.allowed_file_extensions) { Object.keys(input.allowed_file_extensions).forEach((key) => { - input.allowed_file_extensions[key] = encodestring( + input.allowed_file_extensions[key] = decodestring( input.allowed_file_extensions[key], ); }); @@ -6526,7 +3269,7 @@ export const encodeFileUploadConfig = (input: Record) => { if (input.allowed_mime_types) { Object.keys(input.allowed_mime_types).forEach((key) => { - input.allowed_mime_types[key] = encodestring( + input.allowed_mime_types[key] = decodestring( input.allowed_mime_types[key], ); }); @@ -6534,7 +3277,7 @@ export const encodeFileUploadConfig = (input: Record) => { if (input.blocked_file_extensions) { Object.keys(input.blocked_file_extensions).forEach((key) => { - input.blocked_file_extensions[key] = encodestring( + input.blocked_file_extensions[key] = decodestring( input.blocked_file_extensions[key], ); }); @@ -6542,7 +3285,7 @@ export const encodeFileUploadConfig = (input: Record) => { if (input.blocked_mime_types) { Object.keys(input.blocked_mime_types).forEach((key) => { - input.blocked_mime_types[key] = encodestring( + input.blocked_mime_types[key] = decodestring( input.blocked_mime_types[key], ); }); @@ -6551,70 +3294,11 @@ export const encodeFileUploadConfig = (input: Record) => { return input; }; -export const decodeFileUploadConfig = (input: Record) => { +export const decodeFileUploadRequest = (input: Record) => { if (!input) return input; - input.size_limit = decodeinteger(input.size_limit); + input.file = decodestring(input.file); - if (input.allowed_file_extensions) { - Object.keys(input.allowed_file_extensions).forEach((key) => { - input.allowed_file_extensions[key] = decodestring( - input.allowed_file_extensions[key], - ); - }); - } - - if (input.allowed_mime_types) { - Object.keys(input.allowed_mime_types).forEach((key) => { - input.allowed_mime_types[key] = decodestring( - input.allowed_mime_types[key], - ); - }); - } - - if (input.blocked_file_extensions) { - Object.keys(input.blocked_file_extensions).forEach((key) => { - input.blocked_file_extensions[key] = decodestring( - input.blocked_file_extensions[key], - ); - }); - } - - if (input.blocked_mime_types) { - Object.keys(input.blocked_mime_types).forEach((key) => { - input.blocked_mime_types[key] = decodestring( - input.blocked_mime_types[key], - ); - }); - } - - return input; -}; - -export const encodeFileUploadRequest = (input: Record) => { - if (!input) return input; - input.file = encodestring(input.file); - - input.user = encodeOnlyUserID(input.user); - - return input; -}; - -export const decodeFileUploadRequest = (input: Record) => { - if (!input) return input; - input.file = decodestring(input.file); - - input.user = decodeOnlyUserID(input.user); - - return input; -}; - -export const encodeFileUploadResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.file = encodestring(input.file); - - input.thumb_url = encodestring(input.thumb_url); + input.user = decodeOnlyUserID(input.user); return input; }; @@ -6630,23 +3314,6 @@ export const decodeFileUploadResponse = (input: Record) => { return input; }; -export const encodeFirebaseConfig = (input: Record) => { - if (!input) return input; - input.apn_template = encodestring(input.apn_template); - - input.credentials_json = encodestring(input.credentials_json); - - input.data_template = encodestring(input.data_template); - - input.disabled = encodeboolean(input.disabled); - - input.notification_template = encodestring(input.notification_template); - - input.server_key = encodestring(input.server_key); - - return input; -}; - export const decodeFirebaseConfig = (input: Record) => { if (!input) return input; input.apn_template = decodestring(input.apn_template); @@ -6664,23 +3331,6 @@ export const decodeFirebaseConfig = (input: Record) => { return input; }; -export const encodeFirebaseConfigFields = (input: Record) => { - if (!input) return input; - input.apn_template = encodestring(input.apn_template); - - input.data_template = encodestring(input.data_template); - - input.enabled = encodeboolean(input.enabled); - - input.notification_template = encodestring(input.notification_template); - - input.credentials_json = encodestring(input.credentials_json); - - input.server_key = encodestring(input.server_key); - - return input; -}; - export const decodeFirebaseConfigFields = (input: Record) => { if (!input) return input; input.apn_template = decodestring(input.apn_template); @@ -6698,47 +3348,6 @@ export const decodeFirebaseConfigFields = (input: Record) => { return input; }; -export const encodeFlag2 = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.entity_id = encodestring(input.entity_id); - - input.entity_type = encodestring(input.entity_type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.result) { - Object.keys(input.result).forEach((key) => { - input.result[key] = encodeobject(input.result[key]); - }); - } - - input.entity_creator_id = encodestring(input.entity_creator_id); - - input.moderation_payload_hash = encodestring(input.moderation_payload_hash); - - input.reason = encodestring(input.reason); - - input.review_queue_item_id = encodestring(input.review_queue_item_id); - - input.type = encodestring(input.type); - - if (input.labels) { - Object.keys(input.labels).forEach((key) => { - input.labels[key] = encodestring(input.labels[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.moderation_payload = encodeModerationPayload(input.moderation_payload); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeFlag2 = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -6780,17 +3389,6 @@ export const decodeFlag2 = (input: Record) => { return input; }; -export const encodeFlagDetails = (input: Record) => { - if (!input) return input; - input.original_text = encodestring(input.original_text); - - input.extra = encodeobject(input.extra); - - input.automod = encodeAutomodDetails(input.automod); - - return input; -}; - export const decodeFlagDetails = (input: Record) => { if (!input) return input; input.original_text = decodestring(input.original_text); @@ -6802,21 +3400,6 @@ export const decodeFlagDetails = (input: Record) => { return input; }; -export const encodeFlagFeedback = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.message_id = encodestring(input.message_id); - - if (input.labels) { - Object.keys(input.labels).forEach((key) => { - input.labels[key] = encodeLabel(input.labels[key]); - }); - } - - return input; -}; - export const decodeFlagFeedback = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -6832,19 +3415,6 @@ export const decodeFlagFeedback = (input: Record) => { return input; }; -export const encodeFlagMessageDetails = (input: Record) => { - if (!input) return input; - input.pin_changed = encodeboolean(input.pin_changed); - - input.should_enrich = encodeboolean(input.should_enrich); - - input.skip_push = encodeboolean(input.skip_push); - - input.updated_by_id = encodestring(input.updated_by_id); - - return input; -}; - export const decodeFlagMessageDetails = (input: Record) => { if (!input) return input; input.pin_changed = decodeboolean(input.pin_changed); @@ -6858,27 +3428,6 @@ export const decodeFlagMessageDetails = (input: Record) => { return input; }; -export const encodeFlagRequest = (input: Record) => { - if (!input) return input; - input.entity_id = encodestring(input.entity_id); - - input.entity_type = encodestring(input.entity_type); - - input.reason = encodestring(input.reason); - - input.entity_creator_id = encodestring(input.entity_creator_id); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.moderation_payload = encodeModerationPayload(input.moderation_payload); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeFlagRequest = (input: Record) => { if (!input) return input; input.entity_id = decodestring(input.entity_id); @@ -6900,15 +3449,6 @@ export const decodeFlagRequest = (input: Record) => { return input; }; -export const encodeFlagResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.item_id = encodestring(input.item_id); - - return input; -}; - export const decodeFlagResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -6918,97 +3458,6 @@ export const decodeFlagResponse = (input: Record) => { return input; }; -export const encodeFullUserResponse = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.invisible = encodeboolean(input.invisible); - - input.language = encodestring(input.language); - - input.online = encodeboolean(input.online); - - input.role = encodestring(input.role); - - input.shadow_banned = encodeboolean(input.shadow_banned); - - input.total_unread_count = encodeinteger(input.total_unread_count); - - input.unread_channels = encodeinteger(input.unread_channels); - - input.unread_threads = encodeinteger(input.unread_threads); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.blocked_user_ids) { - Object.keys(input.blocked_user_ids).forEach((key) => { - input.blocked_user_ids[key] = encodestring(input.blocked_user_ids[key]); - }); - } - - if (input.channel_mutes) { - Object.keys(input.channel_mutes).forEach((key) => { - input.channel_mutes[key] = encodeChannelMute(input.channel_mutes[key]); - }); - } - - if (input.devices) { - Object.keys(input.devices).forEach((key) => { - input.devices[key] = encodeDevice(input.devices[key]); - }); - } - - if (input.mutes) { - Object.keys(input.mutes).forEach((key) => { - input.mutes[key] = encodeUserMuteResponse(input.mutes[key]); - }); - } - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = encodestring(input.teams[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.deactivated_at = encodeDatetimeType(input.deactivated_at); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.image = encodestring(input.image); - - input.last_active = encodeDatetimeType(input.last_active); - - input.name = encodestring(input.name); - - input.revoke_tokens_issued_before = encodeDatetimeType( - input.revoke_tokens_issued_before, - ); - - if (input.latest_hidden_channels) { - Object.keys(input.latest_hidden_channels).forEach((key) => { - input.latest_hidden_channels[key] = encodestring( - input.latest_hidden_channels[key], - ); - }); - } - - input.privacy_settings = encodePrivacySettingsResponse( - input.privacy_settings, - ); - - input.push_notifications = encodePushNotificationSettingsResponse( - input.push_notifications, - ); - - return input; -}; - export const decodeFullUserResponse = (input: Record) => { if (!input) return input; input.banned = decodeboolean(input.banned); @@ -7100,23 +3549,6 @@ export const decodeFullUserResponse = (input: Record) => { return input; }; -export const encodeGeofenceResponse = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.description = encodestring(input.description); - - input.type = encodestring(input.type); - - if (input.country_codes) { - Object.keys(input.country_codes).forEach((key) => { - input.country_codes[key] = encodestring(input.country_codes[key]); - }); - } - - return input; -}; - export const decodeGeofenceResponse = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -7134,17 +3566,6 @@ export const decodeGeofenceResponse = (input: Record) => { return input; }; -export const encodeGeofenceSettings = (input: Record) => { - if (!input) return input; - if (input.names) { - Object.keys(input.names).forEach((key) => { - input.names[key] = encodestring(input.names[key]); - }); - } - - return input; -}; - export const decodeGeofenceSettings = (input: Record) => { if (!input) return input; if (input.names) { @@ -7156,17 +3577,6 @@ export const decodeGeofenceSettings = (input: Record) => { return input; }; -export const encodeGeofenceSettingsRequest = (input: Record) => { - if (!input) return input; - if (input.names) { - Object.keys(input.names).forEach((key) => { - input.names[key] = encodestring(input.names[key]); - }); - } - - return input; -}; - export const decodeGeofenceSettingsRequest = (input: Record) => { if (!input) return input; if (input.names) { @@ -7178,17 +3588,6 @@ export const decodeGeofenceSettingsRequest = (input: Record) => { return input; }; -export const encodeGeofenceSettingsResponse = (input: Record) => { - if (!input) return input; - if (input.names) { - Object.keys(input.names).forEach((key) => { - input.names[key] = encodestring(input.names[key]); - }); - } - - return input; -}; - export const decodeGeofenceSettingsResponse = (input: Record) => { if (!input) return input; if (input.names) { @@ -7200,31 +3599,6 @@ export const decodeGeofenceSettingsResponse = (input: Record) => { return input; }; -export const encodeGeolocationResult = (input: Record) => { - if (!input) return input; - input.accuracy_radius = encodeinteger(input.accuracy_radius); - - input.city = encodestring(input.city); - - input.continent = encodestring(input.continent); - - input.continent_code = encodestring(input.continent_code); - - input.country = encodestring(input.country); - - input.country_iso_code = encodestring(input.country_iso_code); - - input.latitude = encodenumber(input.latitude); - - input.longitude = encodenumber(input.longitude); - - input.subdivision = encodestring(input.subdivision); - - input.subdivision_iso_code = encodestring(input.subdivision_iso_code); - - return input; -}; - export const decodeGeolocationResult = (input: Record) => { if (!input) return input; input.accuracy_radius = decodeinteger(input.accuracy_radius); @@ -7250,29 +3624,11 @@ export const decodeGeolocationResult = (input: Record) => { return input; }; -export const encodeGetApplicationResponse = (input: Record) => { +export const decodeGetApplicationResponse = (input: Record) => { if (!input) return input; - input.duration = encodestring(input.duration); + input.duration = decodestring(input.duration); - input.app = encodeAppResponseFields(input.app); - - return input; -}; - -export const decodeGetApplicationResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - input.app = decodeAppResponseFields(input.app); - - return input; -}; - -export const encodeGetBlockListResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.blocklist = encodeBlockListResponse(input.blocklist); + input.app = decodeAppResponseFields(input.app); return input; }; @@ -7286,19 +3642,6 @@ export const decodeGetBlockListResponse = (input: Record) => { return input; }; -export const encodeGetBlockedUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.blocks) { - Object.keys(input.blocks).forEach((key) => { - input.blocks[key] = encodeBlockedUserResponse(input.blocks[key]); - }); - } - - return input; -}; - export const decodeGetBlockedUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7312,29 +3655,6 @@ export const decodeGetBlockedUsersResponse = (input: Record) => { return input; }; -export const encodeGetCallResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); - }); - } - - if (input.own_capabilities) { - Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = encodeOwnCapability( - input.own_capabilities[key], - ); - }); - } - - input.call = encodeCallResponse(input.call); - - return input; -}; - export const decodeGetCallResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7358,55 +3678,6 @@ export const decodeGetCallResponse = (input: Record) => { return input; }; -export const encodeGetCallStatsResponse = (input: Record) => { - if (!input) return input; - input.call_duration_seconds = encodeinteger(input.call_duration_seconds); - - input.call_status = encodestring(input.call_status); - - input.duration = encodestring(input.duration); - - input.max_freezes_duration_seconds = encodeinteger( - input.max_freezes_duration_seconds, - ); - - input.max_participants = encodeinteger(input.max_participants); - - input.max_total_quality_limitation_duration_seconds = encodeinteger( - input.max_total_quality_limitation_duration_seconds, - ); - - input.publishing_participants = encodeinteger(input.publishing_participants); - - input.quality_score = encodeinteger(input.quality_score); - - input.sfu_count = encodeinteger(input.sfu_count); - - if (input.participant_report) { - Object.keys(input.participant_report).forEach((key) => { - input.participant_report[key] = encodeUserStats( - input.participant_report[key], - ); - }); - } - - if (input.sfus) { - Object.keys(input.sfus).forEach((key) => { - input.sfus[key] = encodeSFULocationResponse(input.sfus[key]); - }); - } - - input.aggregated = encodeAggregatedStats(input.aggregated); - - input.call_timeline = encodeCallTimeline(input.call_timeline); - - input.jitter = encodeTimeStats(input.jitter); - - input.latency = encodeTimeStats(input.latency); - - return input; -}; - export const decodeGetCallStatsResponse = (input: Record) => { if (!input) return input; input.call_duration_seconds = decodeinteger(input.call_duration_seconds); @@ -7456,33 +3727,6 @@ export const decodeGetCallStatsResponse = (input: Record) => { return input; }; -export const encodeGetCallTypeResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsResponse(input.settings); - - input.external_storage = encodestring(input.external_storage); - - return input; -}; - export const decodeGetCallTypeResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -7510,93 +3754,6 @@ export const decodeGetCallTypeResponse = (input: Record) => { return input; }; -export const encodeGetChannelTypeResponse = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.created_at = encodeDatetimeType(input.created_at); - - input.custom_events = encodeboolean(input.custom_events); - - input.duration = encodestring(input.duration); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.mutes = encodeboolean(input.mutes); - - input.name = encodestring(input.name); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodeCommand(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); - }); - } - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - return input; -}; - export const decodeGetChannelTypeResponse = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -7684,25 +3841,6 @@ export const decodeGetChannelTypeResponse = (input: Record) => { return input; }; -export const encodeGetCommandResponse = (input: Record) => { - if (!input) return input; - input.args = encodestring(input.args); - - input.description = encodestring(input.description); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.set = encodestring(input.set); - - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - return input; -}; - export const decodeGetCommandResponse = (input: Record) => { if (!input) return input; input.args = decodestring(input.args); @@ -7722,15 +3860,6 @@ export const decodeGetCommandResponse = (input: Record) => { return input; }; -export const encodeGetConfigResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.config = encodeConfigResponse(input.config); - - return input; -}; - export const decodeGetConfigResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7740,17 +3869,6 @@ export const decodeGetConfigResponse = (input: Record) => { return input; }; -export const encodeGetCustomPermissionResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.permission = encodePermission(input.permission); - - return input; -}; - export const decodeGetCustomPermissionResponse = ( input: Record, ) => { @@ -7762,19 +3880,6 @@ export const decodeGetCustomPermissionResponse = ( return input; }; -export const encodeGetEdgesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.edges) { - Object.keys(input.edges).forEach((key) => { - input.edges[key] = encodeEdgeResponse(input.edges[key]); - }); - } - - return input; -}; - export const decodeGetEdgesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7788,27 +3893,6 @@ export const decodeGetEdgesResponse = (input: Record) => { return input; }; -export const encodeGetExportChannelsStatusResponse = ( - input: Record, -) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.status = encodestring(input.status); - - input.task_id = encodestring(input.task_id); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.error = encodeErrorResult(input.error); - - input.result = encodeExportChannelsResult(input.result); - - return input; -}; - export const decodeGetExportChannelsStatusResponse = ( input: Record, ) => { @@ -7830,15 +3914,6 @@ export const decodeGetExportChannelsStatusResponse = ( return input; }; -export const encodeGetImportResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.import_task = encodeImportTask(input.import_task); - - return input; -}; - export const decodeGetImportResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7848,19 +3923,6 @@ export const decodeGetImportResponse = (input: Record) => { return input; }; -export const encodeGetManyMessagesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.messages) { - Object.keys(input.messages).forEach((key) => { - input.messages[key] = encodeMessage(input.messages[key]); - }); - } - - return input; -}; - export const decodeGetManyMessagesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7874,23 +3936,6 @@ export const decodeGetManyMessagesResponse = (input: Record) => { return input; }; -export const encodeGetMessageResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessageWithChannelResponse(input.message); - - if (input.pending_message_metadata) { - Object.keys(input.pending_message_metadata).forEach((key) => { - input.pending_message_metadata[key] = encodestring( - input.pending_message_metadata[key], - ); - }); - } - - return input; -}; - export const decodeGetMessageResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -7908,144 +3953,70 @@ export const decodeGetMessageResponse = (input: Record) => { return input; }; -export const encodeGetOGResponse = (input: Record) => { +export const decodeGetOGResponse = (input: Record) => { if (!input) return input; - input.duration = encodestring(input.duration); + input.duration = decodestring(input.duration); - input.custom = encodeobject(input.custom); + input.custom = decodeobject(input.custom); - input.asset_url = encodestring(input.asset_url); + input.asset_url = decodestring(input.asset_url); - input.author_icon = encodestring(input.author_icon); + input.author_icon = decodestring(input.author_icon); - input.author_link = encodestring(input.author_link); + input.author_link = decodestring(input.author_link); - input.author_name = encodestring(input.author_name); + input.author_name = decodestring(input.author_name); - input.color = encodestring(input.color); + input.color = decodestring(input.color); - input.fallback = encodestring(input.fallback); + input.fallback = decodestring(input.fallback); - input.footer = encodestring(input.footer); + input.footer = decodestring(input.footer); - input.footer_icon = encodestring(input.footer_icon); + input.footer_icon = decodestring(input.footer_icon); - input.image_url = encodestring(input.image_url); + input.image_url = decodestring(input.image_url); - input.og_scrape_url = encodestring(input.og_scrape_url); + input.og_scrape_url = decodestring(input.og_scrape_url); - input.original_height = encodeinteger(input.original_height); + input.original_height = decodeinteger(input.original_height); - input.original_width = encodeinteger(input.original_width); + input.original_width = decodeinteger(input.original_width); - input.pretext = encodestring(input.pretext); + input.pretext = decodestring(input.pretext); - input.text = encodestring(input.text); + input.text = decodestring(input.text); - input.thumb_url = encodestring(input.thumb_url); + input.thumb_url = decodestring(input.thumb_url); - input.title = encodestring(input.title); + input.title = decodestring(input.title); - input.title_link = encodestring(input.title_link); + input.title_link = decodestring(input.title_link); - input.type = encodestring(input.type); + input.type = decodestring(input.type); if (input.actions) { Object.keys(input.actions).forEach((key) => { - input.actions[key] = encodeAction(input.actions[key]); + input.actions[key] = decodeAction(input.actions[key]); }); } if (input.fields) { Object.keys(input.fields).forEach((key) => { - input.fields[key] = encodeField(input.fields[key]); + input.fields[key] = decodeField(input.fields[key]); }); } - input.giphy = encodeImages(input.giphy); + input.giphy = decodeImages(input.giphy); return input; }; -export const decodeGetOGResponse = (input: Record) => { +export const decodeGetOrCreateCallRequest = (input: Record) => { if (!input) return input; - input.duration = decodestring(input.duration); + input.members_limit = decodeinteger(input.members_limit); - input.custom = decodeobject(input.custom); - - input.asset_url = decodestring(input.asset_url); - - input.author_icon = decodestring(input.author_icon); - - input.author_link = decodestring(input.author_link); - - input.author_name = decodestring(input.author_name); - - input.color = decodestring(input.color); - - input.fallback = decodestring(input.fallback); - - input.footer = decodestring(input.footer); - - input.footer_icon = decodestring(input.footer_icon); - - input.image_url = decodestring(input.image_url); - - input.og_scrape_url = decodestring(input.og_scrape_url); - - input.original_height = decodeinteger(input.original_height); - - input.original_width = decodeinteger(input.original_width); - - input.pretext = decodestring(input.pretext); - - input.text = decodestring(input.text); - - input.thumb_url = decodestring(input.thumb_url); - - input.title = decodestring(input.title); - - input.title_link = decodestring(input.title_link); - - input.type = decodestring(input.type); - - if (input.actions) { - Object.keys(input.actions).forEach((key) => { - input.actions[key] = decodeAction(input.actions[key]); - }); - } - - if (input.fields) { - Object.keys(input.fields).forEach((key) => { - input.fields[key] = decodeField(input.fields[key]); - }); - } - - input.giphy = decodeImages(input.giphy); - - return input; -}; - -export const encodeGetOrCreateCallRequest = (input: Record) => { - if (!input) return input; - input.members_limit = encodeinteger(input.members_limit); - - input.notify = encodeboolean(input.notify); - - input.ring = encodeboolean(input.ring); - - input.video = encodeboolean(input.video); - - input.data = encodeCallRequest(input.data); - - return input; -}; - -export const decodeGetOrCreateCallRequest = (input: Record) => { - if (!input) return input; - input.members_limit = decodeinteger(input.members_limit); - - input.notify = decodeboolean(input.notify); + input.notify = decodeboolean(input.notify); input.ring = decodeboolean(input.ring); @@ -8056,31 +4027,6 @@ export const decodeGetOrCreateCallRequest = (input: Record) => { return input; }; -export const encodeGetOrCreateCallResponse = (input: Record) => { - if (!input) return input; - input.created = encodeboolean(input.created); - - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); - }); - } - - if (input.own_capabilities) { - Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = encodeOwnCapability( - input.own_capabilities[key], - ); - }); - } - - input.call = encodeCallResponse(input.call); - - return input; -}; - export const decodeGetOrCreateCallResponse = (input: Record) => { if (!input) return input; input.created = decodeboolean(input.created); @@ -8106,37 +4052,6 @@ export const decodeGetOrCreateCallResponse = (input: Record) => { return input; }; -export const encodeGetRateLimitsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.android) { - Object.keys(input.android).forEach((key) => { - input.android[key] = encodeLimitInfo(input.android[key]); - }); - } - - if (input.ios) { - Object.keys(input.ios).forEach((key) => { - input.ios[key] = encodeLimitInfo(input.ios[key]); - }); - } - - if (input.server_side) { - Object.keys(input.server_side).forEach((key) => { - input.server_side[key] = encodeLimitInfo(input.server_side[key]); - }); - } - - if (input.web) { - Object.keys(input.web).forEach((key) => { - input.web[key] = encodeLimitInfo(input.web[key]); - }); - } - - return input; -}; - export const decodeGetRateLimitsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8168,19 +4083,6 @@ export const decodeGetRateLimitsResponse = (input: Record) => { return input; }; -export const encodeGetReactionsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.reactions) { - Object.keys(input.reactions).forEach((key) => { - input.reactions[key] = encodeReaction(input.reactions[key]); - }); - } - - return input; -}; - export const decodeGetReactionsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8194,19 +4096,6 @@ export const decodeGetReactionsResponse = (input: Record) => { return input; }; -export const encodeGetRepliesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.messages) { - Object.keys(input.messages).forEach((key) => { - input.messages[key] = encodeMessageResponse(input.messages[key]); - }); - } - - return input; -}; - export const decodeGetRepliesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8220,23 +4109,6 @@ export const decodeGetRepliesResponse = (input: Record) => { return input; }; -export const encodeGetReviewQueueItemResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.history) { - Object.keys(input.history).forEach((key) => { - input.history[key] = encodeReviewQueueItem(input.history[key]); - }); - } - - input.item = encodeReviewQueueItem(input.item); - - return input; -}; - export const decodeGetReviewQueueItemResponse = ( input: Record, ) => { @@ -8254,25 +4126,6 @@ export const decodeGetReviewQueueItemResponse = ( return input; }; -export const encodeGetTaskResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.status = encodestring(input.status); - - input.task_id = encodestring(input.task_id); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.error = encodeErrorResult(input.error); - - input.result = encodeobject(input.result); - - return input; -}; - export const decodeGetTaskResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -8292,15 +4145,6 @@ export const decodeGetTaskResponse = (input: Record) => { return input; }; -export const encodeGetThreadResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.thread = encodeThreadStateResponse(input.thread); - - return input; -}; - export const decodeGetThreadResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8310,29 +4154,6 @@ export const decodeGetThreadResponse = (input: Record) => { return input; }; -export const encodeGetUserModerationReportResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.user_blocks) { - Object.keys(input.user_blocks).forEach((key) => { - input.user_blocks[key] = encodeUserBlock(input.user_blocks[key]); - }); - } - - if (input.user_mutes) { - Object.keys(input.user_mutes).forEach((key) => { - input.user_mutes[key] = encodeUserMute(input.user_mutes[key]); - }); - } - - input.user = encodeUserResponse(input.user); - - return input; -}; - export const decodeGetUserModerationReportResponse = ( input: Record, ) => { @@ -8356,23 +4177,6 @@ export const decodeGetUserModerationReportResponse = ( return input; }; -export const encodeGoLiveRequest = (input: Record) => { - if (!input) return input; - input.recording_storage_name = encodestring(input.recording_storage_name); - - input.start_hls = encodeboolean(input.start_hls); - - input.start_recording = encodeboolean(input.start_recording); - - input.start_transcription = encodeboolean(input.start_transcription); - - input.transcription_storage_name = encodestring( - input.transcription_storage_name, - ); - - return input; -}; - export const decodeGoLiveRequest = (input: Record) => { if (!input) return input; input.recording_storage_name = decodestring(input.recording_storage_name); @@ -8390,15 +4194,6 @@ export const decodeGoLiveRequest = (input: Record) => { return input; }; -export const encodeGoLiveResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.call = encodeCallResponse(input.call); - - return input; -}; - export const decodeGoLiveResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8408,13 +4203,6 @@ export const decodeGoLiveResponse = (input: Record) => { return input; }; -export const encodeGoogleVisionConfig = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeGoogleVisionConfig = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -8422,23 +4210,6 @@ export const decodeGoogleVisionConfig = (input: Record) => { return input; }; -export const encodeHLSSettings = (input: Record) => { - if (!input) return input; - input.auto_on = encodeboolean(input.auto_on); - - input.enabled = encodeboolean(input.enabled); - - if (input.quality_tracks) { - Object.keys(input.quality_tracks).forEach((key) => { - input.quality_tracks[key] = encodestring(input.quality_tracks[key]); - }); - } - - input.layout = encodeLayoutSettings(input.layout); - - return input; -}; - export const decodeHLSSettings = (input: Record) => { if (!input) return input; input.auto_on = decodeboolean(input.auto_on); @@ -8456,23 +4227,6 @@ export const decodeHLSSettings = (input: Record) => { return input; }; -export const encodeHLSSettingsRequest = (input: Record) => { - if (!input) return input; - if (input.quality_tracks) { - Object.keys(input.quality_tracks).forEach((key) => { - input.quality_tracks[key] = encodestring(input.quality_tracks[key]); - }); - } - - input.auto_on = encodeboolean(input.auto_on); - - input.enabled = encodeboolean(input.enabled); - - input.layout = encodeLayoutSettingsRequest(input.layout); - - return input; -}; - export const decodeHLSSettingsRequest = (input: Record) => { if (!input) return input; if (input.quality_tracks) { @@ -8490,23 +4244,6 @@ export const decodeHLSSettingsRequest = (input: Record) => { return input; }; -export const encodeHLSSettingsResponse = (input: Record) => { - if (!input) return input; - input.auto_on = encodeboolean(input.auto_on); - - input.enabled = encodeboolean(input.enabled); - - if (input.quality_tracks) { - Object.keys(input.quality_tracks).forEach((key) => { - input.quality_tracks[key] = encodestring(input.quality_tracks[key]); - }); - } - - input.layout = encodeLayoutSettingsResponse(input.layout); - - return input; -}; - export const decodeHLSSettingsResponse = (input: Record) => { if (!input) return input; input.auto_on = decodeboolean(input.auto_on); @@ -8524,17 +4261,6 @@ export const decodeHLSSettingsResponse = (input: Record) => { return input; }; -export const encodeHideChannelRequest = (input: Record) => { - if (!input) return input; - input.clear_history = encodeboolean(input.clear_history); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeHideChannelRequest = (input: Record) => { if (!input) return input; input.clear_history = decodeboolean(input.clear_history); @@ -8546,13 +4272,6 @@ export const decodeHideChannelRequest = (input: Record) => { return input; }; -export const encodeHideChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeHideChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8560,40 +4279,18 @@ export const decodeHideChannelResponse = (input: Record) => { return input; }; -export const encodeHuaweiConfig = (input: Record) => { +export const decodeHuaweiConfig = (input: Record) => { if (!input) return input; - input.disabled = encodeboolean(input.disabled); + input.disabled = decodeboolean(input.disabled); - input.id = encodestring(input.id); + input.id = decodestring(input.id); - input.secret = encodestring(input.secret); + input.secret = decodestring(input.secret); return input; }; -export const decodeHuaweiConfig = (input: Record) => { - if (!input) return input; - input.disabled = decodeboolean(input.disabled); - - input.id = decodestring(input.id); - - input.secret = decodestring(input.secret); - - return input; -}; - -export const encodeHuaweiConfigFields = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.id = encodestring(input.id); - - input.secret = encodestring(input.secret); - - return input; -}; - -export const decodeHuaweiConfigFields = (input: Record) => { +export const decodeHuaweiConfigFields = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -8604,21 +4301,6 @@ export const decodeHuaweiConfigFields = (input: Record) => { return input; }; -export const encodeImageData = (input: Record) => { - if (!input) return input; - input.frames = encodestring(input.frames); - - input.height = encodestring(input.height); - - input.size = encodestring(input.size); - - input.url = encodestring(input.url); - - input.width = encodestring(input.width); - - return input; -}; - export const decodeImageData = (input: Record) => { if (!input) return input; input.frames = decodestring(input.frames); @@ -8634,19 +4316,6 @@ export const decodeImageData = (input: Record) => { return input; }; -export const encodeImageSize = (input: Record) => { - if (!input) return input; - input.crop = encodestring(input.crop); - - input.height = encodeinteger(input.height); - - input.resize = encodestring(input.resize); - - input.width = encodeinteger(input.width); - - return input; -}; - export const decodeImageSize = (input: Record) => { if (!input) return input; input.crop = decodestring(input.crop); @@ -8660,21 +4329,6 @@ export const decodeImageSize = (input: Record) => { return input; }; -export const encodeImageUploadRequest = (input: Record) => { - if (!input) return input; - input.file = encodestring(input.file); - - if (input.upload_sizes) { - Object.keys(input.upload_sizes).forEach((key) => { - input.upload_sizes[key] = encodeImageSize(input.upload_sizes[key]); - }); - } - - input.user = encodeOnlyUserID(input.user); - - return input; -}; - export const decodeImageUploadRequest = (input: Record) => { if (!input) return input; input.file = decodestring(input.file); @@ -8690,23 +4344,6 @@ export const decodeImageUploadRequest = (input: Record) => { return input; }; -export const encodeImageUploadResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.file = encodestring(input.file); - - input.thumb_url = encodestring(input.thumb_url); - - if (input.upload_sizes) { - Object.keys(input.upload_sizes).forEach((key) => { - input.upload_sizes[key] = encodeImageSize(input.upload_sizes[key]); - }); - } - - return input; -}; - export const decodeImageUploadResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -8724,29 +4361,6 @@ export const decodeImageUploadResponse = (input: Record) => { return input; }; -export const encodeImages = (input: Record) => { - if (!input) return input; - input.fixed_height = encodeImageData(input.fixed_height); - - input.fixed_height_downsampled = encodeImageData( - input.fixed_height_downsampled, - ); - - input.fixed_height_still = encodeImageData(input.fixed_height_still); - - input.fixed_width = encodeImageData(input.fixed_width); - - input.fixed_width_downsampled = encodeImageData( - input.fixed_width_downsampled, - ); - - input.fixed_width_still = encodeImageData(input.fixed_width_still); - - input.original = encodeImageData(input.original); - - return input; -}; - export const decodeImages = (input: Record) => { if (!input) return input; input.fixed_height = decodeImageData(input.fixed_height); @@ -8770,31 +4384,6 @@ export const decodeImages = (input: Record) => { return input; }; -export const encodeImportTask = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.mode = encodestring(input.mode); - - input.path = encodestring(input.path); - - input.state = encodestring(input.state); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.history) { - Object.keys(input.history).forEach((key) => { - input.history[key] = encodeImportTaskHistory(input.history[key]); - }); - } - - input.size = encodeinteger(input.size); - - return input; -}; - export const decodeImportTask = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -8820,17 +4409,6 @@ export const decodeImportTask = (input: Record) => { return input; }; -export const encodeImportTaskHistory = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.next_state = encodestring(input.next_state); - - input.prev_state = encodestring(input.prev_state); - - return input; -}; - export const decodeImportTaskHistory = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -8842,25 +4420,6 @@ export const decodeImportTaskHistory = (input: Record) => { return input; }; -export const encodeLabel = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - if (input.harm_labels) { - Object.keys(input.harm_labels).forEach((key) => { - input.harm_labels[key] = encodestring(input.harm_labels[key]); - }); - } - - if (input.phrase_list_ids) { - Object.keys(input.phrase_list_ids).forEach((key) => { - input.phrase_list_ids[key] = encodeinteger(input.phrase_list_ids[key]); - }); - } - - return input; -}; - export const decodeLabel = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -8880,15 +4439,6 @@ export const decodeLabel = (input: Record) => { return input; }; -export const encodeLabelThresholds = (input: Record) => { - if (!input) return input; - input.block = encodenumber(input.block); - - input.flag = encodenumber(input.flag); - - return input; -}; - export const decodeLabelThresholds = (input: Record) => { if (!input) return input; input.block = decodenumber(input.block); @@ -8898,19 +4448,6 @@ export const decodeLabelThresholds = (input: Record) => { return input; }; -export const encodeLayoutSettings = (input: Record) => { - if (!input) return input; - input.external_app_url = encodestring(input.external_app_url); - - input.external_css_url = encodestring(input.external_css_url); - - input.name = encodestring(input.name); - - input.options = encodeobject(input.options); - - return input; -}; - export const decodeLayoutSettings = (input: Record) => { if (!input) return input; input.external_app_url = decodestring(input.external_app_url); @@ -8924,19 +4461,6 @@ export const decodeLayoutSettings = (input: Record) => { return input; }; -export const encodeLayoutSettingsRequest = (input: Record) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.external_app_url = encodestring(input.external_app_url); - - input.external_css_url = encodestring(input.external_css_url); - - input.options = encodeobject(input.options); - - return input; -}; - export const decodeLayoutSettingsRequest = (input: Record) => { if (!input) return input; input.name = decodestring(input.name); @@ -8950,19 +4474,6 @@ export const decodeLayoutSettingsRequest = (input: Record) => { return input; }; -export const encodeLayoutSettingsResponse = (input: Record) => { - if (!input) return input; - input.external_app_url = encodestring(input.external_app_url); - - input.external_css_url = encodestring(input.external_css_url); - - input.name = encodestring(input.name); - - input.options = encodeobject(input.options); - - return input; -}; - export const decodeLayoutSettingsResponse = (input: Record) => { if (!input) return input; input.external_app_url = decodestring(input.external_app_url); @@ -8976,17 +4487,6 @@ export const decodeLayoutSettingsResponse = (input: Record) => { return input; }; -export const encodeLimitInfo = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.remaining = encodeinteger(input.remaining); - - input.reset = encodeinteger(input.reset); - - return input; -}; - export const decodeLimitInfo = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -8998,15 +4498,6 @@ export const decodeLimitInfo = (input: Record) => { return input; }; -export const encodeLimitsSettings = (input: Record) => { - if (!input) return input; - input.max_duration_seconds = encodeinteger(input.max_duration_seconds); - - input.max_participants = encodeinteger(input.max_participants); - - return input; -}; - export const decodeLimitsSettings = (input: Record) => { if (!input) return input; input.max_duration_seconds = decodeinteger(input.max_duration_seconds); @@ -9016,15 +4507,6 @@ export const decodeLimitsSettings = (input: Record) => { return input; }; -export const encodeLimitsSettingsRequest = (input: Record) => { - if (!input) return input; - input.max_duration_seconds = encodeinteger(input.max_duration_seconds); - - input.max_participants = encodeinteger(input.max_participants); - - return input; -}; - export const decodeLimitsSettingsRequest = (input: Record) => { if (!input) return input; input.max_duration_seconds = decodeinteger(input.max_duration_seconds); @@ -9034,15 +4516,6 @@ export const decodeLimitsSettingsRequest = (input: Record) => { return input; }; -export const encodeLimitsSettingsResponse = (input: Record) => { - if (!input) return input; - input.max_duration_seconds = encodeinteger(input.max_duration_seconds); - - input.max_participants = encodeinteger(input.max_participants); - - return input; -}; - export const decodeLimitsSettingsResponse = (input: Record) => { if (!input) return input; input.max_duration_seconds = decodeinteger(input.max_duration_seconds); @@ -9052,19 +4525,6 @@ export const decodeLimitsSettingsResponse = (input: Record) => { return input; }; -export const encodeListBlockListResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListResponse(input.blocklists[key]); - }); - } - - return input; -}; - export const decodeListBlockListResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9078,19 +4538,6 @@ export const decodeListBlockListResponse = (input: Record) => { return input; }; -export const encodeListCallTypeResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.call_types) { - Object.keys(input.call_types).forEach((key) => { - input.call_types[key] = encodeCallTypeResponse(input.call_types[key]); - }); - } - - return input; -}; - export const decodeListCallTypeResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9104,21 +4551,6 @@ export const decodeListCallTypeResponse = (input: Record) => { return input; }; -export const encodeListChannelTypesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.channel_types) { - Object.keys(input.channel_types).forEach((key) => { - input.channel_types[key] = encodeChannelTypeConfig( - input.channel_types[key], - ); - }); - } - - return input; -}; - export const decodeListChannelTypesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9134,19 +4566,6 @@ export const decodeListChannelTypesResponse = (input: Record) => { return input; }; -export const encodeListCommandsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodeCommand(input.commands[key]); - }); - } - - return input; -}; - export const decodeListCommandsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9160,19 +4579,6 @@ export const decodeListCommandsResponse = (input: Record) => { return input; }; -export const encodeListDevicesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.devices) { - Object.keys(input.devices).forEach((key) => { - input.devices[key] = encodeDevice(input.devices[key]); - }); - } - - return input; -}; - export const decodeListDevicesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9186,23 +4592,6 @@ export const decodeListDevicesResponse = (input: Record) => { return input; }; -export const encodeListExternalStorageResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.external_storages) { - Object.keys(input.external_storages).forEach((key) => { - input.external_storages[key] = encodeExternalStorageResponse( - input.external_storages[key], - ); - }); - } - - return input; -}; - export const decodeListExternalStorageResponse = ( input: Record, ) => { @@ -9220,19 +4609,6 @@ export const decodeListExternalStorageResponse = ( return input; }; -export const encodeListImportsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.import_tasks) { - Object.keys(input.import_tasks).forEach((key) => { - input.import_tasks[key] = encodeImportTask(input.import_tasks[key]); - }); - } - - return input; -}; - export const decodeListImportsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9246,19 +4622,6 @@ export const decodeListImportsResponse = (input: Record) => { return input; }; -export const encodeListPermissionsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePermission(input.permissions[key]); - }); - } - - return input; -}; - export const decodeListPermissionsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9272,13 +4635,13 @@ export const decodeListPermissionsResponse = (input: Record) => { return input; }; -export const encodeListPushProvidersResponse = (input: Record) => { +export const decodeListPushProvidersResponse = (input: Record) => { if (!input) return input; - input.duration = encodestring(input.duration); + input.duration = decodestring(input.duration); if (input.push_providers) { Object.keys(input.push_providers).forEach((key) => { - input.push_providers[key] = encodePushProviderResponse( + input.push_providers[key] = decodePushProviderResponse( input.push_providers[key], ); }); @@ -9287,34 +4650,6 @@ export const encodeListPushProvidersResponse = (input: Record) => { return input; }; -export const decodeListPushProvidersResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - if (input.push_providers) { - Object.keys(input.push_providers).forEach((key) => { - input.push_providers[key] = decodePushProviderResponse( - input.push_providers[key], - ); - }); - } - - return input; -}; - -export const encodeListRecordingsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.recordings) { - Object.keys(input.recordings).forEach((key) => { - input.recordings[key] = encodeCallRecording(input.recordings[key]); - }); - } - - return input; -}; - export const decodeListRecordingsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9328,19 +4663,6 @@ export const decodeListRecordingsResponse = (input: Record) => { return input; }; -export const encodeListRolesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.roles) { - Object.keys(input.roles).forEach((key) => { - input.roles[key] = encodeRole(input.roles[key]); - }); - } - - return input; -}; - export const decodeListRolesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9354,23 +4676,6 @@ export const decodeListRolesResponse = (input: Record) => { return input; }; -export const encodeListTranscriptionsResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.transcriptions) { - Object.keys(input.transcriptions).forEach((key) => { - input.transcriptions[key] = encodeCallTranscription( - input.transcriptions[key], - ); - }); - } - - return input; -}; - export const decodeListTranscriptionsResponse = ( input: Record, ) => { @@ -9388,17 +4693,6 @@ export const decodeListTranscriptionsResponse = ( return input; }; -export const encodeLocation = (input: Record) => { - if (!input) return input; - input.continent_code = encodestring(input.continent_code); - - input.country_iso_code = encodestring(input.country_iso_code); - - input.subdivision_iso_code = encodestring(input.subdivision_iso_code); - - return input; -}; - export const decodeLocation = (input: Record) => { if (!input) return input; input.continent_code = decodestring(input.continent_code); @@ -9410,25 +4704,6 @@ export const decodeLocation = (input: Record) => { return input; }; -export const encodeMOSStats = (input: Record) => { - if (!input) return input; - input.average_score = encodenumber(input.average_score); - - input.max_score = encodenumber(input.max_score); - - input.min_score = encodenumber(input.min_score); - - if (input.hist_og_ram_duration_seconds) { - Object.keys(input.hist_og_ram_duration_seconds).forEach((key) => { - input.hist_og_ram_duration_seconds[key] = encodenumber( - input.hist_og_ram_duration_seconds[key], - ); - }); - } - - return input; -}; - export const decodeMOSStats = (input: Record) => { if (!input) return input; input.average_score = decodenumber(input.average_score); @@ -9448,21 +4723,6 @@ export const decodeMOSStats = (input: Record) => { return input; }; -export const encodeMarkChannelsReadRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - if (input.read_by_channel) { - Object.keys(input.read_by_channel).forEach((key) => { - input.read_by_channel[key] = encodestring(input.read_by_channel[key]); - }); - } - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMarkChannelsReadRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -9478,19 +4738,6 @@ export const decodeMarkChannelsReadRequest = (input: Record) => { return input; }; -export const encodeMarkReadRequest = (input: Record) => { - if (!input) return input; - input.message_id = encodestring(input.message_id); - - input.thread_id = encodestring(input.thread_id); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMarkReadRequest = (input: Record) => { if (!input) return input; input.message_id = decodestring(input.message_id); @@ -9504,15 +4751,6 @@ export const decodeMarkReadRequest = (input: Record) => { return input; }; -export const encodeMarkReadResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.event = encodeMessageReadEvent(input.event); - - return input; -}; - export const decodeMarkReadResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9522,19 +4760,6 @@ export const decodeMarkReadResponse = (input: Record) => { return input; }; -export const encodeMarkUnreadRequest = (input: Record) => { - if (!input) return input; - input.message_id = encodestring(input.message_id); - - input.thread_id = encodestring(input.thread_id); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMarkUnreadRequest = (input: Record) => { if (!input) return input; input.message_id = decodestring(input.message_id); @@ -9548,19 +4773,6 @@ export const decodeMarkUnreadRequest = (input: Record) => { return input; }; -export const encodeMediaPubSubHint = (input: Record) => { - if (!input) return input; - input.audio_published = encodeboolean(input.audio_published); - - input.audio_subscribed = encodeboolean(input.audio_subscribed); - - input.video_published = encodeboolean(input.video_published); - - input.video_subscribed = encodeboolean(input.video_subscribed); - - return input; -}; - export const decodeMediaPubSubHint = (input: Record) => { if (!input) return input; input.audio_published = decodeboolean(input.audio_published); @@ -9574,17 +4786,6 @@ export const decodeMediaPubSubHint = (input: Record) => { return input; }; -export const encodeMemberRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - input.role = encodestring(input.role); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodeMemberRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -9596,25 +4797,6 @@ export const decodeMemberRequest = (input: Record) => { return input; }; -export const encodeMemberResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserResponse(input.user); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.role = encodestring(input.role); - - return input; -}; - export const decodeMemberResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -9634,19 +4816,6 @@ export const decodeMemberResponse = (input: Record) => { return input; }; -export const encodeMembersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - return input; -}; - export const decodeMembersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -9660,135 +4829,6 @@ export const decodeMembersResponse = (input: Record) => { return input; }; -export const encodeMessage = (input: Record) => { - if (!input) return input; - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.deleted_reply_count = encodeinteger(input.deleted_reply_count); - - input.html = encodestring(input.html); - - input.id = encodestring(input.id); - - input.pinned = encodeboolean(input.pinned); - - input.reply_count = encodeinteger(input.reply_count); - - input.shadowed = encodeboolean(input.shadowed); - - input.silent = encodeboolean(input.silent); - - input.text = encodestring(input.text); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); - }); - } - - if (input.latest_reactions) { - Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = encodeReaction(input.latest_reactions[key]); - }); - } - - if (input.mentioned_users) { - Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = encodeUserObject(input.mentioned_users[key]); - }); - } - - if (input.own_reactions) { - Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = encodeReaction(input.own_reactions[key]); - }); - } - - input.custom = encodeobject(input.custom); - - if (input.reaction_counts) { - Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = encodeinteger(input.reaction_counts[key]); - }); - } - - if (input.reaction_groups) { - Object.keys(input.reaction_groups).forEach((key) => { - input.reaction_groups[key] = encodeReactionGroupResponse( - input.reaction_groups[key], - ); - }); - } - - if (input.reaction_scores) { - Object.keys(input.reaction_scores).forEach((key) => { - input.reaction_scores[key] = encodeinteger(input.reaction_scores[key]); - }); - } - - input.before_message_send_failed = encodeboolean( - input.before_message_send_failed, - ); - - input.command = encodestring(input.command); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.message_text_updated_at = encodeDatetimeType( - input.message_text_updated_at, - ); - - input.mml = encodestring(input.mml); - - input.parent_id = encodestring(input.parent_id); - - input.pin_expires = encodeDatetimeType(input.pin_expires); - - input.pinned_at = encodeDatetimeType(input.pinned_at); - - input.poll_id = encodestring(input.poll_id); - - input.quoted_message_id = encodestring(input.quoted_message_id); - - input.show_in_channel = encodeboolean(input.show_in_channel); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeUserObject( - input.thread_participants[key], - ); - }); - } - - if (input.i18n) { - Object.keys(input.i18n).forEach((key) => { - input.i18n[key] = encodestring(input.i18n[key]); - }); - } - - if (input.image_labels) { - Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = encodearray(input.image_labels[key]); - }); - } - - input.pinned_by = encodeUserObject(input.pinned_by); - - input.poll = encodePoll(input.poll); - - input.quoted_message = encodeMessage(input.quoted_message); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeMessage = (input: Record) => { if (!input) return input; input.cid = decodestring(input.cid); @@ -9918,21 +4958,6 @@ export const decodeMessage = (input: Record) => { return input; }; -export const encodeMessageActionRequest = (input: Record) => { - if (!input) return input; - if (input.form_data) { - Object.keys(input.form_data).forEach((key) => { - input.form_data[key] = encodestring(input.form_data[key]); - }); - } - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMessageActionRequest = (input: Record) => { if (!input) return input; if (input.form_data) { @@ -9948,29 +4973,6 @@ export const decodeMessageActionRequest = (input: Record) => { return input; }; -export const encodeMessageChangeSet = (input: Record) => { - if (!input) return input; - input.attachments = encodeboolean(input.attachments); - - input.custom = encodeboolean(input.custom); - - input.html = encodeboolean(input.html); - - input.mentioned_user_ids = encodeboolean(input.mentioned_user_ids); - - input.mml = encodeboolean(input.mml); - - input.pin = encodeboolean(input.pin); - - input.quoted_message_id = encodeboolean(input.quoted_message_id); - - input.silent = encodeboolean(input.silent); - - input.text = encodeboolean(input.text); - - return input; -}; - export const decodeMessageChangeSet = (input: Record) => { if (!input) return input; input.attachments = decodeboolean(input.attachments); @@ -9994,48 +4996,13 @@ export const decodeMessageChangeSet = (input: Record) => { return input; }; -export const encodeMessageFlagResponse = (input: Record) => { +export const decodeMessageFlagResponse = (input: Record) => { if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); + input.created_at = decodeDatetimeType(input.created_at); - input.created_by_automod = encodeboolean(input.created_by_automod); + input.created_by_automod = decodeboolean(input.created_by_automod); - input.updated_at = encodeDatetimeType(input.updated_at); - - input.approved_at = encodeDatetimeType(input.approved_at); - - input.reason = encodestring(input.reason); - - input.rejected_at = encodeDatetimeType(input.rejected_at); - - input.reviewed_at = encodeDatetimeType(input.reviewed_at); - - input.custom = encodeobject(input.custom); - - input.details = encodeFlagDetails(input.details); - - input.message = encodeMessage(input.message); - - input.moderation_feedback = encodeFlagFeedback(input.moderation_feedback); - - input.moderation_result = encodeMessageModerationResult( - input.moderation_result, - ); - - input.reviewed_by = encodeUserObject(input.reviewed_by); - - input.user = encodeUserObject(input.user); - - return input; -}; - -export const decodeMessageFlagResponse = (input: Record) => { - if (!input) return input; - input.created_at = decodeDatetimeType(input.created_at); - - input.created_by_automod = decodeboolean(input.created_by_automod); - - input.updated_at = decodeDatetimeType(input.updated_at); + input.updated_at = decodeDatetimeType(input.updated_at); input.approved_at = decodeDatetimeType(input.approved_at); @@ -10064,29 +5031,6 @@ export const decodeMessageFlagResponse = (input: Record) => { return input; }; -export const encodeMessageHistoryEntryResponse = ( - input: Record, -) => { - if (!input) return input; - input.message_id = encodestring(input.message_id); - - input.message_updated_at = encodeDatetimeType(input.message_updated_at); - - input.message_updated_by_id = encodestring(input.message_updated_by_id); - - input.text = encodestring(input.text); - - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); - }); - } - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodeMessageHistoryEntryResponse = ( input: Record, ) => { @@ -10110,35 +5054,6 @@ export const decodeMessageHistoryEntryResponse = ( return input; }; -export const encodeMessageModerationResult = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.created_at = encodeDatetimeType(input.created_at); - - input.message_id = encodestring(input.message_id); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.user_bad_karma = encodeboolean(input.user_bad_karma); - - input.user_karma = encodenumber(input.user_karma); - - input.blocked_word = encodestring(input.blocked_word); - - input.blocklist_name = encodestring(input.blocklist_name); - - input.moderated_by = encodestring(input.moderated_by); - - input.ai_moderation_response = encodeModerationResponse( - input.ai_moderation_response, - ); - - input.moderation_thresholds = encodeThresholds(input.moderation_thresholds); - - return input; -}; - export const decodeMessageModerationResult = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -10168,39 +5083,11 @@ export const decodeMessageModerationResult = (input: Record) => { return input; }; -export const encodeMessagePaginationParams = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeMessagePaginationParams = (input: Record) => { if (!input) return input; return input; }; -export const encodeMessageReadEvent = (input: Record) => { - if (!input) return input; - input.channel_id = encodestring(input.channel_id); - - input.channel_type = encodestring(input.channel_type); - - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.type = encodestring(input.type); - - input.last_read_message_id = encodestring(input.last_read_message_id); - - input.team = encodestring(input.team); - - input.thread = encodeThread(input.thread); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeMessageReadEvent = (input: Record) => { if (!input) return input; input.channel_id = decodestring(input.channel_id); @@ -10224,55 +5111,6 @@ export const decodeMessageReadEvent = (input: Record) => { return input; }; -export const encodeMessageRequest = (input: Record) => { - if (!input) return input; - input.html = encodestring(input.html); - - input.id = encodestring(input.id); - - input.mml = encodestring(input.mml); - - input.parent_id = encodestring(input.parent_id); - - input.pin_expires = encodeDatetimeType(input.pin_expires); - - input.pinned = encodeboolean(input.pinned); - - input.pinned_at = encodeDatetimeType(input.pinned_at); - - input.poll_id = encodestring(input.poll_id); - - input.quoted_message_id = encodestring(input.quoted_message_id); - - input.show_in_channel = encodeboolean(input.show_in_channel); - - input.silent = encodeboolean(input.silent); - - input.text = encodestring(input.text); - - input.type = encodestring(input.type); - - input.user_id = encodestring(input.user_id); - - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); - }); - } - - if (input.mentioned_users) { - Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = encodestring(input.mentioned_users[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMessageRequest = (input: Record) => { if (!input) return input; input.html = decodestring(input.html); @@ -10322,41 +5160,41 @@ export const decodeMessageRequest = (input: Record) => { return input; }; -export const encodeMessageResponse = (input: Record) => { +export const decodeMessageResponse = (input: Record) => { if (!input) return input; - input.cid = encodestring(input.cid); + input.cid = decodestring(input.cid); - input.created_at = encodeDatetimeType(input.created_at); + input.created_at = decodeDatetimeType(input.created_at); - input.deleted_reply_count = encodeinteger(input.deleted_reply_count); + input.deleted_reply_count = decodeinteger(input.deleted_reply_count); - input.html = encodestring(input.html); + input.html = decodestring(input.html); - input.id = encodestring(input.id); + input.id = decodestring(input.id); - input.pinned = encodeboolean(input.pinned); + input.pinned = decodeboolean(input.pinned); - input.reply_count = encodeinteger(input.reply_count); + input.reply_count = decodeinteger(input.reply_count); - input.shadowed = encodeboolean(input.shadowed); + input.shadowed = decodeboolean(input.shadowed); - input.silent = encodeboolean(input.silent); + input.silent = decodeboolean(input.silent); - input.text = encodestring(input.text); + input.text = decodestring(input.text); - input.type = encodestring(input.type); + input.type = decodestring(input.type); - input.updated_at = encodeDatetimeType(input.updated_at); + input.updated_at = decodeDatetimeType(input.updated_at); if (input.attachments) { Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); + input.attachments[key] = decodeAttachment(input.attachments[key]); }); } if (input.latest_reactions) { Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = encodeReactionResponse( + input.latest_reactions[key] = decodeReactionResponse( input.latest_reactions[key], ); }); @@ -10364,7 +5202,7 @@ export const encodeMessageResponse = (input: Record) => { if (input.mentioned_users) { Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = encodeUserResponse( + input.mentioned_users[key] = decodeUserResponse( input.mentioned_users[key], ); }); @@ -10372,53 +5210,53 @@ export const encodeMessageResponse = (input: Record) => { if (input.own_reactions) { Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = encodeReactionResponse( + input.own_reactions[key] = decodeReactionResponse( input.own_reactions[key], ); }); } - input.custom = encodeobject(input.custom); + input.custom = decodeobject(input.custom); if (input.reaction_counts) { Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = encodeinteger(input.reaction_counts[key]); + input.reaction_counts[key] = decodeinteger(input.reaction_counts[key]); }); } if (input.reaction_scores) { Object.keys(input.reaction_scores).forEach((key) => { - input.reaction_scores[key] = encodeinteger(input.reaction_scores[key]); + input.reaction_scores[key] = decodeinteger(input.reaction_scores[key]); }); } - input.user = encodeUserResponse(input.user); + input.user = decodeUserResponse(input.user); - input.command = encodestring(input.command); + input.command = decodestring(input.command); - input.deleted_at = encodeDatetimeType(input.deleted_at); + input.deleted_at = decodeDatetimeType(input.deleted_at); - input.message_text_updated_at = encodeDatetimeType( + input.message_text_updated_at = decodeDatetimeType( input.message_text_updated_at, ); - input.mml = encodestring(input.mml); + input.mml = decodestring(input.mml); - input.parent_id = encodestring(input.parent_id); + input.parent_id = decodestring(input.parent_id); - input.pin_expires = encodeDatetimeType(input.pin_expires); + input.pin_expires = decodeDatetimeType(input.pin_expires); - input.pinned_at = encodeDatetimeType(input.pinned_at); + input.pinned_at = decodeDatetimeType(input.pinned_at); - input.poll_id = encodestring(input.poll_id); + input.poll_id = decodestring(input.poll_id); - input.quoted_message_id = encodestring(input.quoted_message_id); + input.quoted_message_id = decodestring(input.quoted_message_id); - input.show_in_channel = encodeboolean(input.show_in_channel); + input.show_in_channel = decodeboolean(input.show_in_channel); if (input.thread_participants) { Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeUserResponse( + input.thread_participants[key] = decodeUserResponse( input.thread_participants[key], ); }); @@ -10426,25 +5264,25 @@ export const encodeMessageResponse = (input: Record) => { if (input.i18n) { Object.keys(input.i18n).forEach((key) => { - input.i18n[key] = encodestring(input.i18n[key]); + input.i18n[key] = decodestring(input.i18n[key]); }); } if (input.image_labels) { Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = encodearray(input.image_labels[key]); + input.image_labels[key] = decodearray(input.image_labels[key]); }); } - input.pinned_by = encodeUserResponse(input.pinned_by); + input.pinned_by = decodeUserResponse(input.pinned_by); - input.poll = encodePoll(input.poll); + input.poll = decodePoll(input.poll); - input.quoted_message = encodeMessage(input.quoted_message); + input.quoted_message = decodeMessage(input.quoted_message); if (input.reaction_groups) { Object.keys(input.reaction_groups).forEach((key) => { - input.reaction_groups[key] = encodeReactionGroupResponse( + input.reaction_groups[key] = decodeReactionGroupResponse( input.reaction_groups[key], ); }); @@ -10453,7 +5291,18 @@ export const encodeMessageResponse = (input: Record) => { return input; }; -export const decodeMessageResponse = (input: Record) => { +export const decodeMessageUpdate = (input: Record) => { + if (!input) return input; + input.old_text = decodestring(input.old_text); + + input.change_set = decodeMessageChangeSet(input.change_set); + + return input; +}; + +export const decodeMessageWithChannelResponse = ( + input: Record, +) => { if (!input) return input; input.cid = decodestring(input.cid); @@ -10509,6 +5358,8 @@ export const decodeMessageResponse = (input: Record) => { }); } + input.channel = decodeChannelResponse(input.channel); + input.custom = decodeobject(input.custom); if (input.reaction_counts) { @@ -10584,520 +5435,115 @@ export const decodeMessageResponse = (input: Record) => { return input; }; -export const encodeMessageUpdate = (input: Record) => { +export const decodeModerationActionConfig = (input: Record) => { if (!input) return input; - input.old_text = encodestring(input.old_text); + input.action = decodestring(input.action); + + input.description = decodestring(input.description); + + input.entity_type = decodestring(input.entity_type); + + input.icon = decodestring(input.icon); + + input.order = decodeinteger(input.order); - input.change_set = encodeMessageChangeSet(input.change_set); + input.custom = decodeobject(input.custom); return input; }; -export const decodeMessageUpdate = (input: Record) => { +export const decodeModerationPayload = (input: Record) => { if (!input) return input; - input.old_text = decodestring(input.old_text); + input.created_at = decodeDatetimeType(input.created_at); - input.change_set = decodeMessageChangeSet(input.change_set); + if (input.images) { + Object.keys(input.images).forEach((key) => { + input.images[key] = decodestring(input.images[key]); + }); + } + + if (input.texts) { + Object.keys(input.texts).forEach((key) => { + input.texts[key] = decodestring(input.texts[key]); + }); + } + + if (input.videos) { + Object.keys(input.videos).forEach((key) => { + input.videos[key] = decodestring(input.videos[key]); + }); + } + + input.custom = decodeobject(input.custom); return input; }; -export const encodeMessageWithChannelResponse = ( - input: Record, -) => { +export const decodeModerationResponse = (input: Record) => { if (!input) return input; - input.cid = encodestring(input.cid); + input.action = decodestring(input.action); - input.created_at = encodeDatetimeType(input.created_at); + input.explicit = decodenumber(input.explicit); - input.deleted_reply_count = encodeinteger(input.deleted_reply_count); + input.spam = decodenumber(input.spam); - input.html = encodestring(input.html); + input.toxic = decodenumber(input.toxic); - input.id = encodestring(input.id); + return input; +}; - input.pinned = encodeboolean(input.pinned); +export const decodeModerationUsageStats = (input: Record) => { + if (!input) return input; + input.bucket = decodestring(input.bucket); - input.reply_count = encodeinteger(input.reply_count); + input.metric = decodestring(input.metric); - input.shadowed = encodeboolean(input.shadowed); + input.updated_at = decodeDatetimeType(input.updated_at); - input.silent = encodeboolean(input.silent); + input.value = decodeinteger(input.value); - input.text = encodestring(input.text); + return input; +}; - input.type = encodestring(input.type); +export const decodeModeratorStats = (input: Record) => { + if (!input) return input; + input.id = decodestring(input.id); - input.updated_at = encodeDatetimeType(input.updated_at); + input.items_reviewed = decodeinteger(input.items_reviewed); - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); + if (input.action_counts) { + Object.keys(input.action_counts).forEach((key) => { + input.action_counts[key] = decodeinteger(input.action_counts[key]); }); } - if (input.latest_reactions) { - Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = encodeReactionResponse( - input.latest_reactions[key], - ); - }); - } + return input; +}; - if (input.mentioned_users) { - Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = encodeUserResponse( - input.mentioned_users[key], - ); - }); - } +export const decodeModeratorStatsResponse = (input: Record) => { + if (!input) return input; + input.duration = decodestring(input.duration); - if (input.own_reactions) { - Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = encodeReactionResponse( - input.own_reactions[key], + if (input.moderator_stats) { + Object.keys(input.moderator_stats).forEach((key) => { + input.moderator_stats[key] = decodeModeratorStats( + input.moderator_stats[key], ); }); } - input.channel = encodeChannelResponse(input.channel); + return input; +}; - input.custom = encodeobject(input.custom); +export const decodeMuteChannelRequest = (input: Record) => { + if (!input) return input; + input.expiration = decodeinteger(input.expiration); - if (input.reaction_counts) { - Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = encodeinteger(input.reaction_counts[key]); - }); - } - - if (input.reaction_scores) { - Object.keys(input.reaction_scores).forEach((key) => { - input.reaction_scores[key] = encodeinteger(input.reaction_scores[key]); - }); - } - - input.user = encodeUserResponse(input.user); - - input.command = encodestring(input.command); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.message_text_updated_at = encodeDatetimeType( - input.message_text_updated_at, - ); - - input.mml = encodestring(input.mml); - - input.parent_id = encodestring(input.parent_id); - - input.pin_expires = encodeDatetimeType(input.pin_expires); - - input.pinned_at = encodeDatetimeType(input.pinned_at); - - input.poll_id = encodestring(input.poll_id); - - input.quoted_message_id = encodestring(input.quoted_message_id); - - input.show_in_channel = encodeboolean(input.show_in_channel); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeUserResponse( - input.thread_participants[key], - ); - }); - } - - if (input.i18n) { - Object.keys(input.i18n).forEach((key) => { - input.i18n[key] = encodestring(input.i18n[key]); - }); - } - - if (input.image_labels) { - Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = encodearray(input.image_labels[key]); - }); - } - - input.pinned_by = encodeUserResponse(input.pinned_by); - - input.poll = encodePoll(input.poll); - - input.quoted_message = encodeMessage(input.quoted_message); - - if (input.reaction_groups) { - Object.keys(input.reaction_groups).forEach((key) => { - input.reaction_groups[key] = encodeReactionGroupResponse( - input.reaction_groups[key], - ); - }); - } - - return input; -}; - -export const decodeMessageWithChannelResponse = ( - input: Record, -) => { - if (!input) return input; - input.cid = decodestring(input.cid); - - input.created_at = decodeDatetimeType(input.created_at); - - input.deleted_reply_count = decodeinteger(input.deleted_reply_count); - - input.html = decodestring(input.html); - - input.id = decodestring(input.id); - - input.pinned = decodeboolean(input.pinned); - - input.reply_count = decodeinteger(input.reply_count); - - input.shadowed = decodeboolean(input.shadowed); - - input.silent = decodeboolean(input.silent); - - input.text = decodestring(input.text); - - input.type = decodestring(input.type); - - input.updated_at = decodeDatetimeType(input.updated_at); - - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = decodeAttachment(input.attachments[key]); - }); - } - - if (input.latest_reactions) { - Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = decodeReactionResponse( - input.latest_reactions[key], - ); - }); - } - - if (input.mentioned_users) { - Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = decodeUserResponse( - input.mentioned_users[key], - ); - }); - } - - if (input.own_reactions) { - Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = decodeReactionResponse( - input.own_reactions[key], - ); - }); - } - - input.channel = decodeChannelResponse(input.channel); - - input.custom = decodeobject(input.custom); - - if (input.reaction_counts) { - Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = decodeinteger(input.reaction_counts[key]); - }); - } - - if (input.reaction_scores) { - Object.keys(input.reaction_scores).forEach((key) => { - input.reaction_scores[key] = decodeinteger(input.reaction_scores[key]); - }); - } - - input.user = decodeUserResponse(input.user); - - input.command = decodestring(input.command); - - input.deleted_at = decodeDatetimeType(input.deleted_at); - - input.message_text_updated_at = decodeDatetimeType( - input.message_text_updated_at, - ); - - input.mml = decodestring(input.mml); - - input.parent_id = decodestring(input.parent_id); - - input.pin_expires = decodeDatetimeType(input.pin_expires); - - input.pinned_at = decodeDatetimeType(input.pinned_at); - - input.poll_id = decodestring(input.poll_id); - - input.quoted_message_id = decodestring(input.quoted_message_id); - - input.show_in_channel = decodeboolean(input.show_in_channel); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = decodeUserResponse( - input.thread_participants[key], - ); - }); - } - - if (input.i18n) { - Object.keys(input.i18n).forEach((key) => { - input.i18n[key] = decodestring(input.i18n[key]); - }); - } - - if (input.image_labels) { - Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = decodearray(input.image_labels[key]); - }); - } - - input.pinned_by = decodeUserResponse(input.pinned_by); - - input.poll = decodePoll(input.poll); - - input.quoted_message = decodeMessage(input.quoted_message); - - if (input.reaction_groups) { - Object.keys(input.reaction_groups).forEach((key) => { - input.reaction_groups[key] = decodeReactionGroupResponse( - input.reaction_groups[key], - ); - }); - } - - return input; -}; - -export const encodeModerationActionConfig = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.description = encodestring(input.description); - - input.entity_type = encodestring(input.entity_type); - - input.icon = encodestring(input.icon); - - input.order = encodeinteger(input.order); - - input.custom = encodeobject(input.custom); - - return input; -}; - -export const decodeModerationActionConfig = (input: Record) => { - if (!input) return input; - input.action = decodestring(input.action); - - input.description = decodestring(input.description); - - input.entity_type = decodestring(input.entity_type); - - input.icon = decodestring(input.icon); - - input.order = decodeinteger(input.order); - - input.custom = decodeobject(input.custom); - - return input; -}; - -export const encodeModerationPayload = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - if (input.images) { - Object.keys(input.images).forEach((key) => { - input.images[key] = encodestring(input.images[key]); - }); - } - - if (input.texts) { - Object.keys(input.texts).forEach((key) => { - input.texts[key] = encodestring(input.texts[key]); - }); - } - - if (input.videos) { - Object.keys(input.videos).forEach((key) => { - input.videos[key] = encodestring(input.videos[key]); - }); - } - - input.custom = encodeobject(input.custom); - - return input; -}; - -export const decodeModerationPayload = (input: Record) => { - if (!input) return input; - input.created_at = decodeDatetimeType(input.created_at); - - if (input.images) { - Object.keys(input.images).forEach((key) => { - input.images[key] = decodestring(input.images[key]); - }); - } - - if (input.texts) { - Object.keys(input.texts).forEach((key) => { - input.texts[key] = decodestring(input.texts[key]); - }); - } - - if (input.videos) { - Object.keys(input.videos).forEach((key) => { - input.videos[key] = decodestring(input.videos[key]); - }); - } - - input.custom = decodeobject(input.custom); - - return input; -}; - -export const encodeModerationResponse = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.explicit = encodenumber(input.explicit); - - input.spam = encodenumber(input.spam); - - input.toxic = encodenumber(input.toxic); - - return input; -}; - -export const decodeModerationResponse = (input: Record) => { - if (!input) return input; - input.action = decodestring(input.action); - - input.explicit = decodenumber(input.explicit); - - input.spam = decodenumber(input.spam); - - input.toxic = decodenumber(input.toxic); - - return input; -}; - -export const encodeModerationUsageStats = (input: Record) => { - if (!input) return input; - input.bucket = encodestring(input.bucket); - - input.metric = encodestring(input.metric); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.value = encodeinteger(input.value); - - return input; -}; - -export const decodeModerationUsageStats = (input: Record) => { - if (!input) return input; - input.bucket = decodestring(input.bucket); - - input.metric = decodestring(input.metric); - - input.updated_at = decodeDatetimeType(input.updated_at); - - input.value = decodeinteger(input.value); - - return input; -}; - -export const encodeModeratorStats = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.items_reviewed = encodeinteger(input.items_reviewed); - - if (input.action_counts) { - Object.keys(input.action_counts).forEach((key) => { - input.action_counts[key] = encodeinteger(input.action_counts[key]); - }); - } - - return input; -}; - -export const decodeModeratorStats = (input: Record) => { - if (!input) return input; - input.id = decodestring(input.id); - - input.items_reviewed = decodeinteger(input.items_reviewed); - - if (input.action_counts) { - Object.keys(input.action_counts).forEach((key) => { - input.action_counts[key] = decodeinteger(input.action_counts[key]); - }); - } - - return input; -}; - -export const encodeModeratorStatsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.moderator_stats) { - Object.keys(input.moderator_stats).forEach((key) => { - input.moderator_stats[key] = encodeModeratorStats( - input.moderator_stats[key], - ); - }); - } - - return input; -}; - -export const decodeModeratorStatsResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - if (input.moderator_stats) { - Object.keys(input.moderator_stats).forEach((key) => { - input.moderator_stats[key] = decodeModeratorStats( - input.moderator_stats[key], - ); - }); - } - - return input; -}; - -export const encodeMuteChannelRequest = (input: Record) => { - if (!input) return input; - input.expiration = encodeinteger(input.expiration); - - input.user_id = encodestring(input.user_id); - - if (input.channel_cids) { - Object.keys(input.channel_cids).forEach((key) => { - input.channel_cids[key] = encodestring(input.channel_cids[key]); - }); - } - - input.user = encodeUserRequest(input.user); - - return input; -}; - -export const decodeMuteChannelRequest = (input: Record) => { - if (!input) return input; - input.expiration = decodeinteger(input.expiration); - - input.user_id = decodestring(input.user_id); - - if (input.channel_cids) { - Object.keys(input.channel_cids).forEach((key) => { - input.channel_cids[key] = decodestring(input.channel_cids[key]); + input.user_id = decodestring(input.user_id); + + if (input.channel_cids) { + Object.keys(input.channel_cids).forEach((key) => { + input.channel_cids[key] = decodestring(input.channel_cids[key]); }); } @@ -11106,23 +5552,6 @@ export const decodeMuteChannelRequest = (input: Record) => { return input; }; -export const encodeMuteChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.channel_mutes) { - Object.keys(input.channel_mutes).forEach((key) => { - input.channel_mutes[key] = encodeChannelMute(input.channel_mutes[key]); - }); - } - - input.channel_mute = encodeChannelMute(input.channel_mute); - - input.own_user = encodeOwnUser(input.own_user); - - return input; -}; - export const decodeMuteChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -11140,23 +5569,6 @@ export const decodeMuteChannelResponse = (input: Record) => { return input; }; -export const encodeMuteRequest = (input: Record) => { - if (!input) return input; - input.timeout = encodeinteger(input.timeout); - - if (input.target_ids) { - Object.keys(input.target_ids).forEach((key) => { - input.target_ids[key] = encodestring(input.target_ids[key]); - }); - } - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeMuteRequest = (input: Record) => { if (!input) return input; input.timeout = decodeinteger(input.timeout); @@ -11174,29 +5586,6 @@ export const decodeMuteRequest = (input: Record) => { return input; }; -export const encodeMuteResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.mutes) { - Object.keys(input.mutes).forEach((key) => { - input.mutes[key] = encodeUserMute(input.mutes[key]); - }); - } - - if (input.non_existing_users) { - Object.keys(input.non_existing_users).forEach((key) => { - input.non_existing_users[key] = encodestring( - input.non_existing_users[key], - ); - }); - } - - input.own_user = encodeOwnUser(input.own_user); - - return input; -}; - export const decodeMuteResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -11220,31 +5609,6 @@ export const decodeMuteResponse = (input: Record) => { return input; }; -export const encodeMuteUsersRequest = (input: Record) => { - if (!input) return input; - input.audio = encodeboolean(input.audio); - - input.mute_all_users = encodeboolean(input.mute_all_users); - - input.muted_by_id = encodestring(input.muted_by_id); - - input.screenshare = encodeboolean(input.screenshare); - - input.screenshare_audio = encodeboolean(input.screenshare_audio); - - input.video = encodeboolean(input.video); - - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - input.muted_by = encodeUserRequest(input.muted_by); - - return input; -}; - export const decodeMuteUsersRequest = (input: Record) => { if (!input) return input; input.audio = decodeboolean(input.audio); @@ -11270,13 +5634,6 @@ export const decodeMuteUsersRequest = (input: Record) => { return input; }; -export const encodeMuteUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeMuteUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -11284,13 +5641,6 @@ export const decodeMuteUsersResponse = (input: Record) => { return input; }; -export const encodeNoiseCancellationSettings = (input: Record) => { - if (!input) return input; - input.mode = encodestring(input.mode); - - return input; -}; - export const decodeNoiseCancellationSettings = (input: Record) => { if (!input) return input; input.mode = decodestring(input.mode); @@ -11298,29 +5648,6 @@ export const decodeNoiseCancellationSettings = (input: Record) => { return input; }; -export const encodeNotificationSettings = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.call_live_started = encodeEventNotificationSettings( - input.call_live_started, - ); - - input.call_missed = encodeEventNotificationSettings(input.call_missed); - - input.call_notification = encodeEventNotificationSettings( - input.call_notification, - ); - - input.call_ring = encodeEventNotificationSettings(input.call_ring); - - input.session_started = encodeEventNotificationSettings( - input.session_started, - ); - - return input; -}; - export const decodeNotificationSettings = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -11344,15 +5671,6 @@ export const decodeNotificationSettings = (input: Record) => { return input; }; -export const encodeNullBool = (input: Record) => { - if (!input) return input; - input.has_value = encodeboolean(input.has_value); - - input.value = encodeboolean(input.value); - - return input; -}; - export const decodeNullBool = (input: Record) => { if (!input) return input; input.has_value = decodeboolean(input.has_value); @@ -11362,15 +5680,6 @@ export const decodeNullBool = (input: Record) => { return input; }; -export const encodeNullTime = (input: Record) => { - if (!input) return input; - input.has_value = encodeboolean(input.has_value); - - input.value = encodeDatetimeType(input.value); - - return input; -}; - export const decodeNullTime = (input: Record) => { if (!input) return input; input.has_value = decodeboolean(input.has_value); @@ -11380,13 +5689,6 @@ export const decodeNullTime = (input: Record) => { return input; }; -export const encodeOnlyUserID = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - return input; -}; - export const decodeOnlyUserID = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -11394,97 +5696,11 @@ export const decodeOnlyUserID = (input: Record) => { return input; }; -export const encodeOwnCapability = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeOwnCapability = (input: Record) => { if (!input) return input; return input; }; -export const encodeOwnUser = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.language = encodestring(input.language); - - input.online = encodeboolean(input.online); - - input.role = encodestring(input.role); - - input.total_unread_count = encodeinteger(input.total_unread_count); - - input.unread_channels = encodeinteger(input.unread_channels); - - input.unread_count = encodeinteger(input.unread_count); - - input.unread_threads = encodeinteger(input.unread_threads); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.channel_mutes) { - Object.keys(input.channel_mutes).forEach((key) => { - input.channel_mutes[key] = encodeChannelMute(input.channel_mutes[key]); - }); - } - - if (input.devices) { - Object.keys(input.devices).forEach((key) => { - input.devices[key] = encodeDevice(input.devices[key]); - }); - } - - if (input.mutes) { - Object.keys(input.mutes).forEach((key) => { - input.mutes[key] = encodeUserMute(input.mutes[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.deactivated_at = encodeDatetimeType(input.deactivated_at); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.invisible = encodeboolean(input.invisible); - - input.last_active = encodeDatetimeType(input.last_active); - - if (input.blocked_user_ids) { - Object.keys(input.blocked_user_ids).forEach((key) => { - input.blocked_user_ids[key] = encodestring(input.blocked_user_ids[key]); - }); - } - - if (input.latest_hidden_channels) { - Object.keys(input.latest_hidden_channels).forEach((key) => { - input.latest_hidden_channels[key] = encodestring( - input.latest_hidden_channels[key], - ); - }); - } - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = encodestring(input.teams[key]); - }); - } - - input.privacy_settings = encodePrivacySettings(input.privacy_settings); - - input.push_notifications = encodePushNotificationSettings( - input.push_notifications, - ); - - return input; -}; - export const decodeOwnUser = (input: Record) => { if (!input) return input; input.banned = decodeboolean(input.banned); @@ -11566,15 +5782,6 @@ export const decodeOwnUser = (input: Record) => { return input; }; -export const encodePaginationParams = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.offset = encodeinteger(input.offset); - - return input; -}; - export const decodePaginationParams = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -11584,23 +5791,6 @@ export const decodePaginationParams = (input: Record) => { return input; }; -export const encodePendingMessage = (input: Record) => { - if (!input) return input; - input.channel = encodeChannel(input.channel); - - input.message = encodeMessage(input.message); - - if (input.metadata) { - Object.keys(input.metadata).forEach((key) => { - input.metadata[key] = encodestring(input.metadata[key]); - }); - } - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodePendingMessage = (input: Record) => { if (!input) return input; input.channel = decodeChannel(input.channel); @@ -11618,35 +5808,6 @@ export const decodePendingMessage = (input: Record) => { return input; }; -export const encodePermission = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.custom = encodeboolean(input.custom); - - input.description = encodestring(input.description); - - input.id = encodestring(input.id); - - input.level = encodestring(input.level); - - input.name = encodestring(input.name); - - input.owner = encodeboolean(input.owner); - - input.same_team = encodeboolean(input.same_team); - - if (input.tags) { - Object.keys(input.tags).forEach((key) => { - input.tags[key] = encodestring(input.tags[key]); - }); - } - - input.condition = encodeobject(input.condition); - - return input; -}; - export const decodePermission = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -11676,15 +5837,6 @@ export const decodePermission = (input: Record) => { return input; }; -export const encodePinRequest = (input: Record) => { - if (!input) return input; - input.session_id = encodestring(input.session_id); - - input.user_id = encodestring(input.user_id); - - return input; -}; - export const decodePinRequest = (input: Record) => { if (!input) return input; input.session_id = decodestring(input.session_id); @@ -11694,45 +5846,9 @@ export const decodePinRequest = (input: Record) => { return input; }; -export const encodePinResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - -export const decodePinResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - return input; -}; - -export const encodePolicy = (input: Record) => { - if (!input) return input; - input.action = encodeinteger(input.action); - - input.created_at = encodeDatetimeType(input.created_at); - - input.name = encodestring(input.name); - - input.owner = encodeboolean(input.owner); - - input.priority = encodeinteger(input.priority); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.resources) { - Object.keys(input.resources).forEach((key) => { - input.resources[key] = encodestring(input.resources[key]); - }); - } - - if (input.roles) { - Object.keys(input.roles).forEach((key) => { - input.roles[key] = encodestring(input.roles[key]); - }); - } +export const decodePinResponse = (input: Record) => { + if (!input) return input; + input.duration = decodestring(input.duration); return input; }; @@ -11766,31 +5882,6 @@ export const decodePolicy = (input: Record) => { return input; }; -export const encodePolicyRequest = (input: Record) => { - if (!input) return input; - input.action = encodestring(input.action); - - input.name = encodestring(input.name); - - input.owner = encodeboolean(input.owner); - - input.priority = encodeinteger(input.priority); - - if (input.resources) { - Object.keys(input.resources).forEach((key) => { - input.resources[key] = encodestring(input.resources[key]); - }); - } - - if (input.roles) { - Object.keys(input.roles).forEach((key) => { - input.roles[key] = encodestring(input.roles[key]); - }); - } - - return input; -}; - export const decodePolicyRequest = (input: Record) => { if (!input) return input; input.action = decodestring(input.action); @@ -11816,79 +5907,6 @@ export const decodePolicyRequest = (input: Record) => { return input; }; -export const encodePoll = (input: Record) => { - if (!input) return input; - input.allow_answers = encodeboolean(input.allow_answers); - - input.allow_user_suggested_options = encodeboolean( - input.allow_user_suggested_options, - ); - - input.answers_count = encodeinteger(input.answers_count); - - input.created_at = encodeDatetimeType(input.created_at); - - input.created_by_id = encodestring(input.created_by_id); - - input.description = encodestring(input.description); - - input.enforce_unique_vote = encodeboolean(input.enforce_unique_vote); - - input.id = encodestring(input.id); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.vote_count = encodeinteger(input.vote_count); - - if (input.latest_answers) { - Object.keys(input.latest_answers).forEach((key) => { - input.latest_answers[key] = encodePollVote(input.latest_answers[key]); - }); - } - - if (input.options) { - Object.keys(input.options).forEach((key) => { - input.options[key] = encodePollOption(input.options[key]); - }); - } - - if (input.own_votes) { - Object.keys(input.own_votes).forEach((key) => { - input.own_votes[key] = encodePollVote(input.own_votes[key]); - }); - } - - input.custom = encodeobject(input.custom); - - if (input.latest_votes_by_option) { - Object.keys(input.latest_votes_by_option).forEach((key) => { - input.latest_votes_by_option[key] = encodearray( - input.latest_votes_by_option[key], - ); - }); - } - - if (input.vote_counts_by_option) { - Object.keys(input.vote_counts_by_option).forEach((key) => { - input.vote_counts_by_option[key] = encodeinteger( - input.vote_counts_by_option[key], - ); - }); - } - - input.is_closed = encodeboolean(input.is_closed); - - input.max_votes_allowed = encodeinteger(input.max_votes_allowed); - - input.voting_visibility = encodestring(input.voting_visibility); - - input.created_by = encodeUserObject(input.created_by); - - return input; -}; - export const decodePoll = (input: Record) => { if (!input) return input; input.allow_answers = decodeboolean(input.allow_answers); @@ -11962,17 +5980,6 @@ export const decodePoll = (input: Record) => { return input; }; -export const encodePollOption = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.text = encodestring(input.text); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodePollOption = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -11984,15 +5991,6 @@ export const decodePollOption = (input: Record) => { return input; }; -export const encodePollOptionInput = (input: Record) => { - if (!input) return input; - input.text = encodestring(input.text); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodePollOptionInput = (input: Record) => { if (!input) return input; input.text = decodestring(input.text); @@ -12002,17 +6000,6 @@ export const decodePollOptionInput = (input: Record) => { return input; }; -export const encodePollOptionRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.text = encodestring(input.text); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodePollOptionRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -12024,15 +6011,6 @@ export const decodePollOptionRequest = (input: Record) => { return input; }; -export const encodePollOptionResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.poll_option = encodePollOptionResponseData(input.poll_option); - - return input; -}; - export const decodePollOptionResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12042,17 +6020,6 @@ export const decodePollOptionResponse = (input: Record) => { return input; }; -export const encodePollOptionResponseData = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.text = encodestring(input.text); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodePollOptionResponseData = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -12064,15 +6031,6 @@ export const decodePollOptionResponseData = (input: Record) => { return input; }; -export const encodePollResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.poll = encodePollResponseData(input.poll); - - return input; -}; - export const decodePollResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12082,73 +6040,6 @@ export const decodePollResponse = (input: Record) => { return input; }; -export const encodePollResponseData = (input: Record) => { - if (!input) return input; - input.allow_answers = encodeboolean(input.allow_answers); - - input.allow_user_suggested_options = encodeboolean( - input.allow_user_suggested_options, - ); - - input.answers_count = encodeinteger(input.answers_count); - - input.created_at = encodeDatetimeType(input.created_at); - - input.created_by_id = encodestring(input.created_by_id); - - input.description = encodestring(input.description); - - input.enforce_unique_vote = encodeboolean(input.enforce_unique_vote); - - input.id = encodestring(input.id); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.vote_count = encodeinteger(input.vote_count); - - input.voting_visibility = encodestring(input.voting_visibility); - - if (input.options) { - Object.keys(input.options).forEach((key) => { - input.options[key] = encodePollOptionResponseData(input.options[key]); - }); - } - - if (input.own_votes) { - Object.keys(input.own_votes).forEach((key) => { - input.own_votes[key] = encodePollVoteResponseData(input.own_votes[key]); - }); - } - - input.custom = encodeobject(input.custom); - - if (input.latest_votes_by_option) { - Object.keys(input.latest_votes_by_option).forEach((key) => { - input.latest_votes_by_option[key] = encodearray( - input.latest_votes_by_option[key], - ); - }); - } - - if (input.vote_counts_by_option) { - Object.keys(input.vote_counts_by_option).forEach((key) => { - input.vote_counts_by_option[key] = encodeinteger( - input.vote_counts_by_option[key], - ); - }); - } - - input.is_closed = encodeboolean(input.is_closed); - - input.max_votes_allowed = encodeinteger(input.max_votes_allowed); - - input.created_by = encodeUserObject(input.created_by); - - return input; -}; - export const decodePollResponseData = (input: Record) => { if (!input) return input; input.allow_answers = decodeboolean(input.allow_answers); @@ -12216,29 +6107,6 @@ export const decodePollResponseData = (input: Record) => { return input; }; -export const encodePollVote = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.option_id = encodestring(input.option_id); - - input.poll_id = encodestring(input.poll_id); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.answer_text = encodestring(input.answer_text); - - input.is_answer = encodeboolean(input.is_answer); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodePollVote = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -12262,15 +6130,6 @@ export const decodePollVote = (input: Record) => { return input; }; -export const encodePollVoteResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.vote = encodePollVoteResponseData(input.vote); - - return input; -}; - export const decodePollVoteResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12280,29 +6139,6 @@ export const decodePollVoteResponse = (input: Record) => { return input; }; -export const encodePollVoteResponseData = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.option_id = encodestring(input.option_id); - - input.poll_id = encodestring(input.poll_id); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.answer_text = encodestring(input.answer_text); - - input.is_answer = encodeboolean(input.is_answer); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodePollVoteResponseData = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -12326,23 +6162,6 @@ export const decodePollVoteResponseData = (input: Record) => { return input; }; -export const encodePollVotesResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.votes) { - Object.keys(input.votes).forEach((key) => { - input.votes[key] = encodePollVoteResponseData(input.votes[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodePollVotesResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12360,15 +6179,6 @@ export const decodePollVotesResponse = (input: Record) => { return input; }; -export const encodePrivacySettings = (input: Record) => { - if (!input) return input; - input.read_receipts = encodeReadReceipts(input.read_receipts); - - input.typing_indicators = encodeTypingIndicators(input.typing_indicators); - - return input; -}; - export const decodePrivacySettings = (input: Record) => { if (!input) return input; input.read_receipts = decodeReadReceipts(input.read_receipts); @@ -12378,17 +6188,6 @@ export const decodePrivacySettings = (input: Record) => { return input; }; -export const encodePrivacySettingsResponse = (input: Record) => { - if (!input) return input; - input.read_receipts = encodeReadReceiptsResponse(input.read_receipts); - - input.typing_indicators = encodeTypingIndicatorsResponse( - input.typing_indicators, - ); - - return input; -}; - export const decodePrivacySettingsResponse = (input: Record) => { if (!input) return input; input.read_receipts = decodeReadReceiptsResponse(input.read_receipts); @@ -12400,17 +6199,6 @@ export const decodePrivacySettingsResponse = (input: Record) => { return input; }; -export const encodePublishedTrackInfo = (input: Record) => { - if (!input) return input; - input.codec_mime_type = encodestring(input.codec_mime_type); - - input.duration_seconds = encodeinteger(input.duration_seconds); - - input.track_type = encodestring(input.track_type); - - return input; -}; - export const decodePublishedTrackInfo = (input: Record) => { if (!input) return input; input.codec_mime_type = decodestring(input.codec_mime_type); @@ -12422,19 +6210,6 @@ export const decodePublishedTrackInfo = (input: Record) => { return input; }; -export const encodePublisherAggregateStats = (input: Record) => { - if (!input) return input; - if (input.by_track_type) { - Object.keys(input.by_track_type).forEach((key) => { - input.by_track_type[key] = encodeCount(input.by_track_type[key]); - }); - } - - input.total = encodeCount(input.total); - - return input; -}; - export const decodePublisherAggregateStats = (input: Record) => { if (!input) return input; if (input.by_track_type) { @@ -12448,43 +6223,11 @@ export const decodePublisherAggregateStats = (input: Record) => { return input; }; -export const encodePushConfig = (input: Record) => { - if (!input) return input; - input.version = encodestring(input.version); - - input.offline_only = encodeboolean(input.offline_only); - - return input; -}; - export const decodePushConfig = (input: Record) => { if (!input) return input; - input.version = decodestring(input.version); - - input.offline_only = decodeboolean(input.offline_only); - - return input; -}; - -export const encodePushNotificationFields = (input: Record) => { - if (!input) return input; - input.offline_only = encodeboolean(input.offline_only); - - input.version = encodestring(input.version); - - input.apn = encodeAPNConfigFields(input.apn); - - input.firebase = encodeFirebaseConfigFields(input.firebase); - - input.huawei = encodeHuaweiConfigFields(input.huawei); - - input.xiaomi = encodeXiaomiConfigFields(input.xiaomi); - - if (input.providers) { - Object.keys(input.providers).forEach((key) => { - input.providers[key] = encodePushProvider(input.providers[key]); - }); - } + input.version = decodestring(input.version); + + input.offline_only = decodeboolean(input.offline_only); return input; }; @@ -12512,15 +6255,6 @@ export const decodePushNotificationFields = (input: Record) => { return input; }; -export const encodePushNotificationSettings = (input: Record) => { - if (!input) return input; - input.disabled = encodeboolean(input.disabled); - - input.disabled_until = encodeDatetimeType(input.disabled_until); - - return input; -}; - export const decodePushNotificationSettings = (input: Record) => { if (!input) return input; input.disabled = decodeboolean(input.disabled); @@ -12530,17 +6264,6 @@ export const decodePushNotificationSettings = (input: Record) => { return input; }; -export const encodePushNotificationSettingsInput = ( - input: Record, -) => { - if (!input) return input; - input.disabled = encodeNullBool(input.disabled); - - input.disabled_until = encodeNullTime(input.disabled_until); - - return input; -}; - export const decodePushNotificationSettingsInput = ( input: Record, ) => { @@ -12552,17 +6275,6 @@ export const decodePushNotificationSettingsInput = ( return input; }; -export const encodePushNotificationSettingsResponse = ( - input: Record, -) => { - if (!input) return input; - input.disabled = encodeboolean(input.disabled); - - input.disabled_until = encodeDatetimeType(input.disabled_until); - - return input; -}; - export const decodePushNotificationSettingsResponse = ( input: Record, ) => { @@ -12574,67 +6286,6 @@ export const decodePushNotificationSettingsResponse = ( return input; }; -export const encodePushProvider = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.name = encodestring(input.name); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.apn_auth_key = encodestring(input.apn_auth_key); - - input.apn_auth_type = encodestring(input.apn_auth_type); - - input.apn_development = encodeboolean(input.apn_development); - - input.apn_host = encodestring(input.apn_host); - - input.apn_key_id = encodestring(input.apn_key_id); - - input.apn_notification_template = encodestring( - input.apn_notification_template, - ); - - input.apn_p12_cert = encodestring(input.apn_p12_cert); - - input.apn_team_id = encodestring(input.apn_team_id); - - input.apn_topic = encodestring(input.apn_topic); - - input.description = encodestring(input.description); - - input.disabled_at = encodeDatetimeType(input.disabled_at); - - input.disabled_reason = encodestring(input.disabled_reason); - - input.firebase_apn_template = encodestring(input.firebase_apn_template); - - input.firebase_credentials = encodestring(input.firebase_credentials); - - input.firebase_data_template = encodestring(input.firebase_data_template); - - input.firebase_host = encodestring(input.firebase_host); - - input.firebase_notification_template = encodestring( - input.firebase_notification_template, - ); - - input.firebase_server_key = encodestring(input.firebase_server_key); - - input.huawei_app_id = encodestring(input.huawei_app_id); - - input.huawei_app_secret = encodestring(input.huawei_app_secret); - - input.xiaomi_app_secret = encodestring(input.xiaomi_app_secret); - - input.xiaomi_package_name = encodestring(input.xiaomi_package_name); - - return input; -}; - export const decodePushProvider = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -12696,73 +6347,6 @@ export const decodePushProvider = (input: Record) => { return input; }; -export const encodePushProviderResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.name = encodestring(input.name); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.apn_auth_key = encodestring(input.apn_auth_key); - - input.apn_auth_type = encodestring(input.apn_auth_type); - - input.apn_development = encodeboolean(input.apn_development); - - input.apn_host = encodestring(input.apn_host); - - input.apn_key_id = encodestring(input.apn_key_id); - - input.apn_p12_cert = encodestring(input.apn_p12_cert); - - input.apn_sandbox_certificate = encodeboolean(input.apn_sandbox_certificate); - - input.apn_supports_remote_notifications = encodeboolean( - input.apn_supports_remote_notifications, - ); - - input.apn_supports_voip_notifications = encodeboolean( - input.apn_supports_voip_notifications, - ); - - input.apn_team_id = encodestring(input.apn_team_id); - - input.apn_topic = encodestring(input.apn_topic); - - input.description = encodestring(input.description); - - input.disabled_at = encodeDatetimeType(input.disabled_at); - - input.disabled_reason = encodestring(input.disabled_reason); - - input.firebase_apn_template = encodestring(input.firebase_apn_template); - - input.firebase_credentials = encodestring(input.firebase_credentials); - - input.firebase_data_template = encodestring(input.firebase_data_template); - - input.firebase_host = encodestring(input.firebase_host); - - input.firebase_notification_template = encodestring( - input.firebase_notification_template, - ); - - input.firebase_server_key = encodestring(input.firebase_server_key); - - input.huawei_app_id = encodestring(input.huawei_app_id); - - input.huawei_app_secret = encodestring(input.huawei_app_secret); - - input.xiaomi_app_secret = encodestring(input.xiaomi_app_secret); - - input.xiaomi_package_name = encodestring(input.xiaomi_package_name); - - return input; -}; - export const decodePushProviderResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -12830,29 +6414,6 @@ export const decodePushProviderResponse = (input: Record) => { return input; }; -export const encodeQueryBannedUsersRequest = (input: Record) => { - if (!input) return input; - input.filter_conditions = encodeobject(input.filter_conditions); - - input.exclude_expired_bans = encodeboolean(input.exclude_expired_bans); - - input.limit = encodeinteger(input.limit); - - input.offset = encodeinteger(input.offset); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryBannedUsersRequest = (input: Record) => { if (!input) return input; input.filter_conditions = decodeobject(input.filter_conditions); @@ -12876,19 +6437,6 @@ export const decodeQueryBannedUsersRequest = (input: Record) => { return input; }; -export const encodeQueryBannedUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.bans) { - Object.keys(input.bans).forEach((key) => { - input.bans[key] = encodeBanResponse(input.bans[key]); - }); - } - - return input; -}; - export const decodeQueryBannedUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12902,29 +6450,6 @@ export const decodeQueryBannedUsersResponse = (input: Record) => { return input; }; -export const encodeQueryCallMembersRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.type = encodestring(input.type); - - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter_conditions = encodeobject(input.filter_conditions); - - return input; -}; - export const decodeQueryCallMembersRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -12948,23 +6473,6 @@ export const decodeQueryCallMembersRequest = (input: Record) => { return input; }; -export const encodeQueryCallMembersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryCallMembersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -12982,25 +6490,6 @@ export const decodeQueryCallMembersResponse = (input: Record) => { return input; }; -export const encodeQueryCallStatsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter_conditions = encodeobject(input.filter_conditions); - - return input; -}; - export const decodeQueryCallStatsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13020,25 +6509,6 @@ export const decodeQueryCallStatsRequest = (input: Record) => { return input; }; -export const encodeQueryCallStatsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.reports) { - Object.keys(input.reports).forEach((key) => { - input.reports[key] = encodeCallStatsReportSummaryResponse( - input.reports[key], - ); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryCallStatsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13058,25 +6528,6 @@ export const decodeQueryCallStatsResponse = (input: Record) => { return input; }; -export const encodeQueryCallsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter_conditions = encodeobject(input.filter_conditions); - - return input; -}; - export const decodeQueryCallsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13096,23 +6547,6 @@ export const decodeQueryCallsRequest = (input: Record) => { return input; }; -export const encodeQueryCallsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.calls) { - Object.keys(input.calls).forEach((key) => { - input.calls[key] = encodeCallStateResponseFields(input.calls[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryCallsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13130,33 +6564,6 @@ export const decodeQueryCallsResponse = (input: Record) => { return input; }; -export const encodeQueryChannelsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.member_limit = encodeinteger(input.member_limit); - - input.message_limit = encodeinteger(input.message_limit); - - input.offset = encodeinteger(input.offset); - - input.state = encodeboolean(input.state); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter_conditions = encodeobject(input.filter_conditions); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryChannelsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13184,64 +6591,18 @@ export const decodeQueryChannelsRequest = (input: Record) => { return input; }; -export const encodeQueryChannelsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = encodeChannelStateResponseFields( - input.channels[key], - ); - }); - } - - return input; -}; - -export const decodeQueryChannelsResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = decodeChannelStateResponseFields( - input.channels[key], - ); - }); - } - - return input; -}; - -export const encodeQueryMembersRequest = (input: Record) => { - if (!input) return input; - input.type = encodestring(input.type); - - input.filter_conditions = encodeobject(input.filter_conditions); - - input.id = encodestring(input.id); - - input.limit = encodeinteger(input.limit); - - input.offset = encodeinteger(input.offset); - - input.user_id = encodestring(input.user_id); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } +export const decodeQueryChannelsResponse = (input: Record) => { + if (!input) return input; + input.duration = decodestring(input.duration); - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); + if (input.channels) { + Object.keys(input.channels).forEach((key) => { + input.channels[key] = decodeChannelStateResponseFields( + input.channels[key], + ); }); } - input.user = encodeUserRequest(input.user); - return input; }; @@ -13276,29 +6637,6 @@ export const decodeQueryMembersRequest = (input: Record) => { return input; }; -export const encodeQueryMessageFlagsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.offset = encodeinteger(input.offset); - - input.show_deleted_messages = encodeboolean(input.show_deleted_messages); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParam(input.sort[key]); - }); - } - - input.filter_conditions = encodeobject(input.filter_conditions); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryMessageFlagsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13322,19 +6660,6 @@ export const decodeQueryMessageFlagsRequest = (input: Record) => { return input; }; -export const encodeQueryMessageFlagsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.flags) { - Object.keys(input.flags).forEach((key) => { - input.flags[key] = encodeMessageFlagResponse(input.flags[key]); - }); - } - - return input; -}; - export const decodeQueryMessageFlagsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13348,27 +6673,6 @@ export const decodeQueryMessageFlagsResponse = (input: Record) => { return input; }; -export const encodeQueryMessageHistoryRequest = ( - input: Record, -) => { - if (!input) return input; - input.filter = encodeobject(input.filter); - - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - return input; -}; - export const decodeQueryMessageHistoryRequest = ( input: Record, ) => { @@ -13390,27 +6694,6 @@ export const decodeQueryMessageHistoryRequest = ( return input; }; -export const encodeQueryMessageHistoryResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.message_history) { - Object.keys(input.message_history).forEach((key) => { - input.message_history[key] = encodeMessageHistoryEntryResponse( - input.message_history[key], - ); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryMessageHistoryResponse = ( input: Record, ) => { @@ -13432,31 +6715,6 @@ export const decodeQueryMessageHistoryResponse = ( return input; }; -export const encodeQueryModerationLogsRequest = ( - input: Record, -) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryModerationLogsRequest = ( input: Record, ) => { @@ -13482,25 +6740,6 @@ export const decodeQueryModerationLogsRequest = ( return input; }; -export const encodeQueryModerationLogsResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.l_og_s) { - Object.keys(input.l_og_s).forEach((key) => { - input.l_og_s[key] = encodeActionLogResponse(input.l_og_s[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryModerationLogsResponse = ( input: Record, ) => { @@ -13520,25 +6759,6 @@ export const decodeQueryModerationLogsResponse = ( return input; }; -export const encodeQueryPollVotesRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - return input; -}; - export const decodeQueryPollVotesRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13558,25 +6778,6 @@ export const decodeQueryPollVotesRequest = (input: Record) => { return input; }; -export const encodeQueryPollsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - return input; -}; - export const decodeQueryPollsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13596,23 +6797,6 @@ export const decodeQueryPollsRequest = (input: Record) => { return input; }; -export const encodeQueryPollsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.polls) { - Object.keys(input.polls).forEach((key) => { - input.polls[key] = encodePollResponseData(input.polls[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryPollsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13630,29 +6814,6 @@ export const decodeQueryPollsResponse = (input: Record) => { return input; }; -export const encodeQueryReactionsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryReactionsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13676,23 +6837,6 @@ export const decodeQueryReactionsRequest = (input: Record) => { return input; }; -export const encodeQueryReactionsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.reactions) { - Object.keys(input.reactions).forEach((key) => { - input.reactions[key] = encodeReactionResponse(input.reactions[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryReactionsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13710,35 +6854,6 @@ export const decodeQueryReactionsResponse = (input: Record) => { return input; }; -export const encodeQueryReviewQueueRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.lock_moderator_duration = encodeinteger(input.lock_moderator_duration); - - input.lock_moderator_id = encodestring(input.lock_moderator_id); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - input.stats_only = encodeboolean(input.stats_only); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryReviewQueueRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13768,35 +6883,6 @@ export const decodeQueryReviewQueueRequest = (input: Record) => { return input; }; -export const encodeQueryReviewQueueResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.items) { - Object.keys(input.items).forEach((key) => { - input.items[key] = encodeReviewQueueItem(input.items[key]); - }); - } - - if (input.action_config) { - Object.keys(input.action_config).forEach((key) => { - input.action_config[key] = encodearray(input.action_config[key]); - }); - } - - if (input.stats) { - Object.keys(input.stats).forEach((key) => { - input.stats[key] = encodeinteger(input.stats[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryReviewQueueResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13826,27 +6912,6 @@ export const decodeQueryReviewQueueResponse = (input: Record) => { return input; }; -export const encodeQueryThreadsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.member_limit = encodeinteger(input.member_limit); - - input.next = encodestring(input.next); - - input.participant_limit = encodeinteger(input.participant_limit); - - input.prev = encodestring(input.prev); - - input.reply_limit = encodeinteger(input.reply_limit); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryThreadsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13868,23 +6933,6 @@ export const decodeQueryThreadsRequest = (input: Record) => { return input; }; -export const encodeQueryThreadsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = encodeThreadStateResponse(input.threads[key]); - }); - } - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - return input; -}; - export const decodeQueryThreadsResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -13902,29 +6950,6 @@ export const decodeQueryThreadsResponse = (input: Record) => { return input; }; -export const encodeQueryUsageStatsRequest = (input: Record) => { - if (!input) return input; - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.prev = encodestring(input.prev); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.filter = encodeobject(input.filter); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryUsageStatsRequest = (input: Record) => { if (!input) return input; input.limit = decodeinteger(input.limit); @@ -13941,26 +6966,9 @@ export const decodeQueryUsageStatsRequest = (input: Record) => { }); } - input.filter = decodeobject(input.filter); - - input.user = decodeUserRequest(input.user); - - return input; -}; - -export const encodeQueryUsageStatsResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.items) { - Object.keys(input.items).forEach((key) => { - input.items[key] = encodeModerationUsageStats(input.items[key]); - }); - } - - input.next = encodestring(input.next); + input.filter = decodeobject(input.filter); - input.prev = encodestring(input.prev); + input.user = decodeUserRequest(input.user); return input; }; @@ -13982,33 +6990,6 @@ export const decodeQueryUsageStatsResponse = (input: Record) => { return input; }; -export const encodeQueryUsersPayload = (input: Record) => { - if (!input) return input; - input.filter_conditions = encodeobject(input.filter_conditions); - - input.include_deactivated_users = encodeboolean( - input.include_deactivated_users, - ); - - input.limit = encodeinteger(input.limit); - - input.offset = encodeinteger(input.offset); - - input.presence = encodeboolean(input.presence); - - input.user_id = encodestring(input.user_id); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeQueryUsersPayload = (input: Record) => { if (!input) return input; input.filter_conditions = decodeobject(input.filter_conditions); @@ -14036,19 +7017,6 @@ export const decodeQueryUsersPayload = (input: Record) => { return input; }; -export const encodeQueryUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.users) { - Object.keys(input.users).forEach((key) => { - input.users[key] = encodeFullUserResponse(input.users[key]); - }); - } - - return input; -}; - export const decodeQueryUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -14062,23 +7030,6 @@ export const decodeQueryUsersResponse = (input: Record) => { return input; }; -export const encodeQueueStatsResponse = (input: Record) => { - if (!input) return input; - input.avg_time_to_action = encodeinteger(input.avg_time_to_action); - - input.duration = encodestring(input.duration); - - if (input.time_to_action_buckets) { - Object.keys(input.time_to_action_buckets).forEach((key) => { - input.time_to_action_buckets[key] = encodeinteger( - input.time_to_action_buckets[key], - ); - }); - } - - return input; -}; - export const decodeQueueStatsResponse = (input: Record) => { if (!input) return input; input.avg_time_to_action = decodeinteger(input.avg_time_to_action); @@ -14096,13 +7047,6 @@ export const decodeQueueStatsResponse = (input: Record) => { return input; }; -export const encodeRTMPIngress = (input: Record) => { - if (!input) return input; - input.address = encodestring(input.address); - - return input; -}; - export const decodeRTMPIngress = (input: Record) => { if (!input) return input; input.address = decodestring(input.address); @@ -14110,27 +7054,6 @@ export const decodeRTMPIngress = (input: Record) => { return input; }; -export const encodeReaction = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.message_id = encodestring(input.message_id); - - input.score = encodeinteger(input.score); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.custom = encodeobject(input.custom); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeReaction = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -14152,19 +7075,6 @@ export const decodeReaction = (input: Record) => { return input; }; -export const encodeReactionGroupResponse = (input: Record) => { - if (!input) return input; - input.count = encodeinteger(input.count); - - input.first_reaction_at = encodeDatetimeType(input.first_reaction_at); - - input.last_reaction_at = encodeDatetimeType(input.last_reaction_at); - - input.sum_scores = encodeinteger(input.sum_scores); - - return input; -}; - export const decodeReactionGroupResponse = (input: Record) => { if (!input) return input; input.count = decodeinteger(input.count); @@ -14178,17 +7088,6 @@ export const decodeReactionGroupResponse = (input: Record) => { return input; }; -export const encodeReactionRemovalResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessage(input.message); - - input.reaction = encodeReaction(input.reaction); - - return input; -}; - export const decodeReactionRemovalResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -14200,25 +7099,6 @@ export const decodeReactionRemovalResponse = (input: Record) => { return input; }; -export const encodeReactionRequest = (input: Record) => { - if (!input) return input; - input.type = encodestring(input.type); - - input.created_at = encodeDatetimeType(input.created_at); - - input.score = encodeinteger(input.score); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeReactionRequest = (input: Record) => { if (!input) return input; input.type = decodestring(input.type); @@ -14238,27 +7118,6 @@ export const decodeReactionRequest = (input: Record) => { return input; }; -export const encodeReactionResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.message_id = encodestring(input.message_id); - - input.score = encodeinteger(input.score); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserResponse(input.user); - - return input; -}; - export const decodeReactionResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -14280,17 +7139,6 @@ export const decodeReactionResponse = (input: Record) => { return input; }; -export const encodeReactivateUserRequest = (input: Record) => { - if (!input) return input; - input.created_by_id = encodestring(input.created_by_id); - - input.name = encodestring(input.name); - - input.restore_messages = encodeboolean(input.restore_messages); - - return input; -}; - export const decodeReactivateUserRequest = (input: Record) => { if (!input) return input; input.created_by_id = decodestring(input.created_by_id); @@ -14302,15 +7150,6 @@ export const decodeReactivateUserRequest = (input: Record) => { return input; }; -export const encodeReactivateUserResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeReactivateUserResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -14320,23 +7159,6 @@ export const decodeReactivateUserResponse = (input: Record) => { return input; }; -export const encodeReactivateUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - input.created_by_id = encodestring(input.created_by_id); - - input.restore_channels = encodeboolean(input.restore_channels); - - input.restore_messages = encodeboolean(input.restore_messages); - - return input; -}; - export const decodeReactivateUsersRequest = (input: Record) => { if (!input) return input; if (input.user_ids) { @@ -14354,15 +7176,6 @@ export const decodeReactivateUsersRequest = (input: Record) => { return input; }; -export const encodeReactivateUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.task_id = encodestring(input.task_id); - - return input; -}; - export const decodeReactivateUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -14372,19 +7185,6 @@ export const decodeReactivateUsersResponse = (input: Record) => { return input; }; -export const encodeRead = (input: Record) => { - if (!input) return input; - input.last_read = encodeDatetimeType(input.last_read); - - input.unread_messages = encodeinteger(input.unread_messages); - - input.last_read_message_id = encodestring(input.last_read_message_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeRead = (input: Record) => { if (!input) return input; input.last_read = decodeDatetimeType(input.last_read); @@ -14398,13 +7198,6 @@ export const decodeRead = (input: Record) => { return input; }; -export const encodeReadReceipts = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeReadReceipts = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -14412,13 +7205,6 @@ export const decodeReadReceipts = (input: Record) => { return input; }; -export const encodeReadReceiptsResponse = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeReadReceiptsResponse = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -14426,19 +7212,6 @@ export const decodeReadReceiptsResponse = (input: Record) => { return input; }; -export const encodeReadStateResponse = (input: Record) => { - if (!input) return input; - input.last_read = encodeDatetimeType(input.last_read); - - input.unread_messages = encodeinteger(input.unread_messages); - - input.user = encodeUserResponse(input.user); - - input.last_read_message_id = encodestring(input.last_read_message_id); - - return input; -}; - export const decodeReadStateResponse = (input: Record) => { if (!input) return input; input.last_read = decodeDatetimeType(input.last_read); @@ -14452,19 +7225,6 @@ export const decodeReadStateResponse = (input: Record) => { return input; }; -export const encodeRecordSettings = (input: Record) => { - if (!input) return input; - input.audio_only = encodeboolean(input.audio_only); - - input.mode = encodestring(input.mode); - - input.quality = encodestring(input.quality); - - input.layout = encodeLayoutSettings(input.layout); - - return input; -}; - export const decodeRecordSettings = (input: Record) => { if (!input) return input; input.audio_only = decodeboolean(input.audio_only); @@ -14478,173 +7238,51 @@ export const decodeRecordSettings = (input: Record) => { return input; }; -export const encodeRecordSettingsRequest = (input: Record) => { - if (!input) return input; - input.mode = encodestring(input.mode); - - input.audio_only = encodeboolean(input.audio_only); - - input.quality = encodestring(input.quality); - - input.layout = encodeLayoutSettingsRequest(input.layout); - - return input; -}; - export const decodeRecordSettingsRequest = (input: Record) => { if (!input) return input; input.mode = decodestring(input.mode); - input.audio_only = decodeboolean(input.audio_only); - - input.quality = decodestring(input.quality); - - input.layout = decodeLayoutSettingsRequest(input.layout); - - return input; -}; - -export const encodeRecordSettingsResponse = (input: Record) => { - if (!input) return input; - input.audio_only = encodeboolean(input.audio_only); - - input.mode = encodestring(input.mode); - - input.quality = encodestring(input.quality); - - input.layout = encodeLayoutSettingsResponse(input.layout); - - return input; -}; - -export const decodeRecordSettingsResponse = (input: Record) => { - if (!input) return input; - input.audio_only = decodeboolean(input.audio_only); - - input.mode = decodestring(input.mode); - - input.quality = decodestring(input.quality); - - input.layout = decodeLayoutSettingsResponse(input.layout); - - return input; -}; - -export const encodeResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - -export const decodeResponse = (input: Record) => { - if (!input) return input; - input.duration = decodestring(input.duration); - - return input; -}; - -export const encodeRestoreActionRequest = (input: Record) => { - if (!input) return input; - return input; -}; - -export const decodeRestoreActionRequest = (input: Record) => { - if (!input) return input; - return input; -}; - -export const encodeRestoreUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - return input; -}; - -export const decodeRestoreUsersRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = decodestring(input.user_ids[key]); - }); - } - - return input; -}; - -export const encodeReviewQueueItem = (input: Record) => { - if (!input) return input; - input.content_changed = encodeboolean(input.content_changed); - - input.created_at = encodeDatetimeType(input.created_at); - - input.entity_id = encodestring(input.entity_id); - - input.entity_type = encodestring(input.entity_type); - - input.has_image = encodeboolean(input.has_image); - - input.has_text = encodeboolean(input.has_text); - - input.has_video = encodeboolean(input.has_video); - - input.id = encodestring(input.id); - - input.moderation_payload_hash = encodestring(input.moderation_payload_hash); - - input.recommended_action = encodestring(input.recommended_action); - - input.reviewed_by = encodestring(input.reviewed_by); - - input.severity = encodeinteger(input.severity); - - input.status = encodestring(input.status); - - input.updated_at = encodeDatetimeType(input.updated_at); + input.audio_only = decodeboolean(input.audio_only); - if (input.actions) { - Object.keys(input.actions).forEach((key) => { - input.actions[key] = encodeActionLog(input.actions[key]); - }); - } + input.quality = decodestring(input.quality); - if (input.bans) { - Object.keys(input.bans).forEach((key) => { - input.bans[key] = encodeBan(input.bans[key]); - }); - } + input.layout = decodeLayoutSettingsRequest(input.layout); - if (input.flags) { - Object.keys(input.flags).forEach((key) => { - input.flags[key] = encodeFlag2(input.flags[key]); - }); - } + return input; +}; - if (input.languages) { - Object.keys(input.languages).forEach((key) => { - input.languages[key] = encodestring(input.languages[key]); - }); - } +export const decodeRecordSettingsResponse = (input: Record) => { + if (!input) return input; + input.audio_only = decodeboolean(input.audio_only); - input.completed_at = encodeNullTime(input.completed_at); + input.mode = decodestring(input.mode); - input.reviewed_at = encodeNullTime(input.reviewed_at); + input.quality = decodestring(input.quality); - input.assigned_to = encodeUserObject(input.assigned_to); + input.layout = decodeLayoutSettingsResponse(input.layout); - input.entity_creator = encodeUserObject(input.entity_creator); + return input; +}; - input.feeds_v2_activity = encodeEnrichedActivity(input.feeds_v2_activity); +export const decodeResponse = (input: Record) => { + if (!input) return input; + input.duration = decodestring(input.duration); - input.feeds_v2_reaction = encodeReaction(input.feeds_v2_reaction); + return input; +}; - input.message = encodeMessage(input.message); +export const decodeRestoreActionRequest = (input: Record) => { + if (!input) return input; + return input; +}; - input.moderation_payload = encodeModerationPayload(input.moderation_payload); +export const decodeRestoreUsersRequest = (input: Record) => { + if (!input) return input; + if (input.user_ids) { + Object.keys(input.user_ids).forEach((key) => { + input.user_ids[key] = decodestring(input.user_ids[key]); + }); + } return input; }; @@ -14722,19 +7360,6 @@ export const decodeReviewQueueItem = (input: Record) => { return input; }; -export const encodeRingSettings = (input: Record) => { - if (!input) return input; - input.auto_cancel_timeout_ms = encodeinteger(input.auto_cancel_timeout_ms); - - input.incoming_call_timeout_ms = encodeinteger( - input.incoming_call_timeout_ms, - ); - - input.missed_call_timeout_ms = encodeinteger(input.missed_call_timeout_ms); - - return input; -}; - export const decodeRingSettings = (input: Record) => { if (!input) return input; input.auto_cancel_timeout_ms = decodeinteger(input.auto_cancel_timeout_ms); @@ -14748,19 +7373,6 @@ export const decodeRingSettings = (input: Record) => { return input; }; -export const encodeRingSettingsRequest = (input: Record) => { - if (!input) return input; - input.auto_cancel_timeout_ms = encodeinteger(input.auto_cancel_timeout_ms); - - input.incoming_call_timeout_ms = encodeinteger( - input.incoming_call_timeout_ms, - ); - - input.missed_call_timeout_ms = encodeinteger(input.missed_call_timeout_ms); - - return input; -}; - export const decodeRingSettingsRequest = (input: Record) => { if (!input) return input; input.auto_cancel_timeout_ms = decodeinteger(input.auto_cancel_timeout_ms); @@ -14774,19 +7386,6 @@ export const decodeRingSettingsRequest = (input: Record) => { return input; }; -export const encodeRingSettingsResponse = (input: Record) => { - if (!input) return input; - input.auto_cancel_timeout_ms = encodeinteger(input.auto_cancel_timeout_ms); - - input.incoming_call_timeout_ms = encodeinteger( - input.incoming_call_timeout_ms, - ); - - input.missed_call_timeout_ms = encodeinteger(input.missed_call_timeout_ms); - - return input; -}; - export const decodeRingSettingsResponse = (input: Record) => { if (!input) return input; input.auto_cancel_timeout_ms = decodeinteger(input.auto_cancel_timeout_ms); @@ -14800,25 +7399,6 @@ export const decodeRingSettingsResponse = (input: Record) => { return input; }; -export const encodeRole = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.custom = encodeboolean(input.custom); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.scopes) { - Object.keys(input.scopes).forEach((key) => { - input.scopes[key] = encodestring(input.scopes[key]); - }); - } - - return input; -}; - export const decodeRole = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -14838,17 +7418,6 @@ export const decodeRole = (input: Record) => { return input; }; -export const encodeS3Request = (input: Record) => { - if (!input) return input; - input.s3_region = encodestring(input.s3_region); - - input.s3_api_key = encodestring(input.s3_api_key); - - input.s3_secret = encodestring(input.s3_secret); - - return input; -}; - export const decodeS3Request = (input: Record) => { if (!input) return input; input.s3_region = decodestring(input.s3_region); @@ -14860,19 +7429,6 @@ export const decodeS3Request = (input: Record) => { return input; }; -export const encodeSFULocationResponse = (input: Record) => { - if (!input) return input; - input.datacenter = encodestring(input.datacenter); - - input.id = encodestring(input.id); - - input.coordinates = encodeCoordinates(input.coordinates); - - input.location = encodeLocation(input.location); - - return input; -}; - export const decodeSFULocationResponse = (input: Record) => { if (!input) return input; input.datacenter = decodestring(input.datacenter); @@ -14886,17 +7442,6 @@ export const decodeSFULocationResponse = (input: Record) => { return input; }; -export const encodeScreensharingSettings = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeScreensharingSettings = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -14908,19 +7453,6 @@ export const decodeScreensharingSettings = (input: Record) => { return input; }; -export const encodeScreensharingSettingsRequest = ( - input: Record, -) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeScreensharingSettingsRequest = ( input: Record, ) => { @@ -14934,19 +7466,6 @@ export const decodeScreensharingSettingsRequest = ( return input; }; -export const encodeScreensharingSettingsResponse = ( - input: Record, -) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeScreensharingSettingsResponse = ( input: Record, ) => { @@ -14960,31 +7479,6 @@ export const decodeScreensharingSettingsResponse = ( return input; }; -export const encodeSearchRequest = (input: Record) => { - if (!input) return input; - input.filter_conditions = encodeobject(input.filter_conditions); - - input.limit = encodeinteger(input.limit); - - input.next = encodestring(input.next); - - input.offset = encodeinteger(input.offset); - - input.query = encodestring(input.query); - - if (input.sort) { - Object.keys(input.sort).forEach((key) => { - input.sort[key] = encodeSortParamRequest(input.sort[key]); - }); - } - - input.message_filter_conditions = encodeobject( - input.message_filter_conditions, - ); - - return input; -}; - export const decodeSearchRequest = (input: Record) => { if (!input) return input; input.filter_conditions = decodeobject(input.filter_conditions); @@ -15010,25 +7504,6 @@ export const decodeSearchRequest = (input: Record) => { return input; }; -export const encodeSearchResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.results) { - Object.keys(input.results).forEach((key) => { - input.results[key] = encodeSearchResult(input.results[key]); - }); - } - - input.next = encodestring(input.next); - - input.previous = encodestring(input.previous); - - input.results_warning = encodeSearchWarning(input.results_warning); - - return input; -}; - export const decodeSearchResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15045,150 +7520,12 @@ export const decodeSearchResponse = (input: Record) => { input.results_warning = decodeSearchWarning(input.results_warning); - return input; -}; - -export const encodeSearchResult = (input: Record) => { - if (!input) return input; - input.message = encodeSearchResultMessage(input.message); - - return input; -}; - -export const decodeSearchResult = (input: Record) => { - if (!input) return input; - input.message = decodeSearchResultMessage(input.message); - - return input; -}; - -export const encodeSearchResultMessage = (input: Record) => { - if (!input) return input; - input.cid = encodestring(input.cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.deleted_reply_count = encodeinteger(input.deleted_reply_count); - - input.html = encodestring(input.html); - - input.id = encodestring(input.id); - - input.pinned = encodeboolean(input.pinned); - - input.reply_count = encodeinteger(input.reply_count); - - input.shadowed = encodeboolean(input.shadowed); - - input.silent = encodeboolean(input.silent); - - input.text = encodestring(input.text); - - input.type = encodestring(input.type); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.attachments) { - Object.keys(input.attachments).forEach((key) => { - input.attachments[key] = encodeAttachment(input.attachments[key]); - }); - } - - if (input.latest_reactions) { - Object.keys(input.latest_reactions).forEach((key) => { - input.latest_reactions[key] = encodeReaction(input.latest_reactions[key]); - }); - } - - if (input.mentioned_users) { - Object.keys(input.mentioned_users).forEach((key) => { - input.mentioned_users[key] = encodeUserObject(input.mentioned_users[key]); - }); - } - - if (input.own_reactions) { - Object.keys(input.own_reactions).forEach((key) => { - input.own_reactions[key] = encodeReaction(input.own_reactions[key]); - }); - } - - input.custom = encodeobject(input.custom); - - if (input.reaction_counts) { - Object.keys(input.reaction_counts).forEach((key) => { - input.reaction_counts[key] = encodeinteger(input.reaction_counts[key]); - }); - } - - if (input.reaction_groups) { - Object.keys(input.reaction_groups).forEach((key) => { - input.reaction_groups[key] = encodeReactionGroupResponse( - input.reaction_groups[key], - ); - }); - } - - if (input.reaction_scores) { - Object.keys(input.reaction_scores).forEach((key) => { - input.reaction_scores[key] = encodeinteger(input.reaction_scores[key]); - }); - } - - input.before_message_send_failed = encodeboolean( - input.before_message_send_failed, - ); - - input.command = encodestring(input.command); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.message_text_updated_at = encodeDatetimeType( - input.message_text_updated_at, - ); - - input.mml = encodestring(input.mml); - - input.parent_id = encodestring(input.parent_id); - - input.pin_expires = encodeDatetimeType(input.pin_expires); - - input.pinned_at = encodeDatetimeType(input.pinned_at); - - input.poll_id = encodestring(input.poll_id); - - input.quoted_message_id = encodestring(input.quoted_message_id); - - input.show_in_channel = encodeboolean(input.show_in_channel); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeUserObject( - input.thread_participants[key], - ); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - if (input.i18n) { - Object.keys(input.i18n).forEach((key) => { - input.i18n[key] = encodestring(input.i18n[key]); - }); - } - - if (input.image_labels) { - Object.keys(input.image_labels).forEach((key) => { - input.image_labels[key] = encodearray(input.image_labels[key]); - }); - } - - input.pinned_by = encodeUserObject(input.pinned_by); - - input.poll = encodePoll(input.poll); - - input.quoted_message = encodeMessage(input.quoted_message); + return input; +}; - input.user = encodeUserObject(input.user); +export const decodeSearchResult = (input: Record) => { + if (!input) return input; + input.message = decodeSearchResultMessage(input.message); return input; }; @@ -15324,25 +7661,6 @@ export const decodeSearchResultMessage = (input: Record) => { return input; }; -export const encodeSearchWarning = (input: Record) => { - if (!input) return input; - input.warning_code = encodeinteger(input.warning_code); - - input.warning_description = encodestring(input.warning_description); - - input.channel_search_count = encodeinteger(input.channel_search_count); - - if (input.channel_search_cids) { - Object.keys(input.channel_search_cids).forEach((key) => { - input.channel_search_cids[key] = encodestring( - input.channel_search_cids[key], - ); - }); - } - - return input; -}; - export const decodeSearchWarning = (input: Record) => { if (!input) return input; input.warning_code = decodeinteger(input.warning_code); @@ -15362,17 +7680,6 @@ export const decodeSearchWarning = (input: Record) => { return input; }; -export const encodeSendCallEventRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeSendCallEventRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -15384,13 +7691,6 @@ export const decodeSendCallEventRequest = (input: Record) => { return input; }; -export const encodeSendCallEventResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeSendCallEventResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15398,13 +7698,6 @@ export const decodeSendCallEventResponse = (input: Record) => { return input; }; -export const encodeSendEventRequest = (input: Record) => { - if (!input) return input; - input.event = encodeEventRequest(input.event); - - return input; -}; - export const decodeSendEventRequest = (input: Record) => { if (!input) return input; input.event = decodeEventRequest(input.event); @@ -15412,31 +7705,6 @@ export const decodeSendEventRequest = (input: Record) => { return input; }; -export const encodeSendMessageRequest = (input: Record) => { - if (!input) return input; - input.message = encodeMessageRequest(input.message); - - input.force_moderation = encodeboolean(input.force_moderation); - - input.keep_channel_hidden = encodeboolean(input.keep_channel_hidden); - - input.pending = encodeboolean(input.pending); - - input.skip_enrich_url = encodeboolean(input.skip_enrich_url); - - input.skip_push = encodeboolean(input.skip_push); - - if (input.pending_message_metadata) { - Object.keys(input.pending_message_metadata).forEach((key) => { - input.pending_message_metadata[key] = encodestring( - input.pending_message_metadata[key], - ); - }); - } - - return input; -}; - export const decodeSendMessageRequest = (input: Record) => { if (!input) return input; input.message = decodeMessageRequest(input.message); @@ -15462,23 +7730,6 @@ export const decodeSendMessageRequest = (input: Record) => { return input; }; -export const encodeSendMessageResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessageResponse(input.message); - - if (input.pending_message_metadata) { - Object.keys(input.pending_message_metadata).forEach((key) => { - input.pending_message_metadata[key] = encodestring( - input.pending_message_metadata[key], - ); - }); - } - - return input; -}; - export const decodeSendMessageResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15496,17 +7747,6 @@ export const decodeSendMessageResponse = (input: Record) => { return input; }; -export const encodeSendReactionRequest = (input: Record) => { - if (!input) return input; - input.reaction = encodeReactionRequest(input.reaction); - - input.enforce_unique = encodeboolean(input.enforce_unique); - - input.skip_push = encodeboolean(input.skip_push); - - return input; -}; - export const decodeSendReactionRequest = (input: Record) => { if (!input) return input; input.reaction = decodeReactionRequest(input.reaction); @@ -15518,17 +7758,6 @@ export const decodeSendReactionRequest = (input: Record) => { return input; }; -export const encodeSendReactionResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessageResponse(input.message); - - input.reaction = encodeReactionResponse(input.reaction); - - return input; -}; - export const decodeSendReactionResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15540,15 +7769,6 @@ export const decodeSendReactionResponse = (input: Record) => { return input; }; -export const encodeSendUserCustomEventRequest = ( - input: Record, -) => { - if (!input) return input; - input.event = encodeUserCustomEventRequest(input.event); - - return input; -}; - export const decodeSendUserCustomEventRequest = ( input: Record, ) => { @@ -15558,15 +7778,6 @@ export const decodeSendUserCustomEventRequest = ( return input; }; -export const encodeShowChannelRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeShowChannelRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -15576,13 +7787,6 @@ export const decodeShowChannelRequest = (input: Record) => { return input; }; -export const encodeShowChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeShowChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15590,15 +7794,6 @@ export const decodeShowChannelResponse = (input: Record) => { return input; }; -export const encodeSortParam = (input: Record) => { - if (!input) return input; - input.direction = encodeinteger(input.direction); - - input.field = encodestring(input.field); - - return input; -}; - export const decodeSortParam = (input: Record) => { if (!input) return input; input.direction = decodeinteger(input.direction); @@ -15608,15 +7803,6 @@ export const decodeSortParam = (input: Record) => { return input; }; -export const encodeSortParamRequest = (input: Record) => { - if (!input) return input; - input.direction = encodeinteger(input.direction); - - input.field = encodestring(input.field); - - return input; -}; - export const decodeSortParamRequest = (input: Record) => { if (!input) return input; input.direction = decodeinteger(input.direction); @@ -15626,13 +7812,6 @@ export const decodeSortParamRequest = (input: Record) => { return input; }; -export const encodeStartHLSBroadcastingRequest = ( - input: Record, -) => { - if (!input) return input; - return input; -}; - export const decodeStartHLSBroadcastingRequest = ( input: Record, ) => { @@ -15640,17 +7819,6 @@ export const decodeStartHLSBroadcastingRequest = ( return input; }; -export const encodeStartHLSBroadcastingResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.playlist_url = encodestring(input.playlist_url); - - return input; -}; - export const decodeStartHLSBroadcastingResponse = ( input: Record, ) => { @@ -15662,15 +7830,6 @@ export const decodeStartHLSBroadcastingResponse = ( return input; }; -export const encodeStartRecordingRequest = (input: Record) => { - if (!input) return input; - input.recording_external_storage = encodestring( - input.recording_external_storage, - ); - - return input; -}; - export const decodeStartRecordingRequest = (input: Record) => { if (!input) return input; input.recording_external_storage = decodestring( @@ -15680,13 +7839,6 @@ export const decodeStartRecordingRequest = (input: Record) => { return input; }; -export const encodeStartRecordingResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeStartRecordingResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15694,15 +7846,6 @@ export const decodeStartRecordingResponse = (input: Record) => { return input; }; -export const encodeStartTranscriptionRequest = (input: Record) => { - if (!input) return input; - input.transcription_external_storage = encodestring( - input.transcription_external_storage, - ); - - return input; -}; - export const decodeStartTranscriptionRequest = (input: Record) => { if (!input) return input; input.transcription_external_storage = decodestring( @@ -15712,15 +7855,6 @@ export const decodeStartTranscriptionRequest = (input: Record) => { return input; }; -export const encodeStartTranscriptionResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeStartTranscriptionResponse = ( input: Record, ) => { @@ -15730,13 +7864,6 @@ export const decodeStartTranscriptionResponse = ( return input; }; -export const encodeStopHLSBroadcastingRequest = ( - input: Record, -) => { - if (!input) return input; - return input; -}; - export const decodeStopHLSBroadcastingRequest = ( input: Record, ) => { @@ -15744,15 +7871,6 @@ export const decodeStopHLSBroadcastingRequest = ( return input; }; -export const encodeStopHLSBroadcastingResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeStopHLSBroadcastingResponse = ( input: Record, ) => { @@ -15762,25 +7880,11 @@ export const decodeStopHLSBroadcastingResponse = ( return input; }; -export const encodeStopLiveRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeStopLiveRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeStopLiveResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.call = encodeCallResponse(input.call); - - return input; -}; - export const decodeStopLiveResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15790,23 +7894,11 @@ export const decodeStopLiveResponse = (input: Record) => { return input; }; -export const encodeStopRecordingRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeStopRecordingRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeStopRecordingResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeStopRecordingResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15814,23 +7906,11 @@ export const decodeStopRecordingResponse = (input: Record) => { return input; }; -export const encodeStopTranscriptionRequest = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeStopTranscriptionRequest = (input: Record) => { if (!input) return input; return input; }; -export const encodeStopTranscriptionResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeStopTranscriptionResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15838,31 +7918,6 @@ export const decodeStopTranscriptionResponse = (input: Record) => { return input; }; -export const encodeSubmitActionRequest = (input: Record) => { - if (!input) return input; - input.action_type = encodestring(input.action_type); - - input.item_id = encodestring(input.item_id); - - input.user_id = encodestring(input.user_id); - - input.ban = encodeBanActionRequest(input.ban); - - input.custom = encodeCustomActionRequest(input.custom); - - input.delete_message = encodeDeleteMessageRequest(input.delete_message); - - input.delete_reaction = encodeDeleteReactionRequest(input.delete_reaction); - - input.delete_user = encodeDeleteUserRequest(input.delete_user); - - input.unban = encodeUnbanActionRequest(input.unban); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeSubmitActionRequest = (input: Record) => { if (!input) return input; input.action_type = decodestring(input.action_type); @@ -15888,15 +7943,6 @@ export const decodeSubmitActionRequest = (input: Record) => { return input; }; -export const encodeSubmitActionResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.item = encodeReviewQueueItem(input.item); - - return input; -}; - export const decodeSubmitActionResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -15906,19 +7952,6 @@ export const decodeSubmitActionResponse = (input: Record) => { return input; }; -export const encodeSubsession = (input: Record) => { - if (!input) return input; - input.ended_at = encodeinteger(input.ended_at); - - input.joined_at = encodeinteger(input.joined_at); - - input.sfu_id = encodestring(input.sfu_id); - - input.pub_sub_hint = encodeMediaPubSubHint(input.pub_sub_hint); - - return input; -}; - export const decodeSubsession = (input: Record) => { if (!input) return input; input.ended_at = decodeinteger(input.ended_at); @@ -15932,15 +7965,6 @@ export const decodeSubsession = (input: Record) => { return input; }; -export const encodeTURNAggregatedStats = (input: Record) => { - if (!input) return input; - input.tcp = encodeCount(input.tcp); - - input.total = encodeCount(input.total); - - return input; -}; - export const decodeTURNAggregatedStats = (input: Record) => { if (!input) return input; input.tcp = decodeCount(input.tcp); @@ -15950,17 +7974,6 @@ export const decodeTURNAggregatedStats = (input: Record) => { return input; }; -export const encodeTargetResolution = (input: Record) => { - if (!input) return input; - input.bitrate = encodeinteger(input.bitrate); - - input.height = encodeinteger(input.height); - - input.width = encodeinteger(input.width); - - return input; -}; - export const decodeTargetResolution = (input: Record) => { if (!input) return input; input.bitrate = decodeinteger(input.bitrate); @@ -15972,45 +7985,6 @@ export const decodeTargetResolution = (input: Record) => { return input; }; -export const encodeThread = (input: Record) => { - if (!input) return input; - input.channel_cid = encodestring(input.channel_cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.parent_message_id = encodestring(input.parent_message_id); - - input.title = encodestring(input.title); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.custom = encodeobject(input.custom); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.participant_count = encodeinteger(input.participant_count); - - input.reply_count = encodeinteger(input.reply_count); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeThreadParticipant( - input.thread_participants[key], - ); - }); - } - - input.channel = encodeChannel(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.parent_message = encodeMessage(input.parent_message); - - return input; -}; - export const decodeThread = (input: Record) => { if (!input) return input; input.channel_cid = decodestring(input.channel_cid); @@ -16050,33 +8024,6 @@ export const decodeThread = (input: Record) => { return input; }; -export const encodeThreadParticipant = (input: Record) => { - if (!input) return input; - input.app_pk = encodeinteger(input.app_pk); - - input.channel_cid = encodestring(input.channel_cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.last_read_at = encodeDatetimeType(input.last_read_at); - - input.custom = encodeobject(input.custom); - - input.last_thread_message_at = encodeDatetimeType( - input.last_thread_message_at, - ); - - input.left_thread_at = encodeDatetimeType(input.left_thread_at); - - input.thread_id = encodestring(input.thread_id); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeThreadParticipant = (input: Record) => { if (!input) return input; input.app_pk = decodeinteger(input.app_pk); @@ -16104,47 +8051,6 @@ export const decodeThreadParticipant = (input: Record) => { return input; }; -export const encodeThreadResponse = (input: Record) => { - if (!input) return input; - input.channel_cid = encodestring(input.channel_cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.created_by_user_id = encodestring(input.created_by_user_id); - - input.parent_message_id = encodestring(input.parent_message_id); - - input.title = encodestring(input.title); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.custom = encodeobject(input.custom); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.participant_count = encodeinteger(input.participant_count); - - input.reply_count = encodeinteger(input.reply_count); - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeThreadParticipant( - input.thread_participants[key], - ); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.parent_message = encodeMessage(input.parent_message); - - return input; -}; - export const decodeThreadResponse = (input: Record) => { if (!input) return input; input.channel_cid = decodestring(input.channel_cid); @@ -16186,57 +8092,6 @@ export const decodeThreadResponse = (input: Record) => { return input; }; -export const encodeThreadState = (input: Record) => { - if (!input) return input; - input.channel_cid = encodestring(input.channel_cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.parent_message_id = encodestring(input.parent_message_id); - - input.title = encodestring(input.title); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.latest_replies) { - Object.keys(input.latest_replies).forEach((key) => { - input.latest_replies[key] = encodeMessage(input.latest_replies[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.participant_count = encodeinteger(input.participant_count); - - input.reply_count = encodeinteger(input.reply_count); - - if (input.read) { - Object.keys(input.read).forEach((key) => { - input.read[key] = encodeRead(input.read[key]); - }); - } - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeThreadParticipant( - input.thread_participants[key], - ); - }); - } - - input.channel = encodeChannel(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.parent_message = encodeMessage(input.parent_message); - - return input; -}; - export const decodeThreadState = (input: Record) => { if (!input) return input; input.channel_cid = decodestring(input.channel_cid); @@ -16288,59 +8143,6 @@ export const decodeThreadState = (input: Record) => { return input; }; -export const encodeThreadStateResponse = (input: Record) => { - if (!input) return input; - input.channel_cid = encodestring(input.channel_cid); - - input.created_at = encodeDatetimeType(input.created_at); - - input.created_by_user_id = encodestring(input.created_by_user_id); - - input.parent_message_id = encodestring(input.parent_message_id); - - input.title = encodestring(input.title); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.latest_replies) { - Object.keys(input.latest_replies).forEach((key) => { - input.latest_replies[key] = encodeMessage(input.latest_replies[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.last_message_at = encodeDatetimeType(input.last_message_at); - - input.participant_count = encodeinteger(input.participant_count); - - input.reply_count = encodeinteger(input.reply_count); - - if (input.read) { - Object.keys(input.read).forEach((key) => { - input.read[key] = encodeRead(input.read[key]); - }); - } - - if (input.thread_participants) { - Object.keys(input.thread_participants).forEach((key) => { - input.thread_participants[key] = encodeThreadParticipant( - input.thread_participants[key], - ); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.parent_message = encodeMessage(input.parent_message); - - return input; -}; - export const decodeThreadStateResponse = (input: Record) => { if (!input) return input; input.channel_cid = decodestring(input.channel_cid); @@ -16394,17 +8196,6 @@ export const decodeThreadStateResponse = (input: Record) => { return input; }; -export const encodeThresholds = (input: Record) => { - if (!input) return input; - input.explicit = encodeLabelThresholds(input.explicit); - - input.spam = encodeLabelThresholds(input.spam); - - input.toxic = encodeLabelThresholds(input.toxic); - - return input; -}; - export const decodeThresholds = (input: Record) => { if (!input) return input; input.explicit = decodeLabelThresholds(input.explicit); @@ -16416,13 +8207,6 @@ export const decodeThresholds = (input: Record) => { return input; }; -export const encodeThumbnailResponse = (input: Record) => { - if (!input) return input; - input.image_url = encodestring(input.image_url); - - return input; -}; - export const decodeThumbnailResponse = (input: Record) => { if (!input) return input; input.image_url = decodestring(input.image_url); @@ -16430,13 +8214,6 @@ export const decodeThumbnailResponse = (input: Record) => { return input; }; -export const encodeThumbnailsSettings = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeThumbnailsSettings = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -16444,13 +8221,6 @@ export const decodeThumbnailsSettings = (input: Record) => { return input; }; -export const encodeThumbnailsSettingsRequest = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeThumbnailsSettingsRequest = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); @@ -16458,15 +8228,6 @@ export const decodeThumbnailsSettingsRequest = (input: Record) => { return input; }; -export const encodeThumbnailsSettingsResponse = ( - input: Record, -) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - export const decodeThumbnailsSettingsResponse = ( input: Record, ) => { @@ -16476,25 +8237,11 @@ export const decodeThumbnailsSettingsResponse = ( return input; }; -export const encodeTime = (input: Record) => { - if (!input) return input; - return input; -}; - export const decodeTime = (input: Record) => { if (!input) return input; return input; }; -export const encodeTimeStats = (input: Record) => { - if (!input) return input; - input.average_seconds = encodenumber(input.average_seconds); - - input.max_seconds = encodenumber(input.max_seconds); - - return input; -}; - export const decodeTimeStats = (input: Record) => { if (!input) return input; input.average_seconds = decodenumber(input.average_seconds); @@ -16504,21 +8251,6 @@ export const decodeTimeStats = (input: Record) => { return input; }; -export const encodeTranscriptionSettings = (input: Record) => { - if (!input) return input; - input.closed_caption_mode = encodestring(input.closed_caption_mode); - - input.mode = encodestring(input.mode); - - if (input.languages) { - Object.keys(input.languages).forEach((key) => { - input.languages[key] = encodestring(input.languages[key]); - }); - } - - return input; -}; - export const decodeTranscriptionSettings = (input: Record) => { if (!input) return input; input.closed_caption_mode = decodestring(input.closed_caption_mode); @@ -16534,23 +8266,6 @@ export const decodeTranscriptionSettings = (input: Record) => { return input; }; -export const encodeTranscriptionSettingsRequest = ( - input: Record, -) => { - if (!input) return input; - input.mode = encodestring(input.mode); - - input.closed_caption_mode = encodestring(input.closed_caption_mode); - - if (input.languages) { - Object.keys(input.languages).forEach((key) => { - input.languages[key] = encodestring(input.languages[key]); - }); - } - - return input; -}; - export const decodeTranscriptionSettingsRequest = ( input: Record, ) => { @@ -16568,23 +8283,6 @@ export const decodeTranscriptionSettingsRequest = ( return input; }; -export const encodeTranscriptionSettingsResponse = ( - input: Record, -) => { - if (!input) return input; - input.closed_caption_mode = encodestring(input.closed_caption_mode); - - input.mode = encodestring(input.mode); - - if (input.languages) { - Object.keys(input.languages).forEach((key) => { - input.languages[key] = encodestring(input.languages[key]); - }); - } - - return input; -}; - export const decodeTranscriptionSettingsResponse = ( input: Record, ) => { @@ -16602,13 +8300,6 @@ export const decodeTranscriptionSettingsResponse = ( return input; }; -export const encodeTranslateMessageRequest = (input: Record) => { - if (!input) return input; - input.language = encodestring(input.language); - - return input; -}; - export const decodeTranslateMessageRequest = (input: Record) => { if (!input) return input; input.language = decodestring(input.language); @@ -16616,23 +8307,6 @@ export const decodeTranslateMessageRequest = (input: Record) => { return input; }; -export const encodeTruncateChannelRequest = (input: Record) => { - if (!input) return input; - input.hard_delete = encodeboolean(input.hard_delete); - - input.skip_push = encodeboolean(input.skip_push); - - input.truncated_at = encodeDatetimeType(input.truncated_at); - - input.user_id = encodestring(input.user_id); - - input.message = encodeMessageRequest(input.message); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeTruncateChannelRequest = (input: Record) => { if (!input) return input; input.hard_delete = decodeboolean(input.hard_delete); @@ -16650,17 +8324,6 @@ export const decodeTruncateChannelRequest = (input: Record) => { return input; }; -export const encodeTruncateChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.channel = encodeChannelResponse(input.channel); - - input.message = encodeMessage(input.message); - - return input; -}; - export const decodeTruncateChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -16672,121 +8335,56 @@ export const decodeTruncateChannelResponse = (input: Record) => { return input; }; -export const encodeTypingIndicators = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - -export const decodeTypingIndicators = (input: Record) => { - if (!input) return input; - input.enabled = decodeboolean(input.enabled); - - return input; -}; - -export const encodeTypingIndicatorsResponse = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - return input; -}; - -export const decodeTypingIndicatorsResponse = (input: Record) => { - if (!input) return input; - input.enabled = decodeboolean(input.enabled); - - return input; -}; - -export const encodeUnbanActionRequest = (input: Record) => { - if (!input) return input; - return input; -}; - -export const decodeUnbanActionRequest = (input: Record) => { - if (!input) return input; - return input; -}; - -export const encodeUnbanRequest = (input: Record) => { - if (!input) return input; - input.unbanned_by_id = encodestring(input.unbanned_by_id); - - input.unbanned_by = encodeUserRequest(input.unbanned_by); - - return input; -}; - -export const decodeUnbanRequest = (input: Record) => { - if (!input) return input; - input.unbanned_by_id = decodestring(input.unbanned_by_id); - - input.unbanned_by = decodeUserRequest(input.unbanned_by); - - return input; -}; - -export const encodeUnbanResponse = (input: Record) => { +export const decodeTypingIndicators = (input: Record) => { if (!input) return input; - input.duration = encodestring(input.duration); + input.enabled = decodeboolean(input.enabled); return input; }; -export const decodeUnbanResponse = (input: Record) => { +export const decodeTypingIndicatorsResponse = (input: Record) => { if (!input) return input; - input.duration = decodestring(input.duration); + input.enabled = decodeboolean(input.enabled); return input; }; -export const encodeUnblockActionRequest = (input: Record) => { +export const decodeUnbanActionRequest = (input: Record) => { if (!input) return input; return input; }; -export const decodeUnblockActionRequest = (input: Record) => { +export const decodeUnbanRequest = (input: Record) => { if (!input) return input; - return input; -}; + input.unbanned_by_id = decodestring(input.unbanned_by_id); -export const encodeUnblockUserRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); + input.unbanned_by = decodeUserRequest(input.unbanned_by); return input; }; -export const decodeUnblockUserRequest = (input: Record) => { +export const decodeUnbanResponse = (input: Record) => { if (!input) return input; - input.user_id = decodestring(input.user_id); + input.duration = decodestring(input.duration); return input; }; -export const encodeUnblockUserResponse = (input: Record) => { +export const decodeUnblockActionRequest = (input: Record) => { if (!input) return input; - input.duration = encodestring(input.duration); - return input; }; -export const decodeUnblockUserResponse = (input: Record) => { +export const decodeUnblockUserRequest = (input: Record) => { if (!input) return input; - input.duration = decodestring(input.duration); + input.user_id = decodestring(input.user_id); return input; }; -export const encodeUnblockUsersRequest = (input: Record) => { +export const decodeUnblockUserResponse = (input: Record) => { if (!input) return input; - input.blocked_user_id = encodestring(input.blocked_user_id); - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); + input.duration = decodestring(input.duration); return input; }; @@ -16802,13 +8400,6 @@ export const decodeUnblockUsersRequest = (input: Record) => { return input; }; -export const encodeUnblockUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeUnblockUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -16816,23 +8407,6 @@ export const decodeUnblockUsersResponse = (input: Record) => { return input; }; -export const encodeUnmuteChannelRequest = (input: Record) => { - if (!input) return input; - input.expiration = encodeinteger(input.expiration); - - input.user_id = encodestring(input.user_id); - - if (input.channel_cids) { - Object.keys(input.channel_cids).forEach((key) => { - input.channel_cids[key] = encodestring(input.channel_cids[key]); - }); - } - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUnmuteChannelRequest = (input: Record) => { if (!input) return input; input.expiration = decodeinteger(input.expiration); @@ -16850,21 +8424,6 @@ export const decodeUnmuteChannelRequest = (input: Record) => { return input; }; -export const encodeUnmuteRequest = (input: Record) => { - if (!input) return input; - if (input.target_ids) { - Object.keys(input.target_ids).forEach((key) => { - input.target_ids[key] = encodestring(input.target_ids[key]); - }); - } - - input.user_id = encodestring(input.user_id); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUnmuteRequest = (input: Record) => { if (!input) return input; if (input.target_ids) { @@ -16880,21 +8439,6 @@ export const decodeUnmuteRequest = (input: Record) => { return input; }; -export const encodeUnmuteResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.non_existing_users) { - Object.keys(input.non_existing_users).forEach((key) => { - input.non_existing_users[key] = encodestring( - input.non_existing_users[key], - ); - }); - } - - return input; -}; - export const decodeUnmuteResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -16910,15 +8454,6 @@ export const decodeUnmuteResponse = (input: Record) => { return input; }; -export const encodeUnpinRequest = (input: Record) => { - if (!input) return input; - input.session_id = encodestring(input.session_id); - - input.user_id = encodestring(input.user_id); - - return input; -}; - export const decodeUnpinRequest = (input: Record) => { if (!input) return input; input.session_id = decodestring(input.session_id); @@ -16928,13 +8463,6 @@ export const decodeUnpinRequest = (input: Record) => { return input; }; -export const encodeUnpinResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - return input; -}; - export const decodeUnpinResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -16942,17 +8470,6 @@ export const decodeUnpinResponse = (input: Record) => { return input; }; -export const encodeUnreadCountsBatchRequest = (input: Record) => { - if (!input) return input; - if (input.user_ids) { - Object.keys(input.user_ids).forEach((key) => { - input.user_ids[key] = encodestring(input.user_ids[key]); - }); - } - - return input; -}; - export const decodeUnreadCountsBatchRequest = (input: Record) => { if (!input) return input; if (input.user_ids) { @@ -16964,21 +8481,6 @@ export const decodeUnreadCountsBatchRequest = (input: Record) => { return input; }; -export const encodeUnreadCountsBatchResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.counts_by_user) { - Object.keys(input.counts_by_user).forEach((key) => { - input.counts_by_user[key] = encodeUnreadCountsResponse( - input.counts_by_user[key], - ); - }); - } - - return input; -}; - export const decodeUnreadCountsBatchResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -16994,17 +8496,6 @@ export const decodeUnreadCountsBatchResponse = (input: Record) => { return input; }; -export const encodeUnreadCountsChannel = (input: Record) => { - if (!input) return input; - input.channel_id = encodestring(input.channel_id); - - input.last_read = encodeDatetimeType(input.last_read); - - input.unread_count = encodeinteger(input.unread_count); - - return input; -}; - export const decodeUnreadCountsChannel = (input: Record) => { if (!input) return input; input.channel_id = decodestring(input.channel_id); @@ -17016,17 +8507,6 @@ export const decodeUnreadCountsChannel = (input: Record) => { return input; }; -export const encodeUnreadCountsChannelType = (input: Record) => { - if (!input) return input; - input.channel_count = encodeinteger(input.channel_count); - - input.channel_type = encodestring(input.channel_type); - - input.unread_count = encodeinteger(input.unread_count); - - return input; -}; - export const decodeUnreadCountsChannelType = (input: Record) => { if (!input) return input; input.channel_count = decodeinteger(input.channel_count); @@ -17038,37 +8518,6 @@ export const decodeUnreadCountsChannelType = (input: Record) => { return input; }; -export const encodeUnreadCountsResponse = (input: Record) => { - if (!input) return input; - input.total_unread_count = encodeinteger(input.total_unread_count); - - input.total_unread_threads_count = encodeinteger( - input.total_unread_threads_count, - ); - - if (input.channel_type) { - Object.keys(input.channel_type).forEach((key) => { - input.channel_type[key] = encodeUnreadCountsChannelType( - input.channel_type[key], - ); - }); - } - - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = encodeUnreadCountsChannel(input.channels[key]); - }); - } - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = encodeUnreadCountsThread(input.threads[key]); - }); - } - - return input; -}; - export const decodeUnreadCountsResponse = (input: Record) => { if (!input) return input; input.total_unread_count = decodeinteger(input.total_unread_count); @@ -17076,199 +8525,39 @@ export const decodeUnreadCountsResponse = (input: Record) => { input.total_unread_threads_count = decodeinteger( input.total_unread_threads_count, ); - - if (input.channel_type) { - Object.keys(input.channel_type).forEach((key) => { - input.channel_type[key] = decodeUnreadCountsChannelType( - input.channel_type[key], - ); - }); - } - - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = decodeUnreadCountsChannel(input.channels[key]); - }); - } - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = decodeUnreadCountsThread(input.threads[key]); - }); - } - - return input; -}; - -export const encodeUnreadCountsThread = (input: Record) => { - if (!input) return input; - input.last_read = encodeDatetimeType(input.last_read); - - input.last_read_message_id = encodestring(input.last_read_message_id); - - input.parent_message_id = encodestring(input.parent_message_id); - - input.unread_count = encodeinteger(input.unread_count); - - return input; -}; - -export const decodeUnreadCountsThread = (input: Record) => { - if (!input) return input; - input.last_read = decodeDatetimeType(input.last_read); - - input.last_read_message_id = decodestring(input.last_read_message_id); - - input.parent_message_id = decodestring(input.parent_message_id); - - input.unread_count = decodeinteger(input.unread_count); - - return input; -}; - -export const encodeUpdateAppRequest = (input: Record) => { - if (!input) return input; - input.async_url_enrich_enabled = encodeboolean( - input.async_url_enrich_enabled, - ); - - input.auto_translation_enabled = encodeboolean( - input.auto_translation_enabled, - ); - - input.before_message_send_hook_url = encodestring( - input.before_message_send_hook_url, - ); - - input.cdn_expiration_seconds = encodeinteger(input.cdn_expiration_seconds); - - input.channel_hide_members_only = encodeboolean( - input.channel_hide_members_only, - ); - - input.custom_action_handler_url = encodestring( - input.custom_action_handler_url, - ); - - input.disable_auth_checks = encodeboolean(input.disable_auth_checks); - - input.disable_permissions_checks = encodeboolean( - input.disable_permissions_checks, - ); - - input.enforce_unique_usernames = encodestring(input.enforce_unique_usernames); - - input.feeds_moderation_enabled = encodeboolean( - input.feeds_moderation_enabled, - ); - - input.feeds_v2_region = encodestring(input.feeds_v2_region); - - input.image_moderation_enabled = encodeboolean( - input.image_moderation_enabled, - ); - - input.migrate_permissions_to_v2 = encodeboolean( - input.migrate_permissions_to_v2, - ); - - input.moderation_webhook_url = encodestring(input.moderation_webhook_url); - - input.multi_tenant_enabled = encodeboolean(input.multi_tenant_enabled); - - input.permission_version = encodestring(input.permission_version); - - input.reminders_interval = encodeinteger(input.reminders_interval); - - input.reminders_max_members = encodeinteger(input.reminders_max_members); - - input.revoke_tokens_issued_before = encodeDatetimeType( - input.revoke_tokens_issued_before, - ); - - input.sns_key = encodestring(input.sns_key); - - input.sns_secret = encodestring(input.sns_secret); - - input.sns_topic_arn = encodestring(input.sns_topic_arn); - - input.sqs_key = encodestring(input.sqs_key); - - input.sqs_secret = encodestring(input.sqs_secret); - - input.sqs_url = encodestring(input.sqs_url); - - input.video_provider = encodestring(input.video_provider); - - input.webhook_url = encodestring(input.webhook_url); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.image_moderation_block_labels) { - Object.keys(input.image_moderation_block_labels).forEach((key) => { - input.image_moderation_block_labels[key] = encodestring( - input.image_moderation_block_labels[key], - ); - }); - } - - if (input.image_moderation_labels) { - Object.keys(input.image_moderation_labels).forEach((key) => { - input.image_moderation_labels[key] = encodestring( - input.image_moderation_labels[key], - ); - }); - } - - if (input.user_search_disallowed_roles) { - Object.keys(input.user_search_disallowed_roles).forEach((key) => { - input.user_search_disallowed_roles[key] = encodestring( - input.user_search_disallowed_roles[key], + + if (input.channel_type) { + Object.keys(input.channel_type).forEach((key) => { + input.channel_type[key] = decodeUnreadCountsChannelType( + input.channel_type[key], ); }); } - if (input.webhook_events) { - Object.keys(input.webhook_events).forEach((key) => { - input.webhook_events[key] = encodestring(input.webhook_events[key]); + if (input.channels) { + Object.keys(input.channels).forEach((key) => { + input.channels[key] = decodeUnreadCountsChannel(input.channels[key]); }); } - input.agora_options = encodeConfig(input.agora_options); - - input.apn_config = encodeAPNConfig(input.apn_config); - - input.async_moderation_config = encodeAsyncModerationConfiguration( - input.async_moderation_config, - ); - - input.datadog_info = encodeDataDogInfo(input.datadog_info); - - input.file_upload_config = encodeFileUploadConfig(input.file_upload_config); - - input.firebase_config = encodeFirebaseConfig(input.firebase_config); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); + if (input.threads) { + Object.keys(input.threads).forEach((key) => { + input.threads[key] = decodeUnreadCountsThread(input.threads[key]); }); } - input.hms_options = encodeConfig(input.hms_options); + return input; +}; - input.huawei_config = encodeHuaweiConfig(input.huawei_config); +export const decodeUnreadCountsThread = (input: Record) => { + if (!input) return input; + input.last_read = decodeDatetimeType(input.last_read); - input.image_upload_config = encodeFileUploadConfig(input.image_upload_config); + input.last_read_message_id = decodestring(input.last_read_message_id); - input.push_config = encodePushConfig(input.push_config); + input.parent_message_id = decodestring(input.parent_message_id); - input.xiaomi_config = encodeXiaomiConfig(input.xiaomi_config); + input.unread_count = decodeinteger(input.unread_count); return input; }; @@ -17420,17 +8709,6 @@ export const decodeUpdateAppRequest = (input: Record) => { return input; }; -export const encodeUpdateBlockListRequest = (input: Record) => { - if (!input) return input; - if (input.words) { - Object.keys(input.words).forEach((key) => { - input.words[key] = encodestring(input.words[key]); - }); - } - - return input; -}; - export const decodeUpdateBlockListRequest = (input: Record) => { if (!input) return input; if (input.words) { @@ -17442,25 +8720,6 @@ export const decodeUpdateBlockListRequest = (input: Record) => { return input; }; -export const encodeUpdateCallMembersRequest = (input: Record) => { - if (!input) return input; - if (input.remove_members) { - Object.keys(input.remove_members).forEach((key) => { - input.remove_members[key] = encodestring(input.remove_members[key]); - }); - } - - if (input.update_members) { - Object.keys(input.update_members).forEach((key) => { - input.update_members[key] = encodeMemberRequest( - input.update_members[key], - ); - }); - } - - return input; -}; - export const decodeUpdateCallMembersRequest = (input: Record) => { if (!input) return input; if (input.remove_members) { @@ -17480,19 +8739,6 @@ export const decodeUpdateCallMembersRequest = (input: Record) => { return input; }; -export const encodeUpdateCallMembersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); - }); - } - - return input; -}; - export const decodeUpdateCallMembersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -17506,17 +8752,6 @@ export const decodeUpdateCallMembersResponse = (input: Record) => { return input; }; -export const encodeUpdateCallRequest = (input: Record) => { - if (!input) return input; - input.starts_at = encodeDatetimeType(input.starts_at); - - input.custom = encodeobject(input.custom); - - input.settings_override = encodeCallSettingsRequest(input.settings_override); - - return input; -}; - export const decodeUpdateCallRequest = (input: Record) => { if (!input) return input; input.starts_at = decodeDatetimeType(input.starts_at); @@ -17528,29 +8763,6 @@ export const decodeUpdateCallRequest = (input: Record) => { return input; }; -export const encodeUpdateCallResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeMemberResponse(input.members[key]); - }); - } - - if (input.own_capabilities) { - Object.keys(input.own_capabilities).forEach((key) => { - input.own_capabilities[key] = encodeOwnCapability( - input.own_capabilities[key], - ); - }); - } - - input.call = encodeCallResponse(input.call); - - return input; -}; - export const decodeUpdateCallResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -17574,25 +8786,6 @@ export const decodeUpdateCallResponse = (input: Record) => { return input; }; -export const encodeUpdateCallTypeRequest = (input: Record) => { - if (!input) return input; - input.external_storage = encodestring(input.external_storage); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsRequest(input.settings); - - return input; -}; - export const decodeUpdateCallTypeRequest = (input: Record) => { if (!input) return input; input.external_storage = decodestring(input.external_storage); @@ -17612,33 +8805,6 @@ export const decodeUpdateCallTypeRequest = (input: Record) => { return input; }; -export const encodeUpdateCallTypeResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.notification_settings = encodeNotificationSettings( - input.notification_settings, - ); - - input.settings = encodeCallSettingsResponse(input.settings); - - input.external_storage = encodestring(input.external_storage); - - return input; -}; - export const decodeUpdateCallTypeResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -17666,25 +8832,6 @@ export const decodeUpdateCallTypeResponse = (input: Record) => { return input; }; -export const encodeUpdateChannelPartialRequest = ( - input: Record, -) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - if (input.unset) { - Object.keys(input.unset).forEach((key) => { - input.unset[key] = encodestring(input.unset[key]); - }); - } - - input.set = encodeobject(input.set); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdateChannelPartialRequest = ( input: Record, ) => { @@ -17704,23 +8851,6 @@ export const decodeUpdateChannelPartialRequest = ( return input; }; -export const encodeUpdateChannelPartialResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMemberResponse(input.members[key]); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - return input; -}; - export const decodeUpdateChannelPartialResponse = ( input: Record, ) => { @@ -17738,65 +8868,6 @@ export const decodeUpdateChannelPartialResponse = ( return input; }; -export const encodeUpdateChannelRequest = (input: Record) => { - if (!input) return input; - input.accept_invite = encodeboolean(input.accept_invite); - - input.cooldown = encodeinteger(input.cooldown); - - input.hide_history = encodeboolean(input.hide_history); - - input.reject_invite = encodeboolean(input.reject_invite); - - input.skip_push = encodeboolean(input.skip_push); - - input.user_id = encodestring(input.user_id); - - if (input.add_members) { - Object.keys(input.add_members).forEach((key) => { - input.add_members[key] = encodeChannelMember(input.add_members[key]); - }); - } - - if (input.add_moderators) { - Object.keys(input.add_moderators).forEach((key) => { - input.add_moderators[key] = encodestring(input.add_moderators[key]); - }); - } - - if (input.assign_roles) { - Object.keys(input.assign_roles).forEach((key) => { - input.assign_roles[key] = encodeChannelMember(input.assign_roles[key]); - }); - } - - if (input.demote_moderators) { - Object.keys(input.demote_moderators).forEach((key) => { - input.demote_moderators[key] = encodestring(input.demote_moderators[key]); - }); - } - - if (input.invites) { - Object.keys(input.invites).forEach((key) => { - input.invites[key] = encodeChannelMember(input.invites[key]); - }); - } - - if (input.remove_members) { - Object.keys(input.remove_members).forEach((key) => { - input.remove_members[key] = encodestring(input.remove_members[key]); - }); - } - - input.data = encodeChannelInput(input.data); - - input.message = encodeMessageRequest(input.message); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdateChannelRequest = (input: Record) => { if (!input) return input; input.accept_invite = decodeboolean(input.accept_invite); @@ -17856,115 +8927,19 @@ export const decodeUpdateChannelRequest = (input: Record) => { return input; }; -export const encodeUpdateChannelResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - if (input.members) { - Object.keys(input.members).forEach((key) => { - input.members[key] = encodeChannelMember(input.members[key]); - }); - } - - input.channel = encodeChannelResponse(input.channel); - - input.message = encodeMessage(input.message); - - return input; -}; - export const decodeUpdateChannelResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); if (input.members) { Object.keys(input.members).forEach((key) => { - input.members[key] = decodeChannelMember(input.members[key]); - }); - } - - input.channel = decodeChannelResponse(input.channel); - - input.message = decodeMessage(input.message); - - return input; -}; - -export const encodeUpdateChannelTypeRequest = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.custom_events = encodeboolean(input.custom_events); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.mutes = encodeboolean(input.mutes); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodestring(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); + input.members[key] = decodeChannelMember(input.members[key]); }); } - input.automod_thresholds = encodeThresholds(input.automod_thresholds); + input.channel = decodeChannelResponse(input.channel); - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } + input.message = decodeMessage(input.message); return input; }; @@ -18048,93 +9023,6 @@ export const decodeUpdateChannelTypeRequest = (input: Record) => { return input; }; -export const encodeUpdateChannelTypeResponse = (input: Record) => { - if (!input) return input; - input.automod = encodestring(input.automod); - - input.automod_behavior = encodestring(input.automod_behavior); - - input.connect_events = encodeboolean(input.connect_events); - - input.created_at = encodeDatetimeType(input.created_at); - - input.custom_events = encodeboolean(input.custom_events); - - input.duration = encodestring(input.duration); - - input.mark_messages_pending = encodeboolean(input.mark_messages_pending); - - input.max_message_length = encodeinteger(input.max_message_length); - - input.mutes = encodeboolean(input.mutes); - - input.name = encodestring(input.name); - - input.polls = encodeboolean(input.polls); - - input.push_notifications = encodeboolean(input.push_notifications); - - input.quotes = encodeboolean(input.quotes); - - input.reactions = encodeboolean(input.reactions); - - input.read_events = encodeboolean(input.read_events); - - input.reminders = encodeboolean(input.reminders); - - input.replies = encodeboolean(input.replies); - - input.search = encodeboolean(input.search); - - input.typing_events = encodeboolean(input.typing_events); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.uploads = encodeboolean(input.uploads); - - input.url_enrichment = encodeboolean(input.url_enrichment); - - if (input.commands) { - Object.keys(input.commands).forEach((key) => { - input.commands[key] = encodestring(input.commands[key]); - }); - } - - if (input.permissions) { - Object.keys(input.permissions).forEach((key) => { - input.permissions[key] = encodePolicyRequest(input.permissions[key]); - }); - } - - if (input.grants) { - Object.keys(input.grants).forEach((key) => { - input.grants[key] = encodearray(input.grants[key]); - }); - } - - input.blocklist = encodestring(input.blocklist); - - input.blocklist_behavior = encodestring(input.blocklist_behavior); - - if (input.allowed_flag_reasons) { - Object.keys(input.allowed_flag_reasons).forEach((key) => { - input.allowed_flag_reasons[key] = encodestring( - input.allowed_flag_reasons[key], - ); - }); - } - - if (input.blocklists) { - Object.keys(input.blocklists).forEach((key) => { - input.blocklists[key] = encodeBlockListOptions(input.blocklists[key]); - }); - } - - input.automod_thresholds = encodeThresholds(input.automod_thresholds); - - return input; -}; - export const decodeUpdateChannelTypeResponse = (input: Record) => { if (!input) return input; input.automod = decodestring(input.automod); @@ -18222,17 +9110,6 @@ export const decodeUpdateChannelTypeResponse = (input: Record) => { return input; }; -export const encodeUpdateCommandRequest = (input: Record) => { - if (!input) return input; - input.description = encodestring(input.description); - - input.args = encodestring(input.args); - - input.set = encodestring(input.set); - - return input; -}; - export const decodeUpdateCommandRequest = (input: Record) => { if (!input) return input; input.description = decodestring(input.description); @@ -18244,15 +9121,6 @@ export const decodeUpdateCommandRequest = (input: Record) => { return input; }; -export const encodeUpdateCommandResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.command = encodeCommand(input.command); - - return input; -}; - export const decodeUpdateCommandResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -18262,25 +9130,6 @@ export const decodeUpdateCommandResponse = (input: Record) => { return input; }; -export const encodeUpdateExternalStorageRequest = ( - input: Record, -) => { - if (!input) return input; - input.bucket = encodestring(input.bucket); - - input.storage_type = encodestring(input.storage_type); - - input.gcs_credentials = encodestring(input.gcs_credentials); - - input.path = encodestring(input.path); - - input.aws_s3 = encodeS3Request(input.aws_s3); - - input.azure_blob = encodeAzureRequest(input.azure_blob); - - return input; -}; - export const decodeUpdateExternalStorageRequest = ( input: Record, ) => { @@ -18300,23 +9149,6 @@ export const decodeUpdateExternalStorageRequest = ( return input; }; -export const encodeUpdateExternalStorageResponse = ( - input: Record, -) => { - if (!input) return input; - input.bucket = encodestring(input.bucket); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.path = encodestring(input.path); - - input.type = encodestring(input.type); - - return input; -}; - export const decodeUpdateExternalStorageResponse = ( input: Record, ) => { @@ -18334,27 +9166,6 @@ export const decodeUpdateExternalStorageResponse = ( return input; }; -export const encodeUpdateMessagePartialRequest = ( - input: Record, -) => { - if (!input) return input; - input.skip_enrich_url = encodeboolean(input.skip_enrich_url); - - input.user_id = encodestring(input.user_id); - - if (input.unset) { - Object.keys(input.unset).forEach((key) => { - input.unset[key] = encodestring(input.unset[key]); - }); - } - - input.set = encodeobject(input.set); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdateMessagePartialRequest = ( input: Record, ) => { @@ -18376,25 +9187,6 @@ export const decodeUpdateMessagePartialRequest = ( return input; }; -export const encodeUpdateMessagePartialResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessage(input.message); - - if (input.pending_message_metadata) { - Object.keys(input.pending_message_metadata).forEach((key) => { - input.pending_message_metadata[key] = encodestring( - input.pending_message_metadata[key], - ); - }); - } - - return input; -}; - export const decodeUpdateMessagePartialResponse = ( input: Record, ) => { @@ -18414,15 +9206,6 @@ export const decodeUpdateMessagePartialResponse = ( return input; }; -export const encodeUpdateMessageRequest = (input: Record) => { - if (!input) return input; - input.message = encodeMessageRequest(input.message); - - input.skip_enrich_url = encodeboolean(input.skip_enrich_url); - - return input; -}; - export const decodeUpdateMessageRequest = (input: Record) => { if (!input) return input; input.message = decodeMessageRequest(input.message); @@ -18432,23 +9215,6 @@ export const decodeUpdateMessageRequest = (input: Record) => { return input; }; -export const encodeUpdateMessageResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.message = encodeMessage(input.message); - - if (input.pending_message_metadata) { - Object.keys(input.pending_message_metadata).forEach((key) => { - input.pending_message_metadata[key] = encodestring( - input.pending_message_metadata[key], - ); - }); - } - - return input; -}; - export const decodeUpdateMessageResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -18466,21 +9232,6 @@ export const decodeUpdateMessageResponse = (input: Record) => { return input; }; -export const encodeUpdatePollOptionRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.text = encodestring(input.text); - - input.user_id = encodestring(input.user_id); - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdatePollOptionRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -18496,23 +9247,6 @@ export const decodeUpdatePollOptionRequest = (input: Record) => { return input; }; -export const encodeUpdatePollPartialRequest = (input: Record) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - if (input.unset) { - Object.keys(input.unset).forEach((key) => { - input.unset[key] = encodestring(input.unset[key]); - }); - } - - input.set = encodeobject(input.set); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdatePollPartialRequest = (input: Record) => { if (!input) return input; input.user_id = decodestring(input.user_id); @@ -18530,43 +9264,6 @@ export const decodeUpdatePollPartialRequest = (input: Record) => { return input; }; -export const encodeUpdatePollRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.name = encodestring(input.name); - - input.allow_answers = encodeboolean(input.allow_answers); - - input.allow_user_suggested_options = encodeboolean( - input.allow_user_suggested_options, - ); - - input.description = encodestring(input.description); - - input.enforce_unique_vote = encodeboolean(input.enforce_unique_vote); - - input.is_closed = encodeboolean(input.is_closed); - - input.max_votes_allowed = encodeinteger(input.max_votes_allowed); - - input.user_id = encodestring(input.user_id); - - input.voting_visibility = encodestring(input.voting_visibility); - - if (input.options) { - Object.keys(input.options).forEach((key) => { - input.options[key] = encodePollOptionRequest(input.options[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdatePollRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -18604,25 +9301,6 @@ export const decodeUpdatePollRequest = (input: Record) => { return input; }; -export const encodeUpdateThreadPartialRequest = ( - input: Record, -) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - if (input.unset) { - Object.keys(input.unset).forEach((key) => { - input.unset[key] = encodestring(input.unset[key]); - }); - } - - input.set = encodeobject(input.set); - - input.user = encodeUserRequest(input.user); - - return input; -}; - export const decodeUpdateThreadPartialRequest = ( input: Record, ) => { @@ -18642,17 +9320,6 @@ export const decodeUpdateThreadPartialRequest = ( return input; }; -export const encodeUpdateThreadPartialResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.thread = encodeThreadResponse(input.thread); - - return input; -}; - export const decodeUpdateThreadPartialResponse = ( input: Record, ) => { @@ -18664,21 +9331,6 @@ export const decodeUpdateThreadPartialResponse = ( return input; }; -export const encodeUpdateUserPartialRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - if (input.unset) { - Object.keys(input.unset).forEach((key) => { - input.unset[key] = encodestring(input.unset[key]); - }); - } - - input.set = encodeobject(input.set); - - return input; -}; - export const decodeUpdateUserPartialRequest = (input: Record) => { if (!input) return input; input.id = decodestring(input.id); @@ -18694,29 +9346,6 @@ export const decodeUpdateUserPartialRequest = (input: Record) => { return input; }; -export const encodeUpdateUserPermissionsRequest = ( - input: Record, -) => { - if (!input) return input; - input.user_id = encodestring(input.user_id); - - if (input.grant_permissions) { - Object.keys(input.grant_permissions).forEach((key) => { - input.grant_permissions[key] = encodestring(input.grant_permissions[key]); - }); - } - - if (input.revoke_permissions) { - Object.keys(input.revoke_permissions).forEach((key) => { - input.revoke_permissions[key] = encodestring( - input.revoke_permissions[key], - ); - }); - } - - return input; -}; - export const decodeUpdateUserPermissionsRequest = ( input: Record, ) => { @@ -18731,20 +9360,11 @@ export const decodeUpdateUserPermissionsRequest = ( if (input.revoke_permissions) { Object.keys(input.revoke_permissions).forEach((key) => { - input.revoke_permissions[key] = decodestring( - input.revoke_permissions[key], - ); - }); - } - - return input; -}; - -export const encodeUpdateUserPermissionsResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); + input.revoke_permissions[key] = decodestring( + input.revoke_permissions[key], + ); + }); + } return input; }; @@ -18758,17 +9378,6 @@ export const decodeUpdateUserPermissionsResponse = ( return input; }; -export const encodeUpdateUsersPartialRequest = (input: Record) => { - if (!input) return input; - if (input.users) { - Object.keys(input.users).forEach((key) => { - input.users[key] = encodeUpdateUserPartialRequest(input.users[key]); - }); - } - - return input; -}; - export const decodeUpdateUsersPartialRequest = (input: Record) => { if (!input) return input; if (input.users) { @@ -18780,17 +9389,6 @@ export const decodeUpdateUsersPartialRequest = (input: Record) => { return input; }; -export const encodeUpdateUsersRequest = (input: Record) => { - if (!input) return input; - if (input.users) { - Object.keys(input.users).forEach((key) => { - input.users[key] = encodeUserRequest(input.users[key]); - }); - } - - return input; -}; - export const decodeUpdateUsersRequest = (input: Record) => { if (!input) return input; if (input.users) { @@ -18802,23 +9400,6 @@ export const decodeUpdateUsersRequest = (input: Record) => { return input; }; -export const encodeUpdateUsersResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.membership_deletion_task_id = encodestring( - input.membership_deletion_task_id, - ); - - if (input.users) { - Object.keys(input.users).forEach((key) => { - input.users[key] = encodeFullUserResponse(input.users[key]); - }); - } - - return input; -}; - export const decodeUpdateUsersResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -18836,40 +9417,6 @@ export const decodeUpdateUsersResponse = (input: Record) => { return input; }; -export const encodeUpsertConfigRequest = (input: Record) => { - if (!input) return input; - input.key = encodestring(input.key); - - input.async = encodeboolean(input.async); - - input.automod_platform_circumvention_config = - encodeAutomodPlatformCircumventionConfig( - input.automod_platform_circumvention_config, - ); - - input.automod_semantic_filters_config = encodeAutomodSemanticFiltersConfig( - input.automod_semantic_filters_config, - ); - - input.automod_toxicity_config = encodeAutomodToxicityConfig( - input.automod_toxicity_config, - ); - - input.aws_rek_og_nition_config = encodeAWSRekognitionConfig( - input.aws_rek_og_nition_config, - ); - - input.block_list_config = encodeBlockListConfig(input.block_list_config); - - input.bodyguard_config = encodeBodyguardConfig(input.bodyguard_config); - - input.go_og_le_vision_config = encodeGoogleVisionConfig( - input.go_og_le_vision_config, - ); - - return input; -}; - export const decodeUpsertConfigRequest = (input: Record) => { if (!input) return input; input.key = decodestring(input.key); @@ -18904,15 +9451,6 @@ export const decodeUpsertConfigRequest = (input: Record) => { return input; }; -export const encodeUpsertConfigResponse = (input: Record) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.config = encodeConfigResponse(input.config); - - return input; -}; - export const decodeUpsertConfigResponse = (input: Record) => { if (!input) return input; input.duration = decodestring(input.duration); @@ -18922,17 +9460,6 @@ export const decodeUpsertConfigResponse = (input: Record) => { return input; }; -export const encodeUpsertModerationTemplateRequest = ( - input: Record, -) => { - if (!input) return input; - input.name = encodestring(input.name); - - input.config = encodeFeedsModerationTemplateConfig(input.config); - - return input; -}; - export const decodeUpsertModerationTemplateRequest = ( input: Record, ) => { @@ -18944,23 +9471,6 @@ export const decodeUpsertModerationTemplateRequest = ( return input; }; -export const encodeUpsertModerationTemplateResponse = ( - input: Record, -) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.duration = encodestring(input.duration); - - input.name = encodestring(input.name); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.config = encodeFeedsModerationTemplateConfig(input.config); - - return input; -}; - export const decodeUpsertModerationTemplateResponse = ( input: Record, ) => { @@ -18978,13 +9488,6 @@ export const decodeUpsertModerationTemplateResponse = ( return input; }; -export const encodeUpsertPushProviderRequest = (input: Record) => { - if (!input) return input; - input.push_provider = encodePushProvider(input.push_provider); - - return input; -}; - export const decodeUpsertPushProviderRequest = (input: Record) => { if (!input) return input; input.push_provider = decodePushProvider(input.push_provider); @@ -18992,17 +9495,6 @@ export const decodeUpsertPushProviderRequest = (input: Record) => { return input; }; -export const encodeUpsertPushProviderResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.push_provider = encodePushProviderResponse(input.push_provider); - - return input; -}; - export const decodeUpsertPushProviderResponse = ( input: Record, ) => { @@ -19014,17 +9506,6 @@ export const decodeUpsertPushProviderResponse = ( return input; }; -export const encodeUserBlock = (input: Record) => { - if (!input) return input; - input.blocked_by_user_id = encodestring(input.blocked_by_user_id); - - input.blocked_user_id = encodestring(input.blocked_user_id); - - input.created_at = encodeDatetimeType(input.created_at); - - return input; -}; - export const decodeUserBlock = (input: Record) => { if (!input) return input; input.blocked_by_user_id = decodestring(input.blocked_by_user_id); @@ -19036,15 +9517,6 @@ export const decodeUserBlock = (input: Record) => { return input; }; -export const encodeUserCustomEventRequest = (input: Record) => { - if (!input) return input; - input.type = encodestring(input.type); - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodeUserCustomEventRequest = (input: Record) => { if (!input) return input; input.type = decodestring(input.type); @@ -19054,23 +9526,6 @@ export const decodeUserCustomEventRequest = (input: Record) => { return input; }; -export const encodeUserInfoResponse = (input: Record) => { - if (!input) return input; - input.image = encodestring(input.image); - - input.name = encodestring(input.name); - - if (input.roles) { - Object.keys(input.roles).forEach((key) => { - input.roles[key] = encodestring(input.roles[key]); - }); - } - - input.custom = encodeobject(input.custom); - - return input; -}; - export const decodeUserInfoResponse = (input: Record) => { if (!input) return input; input.image = decodestring(input.image); @@ -19088,21 +9543,6 @@ export const decodeUserInfoResponse = (input: Record) => { return input; }; -export const encodeUserMute = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.expires = encodeDatetimeType(input.expires); - - input.target = encodeUserObject(input.target); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeUserMute = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -19118,21 +9558,6 @@ export const decodeUserMute = (input: Record) => { return input; }; -export const encodeUserMuteResponse = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.updated_at = encodeDatetimeType(input.updated_at); - - input.expires = encodeDatetimeType(input.expires); - - input.target = encodeUserObject(input.target); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeUserMuteResponse = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -19148,53 +9573,6 @@ export const decodeUserMuteResponse = (input: Record) => { return input; }; -export const encodeUserObject = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.id = encodestring(input.id); - - input.online = encodeboolean(input.online); - - input.role = encodestring(input.role); - - input.custom = encodeobject(input.custom); - - input.ban_expires = encodeDatetimeType(input.ban_expires); - - input.created_at = encodeDatetimeType(input.created_at); - - input.deactivated_at = encodeDatetimeType(input.deactivated_at); - - input.deleted_at = encodeDatetimeType(input.deleted_at); - - input.invisible = encodeboolean(input.invisible); - - input.language = encodestring(input.language); - - input.last_active = encodeDatetimeType(input.last_active); - - input.revoke_tokens_issued_before = encodeDatetimeType( - input.revoke_tokens_issued_before, - ); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = encodestring(input.teams[key]); - }); - } - - input.privacy_settings = encodePrivacySettings(input.privacy_settings); - - input.push_notifications = encodePushNotificationSettings( - input.push_notifications, - ); - - return input; -}; - export const decodeUserObject = (input: Record) => { if (!input) return input; input.banned = decodeboolean(input.banned); @@ -19229,138 +9607,44 @@ export const decodeUserObject = (input: Record) => { if (input.teams) { Object.keys(input.teams).forEach((key) => { - input.teams[key] = decodestring(input.teams[key]); - }); - } - - input.privacy_settings = decodePrivacySettings(input.privacy_settings); - - input.push_notifications = decodePushNotificationSettings( - input.push_notifications, - ); - - return input; -}; - -export const encodeUserRequest = (input: Record) => { - if (!input) return input; - input.id = encodestring(input.id); - - input.image = encodestring(input.image); - - input.invisible = encodeboolean(input.invisible); - - input.language = encodestring(input.language); - - input.name = encodestring(input.name); - - input.role = encodestring(input.role); - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = encodestring(input.teams[key]); - }); - } - - input.custom = encodeobject(input.custom); - - input.privacy_settings = encodePrivacySettings(input.privacy_settings); - - input.push_notifications = encodePushNotificationSettingsInput( - input.push_notifications, - ); - - return input; -}; - -export const decodeUserRequest = (input: Record) => { - if (!input) return input; - input.id = decodestring(input.id); - - input.image = decodestring(input.image); - - input.invisible = decodeboolean(input.invisible); - - input.language = decodestring(input.language); - - input.name = decodestring(input.name); - - input.role = decodestring(input.role); - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = decodestring(input.teams[key]); - }); - } - - input.custom = decodeobject(input.custom); - - input.privacy_settings = decodePrivacySettings(input.privacy_settings); - - input.push_notifications = decodePushNotificationSettingsInput( - input.push_notifications, - ); - - return input; -}; - -export const encodeUserResponse = (input: Record) => { - if (!input) return input; - input.banned = encodeboolean(input.banned); - - input.created_at = encodeDatetimeType(input.created_at); - - input.id = encodestring(input.id); - - input.invisible = encodeboolean(input.invisible); - - input.language = encodestring(input.language); - - input.online = encodeboolean(input.online); - - input.role = encodestring(input.role); - - input.shadow_banned = encodeboolean(input.shadow_banned); - - input.updated_at = encodeDatetimeType(input.updated_at); - - if (input.blocked_user_ids) { - Object.keys(input.blocked_user_ids).forEach((key) => { - input.blocked_user_ids[key] = encodestring(input.blocked_user_ids[key]); - }); - } - - if (input.devices) { - Object.keys(input.devices).forEach((key) => { - input.devices[key] = encodeDevice(input.devices[key]); - }); - } - - if (input.teams) { - Object.keys(input.teams).forEach((key) => { - input.teams[key] = encodestring(input.teams[key]); + input.teams[key] = decodestring(input.teams[key]); }); } - input.custom = encodeobject(input.custom); + input.privacy_settings = decodePrivacySettings(input.privacy_settings); - input.ban_expires = encodeDatetimeType(input.ban_expires); + input.push_notifications = decodePushNotificationSettings( + input.push_notifications, + ); - input.deactivated_at = encodeDatetimeType(input.deactivated_at); + return input; +}; - input.deleted_at = encodeDatetimeType(input.deleted_at); +export const decodeUserRequest = (input: Record) => { + if (!input) return input; + input.id = decodestring(input.id); - input.image = encodestring(input.image); + input.image = decodestring(input.image); - input.last_active = encodeDatetimeType(input.last_active); + input.invisible = decodeboolean(input.invisible); - input.name = encodestring(input.name); + input.language = decodestring(input.language); - input.revoke_tokens_issued_before = encodeDatetimeType( - input.revoke_tokens_issued_before, - ); + input.name = decodestring(input.name); - input.push_notifications = encodePushNotificationSettings( + input.role = decodestring(input.role); + + if (input.teams) { + Object.keys(input.teams).forEach((key) => { + input.teams[key] = decodestring(input.teams[key]); + }); + } + + input.custom = decodeobject(input.custom); + + input.privacy_settings = decodePrivacySettings(input.privacy_settings); + + input.push_notifications = decodePushNotificationSettingsInput( input.push_notifications, ); @@ -19430,152 +9714,6 @@ export const decodeUserResponse = (input: Record) => { return input; }; -export const encodeUserSessionStats = (input: Record) => { - if (!input) return input; - input.freeze_duration_seconds = encodeinteger(input.freeze_duration_seconds); - - input.max_freeze_fraction = encodenumber(input.max_freeze_fraction); - - input.max_freezes_duration_seconds = encodeinteger( - input.max_freezes_duration_seconds, - ); - - input.packet_loss_fraction = encodenumber(input.packet_loss_fraction); - - input.publisher_packet_loss_fraction = encodenumber( - input.publisher_packet_loss_fraction, - ); - - input.publishing_duration_seconds = encodeinteger( - input.publishing_duration_seconds, - ); - - input.quality_score = encodenumber(input.quality_score); - - input.receiving_duration_seconds = encodeinteger( - input.receiving_duration_seconds, - ); - - input.session_id = encodestring(input.session_id); - - input.total_pixels_in = encodeinteger(input.total_pixels_in); - - input.total_pixels_out = encodeinteger(input.total_pixels_out); - - input.bro_ws_er = encodestring(input.bro_ws_er); - - input.browser_version = encodestring(input.browser_version); - - input.current_ip = encodestring(input.current_ip); - - input.current_sfu = encodestring(input.current_sfu); - - input.device_model = encodestring(input.device_model); - - input.device_version = encodestring(input.device_version); - - input.distance_to_sfu_kilometers = encodenumber( - input.distance_to_sfu_kilometers, - ); - - input.max_fir_per_second = encodenumber(input.max_fir_per_second); - - input.max_freezes_per_second = encodenumber(input.max_freezes_per_second); - - input.max_nack_per_second = encodenumber(input.max_nack_per_second); - - input.max_pli_per_second = encodenumber(input.max_pli_per_second); - - input.os = encodestring(input.os); - - input.os_version = encodestring(input.os_version); - - input.publisher_noise_cancellation_seconds = encodenumber( - input.publisher_noise_cancellation_seconds, - ); - - input.publisher_quality_limitation_fraction = encodenumber( - input.publisher_quality_limitation_fraction, - ); - - input.publishing_audio_codec = encodestring(input.publishing_audio_codec); - - input.publishing_video_codec = encodestring(input.publishing_video_codec); - - input.receiving_audio_codec = encodestring(input.receiving_audio_codec); - - input.receiving_video_codec = encodestring(input.receiving_video_codec); - - input.sdk = encodestring(input.sdk); - - input.sdk_version = encodestring(input.sdk_version); - - input.subscriber_video_quality_throttled_duration_seconds = encodenumber( - input.subscriber_video_quality_throttled_duration_seconds, - ); - - input.truncated = encodeboolean(input.truncated); - - input.webrtc_version = encodestring(input.webrtc_version); - - if (input.published_tracks) { - Object.keys(input.published_tracks).forEach((key) => { - input.published_tracks[key] = encodePublishedTrackInfo( - input.published_tracks[key], - ); - }); - } - - if (input.subsessions) { - Object.keys(input.subsessions).forEach((key) => { - input.subsessions[key] = encodeSubsession(input.subsessions[key]); - }); - } - - input.geolocation = encodeGeolocationResult(input.geolocation); - - input.jitter = encodeTimeStats(input.jitter); - - input.latency = encodeTimeStats(input.latency); - - input.max_publishing_video_quality = encodeVideoQuality( - input.max_publishing_video_quality, - ); - - input.max_receiving_video_quality = encodeVideoQuality( - input.max_receiving_video_quality, - ); - - input.pub_sub_hints = encodeMediaPubSubHint(input.pub_sub_hints); - - input.publisher_audio_mos = encodeMOSStats(input.publisher_audio_mos); - - input.publisher_jitter = encodeTimeStats(input.publisher_jitter); - - input.publisher_latency = encodeTimeStats(input.publisher_latency); - - if (input.publisher_video_quality_limitation_duration_seconds) { - Object.keys( - input.publisher_video_quality_limitation_duration_seconds, - ).forEach((key) => { - input.publisher_video_quality_limitation_duration_seconds[key] = - encodenumber( - input.publisher_video_quality_limitation_duration_seconds[key], - ); - }); - } - - input.subscriber_audio_mos = encodeMOSStats(input.subscriber_audio_mos); - - input.subscriber_jitter = encodeTimeStats(input.subscriber_jitter); - - input.subscriber_latency = encodeTimeStats(input.subscriber_latency); - - input.timeline = encodeCallTimeline(input.timeline); - - return input; -}; - export const decodeUserSessionStats = (input: Record) => { if (!input) return input; input.freeze_duration_seconds = decodeinteger(input.freeze_duration_seconds); @@ -19722,25 +9860,6 @@ export const decodeUserSessionStats = (input: Record) => { return input; }; -export const encodeUserStats = (input: Record) => { - if (!input) return input; - input.min_event_ts = encodeinteger(input.min_event_ts); - - if (input.session_stats) { - Object.keys(input.session_stats).forEach((key) => { - input.session_stats[key] = encodeUserSessionStats( - input.session_stats[key], - ); - }); - } - - input.info = encodeUserInfoResponse(input.info); - - input.rating = encodeinteger(input.rating); - - return input; -}; - export const decodeUserStats = (input: Record) => { if (!input) return input; input.min_event_ts = decodeinteger(input.min_event_ts); @@ -19760,15 +9879,6 @@ export const decodeUserStats = (input: Record) => { return input; }; -export const encodeVideoQuality = (input: Record) => { - if (!input) return input; - input.usage_type = encodestring(input.usage_type); - - input.resolution = encodeVideoResolution(input.resolution); - - return input; -}; - export const decodeVideoQuality = (input: Record) => { if (!input) return input; input.usage_type = decodestring(input.usage_type); @@ -19778,15 +9888,6 @@ export const decodeVideoQuality = (input: Record) => { return input; }; -export const encodeVideoResolution = (input: Record) => { - if (!input) return input; - input.height = encodeinteger(input.height); - - input.width = encodeinteger(input.width); - - return input; -}; - export const decodeVideoResolution = (input: Record) => { if (!input) return input; input.height = decodeinteger(input.height); @@ -19796,21 +9897,6 @@ export const decodeVideoResolution = (input: Record) => { return input; }; -export const encodeVideoSettings = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.camera_default_on = encodeboolean(input.camera_default_on); - - input.camera_facing = encodestring(input.camera_facing); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeVideoSettings = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -19826,21 +9912,6 @@ export const decodeVideoSettings = (input: Record) => { return input; }; -export const encodeVideoSettingsRequest = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.camera_default_on = encodeboolean(input.camera_default_on); - - input.camera_facing = encodestring(input.camera_facing); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeVideoSettingsRequest = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -19856,21 +9927,6 @@ export const decodeVideoSettingsRequest = (input: Record) => { return input; }; -export const encodeVideoSettingsResponse = (input: Record) => { - if (!input) return input; - input.access_request_enabled = encodeboolean(input.access_request_enabled); - - input.camera_default_on = encodeboolean(input.camera_default_on); - - input.camera_facing = encodestring(input.camera_facing); - - input.enabled = encodeboolean(input.enabled); - - input.target_resolution = encodeTargetResolution(input.target_resolution); - - return input; -}; - export const decodeVideoSettingsResponse = (input: Record) => { if (!input) return input; input.access_request_enabled = decodeboolean(input.access_request_enabled); @@ -19886,17 +9942,6 @@ export const decodeVideoSettingsResponse = (input: Record) => { return input; }; -export const encodeVoteData = (input: Record) => { - if (!input) return input; - input.answer_text = encodestring(input.answer_text); - - input.option_id = encodestring(input.option_id); - - input.option = encodePollOption(input.option); - - return input; -}; - export const decodeVoteData = (input: Record) => { if (!input) return input; input.answer_text = decodestring(input.answer_text); @@ -19908,63 +9953,6 @@ export const decodeVoteData = (input: Record) => { return input; }; -export const encodeWSEvent = (input: Record) => { - if (!input) return input; - input.created_at = encodeDatetimeType(input.created_at); - - input.type = encodestring(input.type); - - input.custom = encodeobject(input.custom); - - input.automoderation = encodeboolean(input.automoderation); - - input.channel_id = encodestring(input.channel_id); - - input.channel_type = encodestring(input.channel_type); - - input.cid = encodestring(input.cid); - - input.connection_id = encodestring(input.connection_id); - - input.parent_id = encodestring(input.parent_id); - - input.reason = encodestring(input.reason); - - input.team = encodestring(input.team); - - input.user_id = encodestring(input.user_id); - - input.watcher_count = encodeinteger(input.watcher_count); - - input.automoderation_scores = encodeModerationResponse( - input.automoderation_scores, - ); - - input.channel = encodeChannelResponse(input.channel); - - input.created_by = encodeUserObject(input.created_by); - - input.me = encodeOwnUser(input.me); - - input.member = encodeChannelMember(input.member); - - input.message = encodeMessage(input.message); - - input.message_update = encodeMessageUpdate(input.message_update); - - input.poll = encodePoll(input.poll); - - input.poll_vote = encodePollVote(input.poll_vote); - - input.reaction = encodeReaction(input.reaction); - - input.thread = encodeThread(input.thread); - - input.user = encodeUserObject(input.user); - - return input; -}; - export const decodeWSEvent = (input: Record) => { if (!input) return input; input.created_at = decodeDatetimeType(input.created_at); @@ -20022,41 +10010,6 @@ export const decodeWSEvent = (input: Record) => { return input; }; -export const encodeWrappedUnreadCountsResponse = ( - input: Record, -) => { - if (!input) return input; - input.duration = encodestring(input.duration); - - input.total_unread_count = encodeinteger(input.total_unread_count); - - input.total_unread_threads_count = encodeinteger( - input.total_unread_threads_count, - ); - - if (input.channel_type) { - Object.keys(input.channel_type).forEach((key) => { - input.channel_type[key] = encodeUnreadCountsChannelType( - input.channel_type[key], - ); - }); - } - - if (input.channels) { - Object.keys(input.channels).forEach((key) => { - input.channels[key] = encodeUnreadCountsChannel(input.channels[key]); - }); - } - - if (input.threads) { - Object.keys(input.threads).forEach((key) => { - input.threads[key] = encodeUnreadCountsThread(input.threads[key]); - }); - } - - return input; -}; - export const decodeWrappedUnreadCountsResponse = ( input: Record, ) => { @@ -20092,17 +10045,6 @@ export const decodeWrappedUnreadCountsResponse = ( return input; }; -export const encodeXiaomiConfig = (input: Record) => { - if (!input) return input; - input.disabled = encodeboolean(input.disabled); - - input.package_name = encodestring(input.package_name); - - input.secret = encodestring(input.secret); - - return input; -}; - export const decodeXiaomiConfig = (input: Record) => { if (!input) return input; input.disabled = decodeboolean(input.disabled); @@ -20114,17 +10056,6 @@ export const decodeXiaomiConfig = (input: Record) => { return input; }; -export const encodeXiaomiConfigFields = (input: Record) => { - if (!input) return input; - input.enabled = encodeboolean(input.enabled); - - input.package_name = encodestring(input.package_name); - - input.secret = encodestring(input.secret); - - return input; -}; - export const decodeXiaomiConfigFields = (input: Record) => { if (!input) return input; input.enabled = decodeboolean(input.enabled); diff --git a/src/gen/moderation/ModerationApi.ts b/src/gen/moderation/ModerationApi.ts index 94ac41f..77e43fd 100644 --- a/src/gen/moderation/ModerationApi.ts +++ b/src/gen/moderation/ModerationApi.ts @@ -36,56 +36,39 @@ import { UpsertModerationTemplateResponse, } from '../models'; import { - encodeBanRequest, decodeBanResponse, - encodeBlockRequest, decodeBlockResponse, - encodeCheckRequest, decodeCheckResponse, - encodeCustomCheckRequest, decodeCustomCheckResponse, - encodeFlagRequest, decodeFlagResponse, decodeGetConfigResponse, decodeGetReviewQueueItemResponse, decodeGetUserModerationReportResponse, decodeModeratorStatsResponse, - encodeMuteRequest, decodeMuteResponse, - encodeQueryModerationLogsRequest, decodeQueryModerationLogsResponse, - encodeQueryReviewQueueRequest, decodeQueryReviewQueueResponse, - encodeQueryUsageStatsRequest, decodeQueryUsageStatsResponse, decodeQueueStatsResponse, - encodeSubmitActionRequest, decodeSubmitActionResponse, - encodeUnbanRequest, decodeUnbanResponse, - encodeUnmuteRequest, decodeUnmuteResponse, - encodeUpsertConfigRequest, decodeUpsertConfigResponse, - encodeUpsertModerationTemplateRequest, decodeUpsertModerationTemplateResponse, } from '../models-transform'; export class ModerationApi extends BaseApi { ban = async (request: BanRequest): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - target_user_id: requestCopy.target_user_id, - timeout: requestCopy.timeout, - banned_by_id: requestCopy.banned_by_id, - channel_cid: requestCopy.channel_cid, - ip_ban: requestCopy.ip_ban, - reason: requestCopy.reason, - shadow: requestCopy.shadow, - banned_by: requestCopy.banned_by, + target_user_id: request?.target_user_id, + timeout: request?.timeout, + banned_by_id: request?.banned_by_id, + channel_cid: request?.channel_cid, + ip_ban: request?.ip_ban, + reason: request?.reason, + shadow: request?.shadow, + banned_by: request?.banned_by, }; - encodeBanRequest(body); const response = await this.sendRequest>( 'POST', @@ -103,15 +86,12 @@ export class ModerationApi extends BaseApi { block = async ( request: BlockRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - blocked_user_id: requestCopy.blocked_user_id, - user_id: requestCopy.user_id, - options: requestCopy.options, - user: requestCopy.user, + blocked_user_id: request?.blocked_user_id, + user_id: request?.user_id, + options: request?.options, + user: request?.user, }; - encodeBlockRequest(body); const response = await this.sendRequest>( 'POST', @@ -129,19 +109,16 @@ export class ModerationApi extends BaseApi { v2Check = async ( request: CheckRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - config_key: requestCopy.config_key, - entity_creator_id: requestCopy.entity_creator_id, - entity_id: requestCopy.entity_id, - entity_type: requestCopy.entity_type, - user_id: requestCopy.user_id, - moderation_payload: requestCopy.moderation_payload, - options: requestCopy.options, - user: requestCopy.user, + config_key: request?.config_key, + entity_creator_id: request?.entity_creator_id, + entity_id: request?.entity_id, + entity_type: request?.entity_type, + user_id: request?.user_id, + moderation_payload: request?.moderation_payload, + options: request?.options, + user: request?.user, }; - encodeCheckRequest(body); const response = await this.sendRequest>( 'POST', @@ -159,22 +136,18 @@ export class ModerationApi extends BaseApi { v2UpsertConfig = async ( request: UpsertConfigRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - key: requestCopy.key, - async: requestCopy.async, + key: request?.key, + async: request?.async, automod_platform_circumvention_config: - requestCopy.automod_platform_circumvention_config, - automod_semantic_filters_config: - requestCopy.automod_semantic_filters_config, - automod_toxicity_config: requestCopy.automod_toxicity_config, - aws_rek_og_nition_config: requestCopy.aws_rek_og_nition_config, - block_list_config: requestCopy.block_list_config, - bodyguard_config: requestCopy.bodyguard_config, - go_og_le_vision_config: requestCopy.go_og_le_vision_config, + request?.automod_platform_circumvention_config, + automod_semantic_filters_config: request?.automod_semantic_filters_config, + automod_toxicity_config: request?.automod_toxicity_config, + aws_rek_og_nition_config: request?.aws_rek_og_nition_config, + block_list_config: request?.block_list_config, + bodyguard_config: request?.bodyguard_config, + go_og_le_vision_config: request?.go_og_le_vision_config, }; - encodeUpsertConfigRequest(body); const response = await this.sendRequest< StreamResponse @@ -188,10 +161,8 @@ export class ModerationApi extends BaseApi { v2GetConfig = async (request: { key: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - key: requestCopy.key, + key: request?.key, }; const response = await this.sendRequest>( @@ -209,20 +180,17 @@ export class ModerationApi extends BaseApi { v2CustomCheck = async ( request: CustomCheckRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - entity_creator_id: requestCopy.entity_creator_id, - entity_id: requestCopy.entity_id, - entity_type: requestCopy.entity_type, - name: requestCopy.name, - reason: requestCopy.reason, - recommended_action: requestCopy.recommended_action, - user_id: requestCopy.user_id, - moderation_payload: requestCopy.moderation_payload, - user: requestCopy.user, + entity_creator_id: request?.entity_creator_id, + entity_id: request?.entity_id, + entity_type: request?.entity_type, + name: request?.name, + reason: request?.reason, + recommended_action: request?.recommended_action, + user_id: request?.user_id, + moderation_payload: request?.moderation_payload, + user: request?.user, }; - encodeCustomCheckRequest(body); const response = await this.sendRequest< StreamResponse @@ -236,13 +204,10 @@ export class ModerationApi extends BaseApi { v2UpsertTemplate = async ( request: UpsertModerationTemplateRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - name: requestCopy.name, - config: requestCopy.config, + name: request?.name, + config: request?.config, }; - encodeUpsertModerationTemplateRequest(body); const response = await this.sendRequest< StreamResponse @@ -262,19 +227,16 @@ export class ModerationApi extends BaseApi { flag = async ( request: FlagRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - entity_id: requestCopy.entity_id, - entity_type: requestCopy.entity_type, - reason: requestCopy.reason, - entity_creator_id: requestCopy.entity_creator_id, - user_id: requestCopy.user_id, - custom: requestCopy.custom, - moderation_payload: requestCopy.moderation_payload, - user: requestCopy.user, + entity_id: request?.entity_id, + entity_type: request?.entity_type, + reason: request?.reason, + entity_creator_id: request?.entity_creator_id, + user_id: request?.user_id, + custom: request?.custom, + moderation_payload: request?.moderation_payload, + user: request?.user, }; - encodeFlagRequest(body); const response = await this.sendRequest>( 'POST', @@ -292,18 +254,15 @@ export class ModerationApi extends BaseApi { v2QueryModerationLogs = async ( request?: QueryModerationLogsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - user_id: requestCopy.user_id, - sort: requestCopy.sort, - filter: requestCopy.filter, - user: requestCopy.user, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + user_id: request?.user_id, + sort: request?.sort, + filter: request?.filter, + user: request?.user, }; - encodeQueryModerationLogsRequest(body); const response = await this.sendRequest< StreamResponse @@ -329,15 +288,12 @@ export class ModerationApi extends BaseApi { mute = async ( request: MuteRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - timeout: requestCopy.timeout, - target_ids: requestCopy.target_ids, - user_id: requestCopy.user_id, - user: requestCopy.user, + timeout: request?.timeout, + target_ids: request?.target_ids, + user_id: request?.user_id, + user: request?.user, }; - encodeMuteRequest(body); const response = await this.sendRequest>( 'POST', @@ -368,21 +324,18 @@ export class ModerationApi extends BaseApi { v2QueryReviewQueue = async ( request?: QueryReviewQueueRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - lock_moderator_duration: requestCopy.lock_moderator_duration, - lock_moderator_id: requestCopy.lock_moderator_id, - next: requestCopy.next, - prev: requestCopy.prev, - stats_only: requestCopy.stats_only, - user_id: requestCopy.user_id, - sort: requestCopy.sort, - filter: requestCopy.filter, - user: requestCopy.user, + limit: request?.limit, + lock_moderator_duration: request?.lock_moderator_duration, + lock_moderator_id: request?.lock_moderator_id, + next: request?.next, + prev: request?.prev, + stats_only: request?.stats_only, + user_id: request?.user_id, + sort: request?.sort, + filter: request?.filter, + user: request?.user, }; - encodeQueryReviewQueueRequest(body); const response = await this.sendRequest< StreamResponse @@ -396,10 +349,8 @@ export class ModerationApi extends BaseApi { v2GetReviewQueueItem = async (request: { id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - id: requestCopy.id, + id: request?.id, }; const response = await this.sendRequest< @@ -414,21 +365,18 @@ export class ModerationApi extends BaseApi { v2SubmitAction = async ( request: SubmitActionRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - action_type: requestCopy.action_type, - item_id: requestCopy.item_id, - user_id: requestCopy.user_id, - ban: requestCopy.ban, - custom: requestCopy.custom, - delete_message: requestCopy.delete_message, - delete_reaction: requestCopy.delete_reaction, - delete_user: requestCopy.delete_user, - unban: requestCopy.unban, - user: requestCopy.user, + action_type: request?.action_type, + item_id: request?.item_id, + user_id: request?.user_id, + ban: request?.ban, + custom: request?.custom, + delete_message: request?.delete_message, + delete_reaction: request?.delete_reaction, + delete_user: request?.delete_user, + unban: request?.unban, + user: request?.user, }; - encodeSubmitActionRequest(body); const response = await this.sendRequest< StreamResponse @@ -446,18 +394,15 @@ export class ModerationApi extends BaseApi { created_by?: string; }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - target_user_id: requestCopy.target_user_id, - channel_cid: requestCopy.channel_cid, - created_by: requestCopy.created_by, + target_user_id: request?.target_user_id, + channel_cid: request?.channel_cid, + created_by: request?.created_by, }; const body = { - unbanned_by_id: requestCopy.unbanned_by_id, - unbanned_by: requestCopy.unbanned_by, + unbanned_by_id: request?.unbanned_by_id, + unbanned_by: request?.unbanned_by, }; - encodeUnbanRequest(body); const response = await this.sendRequest>( 'POST', @@ -475,14 +420,11 @@ export class ModerationApi extends BaseApi { unmute = async ( request: UnmuteRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - target_ids: requestCopy.target_ids, - user_id: requestCopy.user_id, - user: requestCopy.user, + target_ids: request?.target_ids, + user_id: request?.user_id, + user: request?.user, }; - encodeUnmuteRequest(body); const response = await this.sendRequest>( 'POST', @@ -500,18 +442,15 @@ export class ModerationApi extends BaseApi { v2QueryUsageStats = async ( request?: QueryUsageStatsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - user_id: requestCopy.user_id, - sort: requestCopy.sort, - filter: requestCopy.filter, - user: requestCopy.user, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + user_id: request?.user_id, + sort: request?.sort, + filter: request?.filter, + user: request?.user, }; - encodeQueryUsageStatsRequest(body); const response = await this.sendRequest< StreamResponse @@ -528,13 +467,11 @@ export class ModerationApi extends BaseApi { include_user_mutes?: boolean; include_user_blocks?: boolean; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - user_id: requestCopy.user_id, - create_user_if_not_exists: requestCopy.create_user_if_not_exists, - include_user_mutes: requestCopy.include_user_mutes, - include_user_blocks: requestCopy.include_user_blocks, + user_id: request?.user_id, + create_user_if_not_exists: request?.create_user_if_not_exists, + include_user_mutes: request?.include_user_mutes, + include_user_blocks: request?.include_user_blocks, }; const response = await this.sendRequest< diff --git a/src/gen/video/VideoApi.ts b/src/gen/video/VideoApi.ts index 409329a..528ea24 100644 --- a/src/gen/video/VideoApi.ts +++ b/src/gen/video/VideoApi.ts @@ -59,13 +59,9 @@ import { UpdateUserPermissionsResponse, } from '../models'; import { - encodeBlockUserRequest, decodeBlockUserResponse, - encodeCollectUserFeedbackRequest, decodeCollectUserFeedbackResponse, - encodeCreateCallTypeRequest, decodeCreateCallTypeResponse, - encodeDeleteCallRequest, decodeDeleteCallResponse, decodeDeleteRecordingResponse, decodeDeleteTranscriptionResponse, @@ -74,46 +70,30 @@ import { decodeGetCallStatsResponse, decodeGetCallTypeResponse, decodeGetEdgesResponse, - encodeGetOrCreateCallRequest, decodeGetOrCreateCallResponse, - encodeGoLiveRequest, decodeGoLiveResponse, decodeListCallTypeResponse, decodeListRecordingsResponse, decodeListTranscriptionsResponse, - encodeMuteUsersRequest, decodeMuteUsersResponse, - encodePinRequest, decodePinResponse, - encodeQueryCallMembersRequest, decodeQueryCallMembersResponse, - encodeQueryCallStatsRequest, decodeQueryCallStatsResponse, - encodeQueryCallsRequest, decodeQueryCallsResponse, decodeResponse, - encodeSendCallEventRequest, decodeSendCallEventResponse, decodeStartHLSBroadcastingResponse, - encodeStartRecordingRequest, decodeStartRecordingResponse, - encodeStartTranscriptionRequest, decodeStartTranscriptionResponse, decodeStopHLSBroadcastingResponse, decodeStopLiveResponse, decodeStopRecordingResponse, decodeStopTranscriptionResponse, - encodeUnblockUserRequest, decodeUnblockUserResponse, - encodeUnpinRequest, decodeUnpinResponse, - encodeUpdateCallMembersRequest, decodeUpdateCallMembersResponse, - encodeUpdateCallRequest, decodeUpdateCallResponse, - encodeUpdateCallTypeRequest, decodeUpdateCallTypeResponse, - encodeUpdateUserPermissionsRequest, decodeUpdateUserPermissionsResponse, } from '../models-transform'; @@ -121,18 +101,15 @@ export class VideoApi extends BaseApi { queryCallMembers = async ( request: QueryCallMembersRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - id: requestCopy.id, - type: requestCopy.type, - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, - filter_conditions: requestCopy.filter_conditions, + id: request?.id, + type: request?.type, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter_conditions: request?.filter_conditions, }; - encodeQueryCallMembersRequest(body); const response = await this.sendRequest< StreamResponse @@ -146,16 +123,13 @@ export class VideoApi extends BaseApi { queryCallStats = async ( request?: QueryCallStatsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, - filter_conditions: requestCopy.filter_conditions, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter_conditions: request?.filter_conditions, }; - encodeQueryCallStatsRequest(body); const response = await this.sendRequest< StreamResponse @@ -174,17 +148,15 @@ export class VideoApi extends BaseApi { notify?: boolean; video?: boolean; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const queryParams = { - members_limit: requestCopy.members_limit, - ring: requestCopy.ring, - notify: requestCopy.notify, - video: requestCopy.video, + members_limit: request?.members_limit, + ring: request?.ring, + notify: request?.notify, + video: request?.video, }; const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest>( @@ -202,18 +174,15 @@ export class VideoApi extends BaseApi { updateCall = async ( request: UpdateCallRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - starts_at: requestCopy.starts_at, - custom: requestCopy.custom, - settings_override: requestCopy.settings_override, + starts_at: request?.starts_at, + custom: request?.custom, + settings_override: request?.settings_override, }; - encodeUpdateCallRequest(body); const response = await this.sendRequest>( 'PATCH', @@ -231,20 +200,17 @@ export class VideoApi extends BaseApi { getOrCreateCall = async ( request: GetOrCreateCallRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - members_limit: requestCopy.members_limit, - notify: requestCopy.notify, - ring: requestCopy.ring, - video: requestCopy.video, - data: requestCopy.data, + members_limit: request?.members_limit, + notify: request?.notify, + ring: request?.ring, + video: request?.video, + data: request?.data, }; - encodeGetOrCreateCallRequest(body); const response = await this.sendRequest< StreamResponse @@ -258,16 +224,13 @@ export class VideoApi extends BaseApi { blockUser = async ( request: BlockUserRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; - encodeBlockUserRequest(body); const response = await this.sendRequest>( 'POST', @@ -285,16 +248,13 @@ export class VideoApi extends BaseApi { deleteCall = async ( request: DeleteCallRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - hard: requestCopy.hard, + hard: request?.hard, }; - encodeDeleteCallRequest(body); const response = await this.sendRequest>( 'POST', @@ -312,18 +272,15 @@ export class VideoApi extends BaseApi { sendCallEvent = async ( request: SendCallEventRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, - custom: requestCopy.custom, - user: requestCopy.user, + user_id: request?.user_id, + custom: request?.custom, + user: request?.user, }; - encodeSendCallEventRequest(body); const response = await this.sendRequest< StreamResponse @@ -347,22 +304,19 @@ export class VideoApi extends BaseApi { session: string; }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, - session: requestCopy.session, + type: request?.type, + id: request?.id, + session: request?.session, }; const body = { - rating: requestCopy.rating, - sdk: requestCopy.sdk, - sdk_version: requestCopy.sdk_version, - user_session_id: requestCopy.user_session_id, - reason: requestCopy.reason, - custom: requestCopy.custom, + rating: request?.rating, + sdk: request?.sdk, + sdk_version: request?.sdk_version, + user_session_id: request?.user_session_id, + reason: request?.reason, + custom: request?.custom, }; - encodeCollectUserFeedbackRequest(body); const response = await this.sendRequest< StreamResponse @@ -382,20 +336,17 @@ export class VideoApi extends BaseApi { goLive = async ( request: GoLiveRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - recording_storage_name: requestCopy.recording_storage_name, - start_hls: requestCopy.start_hls, - start_recording: requestCopy.start_recording, - start_transcription: requestCopy.start_transcription, - transcription_storage_name: requestCopy.transcription_storage_name, + recording_storage_name: request?.recording_storage_name, + start_hls: request?.start_hls, + start_recording: request?.start_recording, + start_transcription: request?.start_transcription, + transcription_storage_name: request?.transcription_storage_name, }; - encodeGoLiveRequest(body); const response = await this.sendRequest>( 'POST', @@ -414,11 +365,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest>( @@ -436,17 +385,14 @@ export class VideoApi extends BaseApi { updateCallMembers = async ( request: UpdateCallMembersRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - remove_members: requestCopy.remove_members, - update_members: requestCopy.update_members, + remove_members: request?.remove_members, + update_members: request?.update_members, }; - encodeUpdateCallMembersRequest(body); const response = await this.sendRequest< StreamResponse @@ -466,23 +412,20 @@ export class VideoApi extends BaseApi { muteUsers = async ( request: MuteUsersRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - audio: requestCopy.audio, - mute_all_users: requestCopy.mute_all_users, - muted_by_id: requestCopy.muted_by_id, - screenshare: requestCopy.screenshare, - screenshare_audio: requestCopy.screenshare_audio, - video: requestCopy.video, - user_ids: requestCopy.user_ids, - muted_by: requestCopy.muted_by, + audio: request?.audio, + mute_all_users: request?.mute_all_users, + muted_by_id: request?.muted_by_id, + screenshare: request?.screenshare, + screenshare_audio: request?.screenshare_audio, + video: request?.video, + user_ids: request?.user_ids, + muted_by: request?.muted_by, }; - encodeMuteUsersRequest(body); const response = await this.sendRequest>( 'POST', @@ -500,17 +443,14 @@ export class VideoApi extends BaseApi { videoPin = async ( request: PinRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - session_id: requestCopy.session_id, - user_id: requestCopy.user_id, + session_id: request?.session_id, + user_id: request?.user_id, }; - encodePinRequest(body); const response = await this.sendRequest>( 'POST', @@ -529,11 +469,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -554,11 +492,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -578,16 +514,13 @@ export class VideoApi extends BaseApi { startRecording = async ( request: StartRecordingRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - recording_external_storage: requestCopy.recording_external_storage, + recording_external_storage: request?.recording_external_storage, }; - encodeStartRecordingRequest(body); const response = await this.sendRequest< StreamResponse @@ -607,17 +540,13 @@ export class VideoApi extends BaseApi { startTranscription = async ( request: StartTranscriptionRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - transcription_external_storage: - requestCopy.transcription_external_storage, + transcription_external_storage: request?.transcription_external_storage, }; - encodeStartTranscriptionRequest(body); const response = await this.sendRequest< StreamResponse @@ -639,12 +568,10 @@ export class VideoApi extends BaseApi { id: string; session: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, - session: requestCopy.session, + type: request?.type, + id: request?.id, + session: request?.session, }; const response = await this.sendRequest< @@ -665,11 +592,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -690,11 +615,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest>( @@ -713,11 +636,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -738,11 +659,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -763,11 +682,9 @@ export class VideoApi extends BaseApi { type: string; id: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const response = await this.sendRequest< @@ -787,16 +704,13 @@ export class VideoApi extends BaseApi { unblockUser = async ( request: UnblockUserRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, + user_id: request?.user_id, }; - encodeUnblockUserRequest(body); const response = await this.sendRequest< StreamResponse @@ -816,17 +730,14 @@ export class VideoApi extends BaseApi { videoUnpin = async ( request: UnpinRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - session_id: requestCopy.session_id, - user_id: requestCopy.user_id, + session_id: request?.session_id, + user_id: request?.user_id, }; - encodeUnpinRequest(body); const response = await this.sendRequest>( 'POST', @@ -844,18 +755,15 @@ export class VideoApi extends BaseApi { updateUserPermissions = async ( request: UpdateUserPermissionsRequest & { type: string; id: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, + type: request?.type, + id: request?.id, }; const body = { - user_id: requestCopy.user_id, - grant_permissions: requestCopy.grant_permissions, - revoke_permissions: requestCopy.revoke_permissions, + user_id: request?.user_id, + grant_permissions: request?.grant_permissions, + revoke_permissions: request?.revoke_permissions, }; - encodeUpdateUserPermissionsRequest(body); const response = await this.sendRequest< StreamResponse @@ -878,13 +786,11 @@ export class VideoApi extends BaseApi { session: string; filename: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, - session: requestCopy.session, - filename: requestCopy.filename, + type: request?.type, + id: request?.id, + session: request?.session, + filename: request?.filename, }; const response = await this.sendRequest< @@ -907,13 +813,11 @@ export class VideoApi extends BaseApi { session: string; filename: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - type: requestCopy.type, - id: requestCopy.id, - session: requestCopy.session, - filename: requestCopy.filename, + type: request?.type, + id: request?.id, + session: request?.session, + filename: request?.filename, }; const response = await this.sendRequest< @@ -933,16 +837,13 @@ export class VideoApi extends BaseApi { queryCalls = async ( request?: QueryCallsRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - limit: requestCopy.limit, - next: requestCopy.next, - prev: requestCopy.prev, - sort: requestCopy.sort, - filter_conditions: requestCopy.filter_conditions, + limit: request?.limit, + next: request?.next, + prev: request?.prev, + sort: request?.sort, + filter_conditions: request?.filter_conditions, }; - encodeQueryCallsRequest(body); const response = await this.sendRequest>( 'POST', @@ -970,16 +871,13 @@ export class VideoApi extends BaseApi { createCallType = async ( request: CreateCallTypeRequest, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const body = { - name: requestCopy.name, - external_storage: requestCopy.external_storage, - grants: requestCopy.grants, - notification_settings: requestCopy.notification_settings, - settings: requestCopy.settings, + name: request?.name, + external_storage: request?.external_storage, + grants: request?.grants, + notification_settings: request?.notification_settings, + settings: request?.settings, }; - encodeCreateCallTypeRequest(body); const response = await this.sendRequest< StreamResponse @@ -993,10 +891,8 @@ export class VideoApi extends BaseApi { deleteCallType = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest>( @@ -1014,10 +910,8 @@ export class VideoApi extends BaseApi { getCallType = async (request: { name: string; }): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const response = await this.sendRequest< @@ -1032,18 +926,15 @@ export class VideoApi extends BaseApi { updateCallType = async ( request: UpdateCallTypeRequest & { name: string }, ): Promise> => { - const requestCopy = JSON.parse(JSON.stringify(request ?? {})); - const pathParams = { - name: requestCopy.name, + name: request?.name, }; const body = { - external_storage: requestCopy.external_storage, - grants: requestCopy.grants, - notification_settings: requestCopy.notification_settings, - settings: requestCopy.settings, + external_storage: request?.external_storage, + grants: request?.grants, + notification_settings: request?.notification_settings, + settings: request?.settings, }; - encodeUpdateCallTypeRequest(body); const response = await this.sendRequest< StreamResponse