@stream-io/node-sdk 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/index.cjs.js +4136 -9282
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -3
  4. package/dist/index.es.js +4136 -9206
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/BaseApi.d.ts +10 -0
  7. package/dist/src/StreamCall.d.ts +5 -37
  8. package/dist/src/StreamChannel.d.ts +7 -34
  9. package/dist/src/StreamChatClient.d.ts +2 -25
  10. package/dist/src/StreamClient.d.ts +51 -59
  11. package/dist/src/StreamModerationClient.d.ts +3 -0
  12. package/dist/src/StreamVideoClient.d.ts +2 -18
  13. package/dist/src/gen/chat/ChannelApi.d.ts +33 -0
  14. package/dist/src/gen/chat/ChatApi.d.ts +241 -0
  15. package/dist/src/gen/common/CommonApi.d.ts +99 -0
  16. package/dist/src/gen/model-decoders/index.d.ts +3 -0
  17. package/dist/src/gen/models/index.d.ts +3881 -0
  18. package/dist/src/gen/moderation/ModerationApi.d.ts +38 -0
  19. package/dist/src/gen/video/CallApi.d.ts +56 -0
  20. package/dist/src/gen/video/VideoApi.d.ts +151 -0
  21. package/dist/src/types.d.ts +25 -0
  22. package/dist/src/utils/create-token.d.ts +2 -0
  23. package/dist/src/utils/rate-limit.d.ts +2 -0
  24. package/index.ts +2 -3
  25. package/package.json +5 -4
  26. package/src/BaseApi.ts +115 -0
  27. package/src/StreamCall.ts +9 -199
  28. package/src/StreamChannel.ts +23 -246
  29. package/src/StreamChatClient.ts +3 -122
  30. package/src/StreamClient.ts +101 -345
  31. package/src/StreamModerationClient.ts +3 -0
  32. package/src/StreamVideoClient.ts +3 -95
  33. package/src/gen/chat/ChannelApi.ts +270 -0
  34. package/src/gen/chat/ChatApi.ts +1857 -0
  35. package/src/gen/common/CommonApi.ts +1004 -0
  36. package/src/gen/model-decoders/index.ts +1897 -0
  37. package/src/gen/models/index.ts +6794 -0
  38. package/src/gen/moderation/ModerationApi.ts +476 -0
  39. package/src/gen/video/CallApi.ts +309 -0
  40. package/src/gen/video/VideoApi.ts +1007 -0
  41. package/src/types.ts +35 -0
  42. package/src/utils/create-token.ts +6 -1
  43. package/src/utils/rate-limit.ts +21 -0
  44. package/dist/src/gen/chat/apis/ProductchatApi.d.ts +0 -1750
  45. package/dist/src/gen/chat/apis/index.d.ts +0 -1
  46. package/dist/src/gen/chat/index.d.ts +0 -3
  47. package/dist/src/gen/chat/models/index.d.ts +0 -14865
  48. package/dist/src/gen/chat/runtime.d.ts +0 -180
  49. package/dist/src/gen/video/apis/ProductvideoApi.d.ts +0 -648
  50. package/dist/src/gen/video/apis/index.d.ts +0 -1
  51. package/dist/src/gen/video/index.d.ts +0 -3
  52. package/dist/src/gen/video/models/index.d.ts +0 -5011
  53. package/dist/src/gen/video/runtime.d.ts +0 -180
  54. package/src/gen/chat/.openapi-generator/FILES +0 -6
  55. package/src/gen/chat/.openapi-generator/VERSION +0 -1
  56. package/src/gen/chat/.openapi-generator-ignore +0 -23
  57. package/src/gen/chat/apis/ProductchatApi.ts +0 -7007
  58. package/src/gen/chat/apis/index.ts +0 -3
  59. package/src/gen/chat/index.ts +0 -5
  60. package/src/gen/chat/models/index.ts +0 -14766
  61. package/src/gen/chat/runtime.ts +0 -415
  62. package/src/gen/video/.openapi-generator/FILES +0 -6
  63. package/src/gen/video/.openapi-generator/VERSION +0 -1
  64. package/src/gen/video/.openapi-generator-ignore +0 -23
  65. package/src/gen/video/apis/ProductvideoApi.ts +0 -2575
  66. package/src/gen/video/apis/index.ts +0 -3
  67. package/src/gen/video/index.ts +0 -5
  68. package/src/gen/video/models/index.ts +0 -5000
  69. package/src/gen/video/runtime.ts +0 -415
