Skip to content

Commit cd6dc79

Browse files
committed
feat: add signer language, cancel sign request reason (box/box-openapi#584) (box#1343)
1 parent b058b94 commit cd6dc79

8 files changed

Lines changed: 89 additions & 10 deletions

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "bfb97cc", "specHash": "ccdb456", "version": "10.3.0" }
1+
{ "engineHash": "bfb97cc", "specHash": "77eac4b", "version": "10.3.0" }

src/managers/folders.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,10 @@ export interface GetFolderByIdQueryParams {
293293
/**
294294
* The offset of the item at which to begin the response.
295295
*
296-
* Queries with offset parameter value
297-
* exceeding 10000 will be rejected
298-
* with a 400 response. */
296+
* Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
297+
* those cases, reduce the number of items in the folder (for example, by
298+
* restructuring the folder into smaller subfolders) before retrying the
299+
* request. */
299300
readonly offset?: number;
300301
/**
301302
* The maximum number of items to return per page. */
@@ -684,9 +685,8 @@ export interface GetFolderItemsQueryParams {
684685
/**
685686
* The offset of the item at which to begin the response.
686687
*
687-
* Queries with offset parameter value
688-
* exceeding 10000 will be rejected
689-
* with a 400 response. */
688+
* Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
689+
* those cases, use marker-based pagination by setting `usemarker` to `true`. */
690690
readonly offset?: number;
691691
/**
692692
* The maximum number of items to return per page. */

src/managers/signRequests.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { serializeSignRequest } from '../schemas/signRequest';
22
import { deserializeSignRequest } from '../schemas/signRequest';
33
import { serializeClientError } from '../schemas/clientError';
44
import { deserializeClientError } from '../schemas/clientError';
5+
import { serializeSignRequestCancelRequest } from '../schemas/signRequestCancelRequest';
6+
import { deserializeSignRequestCancelRequest } from '../schemas/signRequestCancelRequest';
57
import { serializeSignRequests } from '../schemas/signRequests';
68
import { deserializeSignRequests } from '../schemas/signRequests';
79
import { serializeSignRequestCreateRequest } from '../schemas/signRequestCreateRequest';
810
import { deserializeSignRequestCreateRequest } from '../schemas/signRequestCreateRequest';
911
import { ResponseFormat } from '../networking/fetchOptions';
1012
import { SignRequest } from '../schemas/signRequest';
1113
import { ClientError } from '../schemas/clientError';
14+
import { SignRequestCancelRequest } from '../schemas/signRequestCancelRequest';
1215
import { SignRequests } from '../schemas/signRequests';
1316
import { SignRequestCreateRequest } from '../schemas/signRequestCreateRequest';
1417
import { BoxSdkError } from '../box/errors';
@@ -29,14 +32,24 @@ import { sdIsString } from '../serialization/json';
2932
import { sdIsList } from '../serialization/json';
3033
import { sdIsMap } from '../serialization/json';
3134
export class CancelSignRequestOptionals {
35+
readonly requestBody?: SignRequestCancelRequest = void 0;
3236
readonly headers: CancelSignRequestHeaders = new CancelSignRequestHeaders({});
3337
readonly cancellationToken?: CancellationToken = void 0;
3438
constructor(
35-
fields: Omit<CancelSignRequestOptionals, 'headers' | 'cancellationToken'> &
39+
fields: Omit<
40+
CancelSignRequestOptionals,
41+
'requestBody' | 'headers' | 'cancellationToken'
42+
> &
3643
Partial<
37-
Pick<CancelSignRequestOptionals, 'headers' | 'cancellationToken'>
44+
Pick<
45+
CancelSignRequestOptionals,
46+
'requestBody' | 'headers' | 'cancellationToken'
47+
>
3848
>,
3949
) {
50+
if (fields.requestBody !== undefined) {
51+
this.requestBody = fields.requestBody;
52+
}
4053
if (fields.headers !== undefined) {
4154
this.headers = fields.headers;
4255
}
@@ -46,6 +59,7 @@ export class CancelSignRequestOptionals {
4659
}
4760
}
4861
export interface CancelSignRequestOptionalsInput {
62+
readonly requestBody?: SignRequestCancelRequest;
4963
readonly headers?: CancelSignRequestHeaders;
5064
readonly cancellationToken?: CancellationToken;
5165
}
@@ -280,9 +294,11 @@ export class SignRequestsManager {
280294
): Promise<SignRequest> {
281295
const optionals: CancelSignRequestOptionals =
282296
new CancelSignRequestOptionals({
297+
requestBody: optionalsInput.requestBody,
283298
headers: optionalsInput.headers,
284299
cancellationToken: optionalsInput.cancellationToken,
285300
});
301+
const requestBody: any = optionals.requestBody;
286302
const headers: any = optionals.headers;
287303
const cancellationToken: any = optionals.cancellationToken;
288304
const headersMap: {
@@ -299,6 +315,10 @@ export class SignRequestsManager {
299315
) as string,
300316
method: 'POST',
301317
headers: headersMap,
318+
data: !(requestBody == void 0)
319+
? serializeSignRequestCancelRequest(requestBody)
320+
: void 0,
321+
contentType: 'application/json',
302322
responseFormat: 'json' as ResponseFormat,
303323
auth: this.auth,
304324
networkSession: this.networkSession,

src/schemas/aiExtractStructuredResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface AiExtractStructuredResponse {
2424
* The reason the response finishes. */
2525
readonly completionReason?: string;
2626
/**
27-
* The confidence score numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted. */
27+
* The confidence score levels and numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted. */
2828
readonly confidenceScore?: {
2929
readonly [key: string]: any;
3030
};

src/schemas/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export * from './shieldInformationBarrierReportDetails';
138138
export * from './shieldInformationBarrierSegmentMemberBase';
139139
export * from './shieldInformationBarrierSegmentRestrictionBase';
140140
export * from './shieldInformationBarrierSegmentRestrictionMini';
141+
export * from './signRequestCancelRequest';
141142
export * from './signRequestCreateSigner';
142143
export * from './signRequestPrefillTag';
143144
export * from './signRequestBase';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { BoxSdkError } from '../box/errors';
2+
import { SerializedData } from '../serialization/json';
3+
import { sdIsEmpty } from '../serialization/json';
4+
import { sdIsBoolean } from '../serialization/json';
5+
import { sdIsNumber } from '../serialization/json';
6+
import { sdIsString } from '../serialization/json';
7+
import { sdIsList } from '../serialization/json';
8+
import { sdIsMap } from '../serialization/json';
9+
export interface SignRequestCancelRequest {
10+
/**
11+
* An optional reason for cancelling the sign request. */
12+
readonly reason?: string;
13+
readonly rawData?: SerializedData;
14+
}
15+
export function serializeSignRequestCancelRequest(
16+
val: SignRequestCancelRequest,
17+
): SerializedData {
18+
return { ['reason']: val.reason };
19+
}
20+
export function deserializeSignRequestCancelRequest(
21+
val: SerializedData,
22+
): SignRequestCancelRequest {
23+
if (!sdIsMap(val)) {
24+
throw new BoxSdkError({
25+
message: 'Expecting a map for "SignRequestCancelRequest"',
26+
});
27+
}
28+
if (!(val.reason == void 0) && !sdIsString(val.reason)) {
29+
throw new BoxSdkError({
30+
message:
31+
'Expecting string for "reason" of type "SignRequestCancelRequest"',
32+
});
33+
}
34+
const reason: undefined | string = val.reason == void 0 ? void 0 : val.reason;
35+
return { reason: reason } satisfies SignRequestCancelRequest;
36+
}

src/schemas/signRequestCreateSigner.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ export interface SignRequestCreateSigner {
7474
/**
7575
* If true, no emails about the sign request will be sent. */
7676
readonly suppressNotifications?: boolean | null;
77+
/**
78+
* The language of the user, formatted in modified version of the
79+
* [ISO 639-1](https://developer.box.com/guides/api-calls/language-codes) format. */
80+
readonly language?: string | null;
7781
readonly rawData?: SerializedData;
7882
}
7983
export function serializeSignRequestCreateSignerRoleField(
@@ -119,6 +123,7 @@ export function serializeSignRequestCreateSigner(
119123
['password']: val.password,
120124
['signer_group_id']: val.signerGroupId,
121125
['suppress_notifications']: val.suppressNotifications,
126+
['language']: val.language,
122127
};
123128
}
124129
export function deserializeSignRequestCreateSigner(
@@ -233,6 +238,14 @@ export function deserializeSignRequestCreateSigner(
233238
}
234239
const suppressNotifications: undefined | boolean =
235240
val.suppress_notifications == void 0 ? void 0 : val.suppress_notifications;
241+
if (!(val.language == void 0) && !sdIsString(val.language)) {
242+
throw new BoxSdkError({
243+
message:
244+
'Expecting string for "language" of type "SignRequestCreateSigner"',
245+
});
246+
}
247+
const language: undefined | string =
248+
val.language == void 0 ? void 0 : val.language;
236249
return {
237250
email: email,
238251
role: role,
@@ -246,5 +259,6 @@ export function deserializeSignRequestCreateSigner(
246259
password: password,
247260
signerGroupId: signerGroupId,
248261
suppressNotifications: suppressNotifications,
262+
language: language,
249263
} satisfies SignRequestCreateSigner;
250264
}

src/schemas/signRequestSigner.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,13 @@ export function deserializeSignRequestSigner(
336336
}
337337
const suppressNotifications: undefined | boolean =
338338
val.suppress_notifications == void 0 ? void 0 : val.suppress_notifications;
339+
if (!(val.language == void 0) && !sdIsString(val.language)) {
340+
throw new BoxSdkError({
341+
message: 'Expecting string for "language" of type "SignRequestSigner"',
342+
});
343+
}
344+
const language: undefined | string =
345+
val.language == void 0 ? void 0 : val.language;
339346
return {
340347
hasViewedDocument: hasViewedDocument,
341348
signerDecision: signerDecision,
@@ -355,5 +362,6 @@ export function deserializeSignRequestSigner(
355362
password: password,
356363
signerGroupId: signerGroupId,
357364
suppressNotifications: suppressNotifications,
365+
language: language,
358366
} satisfies SignRequestSigner;
359367
}

0 commit comments

Comments
 (0)