Skip to content

Commit 73efff2

Browse files
authored
feat: update to api spec v151.0.1 (#80)
1 parent 01cfd52 commit 73efff2

File tree

4 files changed

+79
-24
lines changed

4 files changed

+79
-24
lines changed

src/gen/common/CommonApi.ts

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
CheckSQSRequest,
1212
CheckSQSResponse,
1313
CreateBlockListRequest,
14+
CreateBlockListResponse,
1415
CreateDeviceRequest,
1516
CreateExternalStorageRequest,
1617
CreateExternalStorageResponse,
@@ -59,6 +60,7 @@ import {
5960
UnblockUsersResponse,
6061
UpdateAppRequest,
6162
UpdateBlockListRequest,
63+
UpdateBlockListResponse,
6264
UpdateExternalStorageRequest,
6365
UpdateExternalStorageResponse,
6466
UpdateUsersPartialRequest,
@@ -141,10 +143,16 @@ export class CommonApi extends BaseApi {
141143
return { ...response.body, metadata: response.metadata };
142144
};
143145

144-
listBlockLists = async (): Promise<StreamResponse<ListBlockListResponse>> => {
146+
listBlockLists = async (request?: {
147+
team?: string;
148+
}): Promise<StreamResponse<ListBlockListResponse>> => {
149+
const queryParams = {
150+
team: request?.team,
151+
};
152+
145153
const response = await this.sendRequest<
146154
StreamResponse<ListBlockListResponse>
147-
>('GET', '/api/v2/blocklists', undefined, undefined);
155+
>('GET', '/api/v2/blocklists', undefined, queryParams);
148156

149157
decoders.ListBlockListResponse?.(response.body);
150158

@@ -153,29 +161,30 @@ export class CommonApi extends BaseApi {
153161

154162
createBlockList = async (
155163
request: CreateBlockListRequest,
156-
): Promise<StreamResponse<Response>> => {
164+
): Promise<StreamResponse<CreateBlockListResponse>> => {
157165
const body = {
158166
name: request?.name,
159167
words: request?.words,
168+
team: request?.team,
160169
type: request?.type,
161170
};
162171

163-
const response = await this.sendRequest<StreamResponse<Response>>(
164-
'POST',
165-
'/api/v2/blocklists',
166-
undefined,
167-
undefined,
168-
body,
169-
);
172+
const response = await this.sendRequest<
173+
StreamResponse<CreateBlockListResponse>
174+
>('POST', '/api/v2/blocklists', undefined, undefined, body);
170175

171-
decoders.Response?.(response.body);
176+
decoders.CreateBlockListResponse?.(response.body);
172177

173178
return { ...response.body, metadata: response.metadata };
174179
};
175180

176181
deleteBlockList = async (request: {
177182
name: string;
183+
team?: string;
178184
}): Promise<StreamResponse<Response>> => {
185+
const queryParams = {
186+
team: request?.team,
187+
};
179188
const pathParams = {
180189
name: request?.name,
181190
};
@@ -184,7 +193,7 @@ export class CommonApi extends BaseApi {
184193
'DELETE',
185194
'/api/v2/blocklists/{name}',
186195
pathParams,
187-
undefined,
196+
queryParams,
188197
);
189198

190199
decoders.Response?.(response.body);
@@ -194,14 +203,18 @@ export class CommonApi extends BaseApi {
194203

195204
getBlockList = async (request: {
196205
name: string;
206+
team?: string;
197207
}): Promise<StreamResponse<GetBlockListResponse>> => {
208+
const queryParams = {
209+
team: request?.team,
210+
};
198211
const pathParams = {
199212
name: request?.name,
200213
};
201214

202215
const response = await this.sendRequest<
203216
StreamResponse<GetBlockListResponse>
204-
>('GET', '/api/v2/blocklists/{name}', pathParams, undefined);
217+
>('GET', '/api/v2/blocklists/{name}', pathParams, queryParams);
205218

206219
decoders.GetBlockListResponse?.(response.body);
207220

@@ -210,23 +223,20 @@ export class CommonApi extends BaseApi {
210223

211224
updateBlockList = async (
212225
request: UpdateBlockListRequest & { name: string },
213-
): Promise<StreamResponse<Response>> => {
226+
): Promise<StreamResponse<UpdateBlockListResponse>> => {
214227
const pathParams = {
215228
name: request?.name,
216229
};
217230
const body = {
231+
team: request?.team,
218232
words: request?.words,
219233
};
220234

221-
const response = await this.sendRequest<StreamResponse<Response>>(
222-
'PUT',
223-
'/api/v2/blocklists/{name}',
224-
pathParams,
225-
undefined,
226-
body,
227-
);
235+
const response = await this.sendRequest<
236+
StreamResponse<UpdateBlockListResponse>
237+
>('PUT', '/api/v2/blocklists/{name}', pathParams, undefined, body);
228238

229-
decoders.Response?.(response.body);
239+
decoders.UpdateBlockListResponse?.(response.body);
230240

231241
return { ...response.body, metadata: response.metadata };
232242
};

src/gen/model-decoders/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,13 @@ decoders.ConfigResponse = (input?: Record<string, any>) => {
505505
return decode(typeMappings, input);
506506
};
507507

508+
decoders.CreateBlockListResponse = (input?: Record<string, any>) => {
509+
const typeMappings: TypeMapping = {
510+
blocklist: { type: 'BlockListResponse', isSingle: true },
511+
};
512+
return decode(typeMappings, input);
513+
};
514+
508515
decoders.CreateCallTypeResponse = (input?: Record<string, any>) => {
509516
const typeMappings: TypeMapping = {
510517
created_at: { type: 'DatetimeType', isSingle: true },
@@ -1860,6 +1867,13 @@ decoders.UnreadCountsThread = (input?: Record<string, any>) => {
18601867
return decode(typeMappings, input);
18611868
};
18621869

1870+
decoders.UpdateBlockListResponse = (input?: Record<string, any>) => {
1871+
const typeMappings: TypeMapping = {
1872+
blocklist: { type: 'BlockListResponse', isSingle: true },
1873+
};
1874+
return decode(typeMappings, input);
1875+
};
1876+
18631877
decoders.UpdateCallMembersResponse = (input?: Record<string, any>) => {
18641878
const typeMappings: TypeMapping = {
18651879
members: { type: 'MemberResponse', isSingle: false },

src/gen/models/index.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ export interface AppResponseFields {
199199

200200
moderation_enabled: boolean;
201201

202+
moderation_multitenant_blocklist_enabled: boolean;
203+
202204
moderation_webhook_url: string;
203205

204206
multi_tenant_enabled: boolean;
@@ -543,6 +545,10 @@ export interface BlockListResponse {
543545

544546
created_at?: Date;
545547

548+
id?: string;
549+
550+
team?: string;
551+
546552
updated_at?: Date;
547553
}
548554

@@ -556,6 +562,8 @@ export interface BlockListRule {
556562
| 'bounce_remove';
557563

558564
name: string;
565+
566+
team: string;
559567
}
560568

561569
export interface BlockUserRequest {
@@ -797,6 +805,8 @@ export interface CallHLSBroadcastingStartedEvent {
797805

798806
hls_playlist_url: string;
799807

808+
call: CallResponse;
809+
800810
type: string;
801811
}
802812

@@ -2262,6 +2272,8 @@ export interface CheckRequest {
22622272

22632273
entity_type: string;
22642274

2275+
config_team?: string;
2276+
22652277
test_mode?: boolean;
22662278

22672279
user_id?: string;
@@ -2442,9 +2454,17 @@ export interface CreateBlockListRequest {
24422454

24432455
words: string[];
24442456

2457+
team?: string;
2458+
24452459
type?: 'regex' | 'domain' | 'email' | 'word';
24462460
}
24472461

2462+
export interface CreateBlockListResponse {
2463+
duration: string;
2464+
2465+
blocklist?: BlockListResponse;
2466+
}
2467+
24482468
export interface CreateCallTypeRequest {
24492469
name: string;
24502470

@@ -6746,8 +6766,6 @@ export interface ReportByHistogramBucket {
67466766

67476767
count: number;
67486768

6749-
mean: number;
6750-
67516769
sum: number;
67526770

67536771
lower_bound?: Bound;
@@ -6774,6 +6792,8 @@ export interface RestoreUsersRequest {
67746792
}
67756793

67766794
export interface ReviewQueueItem {
6795+
ai_text_severity: string;
6796+
67776797
bounce_count: number;
67786798

67796799
content_changed: boolean;
@@ -6830,6 +6850,8 @@ export interface ReviewQueueItem {
68306850
}
68316851

68326852
export interface ReviewQueueItemResponse {
6853+
ai_text_severity: string;
6854+
68336855
created_at: Date;
68346856

68356857
entity_id: string;
@@ -7985,9 +8007,17 @@ export interface UpdateAppRequest {
79858007
}
79868008

79878009
export interface UpdateBlockListRequest {
8010+
team?: string;
8011+
79888012
words?: string[];
79898013
}
79908014

8015+
export interface UpdateBlockListResponse {
8016+
duration: string;
8017+
8018+
blocklist?: BlockListResponse;
8019+
}
8020+
79918021
export interface UpdateCallMembersRequest {
79928022
remove_members?: string[];
79938023

src/gen/moderation/ModerationApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class ModerationApi extends BaseApi {
7474
entity_creator_id: request?.entity_creator_id,
7575
entity_id: request?.entity_id,
7676
entity_type: request?.entity_type,
77+
config_team: request?.config_team,
7778
test_mode: request?.test_mode,
7879
user_id: request?.user_id,
7980
moderation_payload: request?.moderation_payload,

0 commit comments

Comments
 (0)