@@ -0,0 +1,1897 @@
1
+ type Decoder = (i: any) => any;
2
+
3
+ type TypeMapping = Record<string, { type: string; isSingle: boolean }>;
4
+
5
+ export const decoders: Record<string, Decoder> = {};
6
+
7
+ const decodeDatetimeType = (input: number) =>
8
+ new Date(Math.floor(input / 1000000));
9
+
10
+ decoders.DatetimeType = decodeDatetimeType;
11
+
12
+ const decode = (typeMappings: TypeMapping, input?: Record<string, any>) => {
13
+ if (!input || Object.keys(typeMappings).length === 0) return input;
14
+
15
+ Object.keys(typeMappings).forEach((key) => {
16
+ if (input[key] != null) {
17
+ if (typeMappings[key]) {
18
+ const decoder = decoders[typeMappings[key].type];
19
+ if (decoder) {
20
+ if (typeMappings[key].isSingle) {
21
+ input[key] = decoder(input[key]);
22
+ } else {
23
+ Object.keys(input[key]).forEach((k) => {
24
+ input[key][k] = decoder(input[key][k]);
25
+ });
26
+ }
27
+ }
28
+ }
29
+ }
30
+ });
31
+
32
+ return input;
33
+ };
34
+
35
+ decoders.ActionLog = (input?: Record<string, any>) => {
36
+ const typeMappings: TypeMapping = {
37
+ created_at: { type: 'DatetimeType', isSingle: true },
38
+
39
+ review_queue_item: { type: 'ReviewQueueItem', isSingle: true },
40
+
41
+ target_user: { type: 'UserObject', isSingle: true },
42
+
43
+ user: { type: 'UserObject', isSingle: true },
44
+ };
45
+ return decode(typeMappings, input);
46
+ };
47
+
48
+ decoders.ActionLogResponse = (input?: Record<string, any>) => {
49
+ const typeMappings: TypeMapping = {
50
+ created_at: { type: 'DatetimeType', isSingle: true },
51
+
52
+ review_queue_item: { type: 'ReviewQueueItem', isSingle: true },
53
+
54
+ target_user: { type: 'UserResponse', isSingle: true },
55
+
56
+ user: { type: 'UserResponse', isSingle: true },
57
+ };
58
+ return decode(typeMappings, input);
59
+ };
60
+
61
+ decoders.AppResponseFields = (input?: Record<string, any>) => {
62
+ const typeMappings: TypeMapping = {
63
+ call_types: { type: 'CallType', isSingle: false },
64
+
65
+ channel_configs: { type: 'ChannelConfig', isSingle: false },
66
+
67
+ push_notifications: { type: 'PushNotificationFields', isSingle: true },
68
+
69
+ revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
70
+ };
71
+ return decode(typeMappings, input);
72
+ };
73
+
74
+ decoders.AutomodDetails = (input?: Record<string, any>) => {
75
+ const typeMappings: TypeMapping = {
76
+ result: { type: 'MessageModerationResult', isSingle: true },
77
+ };
78
+ return decode(typeMappings, input);
79
+ };
80
+
81
+ decoders.Ban = (input?: Record<string, any>) => {
82
+ const typeMappings: TypeMapping = {
83
+ created_at: { type: 'DatetimeType', isSingle: true },
84
+
85
+ expires: { type: 'DatetimeType', isSingle: true },
86
+
87
+ channel: { type: 'Channel', isSingle: true },
88
+
89
+ created_by: { type: 'UserObject', isSingle: true },
90
+
91
+ target: { type: 'UserObject', isSingle: true },
92
+ };
93
+ return decode(typeMappings, input);
94
+ };
95
+
96
+ decoders.BanResponse = (input?: Record<string, any>) => {
97
+ const typeMappings: TypeMapping = {
98
+ created_at: { type: 'DatetimeType', isSingle: true },
99
+
100
+ expires: { type: 'DatetimeType', isSingle: true },
101
+
102
+ banned_by: { type: 'UserResponse', isSingle: true },
103
+
104
+ channel: { type: 'ChannelResponse', isSingle: true },
105
+
106
+ user: { type: 'UserResponse', isSingle: true },
107
+ };
108
+ return decode(typeMappings, input);
109
+ };
110
+
111
+ decoders.BlockListResponse = (input?: Record<string, any>) => {
112
+ const typeMappings: TypeMapping = {
113
+ created_at: { type: 'DatetimeType', isSingle: true },
114
+
115
+ updated_at: { type: 'DatetimeType', isSingle: true },
116
+ };
117
+ return decode(typeMappings, input);
118
+ };
119
+
120
+ decoders.BlockUsersResponse = (input?: Record<string, any>) => {
121
+ const typeMappings: TypeMapping = {
122
+ created_at: { type: 'DatetimeType', isSingle: true },
123
+ };
124
+ return decode(typeMappings, input);
125
+ };
126
+
127
+ decoders.BlockedUserResponse = (input?: Record<string, any>) => {
128
+ const typeMappings: TypeMapping = {
129
+ created_at: { type: 'DatetimeType', isSingle: true },
130
+
131
+ blocked_user: { type: 'UserResponse', isSingle: true },
132
+
133
+ user: { type: 'UserResponse', isSingle: true },
134
+ };
135
+ return decode(typeMappings, input);
136
+ };
137
+
138
+ decoders.CallParticipantResponse = (input?: Record<string, any>) => {
139
+ const typeMappings: TypeMapping = {
140
+ joined_at: { type: 'DatetimeType', isSingle: true },
141
+
142
+ user: { type: 'UserResponse', isSingle: true },
143
+ };
144
+ return decode(typeMappings, input);
145
+ };
146
+
147
+ decoders.CallRecording = (input?: Record<string, any>) => {
148
+ const typeMappings: TypeMapping = {
149
+ end_time: { type: 'DatetimeType', isSingle: true },
150
+
151
+ start_time: { type: 'DatetimeType', isSingle: true },
152
+ };
153
+ return decode(typeMappings, input);
154
+ };
155
+
156
+ decoders.CallResponse = (input?: Record<string, any>) => {
157
+ const typeMappings: TypeMapping = {
158
+ created_at: { type: 'DatetimeType', isSingle: true },
159
+
160
+ updated_at: { type: 'DatetimeType', isSingle: true },
161
+
162
+ created_by: { type: 'UserResponse', isSingle: true },
163
+
164
+ ended_at: { type: 'DatetimeType', isSingle: true },
165
+
166
+ starts_at: { type: 'DatetimeType', isSingle: true },
167
+
168
+ session: { type: 'CallSessionResponse', isSingle: true },
169
+ };
170
+ return decode(typeMappings, input);
171
+ };
172
+
173
+ decoders.CallSessionResponse = (input?: Record<string, any>) => {
174
+ const typeMappings: TypeMapping = {
175
+ participants: { type: 'CallParticipantResponse', isSingle: false },
176
+
177
+ accepted_by: { type: 'DatetimeType', isSingle: false },
178
+
179
+ missed_by: { type: 'DatetimeType', isSingle: false },
180
+
181
+ rejected_by: { type: 'DatetimeType', isSingle: false },
182
+
183
+ ended_at: { type: 'DatetimeType', isSingle: true },
184
+
185
+ live_ended_at: { type: 'DatetimeType', isSingle: true },
186
+
187
+ live_started_at: { type: 'DatetimeType', isSingle: true },
188
+
189
+ started_at: { type: 'DatetimeType', isSingle: true },
190
+
191
+ timer_ends_at: { type: 'DatetimeType', isSingle: true },
192
+ };
193
+ return decode(typeMappings, input);
194
+ };
195
+
196
+ decoders.CallStateResponseFields = (input?: Record<string, any>) => {
197
+ const typeMappings: TypeMapping = {
198
+ members: { type: 'MemberResponse', isSingle: false },
199
+
200
+ call: { type: 'CallResponse', isSingle: true },
201
+ };
202
+ return decode(typeMappings, input);
203
+ };
204
+
205
+ decoders.CallStatsReportSummaryResponse = (input?: Record<string, any>) => {
206
+ const typeMappings: TypeMapping = {
207
+ first_stats_time: { type: 'DatetimeType', isSingle: true },
208
+
209
+ created_at: { type: 'DatetimeType', isSingle: true },
210
+ };
211
+ return decode(typeMappings, input);
212
+ };
213
+
214
+ decoders.CallTranscription = (input?: Record<string, any>) => {
215
+ const typeMappings: TypeMapping = {
216
+ end_time: { type: 'DatetimeType', isSingle: true },
217
+
218
+ start_time: { type: 'DatetimeType', isSingle: true },
219
+ };
220
+ return decode(typeMappings, input);
221
+ };
222
+
223
+ decoders.CallType = (input?: Record<string, any>) => {
224
+ const typeMappings: TypeMapping = {
225
+ created_at: { type: 'DatetimeType', isSingle: true },
226
+
227
+ updated_at: { type: 'DatetimeType', isSingle: true },
228
+ };
229
+ return decode(typeMappings, input);
230
+ };
231
+
232
+ decoders.CallTypeResponse = (input?: Record<string, any>) => {
233
+ const typeMappings: TypeMapping = {
234
+ created_at: { type: 'DatetimeType', isSingle: true },
235
+
236
+ updated_at: { type: 'DatetimeType', isSingle: true },
237
+ };
238
+ return decode(typeMappings, input);
239
+ };
240
+
241
+ decoders.Channel = (input?: Record<string, any>) => {
242
+ const typeMappings: TypeMapping = {
243
+ created_at: { type: 'DatetimeType', isSingle: true },
244
+
245
+ updated_at: { type: 'DatetimeType', isSingle: true },
246
+
247
+ deleted_at: { type: 'DatetimeType', isSingle: true },
248
+
249
+ last_message_at: { type: 'DatetimeType', isSingle: true },
250
+
251
+ invites: { type: 'ChannelMember', isSingle: false },
252
+
253
+ members: { type: 'ChannelMember', isSingle: false },
254
+
255
+ config: { type: 'ChannelConfig', isSingle: true },
256
+
257
+ config_overrides: { type: 'ChannelConfig', isSingle: true },
258
+
259
+ created_by: { type: 'UserObject', isSingle: true },
260
+
261
+ truncated_by: { type: 'UserObject', isSingle: true },
262
+ };
263
+ return decode(typeMappings, input);
264
+ };
265
+
266
+ decoders.ChannelConfig = (input?: Record<string, any>) => {
267
+ const typeMappings: TypeMapping = {
268
+ created_at: { type: 'DatetimeType', isSingle: true },
269
+
270
+ updated_at: { type: 'DatetimeType', isSingle: true },
271
+ };
272
+ return decode(typeMappings, input);
273
+ };
274
+
275
+ decoders.ChannelConfigWithInfo = (input?: Record<string, any>) => {
276
+ const typeMappings: TypeMapping = {
277
+ created_at: { type: 'DatetimeType', isSingle: true },
278
+
279
+ updated_at: { type: 'DatetimeType', isSingle: true },
280
+
281
+ commands: { type: 'Command', isSingle: false },
282
+ };
283
+ return decode(typeMappings, input);
284
+ };
285
+
286
+ decoders.ChannelMember = (input?: Record<string, any>) => {
287
+ const typeMappings: TypeMapping = {
288
+ created_at: { type: 'DatetimeType', isSingle: true },
289
+
290
+ updated_at: { type: 'DatetimeType', isSingle: true },
291
+
292
+ ban_expires: { type: 'DatetimeType', isSingle: true },
293
+
294
+ deleted_at: { type: 'DatetimeType', isSingle: true },
295
+
296
+ invite_accepted_at: { type: 'DatetimeType', isSingle: true },
297
+
298
+ invite_rejected_at: { type: 'DatetimeType', isSingle: true },
299
+
300
+ user: { type: 'UserObject', isSingle: true },
301
+ };
302
+ return decode(typeMappings, input);
303
+ };
304
+
305
+ decoders.ChannelMemberResponse = (input?: Record<string, any>) => {
306
+ const typeMappings: TypeMapping = {
307
+ created_at: { type: 'DatetimeType', isSingle: true },
308
+
309
+ updated_at: { type: 'DatetimeType', isSingle: true },
310
+
311
+ ban_expires: { type: 'DatetimeType', isSingle: true },
312
+
313
+ deleted_at: { type: 'DatetimeType', isSingle: true },
314
+
315
+ invite_accepted_at: { type: 'DatetimeType', isSingle: true },
316
+
317
+ invite_rejected_at: { type: 'DatetimeType', isSingle: true },
318
+
319
+ user: { type: 'UserResponse', isSingle: true },
320
+ };
321
+ return decode(typeMappings, input);
322
+ };
323
+
324
+ decoders.ChannelMute = (input?: Record<string, any>) => {
325
+ const typeMappings: TypeMapping = {
326
+ created_at: { type: 'DatetimeType', isSingle: true },
327
+
328
+ updated_at: { type: 'DatetimeType', isSingle: true },
329
+
330
+ expires: { type: 'DatetimeType', isSingle: true },
331
+
332
+ channel: { type: 'ChannelResponse', isSingle: true },
333
+
334
+ user: { type: 'UserObject', isSingle: true },
335
+ };
336
+ return decode(typeMappings, input);
337
+ };
338
+
339
+ decoders.ChannelResponse = (input?: Record<string, any>) => {
340
+ const typeMappings: TypeMapping = {
341
+ created_at: { type: 'DatetimeType', isSingle: true },
342
+
343
+ updated_at: { type: 'DatetimeType', isSingle: true },
344
+
345
+ deleted_at: { type: 'DatetimeType', isSingle: true },
346
+
347
+ hide_messages_before: { type: 'DatetimeType', isSingle: true },
348
+
349
+ last_message_at: { type: 'DatetimeType', isSingle: true },
350
+
351
+ mute_expires_at: { type: 'DatetimeType', isSingle: true },
352
+
353
+ truncated_at: { type: 'DatetimeType', isSingle: true },
354
+
355
+ members: { type: 'ChannelMember', isSingle: false },
356
+
357
+ config: { type: 'ChannelConfigWithInfo', isSingle: true },
358
+
359
+ created_by: { type: 'UserObject', isSingle: true },
360
+
361
+ truncated_by: { type: 'UserObject', isSingle: true },
362
+ };
363
+ return decode(typeMappings, input);
364
+ };
365
+
366
+ decoders.ChannelStateResponse = (input?: Record<string, any>) => {
367
+ const typeMappings: TypeMapping = {
368
+ members: { type: 'ChannelMember', isSingle: false },
369
+
370
+ messages: { type: 'MessageResponse', isSingle: false },
371
+
372
+ pinned_messages: { type: 'MessageResponse', isSingle: false },
373
+
374
+ threads: { type: 'ThreadState', isSingle: false },
375
+
376
+ hide_messages_before: { type: 'DatetimeType', isSingle: true },
377
+
378
+ pending_messages: { type: 'PendingMessage', isSingle: false },
379
+
380
+ read: { type: 'ReadStateResponse', isSingle: false },
381
+
382
+ watchers: { type: 'UserResponse', isSingle: false },
383
+
384
+ channel: { type: 'ChannelResponse', isSingle: true },
385
+
386
+ membership: { type: 'ChannelMember', isSingle: true },
387
+ };
388
+ return decode(typeMappings, input);
389
+ };
390
+
391
+ decoders.ChannelStateResponseFields = (input?: Record<string, any>) => {
392
+ const typeMappings: TypeMapping = {
393
+ members: { type: 'ChannelMember', isSingle: false },
394
+
395
+ messages: { type: 'MessageResponse', isSingle: false },
396
+
397
+ pinned_messages: { type: 'MessageResponse', isSingle: false },
398
+
399
+ threads: { type: 'ThreadState', isSingle: false },
400
+
401
+ hide_messages_before: { type: 'DatetimeType', isSingle: true },
402
+
403
+ pending_messages: { type: 'PendingMessage', isSingle: false },
404
+
405
+ read: { type: 'ReadStateResponse', isSingle: false },
406
+
407
+ watchers: { type: 'UserResponse', isSingle: false },
408
+
409
+ channel: { type: 'ChannelResponse', isSingle: true },
410
+
411
+ membership: { type: 'ChannelMember', isSingle: true },
412
+ };
413
+ return decode(typeMappings, input);
414
+ };
415
+
416
+ decoders.ChannelTypeConfig = (input?: Record<string, any>) => {
417
+ const typeMappings: TypeMapping = {
418
+ created_at: { type: 'DatetimeType', isSingle: true },
419
+
420
+ updated_at: { type: 'DatetimeType', isSingle: true },
421
+
422
+ commands: { type: 'Command', isSingle: false },
423
+ };
424
+ return decode(typeMappings, input);
425
+ };
426
+
427
+ decoders.CheckResponse = (input?: Record<string, any>) => {
428
+ const typeMappings: TypeMapping = {
429
+ item: { type: 'ReviewQueueItem', isSingle: true },
430
+ };
431
+ return decode(typeMappings, input);
432
+ };
433
+
434
+ decoders.Command = (input?: Record<string, any>) => {
435
+ const typeMappings: TypeMapping = {
436
+ created_at: { type: 'DatetimeType', isSingle: true },
437
+
438
+ updated_at: { type: 'DatetimeType', isSingle: true },
439
+ };
440
+ return decode(typeMappings, input);
441
+ };
442
+
443
+ decoders.ConfigResponse = (input?: Record<string, any>) => {
444
+ const typeMappings: TypeMapping = {
445
+ created_at: { type: 'DatetimeType', isSingle: true },
446
+
447
+ updated_at: { type: 'DatetimeType', isSingle: true },
448
+ };
449
+ return decode(typeMappings, input);
450
+ };
451
+
452
+ decoders.CreateCallTypeResponse = (input?: Record<string, any>) => {
453
+ const typeMappings: TypeMapping = {
454
+ created_at: { type: 'DatetimeType', isSingle: true },
455
+
456
+ updated_at: { type: 'DatetimeType', isSingle: true },
457
+ };
458
+ return decode(typeMappings, input);
459
+ };
460
+
461
+ decoders.CreateChannelTypeResponse = (input?: Record<string, any>) => {
462
+ const typeMappings: TypeMapping = {
463
+ created_at: { type: 'DatetimeType', isSingle: true },
464
+
465
+ updated_at: { type: 'DatetimeType', isSingle: true },
466
+ };
467
+ return decode(typeMappings, input);
468
+ };
469
+
470
+ decoders.CreateCommandResponse = (input?: Record<string, any>) => {
471
+ const typeMappings: TypeMapping = {
472
+ command: { type: 'Command', isSingle: true },
473
+ };
474
+ return decode(typeMappings, input);
475
+ };
476
+
477
+ decoders.CreateGuestResponse = (input?: Record<string, any>) => {
478
+ const typeMappings: TypeMapping = {
479
+ user: { type: 'UserResponse', isSingle: true },
480
+ };
481
+ return decode(typeMappings, input);
482
+ };
483
+
484
+ decoders.CreateImportResponse = (input?: Record<string, any>) => {
485
+ const typeMappings: TypeMapping = {
486
+ import_task: { type: 'ImportTask', isSingle: true },
487
+ };
488
+ return decode(typeMappings, input);
489
+ };
490
+
491
+ decoders.CreateRoleResponse = (input?: Record<string, any>) => {
492
+ const typeMappings: TypeMapping = {
493
+ role: { type: 'Role', isSingle: true },
494
+ };
495
+ return decode(typeMappings, input);
496
+ };
497
+
498
+ decoders.CustomCheckResponse = (input?: Record<string, any>) => {
499
+ const typeMappings: TypeMapping = {
500
+ scored_at: { type: 'DatetimeType', isSingle: true },
501
+
502
+ reviewed_at: { type: 'DatetimeType', isSingle: true },
503
+ };
504
+ return decode(typeMappings, input);
505
+ };
506
+
507
+ decoders.DeactivateUserResponse = (input?: Record<string, any>) => {
508
+ const typeMappings: TypeMapping = {
509
+ user: { type: 'UserResponse', isSingle: true },
510
+ };
511
+ return decode(typeMappings, input);
512
+ };
513
+
514
+ decoders.DeleteCallResponse = (input?: Record<string, any>) => {
515
+ const typeMappings: TypeMapping = {
516
+ call: { type: 'CallResponse', isSingle: true },
517
+ };
518
+ return decode(typeMappings, input);
519
+ };
520
+
521
+ decoders.DeleteChannelResponse = (input?: Record<string, any>) => {
522
+ const typeMappings: TypeMapping = {
523
+ channel: { type: 'ChannelResponse', isSingle: true },
524
+ };
525
+ return decode(typeMappings, input);
526
+ };
527
+
528
+ decoders.DeleteMessageResponse = (input?: Record<string, any>) => {
529
+ const typeMappings: TypeMapping = {
530
+ message: { type: 'MessageResponse', isSingle: true },
531
+ };
532
+ return decode(typeMappings, input);
533
+ };
534
+
535
+ decoders.Device = (input?: Record<string, any>) => {
536
+ const typeMappings: TypeMapping = {
537
+ created_at: { type: 'DatetimeType', isSingle: true },
538
+ };
539
+ return decode(typeMappings, input);
540
+ };
541
+
542
+ decoders.EgressRTMPResponse = (input?: Record<string, any>) => {
543
+ const typeMappings: TypeMapping = {
544
+ started_at: { type: 'DatetimeType', isSingle: true },
545
+ };
546
+ return decode(typeMappings, input);
547
+ };
548
+
549
+ decoders.EventResponse = (input?: Record<string, any>) => {
550
+ const typeMappings: TypeMapping = {
551
+ event: { type: 'WSEvent', isSingle: true },
552
+ };
553
+ return decode(typeMappings, input);
554
+ };
555
+
556
+ decoders.ExportUserResponse = (input?: Record<string, any>) => {
557
+ const typeMappings: TypeMapping = {
558
+ messages: { type: 'Message', isSingle: false },
559
+
560
+ reactions: { type: 'Reaction', isSingle: false },
561
+
562
+ user: { type: 'UserResponse', isSingle: true },
563
+ };
564
+ return decode(typeMappings, input);
565
+ };
566
+
567
+ decoders.Flag2 = (input?: Record<string, any>) => {
568
+ const typeMappings: TypeMapping = {
569
+ created_at: { type: 'DatetimeType', isSingle: true },
570
+
571
+ updated_at: { type: 'DatetimeType', isSingle: true },
572
+
573
+ moderation_payload: { type: 'ModerationPayload', isSingle: true },
574
+
575
+ user: { type: 'UserObject', isSingle: true },
576
+ };
577
+ return decode(typeMappings, input);
578
+ };
579
+
580
+ decoders.FlagDetails = (input?: Record<string, any>) => {
581
+ const typeMappings: TypeMapping = {
582
+ automod: { type: 'AutomodDetails', isSingle: true },
583
+ };
584
+ return decode(typeMappings, input);
585
+ };
586
+
587
+ decoders.FlagFeedback = (input?: Record<string, any>) => {
588
+ const typeMappings: TypeMapping = {
589
+ created_at: { type: 'DatetimeType', isSingle: true },
590
+ };
591
+ return decode(typeMappings, input);
592
+ };
593
+
594
+ decoders.FullUserResponse = (input?: Record<string, any>) => {
595
+ const typeMappings: TypeMapping = {
596
+ created_at: { type: 'DatetimeType', isSingle: true },
597
+
598
+ updated_at: { type: 'DatetimeType', isSingle: true },
599
+
600
+ channel_mutes: { type: 'ChannelMute', isSingle: false },
601
+
602
+ devices: { type: 'Device', isSingle: false },
603
+
604
+ mutes: { type: 'UserMuteResponse', isSingle: false },
605
+
606
+ deactivated_at: { type: 'DatetimeType', isSingle: true },
607
+
608
+ deleted_at: { type: 'DatetimeType', isSingle: true },
609
+
610
+ last_active: { type: 'DatetimeType', isSingle: true },
611
+
612
+ revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
613
+
614
+ push_notifications: {
615
+ type: 'PushNotificationSettingsResponse',
616
+ isSingle: true,
617
+ },
618
+ };
619
+ return decode(typeMappings, input);
620
+ };
621
+
622
+ decoders.GetApplicationResponse = (input?: Record<string, any>) => {
623
+ const typeMappings: TypeMapping = {
624
+ app: { type: 'AppResponseFields', isSingle: true },
625
+ };
626
+ return decode(typeMappings, input);
627
+ };
628
+
629
+ decoders.GetBlockListResponse = (input?: Record<string, any>) => {
630
+ const typeMappings: TypeMapping = {
631
+ blocklist: { type: 'BlockListResponse', isSingle: true },
632
+ };
633
+ return decode(typeMappings, input);
634
+ };
635
+
636
+ decoders.GetBlockedUsersResponse = (input?: Record<string, any>) => {
637
+ const typeMappings: TypeMapping = {
638
+ blocks: { type: 'BlockedUserResponse', isSingle: false },
639
+ };
640
+ return decode(typeMappings, input);
641
+ };
642
+
643
+ decoders.GetCallResponse = (input?: Record<string, any>) => {
644
+ const typeMappings: TypeMapping = {
645
+ members: { type: 'MemberResponse', isSingle: false },
646
+
647
+ call: { type: 'CallResponse', isSingle: true },
648
+ };
649
+ return decode(typeMappings, input);
650
+ };
651
+
652
+ decoders.GetCallTypeResponse = (input?: Record<string, any>) => {
653
+ const typeMappings: TypeMapping = {
654
+ created_at: { type: 'DatetimeType', isSingle: true },
655
+
656
+ updated_at: { type: 'DatetimeType', isSingle: true },
657
+ };
658
+ return decode(typeMappings, input);
659
+ };
660
+
661
+ decoders.GetChannelTypeResponse = (input?: Record<string, any>) => {
662
+ const typeMappings: TypeMapping = {
663
+ created_at: { type: 'DatetimeType', isSingle: true },
664
+
665
+ updated_at: { type: 'DatetimeType', isSingle: true },
666
+
667
+ commands: { type: 'Command', isSingle: false },
668
+ };
669
+ return decode(typeMappings, input);
670
+ };
671
+
672
+ decoders.GetCommandResponse = (input?: Record<string, any>) => {
673
+ const typeMappings: TypeMapping = {
674
+ created_at: { type: 'DatetimeType', isSingle: true },
675
+
676
+ updated_at: { type: 'DatetimeType', isSingle: true },
677
+ };
678
+ return decode(typeMappings, input);
679
+ };
680
+
681
+ decoders.GetConfigResponse = (input?: Record<string, any>) => {
682
+ const typeMappings: TypeMapping = {
683
+ config: { type: 'ConfigResponse', isSingle: true },
684
+ };
685
+ return decode(typeMappings, input);
686
+ };
687
+
688
+ decoders.GetExportChannelsStatusResponse = (input?: Record<string, any>) => {
689
+ const typeMappings: TypeMapping = {
690
+ created_at: { type: 'DatetimeType', isSingle: true },
691
+
692
+ updated_at: { type: 'DatetimeType', isSingle: true },
693
+ };
694
+ return decode(typeMappings, input);
695
+ };
696
+
697
+ decoders.GetImportResponse = (input?: Record<string, any>) => {
698
+ const typeMappings: TypeMapping = {
699
+ import_task: { type: 'ImportTask', isSingle: true },
700
+ };
701
+ return decode(typeMappings, input);
702
+ };
703
+
704
+ decoders.GetManyMessagesResponse = (input?: Record<string, any>) => {
705
+ const typeMappings: TypeMapping = {
706
+ messages: { type: 'Message', isSingle: false },
707
+ };
708
+ return decode(typeMappings, input);
709
+ };
710
+
711
+ decoders.GetMessageResponse = (input?: Record<string, any>) => {
712
+ const typeMappings: TypeMapping = {
713
+ message: { type: 'MessageWithChannelResponse', isSingle: true },
714
+ };
715
+ return decode(typeMappings, input);
716
+ };
717
+
718
+ decoders.GetOrCreateCallResponse = (input?: Record<string, any>) => {
719
+ const typeMappings: TypeMapping = {
720
+ members: { type: 'MemberResponse', isSingle: false },
721
+
722
+ call: { type: 'CallResponse', isSingle: true },
723
+ };
724
+ return decode(typeMappings, input);
725
+ };
726
+
727
+ decoders.GetReactionsResponse = (input?: Record<string, any>) => {
728
+ const typeMappings: TypeMapping = {
729
+ reactions: { type: 'Reaction', isSingle: false },
730
+ };
731
+ return decode(typeMappings, input);
732
+ };
733
+
734
+ decoders.GetRepliesResponse = (input?: Record<string, any>) => {
735
+ const typeMappings: TypeMapping = {
736
+ messages: { type: 'MessageResponse', isSingle: false },
737
+ };
738
+ return decode(typeMappings, input);
739
+ };
740
+
741
+ decoders.GetReviewQueueItemResponse = (input?: Record<string, any>) => {
742
+ const typeMappings: TypeMapping = {
743
+ history: { type: 'ReviewQueueItem', isSingle: false },
744
+
745
+ item: { type: 'ReviewQueueItem', isSingle: true },
746
+ };
747
+ return decode(typeMappings, input);
748
+ };
749
+
750
+ decoders.GetTaskResponse = (input?: Record<string, any>) => {
751
+ const typeMappings: TypeMapping = {
752
+ created_at: { type: 'DatetimeType', isSingle: true },
753
+
754
+ updated_at: { type: 'DatetimeType', isSingle: true },
755
+ };
756
+ return decode(typeMappings, input);
757
+ };
758
+
759
+ decoders.GetThreadResponse = (input?: Record<string, any>) => {
760
+ const typeMappings: TypeMapping = {
761
+ thread: { type: 'ThreadStateResponse', isSingle: true },
762
+ };
763
+ return decode(typeMappings, input);
764
+ };
765
+
766
+ decoders.GetUserModerationReportResponse = (input?: Record<string, any>) => {
767
+ const typeMappings: TypeMapping = {
768
+ user_blocks: { type: 'UserBlock', isSingle: false },
769
+
770
+ user_mutes: { type: 'UserMute', isSingle: false },
771
+
772
+ user: { type: 'UserResponse', isSingle: true },
773
+ };
774
+ return decode(typeMappings, input);
775
+ };
776
+
777
+ decoders.GoLiveResponse = (input?: Record<string, any>) => {
778
+ const typeMappings: TypeMapping = {
779
+ call: { type: 'CallResponse', isSingle: true },
780
+ };
781
+ return decode(typeMappings, input);
782
+ };
783
+
784
+ decoders.ImportTask = (input?: Record<string, any>) => {
785
+ const typeMappings: TypeMapping = {
786
+ created_at: { type: 'DatetimeType', isSingle: true },
787
+
788
+ updated_at: { type: 'DatetimeType', isSingle: true },
789
+
790
+ history: { type: 'ImportTaskHistory', isSingle: false },
791
+ };
792
+ return decode(typeMappings, input);
793
+ };
794
+
795
+ decoders.ImportTaskHistory = (input?: Record<string, any>) => {
796
+ const typeMappings: TypeMapping = {
797
+ created_at: { type: 'DatetimeType', isSingle: true },
798
+ };
799
+ return decode(typeMappings, input);
800
+ };
801
+
802
+ decoders.ListBlockListResponse = (input?: Record<string, any>) => {
803
+ const typeMappings: TypeMapping = {
804
+ blocklists: { type: 'BlockListResponse', isSingle: false },
805
+ };
806
+ return decode(typeMappings, input);
807
+ };
808
+
809
+ decoders.ListCallTypeResponse = (input?: Record<string, any>) => {
810
+ const typeMappings: TypeMapping = {
811
+ call_types: { type: 'CallTypeResponse', isSingle: false },
812
+ };
813
+ return decode(typeMappings, input);
814
+ };
815
+
816
+ decoders.ListChannelTypesResponse = (input?: Record<string, any>) => {
817
+ const typeMappings: TypeMapping = {
818
+ channel_types: { type: 'ChannelTypeConfig', isSingle: false },
819
+ };
820
+ return decode(typeMappings, input);
821
+ };
822
+
823
+ decoders.ListCommandsResponse = (input?: Record<string, any>) => {
824
+ const typeMappings: TypeMapping = {
825
+ commands: { type: 'Command', isSingle: false },
826
+ };
827
+ return decode(typeMappings, input);
828
+ };
829
+
830
+ decoders.ListDevicesResponse = (input?: Record<string, any>) => {
831
+ const typeMappings: TypeMapping = {
832
+ devices: { type: 'Device', isSingle: false },
833
+ };
834
+ return decode(typeMappings, input);
835
+ };
836
+
837
+ decoders.ListImportsResponse = (input?: Record<string, any>) => {
838
+ const typeMappings: TypeMapping = {
839
+ import_tasks: { type: 'ImportTask', isSingle: false },
840
+ };
841
+ return decode(typeMappings, input);
842
+ };
843
+
844
+ decoders.ListPushProvidersResponse = (input?: Record<string, any>) => {
845
+ const typeMappings: TypeMapping = {
846
+ push_providers: { type: 'PushProviderResponse', isSingle: false },
847
+ };
848
+ return decode(typeMappings, input);
849
+ };
850
+
851
+ decoders.ListRecordingsResponse = (input?: Record<string, any>) => {
852
+ const typeMappings: TypeMapping = {
853
+ recordings: { type: 'CallRecording', isSingle: false },
854
+ };
855
+ return decode(typeMappings, input);
856
+ };
857
+
858
+ decoders.ListRolesResponse = (input?: Record<string, any>) => {
859
+ const typeMappings: TypeMapping = {
860
+ roles: { type: 'Role', isSingle: false },
861
+ };
862
+ return decode(typeMappings, input);
863
+ };
864
+
865
+ decoders.ListTranscriptionsResponse = (input?: Record<string, any>) => {
866
+ const typeMappings: TypeMapping = {
867
+ transcriptions: { type: 'CallTranscription', isSingle: false },
868
+ };
869
+ return decode(typeMappings, input);
870
+ };
871
+
872
+ decoders.MarkReadResponse = (input?: Record<string, any>) => {
873
+ const typeMappings: TypeMapping = {
874
+ event: { type: 'MessageReadEvent', isSingle: true },
875
+ };
876
+ return decode(typeMappings, input);
877
+ };
878
+
879
+ decoders.MemberResponse = (input?: Record<string, any>) => {
880
+ const typeMappings: TypeMapping = {
881
+ created_at: { type: 'DatetimeType', isSingle: true },
882
+
883
+ updated_at: { type: 'DatetimeType', isSingle: true },
884
+
885
+ user: { type: 'UserResponse', isSingle: true },
886
+
887
+ deleted_at: { type: 'DatetimeType', isSingle: true },
888
+ };
889
+ return decode(typeMappings, input);
890
+ };
891
+
892
+ decoders.MembersResponse = (input?: Record<string, any>) => {
893
+ const typeMappings: TypeMapping = {
894
+ members: { type: 'ChannelMember', isSingle: false },
895
+ };
896
+ return decode(typeMappings, input);
897
+ };
898
+
899
+ decoders.Message = (input?: Record<string, any>) => {
900
+ const typeMappings: TypeMapping = {
901
+ created_at: { type: 'DatetimeType', isSingle: true },
902
+
903
+ updated_at: { type: 'DatetimeType', isSingle: true },
904
+
905
+ latest_reactions: { type: 'Reaction', isSingle: false },
906
+
907
+ mentioned_users: { type: 'UserObject', isSingle: false },
908
+
909
+ own_reactions: { type: 'Reaction', isSingle: false },
910
+
911
+ reaction_groups: { type: 'ReactionGroupResponse', isSingle: false },
912
+
913
+ deleted_at: { type: 'DatetimeType', isSingle: true },
914
+
915
+ message_text_updated_at: { type: 'DatetimeType', isSingle: true },
916
+
917
+ pin_expires: { type: 'DatetimeType', isSingle: true },
918
+
919
+ pinned_at: { type: 'DatetimeType', isSingle: true },
920
+
921
+ thread_participants: { type: 'UserObject', isSingle: false },
922
+
923
+ pinned_by: { type: 'UserObject', isSingle: true },
924
+
925
+ poll: { type: 'Poll', isSingle: true },
926
+
927
+ quoted_message: { type: 'Message', isSingle: true },
928
+
929
+ user: { type: 'UserObject', isSingle: true },
930
+ };
931
+ return decode(typeMappings, input);
932
+ };
933
+
934
+ decoders.MessageFlagResponse = (input?: Record<string, any>) => {
935
+ const typeMappings: TypeMapping = {
936
+ created_at: { type: 'DatetimeType', isSingle: true },
937
+
938
+ updated_at: { type: 'DatetimeType', isSingle: true },
939
+
940
+ approved_at: { type: 'DatetimeType', isSingle: true },
941
+
942
+ rejected_at: { type: 'DatetimeType', isSingle: true },
943
+
944
+ reviewed_at: { type: 'DatetimeType', isSingle: true },
945
+
946
+ details: { type: 'FlagDetails', isSingle: true },
947
+
948
+ message: { type: 'Message', isSingle: true },
949
+
950
+ moderation_feedback: { type: 'FlagFeedback', isSingle: true },
951
+
952
+ moderation_result: { type: 'MessageModerationResult', isSingle: true },
953
+
954
+ reviewed_by: { type: 'UserResponse', isSingle: true },
955
+
956
+ user: { type: 'UserResponse', isSingle: true },
957
+ };
958
+ return decode(typeMappings, input);
959
+ };
960
+
961
+ decoders.MessageHistoryEntryResponse = (input?: Record<string, any>) => {
962
+ const typeMappings: TypeMapping = {
963
+ message_updated_at: { type: 'DatetimeType', isSingle: true },
964
+ };
965
+ return decode(typeMappings, input);
966
+ };
967
+
968
+ decoders.MessageModerationResult = (input?: Record<string, any>) => {
969
+ const typeMappings: TypeMapping = {
970
+ created_at: { type: 'DatetimeType', isSingle: true },
971
+
972
+ updated_at: { type: 'DatetimeType', isSingle: true },
973
+ };
974
+ return decode(typeMappings, input);
975
+ };
976
+
977
+ decoders.MessageReadEvent = (input?: Record<string, any>) => {
978
+ const typeMappings: TypeMapping = {
979
+ created_at: { type: 'DatetimeType', isSingle: true },
980
+
981
+ thread: { type: 'ThreadResponse', isSingle: true },
982
+
983
+ user: { type: 'UserObject', isSingle: true },
984
+ };
985
+ return decode(typeMappings, input);
986
+ };
987
+
988
+ decoders.MessageResponse = (input?: Record<string, any>) => {
989
+ const typeMappings: TypeMapping = {
990
+ created_at: { type: 'DatetimeType', isSingle: true },
991
+
992
+ updated_at: { type: 'DatetimeType', isSingle: true },
993
+
994
+ latest_reactions: { type: 'ReactionResponse', isSingle: false },
995
+
996
+ mentioned_users: { type: 'UserResponse', isSingle: false },
997
+
998
+ own_reactions: { type: 'ReactionResponse', isSingle: false },
999
+
1000
+ user: { type: 'UserResponse', isSingle: true },
1001
+
1002
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1003
+
1004
+ message_text_updated_at: { type: 'DatetimeType', isSingle: true },
1005
+
1006
+ pin_expires: { type: 'DatetimeType', isSingle: true },
1007
+
1008
+ pinned_at: { type: 'DatetimeType', isSingle: true },
1009
+
1010
+ thread_participants: { type: 'UserResponse', isSingle: false },
1011
+
1012
+ pinned_by: { type: 'UserResponse', isSingle: true },
1013
+
1014
+ poll: { type: 'Poll', isSingle: true },
1015
+
1016
+ quoted_message: { type: 'Message', isSingle: true },
1017
+
1018
+ reaction_groups: { type: 'ReactionGroupResponse', isSingle: false },
1019
+ };
1020
+ return decode(typeMappings, input);
1021
+ };
1022
+
1023
+ decoders.MessageWithChannelResponse = (input?: Record<string, any>) => {
1024
+ const typeMappings: TypeMapping = {
1025
+ created_at: { type: 'DatetimeType', isSingle: true },
1026
+
1027
+ updated_at: { type: 'DatetimeType', isSingle: true },
1028
+
1029
+ latest_reactions: { type: 'ReactionResponse', isSingle: false },
1030
+
1031
+ mentioned_users: { type: 'UserResponse', isSingle: false },
1032
+
1033
+ own_reactions: { type: 'ReactionResponse', isSingle: false },
1034
+
1035
+ channel: { type: 'ChannelResponse', isSingle: true },
1036
+
1037
+ user: { type: 'UserResponse', isSingle: true },
1038
+
1039
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1040
+
1041
+ message_text_updated_at: { type: 'DatetimeType', isSingle: true },
1042
+
1043
+ pin_expires: { type: 'DatetimeType', isSingle: true },
1044
+
1045
+ pinned_at: { type: 'DatetimeType', isSingle: true },
1046
+
1047
+ thread_participants: { type: 'UserResponse', isSingle: false },
1048
+
1049
+ pinned_by: { type: 'UserResponse', isSingle: true },
1050
+
1051
+ poll: { type: 'Poll', isSingle: true },
1052
+
1053
+ quoted_message: { type: 'Message', isSingle: true },
1054
+
1055
+ reaction_groups: { type: 'ReactionGroupResponse', isSingle: false },
1056
+ };
1057
+ return decode(typeMappings, input);
1058
+ };
1059
+
1060
+ decoders.ModerationPayload = (input?: Record<string, any>) => {
1061
+ const typeMappings: TypeMapping = {
1062
+ created_at: { type: 'DatetimeType', isSingle: true },
1063
+ };
1064
+ return decode(typeMappings, input);
1065
+ };
1066
+
1067
+ decoders.ModerationUsageStats = (input?: Record<string, any>) => {
1068
+ const typeMappings: TypeMapping = {
1069
+ updated_at: { type: 'DatetimeType', isSingle: true },
1070
+ };
1071
+ return decode(typeMappings, input);
1072
+ };
1073
+
1074
+ decoders.MuteChannelResponse = (input?: Record<string, any>) => {
1075
+ const typeMappings: TypeMapping = {
1076
+ channel_mutes: { type: 'ChannelMute', isSingle: false },
1077
+
1078
+ channel_mute: { type: 'ChannelMute', isSingle: true },
1079
+
1080
+ own_user: { type: 'OwnUser', isSingle: true },
1081
+ };
1082
+ return decode(typeMappings, input);
1083
+ };
1084
+
1085
+ decoders.MuteResponse = (input?: Record<string, any>) => {
1086
+ const typeMappings: TypeMapping = {
1087
+ mutes: { type: 'UserMute', isSingle: false },
1088
+
1089
+ own_user: { type: 'OwnUser', isSingle: true },
1090
+ };
1091
+ return decode(typeMappings, input);
1092
+ };
1093
+
1094
+ decoders.NullTime = (input?: Record<string, any>) => {
1095
+ const typeMappings: TypeMapping = {
1096
+ value: { type: 'DatetimeType', isSingle: true },
1097
+ };
1098
+ return decode(typeMappings, input);
1099
+ };
1100
+
1101
+ decoders.OwnUser = (input?: Record<string, any>) => {
1102
+ const typeMappings: TypeMapping = {
1103
+ created_at: { type: 'DatetimeType', isSingle: true },
1104
+
1105
+ updated_at: { type: 'DatetimeType', isSingle: true },
1106
+
1107
+ channel_mutes: { type: 'ChannelMute', isSingle: false },
1108
+
1109
+ devices: { type: 'Device', isSingle: false },
1110
+
1111
+ mutes: { type: 'UserMute', isSingle: false },
1112
+
1113
+ deactivated_at: { type: 'DatetimeType', isSingle: true },
1114
+
1115
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1116
+
1117
+ last_active: { type: 'DatetimeType', isSingle: true },
1118
+
1119
+ push_notifications: { type: 'PushNotificationSettings', isSingle: true },
1120
+ };
1121
+ return decode(typeMappings, input);
1122
+ };
1123
+
1124
+ decoders.PendingMessage = (input?: Record<string, any>) => {
1125
+ const typeMappings: TypeMapping = {
1126
+ channel: { type: 'Channel', isSingle: true },
1127
+
1128
+ message: { type: 'Message', isSingle: true },
1129
+
1130
+ user: { type: 'UserObject', isSingle: true },
1131
+ };
1132
+ return decode(typeMappings, input);
1133
+ };
1134
+
1135
+ decoders.Poll = (input?: Record<string, any>) => {
1136
+ const typeMappings: TypeMapping = {
1137
+ created_at: { type: 'DatetimeType', isSingle: true },
1138
+
1139
+ updated_at: { type: 'DatetimeType', isSingle: true },
1140
+
1141
+ latest_answers: { type: 'PollVote', isSingle: false },
1142
+
1143
+ own_votes: { type: 'PollVote', isSingle: false },
1144
+
1145
+ created_by: { type: 'UserObject', isSingle: true },
1146
+ };
1147
+ return decode(typeMappings, input);
1148
+ };
1149
+
1150
+ decoders.PollResponse = (input?: Record<string, any>) => {
1151
+ const typeMappings: TypeMapping = {
1152
+ poll: { type: 'PollResponseData', isSingle: true },
1153
+ };
1154
+ return decode(typeMappings, input);
1155
+ };
1156
+
1157
+ decoders.PollResponseData = (input?: Record<string, any>) => {
1158
+ const typeMappings: TypeMapping = {
1159
+ created_at: { type: 'DatetimeType', isSingle: true },
1160
+
1161
+ updated_at: { type: 'DatetimeType', isSingle: true },
1162
+
1163
+ own_votes: { type: 'PollVoteResponseData', isSingle: false },
1164
+
1165
+ created_by: { type: 'UserResponse', isSingle: true },
1166
+ };
1167
+ return decode(typeMappings, input);
1168
+ };
1169
+
1170
+ decoders.PollVote = (input?: Record<string, any>) => {
1171
+ const typeMappings: TypeMapping = {
1172
+ created_at: { type: 'DatetimeType', isSingle: true },
1173
+
1174
+ updated_at: { type: 'DatetimeType', isSingle: true },
1175
+
1176
+ user: { type: 'UserObject', isSingle: true },
1177
+ };
1178
+ return decode(typeMappings, input);
1179
+ };
1180
+
1181
+ decoders.PollVoteResponse = (input?: Record<string, any>) => {
1182
+ const typeMappings: TypeMapping = {
1183
+ vote: { type: 'PollVoteResponseData', isSingle: true },
1184
+ };
1185
+ return decode(typeMappings, input);
1186
+ };
1187
+
1188
+ decoders.PollVoteResponseData = (input?: Record<string, any>) => {
1189
+ const typeMappings: TypeMapping = {
1190
+ created_at: { type: 'DatetimeType', isSingle: true },
1191
+
1192
+ updated_at: { type: 'DatetimeType', isSingle: true },
1193
+
1194
+ user: { type: 'UserResponse', isSingle: true },
1195
+ };
1196
+ return decode(typeMappings, input);
1197
+ };
1198
+
1199
+ decoders.PollVotesResponse = (input?: Record<string, any>) => {
1200
+ const typeMappings: TypeMapping = {
1201
+ votes: { type: 'PollVoteResponseData', isSingle: false },
1202
+ };
1203
+ return decode(typeMappings, input);
1204
+ };
1205
+
1206
+ decoders.PushNotificationFields = (input?: Record<string, any>) => {
1207
+ const typeMappings: TypeMapping = {
1208
+ providers: { type: 'PushProvider', isSingle: false },
1209
+ };
1210
+ return decode(typeMappings, input);
1211
+ };
1212
+
1213
+ decoders.PushNotificationSettings = (input?: Record<string, any>) => {
1214
+ const typeMappings: TypeMapping = {
1215
+ disabled_until: { type: 'DatetimeType', isSingle: true },
1216
+ };
1217
+ return decode(typeMappings, input);
1218
+ };
1219
+
1220
+ decoders.PushNotificationSettingsResponse = (input?: Record<string, any>) => {
1221
+ const typeMappings: TypeMapping = {
1222
+ disabled_until: { type: 'DatetimeType', isSingle: true },
1223
+ };
1224
+ return decode(typeMappings, input);
1225
+ };
1226
+
1227
+ decoders.PushProvider = (input?: Record<string, any>) => {
1228
+ const typeMappings: TypeMapping = {
1229
+ created_at: { type: 'DatetimeType', isSingle: true },
1230
+
1231
+ updated_at: { type: 'DatetimeType', isSingle: true },
1232
+
1233
+ disabled_at: { type: 'DatetimeType', isSingle: true },
1234
+ };
1235
+ return decode(typeMappings, input);
1236
+ };
1237
+
1238
+ decoders.PushProviderResponse = (input?: Record<string, any>) => {
1239
+ const typeMappings: TypeMapping = {
1240
+ created_at: { type: 'DatetimeType', isSingle: true },
1241
+
1242
+ updated_at: { type: 'DatetimeType', isSingle: true },
1243
+
1244
+ disabled_at: { type: 'DatetimeType', isSingle: true },
1245
+ };
1246
+ return decode(typeMappings, input);
1247
+ };
1248
+
1249
+ decoders.QueryBannedUsersResponse = (input?: Record<string, any>) => {
1250
+ const typeMappings: TypeMapping = {
1251
+ bans: { type: 'BanResponse', isSingle: false },
1252
+ };
1253
+ return decode(typeMappings, input);
1254
+ };
1255
+
1256
+ decoders.QueryCallMembersResponse = (input?: Record<string, any>) => {
1257
+ const typeMappings: TypeMapping = {
1258
+ members: { type: 'MemberResponse', isSingle: false },
1259
+ };
1260
+ return decode(typeMappings, input);
1261
+ };
1262
+
1263
+ decoders.QueryCallStatsResponse = (input?: Record<string, any>) => {
1264
+ const typeMappings: TypeMapping = {
1265
+ reports: { type: 'CallStatsReportSummaryResponse', isSingle: false },
1266
+ };
1267
+ return decode(typeMappings, input);
1268
+ };
1269
+
1270
+ decoders.QueryCallsResponse = (input?: Record<string, any>) => {
1271
+ const typeMappings: TypeMapping = {
1272
+ calls: { type: 'CallStateResponseFields', isSingle: false },
1273
+ };
1274
+ return decode(typeMappings, input);
1275
+ };
1276
+
1277
+ decoders.QueryChannelsResponse = (input?: Record<string, any>) => {
1278
+ const typeMappings: TypeMapping = {
1279
+ channels: { type: 'ChannelStateResponseFields', isSingle: false },
1280
+ };
1281
+ return decode(typeMappings, input);
1282
+ };
1283
+
1284
+ decoders.QueryFeedModerationTemplate = (input?: Record<string, any>) => {
1285
+ const typeMappings: TypeMapping = {
1286
+ created_at: { type: 'DatetimeType', isSingle: true },
1287
+
1288
+ updated_at: { type: 'DatetimeType', isSingle: true },
1289
+ };
1290
+ return decode(typeMappings, input);
1291
+ };
1292
+
1293
+ decoders.QueryFeedModerationTemplatesResponse = (
1294
+ input?: Record<string, any>,
1295
+ ) => {
1296
+ const typeMappings: TypeMapping = {
1297
+ templates: { type: 'QueryFeedModerationTemplate', isSingle: false },
1298
+ };
1299
+ return decode(typeMappings, input);
1300
+ };
1301
+
1302
+ decoders.QueryMessageFlagsResponse = (input?: Record<string, any>) => {
1303
+ const typeMappings: TypeMapping = {
1304
+ flags: { type: 'MessageFlagResponse', isSingle: false },
1305
+ };
1306
+ return decode(typeMappings, input);
1307
+ };
1308
+
1309
+ decoders.QueryMessageHistoryResponse = (input?: Record<string, any>) => {
1310
+ const typeMappings: TypeMapping = {
1311
+ message_history: { type: 'MessageHistoryEntryResponse', isSingle: false },
1312
+ };
1313
+ return decode(typeMappings, input);
1314
+ };
1315
+
1316
+ decoders.QueryModerationLogsResponse = (input?: Record<string, any>) => {
1317
+ const typeMappings: TypeMapping = {
1318
+ l_og_s: { type: 'ActionLogResponse', isSingle: false },
1319
+ };
1320
+ return decode(typeMappings, input);
1321
+ };
1322
+
1323
+ decoders.QueryPollsResponse = (input?: Record<string, any>) => {
1324
+ const typeMappings: TypeMapping = {
1325
+ polls: { type: 'PollResponseData', isSingle: false },
1326
+ };
1327
+ return decode(typeMappings, input);
1328
+ };
1329
+
1330
+ decoders.QueryReactionsResponse = (input?: Record<string, any>) => {
1331
+ const typeMappings: TypeMapping = {
1332
+ reactions: { type: 'ReactionResponse', isSingle: false },
1333
+ };
1334
+ return decode(typeMappings, input);
1335
+ };
1336
+
1337
+ decoders.QueryReviewQueueResponse = (input?: Record<string, any>) => {
1338
+ const typeMappings: TypeMapping = {
1339
+ items: { type: 'ReviewQueueItem', isSingle: false },
1340
+ };
1341
+ return decode(typeMappings, input);
1342
+ };
1343
+
1344
+ decoders.QueryThreadsResponse = (input?: Record<string, any>) => {
1345
+ const typeMappings: TypeMapping = {
1346
+ threads: { type: 'ThreadStateResponse', isSingle: false },
1347
+ };
1348
+ return decode(typeMappings, input);
1349
+ };
1350
+
1351
+ decoders.QueryUsageStatsResponse = (input?: Record<string, any>) => {
1352
+ const typeMappings: TypeMapping = {
1353
+ items: { type: 'ModerationUsageStats', isSingle: false },
1354
+ };
1355
+ return decode(typeMappings, input);
1356
+ };
1357
+
1358
+ decoders.QueryUsersResponse = (input?: Record<string, any>) => {
1359
+ const typeMappings: TypeMapping = {
1360
+ users: { type: 'FullUserResponse', isSingle: false },
1361
+ };
1362
+ return decode(typeMappings, input);
1363
+ };
1364
+
1365
+ decoders.Reaction = (input?: Record<string, any>) => {
1366
+ const typeMappings: TypeMapping = {
1367
+ created_at: { type: 'DatetimeType', isSingle: true },
1368
+
1369
+ updated_at: { type: 'DatetimeType', isSingle: true },
1370
+
1371
+ user: { type: 'UserObject', isSingle: true },
1372
+ };
1373
+ return decode(typeMappings, input);
1374
+ };
1375
+
1376
+ decoders.ReactionGroupResponse = (input?: Record<string, any>) => {
1377
+ const typeMappings: TypeMapping = {
1378
+ first_reaction_at: { type: 'DatetimeType', isSingle: true },
1379
+
1380
+ last_reaction_at: { type: 'DatetimeType', isSingle: true },
1381
+ };
1382
+ return decode(typeMappings, input);
1383
+ };
1384
+
1385
+ decoders.ReactionRemovalResponse = (input?: Record<string, any>) => {
1386
+ const typeMappings: TypeMapping = {
1387
+ message: { type: 'Message', isSingle: true },
1388
+
1389
+ reaction: { type: 'Reaction', isSingle: true },
1390
+ };
1391
+ return decode(typeMappings, input);
1392
+ };
1393
+
1394
+ decoders.ReactionResponse = (input?: Record<string, any>) => {
1395
+ const typeMappings: TypeMapping = {
1396
+ created_at: { type: 'DatetimeType', isSingle: true },
1397
+
1398
+ updated_at: { type: 'DatetimeType', isSingle: true },
1399
+
1400
+ user: { type: 'UserResponse', isSingle: true },
1401
+ };
1402
+ return decode(typeMappings, input);
1403
+ };
1404
+
1405
+ decoders.ReactivateUserResponse = (input?: Record<string, any>) => {
1406
+ const typeMappings: TypeMapping = {
1407
+ user: { type: 'UserResponse', isSingle: true },
1408
+ };
1409
+ return decode(typeMappings, input);
1410
+ };
1411
+
1412
+ decoders.Read = (input?: Record<string, any>) => {
1413
+ const typeMappings: TypeMapping = {
1414
+ last_read: { type: 'DatetimeType', isSingle: true },
1415
+
1416
+ user: { type: 'UserObject', isSingle: true },
1417
+ };
1418
+ return decode(typeMappings, input);
1419
+ };
1420
+
1421
+ decoders.ReadStateResponse = (input?: Record<string, any>) => {
1422
+ const typeMappings: TypeMapping = {
1423
+ last_read: { type: 'DatetimeType', isSingle: true },
1424
+
1425
+ user: { type: 'UserResponse', isSingle: true },
1426
+ };
1427
+ return decode(typeMappings, input);
1428
+ };
1429
+
1430
+ decoders.ReviewQueueItem = (input?: Record<string, any>) => {
1431
+ const typeMappings: TypeMapping = {
1432
+ created_at: { type: 'DatetimeType', isSingle: true },
1433
+
1434
+ updated_at: { type: 'DatetimeType', isSingle: true },
1435
+
1436
+ actions: { type: 'ActionLog', isSingle: false },
1437
+
1438
+ bans: { type: 'Ban', isSingle: false },
1439
+
1440
+ flags: { type: 'Flag2', isSingle: false },
1441
+
1442
+ completed_at: { type: 'NullTime', isSingle: true },
1443
+
1444
+ reviewed_at: { type: 'NullTime', isSingle: true },
1445
+
1446
+ assigned_to: { type: 'UserObject', isSingle: true },
1447
+
1448
+ entity_creator: { type: 'UserObject', isSingle: true },
1449
+
1450
+ feeds_v2_reaction: { type: 'Reaction', isSingle: true },
1451
+
1452
+ message: { type: 'Message', isSingle: true },
1453
+
1454
+ moderation_payload: { type: 'ModerationPayload', isSingle: true },
1455
+ };
1456
+ return decode(typeMappings, input);
1457
+ };
1458
+
1459
+ decoders.Role = (input?: Record<string, any>) => {
1460
+ const typeMappings: TypeMapping = {
1461
+ created_at: { type: 'DatetimeType', isSingle: true },
1462
+
1463
+ updated_at: { type: 'DatetimeType', isSingle: true },
1464
+ };
1465
+ return decode(typeMappings, input);
1466
+ };
1467
+
1468
+ decoders.SearchResult = (input?: Record<string, any>) => {
1469
+ const typeMappings: TypeMapping = {
1470
+ message: { type: 'SearchResultMessage', isSingle: true },
1471
+ };
1472
+ return decode(typeMappings, input);
1473
+ };
1474
+
1475
+ decoders.SearchResultMessage = (input?: Record<string, any>) => {
1476
+ const typeMappings: TypeMapping = {
1477
+ created_at: { type: 'DatetimeType', isSingle: true },
1478
+
1479
+ updated_at: { type: 'DatetimeType', isSingle: true },
1480
+
1481
+ latest_reactions: { type: 'Reaction', isSingle: false },
1482
+
1483
+ mentioned_users: { type: 'UserObject', isSingle: false },
1484
+
1485
+ own_reactions: { type: 'Reaction', isSingle: false },
1486
+
1487
+ reaction_groups: { type: 'ReactionGroupResponse', isSingle: false },
1488
+
1489
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1490
+
1491
+ message_text_updated_at: { type: 'DatetimeType', isSingle: true },
1492
+
1493
+ pin_expires: { type: 'DatetimeType', isSingle: true },
1494
+
1495
+ pinned_at: { type: 'DatetimeType', isSingle: true },
1496
+
1497
+ thread_participants: { type: 'UserObject', isSingle: false },
1498
+
1499
+ channel: { type: 'ChannelResponse', isSingle: true },
1500
+
1501
+ pinned_by: { type: 'UserObject', isSingle: true },
1502
+
1503
+ poll: { type: 'Poll', isSingle: true },
1504
+
1505
+ quoted_message: { type: 'Message', isSingle: true },
1506
+
1507
+ user: { type: 'UserObject', isSingle: true },
1508
+ };
1509
+ return decode(typeMappings, input);
1510
+ };
1511
+
1512
+ decoders.SendMessageResponse = (input?: Record<string, any>) => {
1513
+ const typeMappings: TypeMapping = {
1514
+ message: { type: 'MessageResponse', isSingle: true },
1515
+ };
1516
+ return decode(typeMappings, input);
1517
+ };
1518
+
1519
+ decoders.SendReactionResponse = (input?: Record<string, any>) => {
1520
+ const typeMappings: TypeMapping = {
1521
+ message: { type: 'MessageResponse', isSingle: true },
1522
+
1523
+ reaction: { type: 'ReactionResponse', isSingle: true },
1524
+ };
1525
+ return decode(typeMappings, input);
1526
+ };
1527
+
1528
+ decoders.StopLiveResponse = (input?: Record<string, any>) => {
1529
+ const typeMappings: TypeMapping = {
1530
+ call: { type: 'CallResponse', isSingle: true },
1531
+ };
1532
+ return decode(typeMappings, input);
1533
+ };
1534
+
1535
+ decoders.SubmitActionResponse = (input?: Record<string, any>) => {
1536
+ const typeMappings: TypeMapping = {
1537
+ item: { type: 'ReviewQueueItem', isSingle: true },
1538
+ };
1539
+ return decode(typeMappings, input);
1540
+ };
1541
+
1542
+ decoders.ThreadParticipant = (input?: Record<string, any>) => {
1543
+ const typeMappings: TypeMapping = {
1544
+ created_at: { type: 'DatetimeType', isSingle: true },
1545
+
1546
+ last_read_at: { type: 'DatetimeType', isSingle: true },
1547
+
1548
+ last_thread_message_at: { type: 'DatetimeType', isSingle: true },
1549
+
1550
+ left_thread_at: { type: 'DatetimeType', isSingle: true },
1551
+
1552
+ user: { type: 'UserObject', isSingle: true },
1553
+ };
1554
+ return decode(typeMappings, input);
1555
+ };
1556
+
1557
+ decoders.ThreadResponse = (input?: Record<string, any>) => {
1558
+ const typeMappings: TypeMapping = {
1559
+ created_at: { type: 'DatetimeType', isSingle: true },
1560
+
1561
+ updated_at: { type: 'DatetimeType', isSingle: true },
1562
+
1563
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1564
+
1565
+ last_message_at: { type: 'DatetimeType', isSingle: true },
1566
+
1567
+ thread_participants: { type: 'ThreadParticipant', isSingle: false },
1568
+
1569
+ channel: { type: 'ChannelResponse', isSingle: true },
1570
+
1571
+ created_by: { type: 'UserObject', isSingle: true },
1572
+
1573
+ parent_message: { type: 'Message', isSingle: true },
1574
+ };
1575
+ return decode(typeMappings, input);
1576
+ };
1577
+
1578
+ decoders.ThreadState = (input?: Record<string, any>) => {
1579
+ const typeMappings: TypeMapping = {
1580
+ created_at: { type: 'DatetimeType', isSingle: true },
1581
+
1582
+ updated_at: { type: 'DatetimeType', isSingle: true },
1583
+
1584
+ latest_replies: { type: 'Message', isSingle: false },
1585
+
1586
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1587
+
1588
+ last_message_at: { type: 'DatetimeType', isSingle: true },
1589
+
1590
+ read: { type: 'Read', isSingle: false },
1591
+
1592
+ thread_participants: { type: 'ThreadParticipant', isSingle: false },
1593
+
1594
+ channel: { type: 'Channel', isSingle: true },
1595
+
1596
+ created_by: { type: 'UserObject', isSingle: true },
1597
+
1598
+ parent_message: { type: 'Message', isSingle: true },
1599
+ };
1600
+ return decode(typeMappings, input);
1601
+ };
1602
+
1603
+ decoders.ThreadStateResponse = (input?: Record<string, any>) => {
1604
+ const typeMappings: TypeMapping = {
1605
+ created_at: { type: 'DatetimeType', isSingle: true },
1606
+
1607
+ updated_at: { type: 'DatetimeType', isSingle: true },
1608
+
1609
+ latest_replies: { type: 'Message', isSingle: false },
1610
+
1611
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1612
+
1613
+ last_message_at: { type: 'DatetimeType', isSingle: true },
1614
+
1615
+ read: { type: 'Read', isSingle: false },
1616
+
1617
+ thread_participants: { type: 'ThreadParticipant', isSingle: false },
1618
+
1619
+ channel: { type: 'ChannelResponse', isSingle: true },
1620
+
1621
+ created_by: { type: 'UserResponse', isSingle: true },
1622
+
1623
+ parent_message: { type: 'Message', isSingle: true },
1624
+ };
1625
+ return decode(typeMappings, input);
1626
+ };
1627
+
1628
+ decoders.TruncateChannelResponse = (input?: Record<string, any>) => {
1629
+ const typeMappings: TypeMapping = {
1630
+ channel: { type: 'ChannelResponse', isSingle: true },
1631
+
1632
+ message: { type: 'Message', isSingle: true },
1633
+ };
1634
+ return decode(typeMappings, input);
1635
+ };
1636
+
1637
+ decoders.UnreadCountsBatchResponse = (input?: Record<string, any>) => {
1638
+ const typeMappings: TypeMapping = {
1639
+ counts_by_user: { type: 'UnreadCountsResponse', isSingle: false },
1640
+ };
1641
+ return decode(typeMappings, input);
1642
+ };
1643
+
1644
+ decoders.UnreadCountsChannel = (input?: Record<string, any>) => {
1645
+ const typeMappings: TypeMapping = {
1646
+ last_read: { type: 'DatetimeType', isSingle: true },
1647
+ };
1648
+ return decode(typeMappings, input);
1649
+ };
1650
+
1651
+ decoders.UnreadCountsResponse = (input?: Record<string, any>) => {
1652
+ const typeMappings: TypeMapping = {
1653
+ channels: { type: 'UnreadCountsChannel', isSingle: false },
1654
+
1655
+ threads: { type: 'UnreadCountsThread', isSingle: false },
1656
+ };
1657
+ return decode(typeMappings, input);
1658
+ };
1659
+
1660
+ decoders.UnreadCountsThread = (input?: Record<string, any>) => {
1661
+ const typeMappings: TypeMapping = {
1662
+ last_read: { type: 'DatetimeType', isSingle: true },
1663
+ };
1664
+ return decode(typeMappings, input);
1665
+ };
1666
+
1667
+ decoders.UpdateCallMembersResponse = (input?: Record<string, any>) => {
1668
+ const typeMappings: TypeMapping = {
1669
+ members: { type: 'MemberResponse', isSingle: false },
1670
+ };
1671
+ return decode(typeMappings, input);
1672
+ };
1673
+
1674
+ decoders.UpdateCallResponse = (input?: Record<string, any>) => {
1675
+ const typeMappings: TypeMapping = {
1676
+ members: { type: 'MemberResponse', isSingle: false },
1677
+
1678
+ call: { type: 'CallResponse', isSingle: true },
1679
+ };
1680
+ return decode(typeMappings, input);
1681
+ };
1682
+
1683
+ decoders.UpdateCallTypeResponse = (input?: Record<string, any>) => {
1684
+ const typeMappings: TypeMapping = {
1685
+ created_at: { type: 'DatetimeType', isSingle: true },
1686
+
1687
+ updated_at: { type: 'DatetimeType', isSingle: true },
1688
+ };
1689
+ return decode(typeMappings, input);
1690
+ };
1691
+
1692
+ decoders.UpdateChannelPartialResponse = (input?: Record<string, any>) => {
1693
+ const typeMappings: TypeMapping = {
1694
+ members: { type: 'ChannelMemberResponse', isSingle: false },
1695
+
1696
+ channel: { type: 'ChannelResponse', isSingle: true },
1697
+ };
1698
+ return decode(typeMappings, input);
1699
+ };
1700
+
1701
+ decoders.UpdateChannelResponse = (input?: Record<string, any>) => {
1702
+ const typeMappings: TypeMapping = {
1703
+ members: { type: 'ChannelMember', isSingle: false },
1704
+
1705
+ channel: { type: 'ChannelResponse', isSingle: true },
1706
+
1707
+ message: { type: 'Message', isSingle: true },
1708
+ };
1709
+ return decode(typeMappings, input);
1710
+ };
1711
+
1712
+ decoders.UpdateChannelTypeResponse = (input?: Record<string, any>) => {
1713
+ const typeMappings: TypeMapping = {
1714
+ created_at: { type: 'DatetimeType', isSingle: true },
1715
+
1716
+ updated_at: { type: 'DatetimeType', isSingle: true },
1717
+ };
1718
+ return decode(typeMappings, input);
1719
+ };
1720
+
1721
+ decoders.UpdateCommandResponse = (input?: Record<string, any>) => {
1722
+ const typeMappings: TypeMapping = {
1723
+ command: { type: 'Command', isSingle: true },
1724
+ };
1725
+ return decode(typeMappings, input);
1726
+ };
1727
+
1728
+ decoders.UpdateMessagePartialResponse = (input?: Record<string, any>) => {
1729
+ const typeMappings: TypeMapping = {
1730
+ message: { type: 'Message', isSingle: true },
1731
+ };
1732
+ return decode(typeMappings, input);
1733
+ };
1734
+
1735
+ decoders.UpdateMessageResponse = (input?: Record<string, any>) => {
1736
+ const typeMappings: TypeMapping = {
1737
+ message: { type: 'Message', isSingle: true },
1738
+ };
1739
+ return decode(typeMappings, input);
1740
+ };
1741
+
1742
+ decoders.UpdateThreadPartialResponse = (input?: Record<string, any>) => {
1743
+ const typeMappings: TypeMapping = {
1744
+ thread: { type: 'ThreadResponse', isSingle: true },
1745
+ };
1746
+ return decode(typeMappings, input);
1747
+ };
1748
+
1749
+ decoders.UpdateUsersResponse = (input?: Record<string, any>) => {
1750
+ const typeMappings: TypeMapping = {
1751
+ users: { type: 'FullUserResponse', isSingle: false },
1752
+ };
1753
+ return decode(typeMappings, input);
1754
+ };
1755
+
1756
+ decoders.UpsertConfigResponse = (input?: Record<string, any>) => {
1757
+ const typeMappings: TypeMapping = {
1758
+ config: { type: 'ConfigResponse', isSingle: true },
1759
+ };
1760
+ return decode(typeMappings, input);
1761
+ };
1762
+
1763
+ decoders.UpsertModerationTemplateResponse = (input?: Record<string, any>) => {
1764
+ const typeMappings: TypeMapping = {
1765
+ created_at: { type: 'DatetimeType', isSingle: true },
1766
+
1767
+ updated_at: { type: 'DatetimeType', isSingle: true },
1768
+ };
1769
+ return decode(typeMappings, input);
1770
+ };
1771
+
1772
+ decoders.UpsertPushProviderResponse = (input?: Record<string, any>) => {
1773
+ const typeMappings: TypeMapping = {
1774
+ push_provider: { type: 'PushProviderResponse', isSingle: true },
1775
+ };
1776
+ return decode(typeMappings, input);
1777
+ };
1778
+
1779
+ decoders.UserBlock = (input?: Record<string, any>) => {
1780
+ const typeMappings: TypeMapping = {
1781
+ created_at: { type: 'DatetimeType', isSingle: true },
1782
+ };
1783
+ return decode(typeMappings, input);
1784
+ };
1785
+
1786
+ decoders.UserMute = (input?: Record<string, any>) => {
1787
+ const typeMappings: TypeMapping = {
1788
+ created_at: { type: 'DatetimeType', isSingle: true },
1789
+
1790
+ updated_at: { type: 'DatetimeType', isSingle: true },
1791
+
1792
+ expires: { type: 'DatetimeType', isSingle: true },
1793
+
1794
+ target: { type: 'UserObject', isSingle: true },
1795
+
1796
+ user: { type: 'UserObject', isSingle: true },
1797
+ };
1798
+ return decode(typeMappings, input);
1799
+ };
1800
+
1801
+ decoders.UserMuteResponse = (input?: Record<string, any>) => {
1802
+ const typeMappings: TypeMapping = {
1803
+ created_at: { type: 'DatetimeType', isSingle: true },
1804
+
1805
+ updated_at: { type: 'DatetimeType', isSingle: true },
1806
+
1807
+ expires: { type: 'DatetimeType', isSingle: true },
1808
+
1809
+ target: { type: 'UserResponse', isSingle: true },
1810
+
1811
+ user: { type: 'UserResponse', isSingle: true },
1812
+ };
1813
+ return decode(typeMappings, input);
1814
+ };
1815
+
1816
+ decoders.UserObject = (input?: Record<string, any>) => {
1817
+ const typeMappings: TypeMapping = {
1818
+ ban_expires: { type: 'DatetimeType', isSingle: true },
1819
+
1820
+ created_at: { type: 'DatetimeType', isSingle: true },
1821
+
1822
+ deactivated_at: { type: 'DatetimeType', isSingle: true },
1823
+
1824
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1825
+
1826
+ last_active: { type: 'DatetimeType', isSingle: true },
1827
+
1828
+ revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
1829
+
1830
+ updated_at: { type: 'DatetimeType', isSingle: true },
1831
+
1832
+ push_notifications: { type: 'PushNotificationSettings', isSingle: true },
1833
+ };
1834
+ return decode(typeMappings, input);
1835
+ };
1836
+
1837
+ decoders.UserResponse = (input?: Record<string, any>) => {
1838
+ const typeMappings: TypeMapping = {
1839
+ created_at: { type: 'DatetimeType', isSingle: true },
1840
+
1841
+ updated_at: { type: 'DatetimeType', isSingle: true },
1842
+
1843
+ devices: { type: 'Device', isSingle: false },
1844
+
1845
+ ban_expires: { type: 'DatetimeType', isSingle: true },
1846
+
1847
+ deactivated_at: { type: 'DatetimeType', isSingle: true },
1848
+
1849
+ deleted_at: { type: 'DatetimeType', isSingle: true },
1850
+
1851
+ last_active: { type: 'DatetimeType', isSingle: true },
1852
+
1853
+ revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
1854
+
1855
+ push_notifications: {
1856
+ type: 'PushNotificationSettingsResponse',
1857
+ isSingle: true,
1858
+ },
1859
+ };
1860
+ return decode(typeMappings, input);
1861
+ };
1862
+
1863
+ decoders.WSEvent = (input?: Record<string, any>) => {
1864
+ const typeMappings: TypeMapping = {
1865
+ created_at: { type: 'DatetimeType', isSingle: true },
1866
+
1867
+ channel: { type: 'ChannelResponse', isSingle: true },
1868
+
1869
+ created_by: { type: 'UserObject', isSingle: true },
1870
+
1871
+ me: { type: 'OwnUser', isSingle: true },
1872
+
1873
+ member: { type: 'ChannelMember', isSingle: true },
1874
+
1875
+ message: { type: 'Message', isSingle: true },
1876
+
1877
+ poll: { type: 'Poll', isSingle: true },
1878
+
1879
+ poll_vote: { type: 'PollVote', isSingle: true },
1880
+
1881
+ reaction: { type: 'Reaction', isSingle: true },
1882
+
1883
+ thread: { type: 'ThreadResponse', isSingle: true },
1884
+
1885
+ user: { type: 'UserObject', isSingle: true },
1886
+ };
1887
+ return decode(typeMappings, input);
1888
+ };
1889
+
1890
+ decoders.WrappedUnreadCountsResponse = (input?: Record<string, any>) => {
1891
+ const typeMappings: TypeMapping = {
1892
+ channels: { type: 'UnreadCountsChannel', isSingle: false },
1893
+
1894
+ threads: { type: 'UnreadCountsThread', isSingle: false },
1895
+ };
1896
+ return decode(typeMappings, input);
1897
+ };