Skip to content

Commit 2f311c9

Browse files
feat: pack optional arguments of API methods into a new record(box/box-codegen#471) (#156)
1 parent 9939ea9 commit 2f311c9

File tree

163 files changed

+12732
-4953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+12732
-4953
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "267eec8", "specHash": "1698c95", "version": "0.5.3" }
1+
{ "engineHash": "81071a6", "specHash": "1698c95", "version": "0.5.3" }

docs/authorization.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ _Currently we don't have an example for calling `authorizeUser` in integration t
2626

2727
- queryParams `AuthorizeUserQueryParams`
2828
- Query parameters of authorizeUser method
29-
- headersInput `AuthorizeUserHeadersInput`
30-
- Headers of authorizeUser method
31-
- cancellationToken `undefined | CancellationToken`
32-
- Token used for request cancellation.
29+
- optionalsInput `AuthorizeUserOptionalsInput`
30+
-
3331

3432
### Returns
3533

@@ -63,10 +61,8 @@ _Currently we don't have an example for calling `requestAccessToken` in integrat
6361

6462
- requestBody `PostOAuth2Token`
6563
- Request body of requestAccessToken method
66-
- headersInput `RequestAccessTokenHeadersInput`
67-
- Headers of requestAccessToken method
68-
- cancellationToken `undefined | CancellationToken`
69-
- Token used for request cancellation.
64+
- optionalsInput `RequestAccessTokenOptionalsInput`
65+
-
7066

7167
### Returns
7268

@@ -91,10 +87,8 @@ _Currently we don't have an example for calling `refreshAccessToken` in integrat
9187

9288
- requestBodyInput `PostOAuth2TokenRefreshAccessTokenInput`
9389
- Request body of refreshAccessToken method
94-
- headersInput `RefreshAccessTokenHeadersInput`
95-
- Headers of refreshAccessToken method
96-
- cancellationToken `undefined | CancellationToken`
97-
- Token used for request cancellation.
90+
- optionalsInput `RefreshAccessTokenOptionalsInput`
91+
-
9892

9993
### Returns
10094

@@ -120,10 +114,8 @@ _Currently we don't have an example for calling `revokeAccessToken` in integrati
120114

121115
- requestBody `PostOAuth2Revoke`
122116
- Request body of revokeAccessToken method
123-
- headersInput `RevokeAccessTokenHeadersInput`
124-
- Headers of revokeAccessToken method
125-
- cancellationToken `undefined | CancellationToken`
126-
- Token used for request cancellation.
117+
- optionalsInput `RevokeAccessTokenOptionalsInput`
118+
-
127119

128120
### Returns
129121

docs/avatars.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ await client.avatars.getUserAvatar(user.id);
2323

2424
- userId `string`
2525
- The ID of the user. Example: "12345"
26-
- headersInput `GetUserAvatarHeadersInput`
27-
- Headers of getUserAvatar method
28-
- cancellationToken `undefined | CancellationToken`
29-
- Token used for request cancellation.
26+
- optionalsInput `GetUserAvatarOptionalsInput`
27+
-
3028

3129
### Returns
3230

@@ -63,10 +61,8 @@ await client.avatars.createUserAvatar(user.id, {
6361
- The ID of the user. Example: "12345"
6462
- requestBody `CreateUserAvatarRequestBody`
6563
- Request body of createUserAvatar method
66-
- headersInput `CreateUserAvatarHeadersInput`
67-
- Headers of createUserAvatar method
68-
- cancellationToken `undefined | CancellationToken`
69-
- Token used for request cancellation.
64+
- optionalsInput `CreateUserAvatarOptionalsInput`
65+
-
7066

7167
### Returns
7268

@@ -96,10 +92,8 @@ await client.avatars.deleteUserAvatar(user.id);
9692

9793
- userId `string`
9894
- The ID of the user. Example: "12345"
99-
- headersInput `DeleteUserAvatarHeadersInput`
100-
- Headers of deleteUserAvatar method
101-
- cancellationToken `undefined | CancellationToken`
102-
- Token used for request cancellation.
95+
- optionalsInput `DeleteUserAvatarOptionalsInput`
96+
-
10397

10498
### Returns
10599

docs/chunkedUploads.md

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ await this.createFileUploadSession(
2929
fileSize: fileSize,
3030
folderId: parentFolderId,
3131
} satisfies CreateFileUploadSessionRequestBody,
32-
{} satisfies CreateFileUploadSessionHeadersInput,
33-
cancellationToken
32+
{
33+
headers: new CreateFileUploadSessionHeaders({}),
34+
cancellationToken: cancellationToken,
35+
} satisfies CreateFileUploadSessionOptionalsInput
3436
);
3537
```
3638

3739
### Arguments
3840

3941
- requestBody `CreateFileUploadSessionRequestBody`
4042
- Request body of createFileUploadSession method
41-
- headersInput `CreateFileUploadSessionHeadersInput`
42-
- Headers of createFileUploadSession method
43-
- cancellationToken `undefined | CancellationToken`
44-
- Token used for request cancellation.
43+
- optionalsInput `CreateFileUploadSessionOptionalsInput`
44+
-
4545

4646
### Returns
4747

@@ -66,10 +66,8 @@ _Currently we don't have an example for calling `createFileUploadSessionForExist
6666
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345"
6767
- requestBody `CreateFileUploadSessionForExistingFileRequestBody`
6868
- Request body of createFileUploadSessionForExistingFile method
69-
- headersInput `CreateFileUploadSessionForExistingFileHeadersInput`
70-
- Headers of createFileUploadSessionForExistingFile method
71-
- cancellationToken `undefined | CancellationToken`
72-
- Token used for request cancellation.
69+
- optionalsInput `CreateFileUploadSessionForExistingFileOptionalsInput`
70+
-
7371

7472
### Returns
7573

@@ -89,21 +87,18 @@ See the endpoint docs at
8987
<!-- sample get_files_upload_sessions_id -->
9088

9189
```ts
92-
await this.getFileUploadSessionById(
93-
uploadSessionId,
94-
{} satisfies GetFileUploadSessionByIdHeadersInput,
95-
cancellationToken
96-
);
90+
await this.getFileUploadSessionById(uploadSessionId, {
91+
headers: new GetFileUploadSessionByIdHeaders({}),
92+
cancellationToken: cancellationToken,
93+
} satisfies GetFileUploadSessionByIdOptionalsInput);
9794
```
9895

9996
### Arguments
10097

10198
- uploadSessionId `string`
10299
- The ID of the upload session. Example: "D5E3F7A"
103-
- headersInput `GetFileUploadSessionByIdHeadersInput`
104-
- Headers of getFileUploadSessionById method
105-
- cancellationToken `undefined | CancellationToken`
106-
- Token used for request cancellation.
100+
- optionalsInput `GetFileUploadSessionByIdOptionalsInput`
101+
-
107102

108103
### Returns
109104

@@ -141,8 +136,8 @@ await this.uploadFilePart(
141136
- Request body of uploadFilePart method
142137
- headersInput `UploadFilePartHeadersInput`
143138
- Headers of uploadFilePart method
144-
- cancellationToken `undefined | CancellationToken`
145-
- Token used for request cancellation.
139+
- optionalsInput `UploadFilePartOptionalsInput`
140+
-
146141

147142
### Returns
148143

@@ -167,10 +162,8 @@ _Currently we don't have an example for calling `deleteFileUploadSessionById` in
167162

168163
- uploadSessionId `string`
169164
- The ID of the upload session. Example: "D5E3F7A"
170-
- headersInput `DeleteFileUploadSessionByIdHeadersInput`
171-
- Headers of deleteFileUploadSessionById method
172-
- cancellationToken `undefined | CancellationToken`
173-
- Token used for request cancellation.
165+
- optionalsInput `DeleteFileUploadSessionByIdOptionalsInput`
166+
-
174167

175168
### Returns
176169

@@ -192,24 +185,19 @@ See the endpoint docs at
192185
<!-- sample get_files_upload_sessions_id_parts -->
193186

194187
```ts
195-
await this.getFileUploadSessionParts(
196-
uploadSessionId,
197-
{} satisfies GetFileUploadSessionPartsQueryParams,
198-
{} satisfies GetFileUploadSessionPartsHeadersInput,
199-
cancellationToken
200-
);
188+
await this.getFileUploadSessionParts(uploadSessionId, {
189+
queryParams: {} satisfies GetFileUploadSessionPartsQueryParams,
190+
headers: new GetFileUploadSessionPartsHeaders({}),
191+
cancellationToken: cancellationToken,
192+
} satisfies GetFileUploadSessionPartsOptionalsInput);
201193
```
202194

203195
### Arguments
204196

205197
- uploadSessionId `string`
206198
- The ID of the upload session. Example: "D5E3F7A"
207-
- queryParams `GetFileUploadSessionPartsQueryParams`
208-
- Query parameters of getFileUploadSessionParts method
209-
- headersInput `GetFileUploadSessionPartsHeadersInput`
210-
- Headers of getFileUploadSessionParts method
211-
- cancellationToken `undefined | CancellationToken`
212-
- Token used for request cancellation.
199+
- optionalsInput `GetFileUploadSessionPartsOptionalsInput`
200+
-
213201

214202
### Returns
215203

@@ -234,7 +222,9 @@ await this.createFileUploadSessionCommit(
234222
uploadSessionId,
235223
{ parts: parts } satisfies CreateFileUploadSessionCommitRequestBody,
236224
{ digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput,
237-
cancellationToken
225+
{
226+
cancellationToken: cancellationToken,
227+
} satisfies CreateFileUploadSessionCommitOptionalsInput
238228
);
239229
```
240230

@@ -246,8 +236,8 @@ await this.createFileUploadSessionCommit(
246236
- Request body of createFileUploadSessionCommit method
247237
- headersInput `CreateFileUploadSessionCommitHeadersInput`
248238
- Headers of createFileUploadSessionCommit method
249-
- cancellationToken `undefined | CancellationToken`
250-
- Token used for request cancellation.
239+
- optionalsInput `CreateFileUploadSessionCommitOptionalsInput`
240+
-
251241

252242
### Returns
253243

docs/classifications.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ await client.classifications.addClassification([
7676

7777
- requestBody `readonly AddClassificationRequestBody[]`
7878
- Request body of addClassification method
79-
- headersInput `AddClassificationHeadersInput`
80-
- Headers of addClassification method
81-
- cancellationToken `undefined | CancellationToken`
82-
- Token used for request cancellation.
79+
- optionalsInput `AddClassificationOptionalsInput`
80+
-
8381

8482
### Returns
8583

@@ -126,10 +124,8 @@ await client.classifications.updateClassification([
126124

127125
- requestBody `readonly UpdateClassificationRequestBody[]`
128126
- Request body of updateClassification method
129-
- headersInput `UpdateClassificationHeadersInput`
130-
- Headers of updateClassification method
131-
- cancellationToken `undefined | CancellationToken`
132-
- Token used for request cancellation.
127+
- optionalsInput `UpdateClassificationOptionalsInput`
128+
-
133129

134130
### Returns
135131

@@ -160,10 +156,8 @@ _Currently we don't have an example for calling `createClassificationTemplate` i
160156

161157
- requestBodyInput `CreateClassificationTemplateRequestBodyInput`
162158
- Request body of createClassificationTemplate method
163-
- headersInput `CreateClassificationTemplateHeadersInput`
164-
- Headers of createClassificationTemplate method
165-
- cancellationToken `undefined | CancellationToken`
166-
- Token used for request cancellation.
159+
- optionalsInput `CreateClassificationTemplateOptionalsInput`
160+
-
167161

168162
### Returns
169163

docs/collaborationAllowlistEntries.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ await client.collaborationAllowlistEntries.createCollaborationWhitelistEntry({
5959

6060
- requestBody `CreateCollaborationWhitelistEntryRequestBody`
6161
- Request body of createCollaborationWhitelistEntry method
62-
- headersInput `CreateCollaborationWhitelistEntryHeadersInput`
63-
- Headers of createCollaborationWhitelistEntry method
64-
- cancellationToken `undefined | CancellationToken`
65-
- Token used for request cancellation.
62+
- optionalsInput `CreateCollaborationWhitelistEntryOptionalsInput`
63+
-
6664

6765
### Returns
6866

@@ -92,10 +90,8 @@ await client.collaborationAllowlistEntries.getCollaborationWhitelistEntryById(
9290

9391
- collaborationWhitelistEntryId `string`
9492
- The ID of the entry in the list. Example: "213123"
95-
- headersInput `GetCollaborationWhitelistEntryByIdHeadersInput`
96-
- Headers of getCollaborationWhitelistEntryById method
97-
- cancellationToken `undefined | CancellationToken`
98-
- Token used for request cancellation.
93+
- optionalsInput `GetCollaborationWhitelistEntryByIdOptionalsInput`
94+
-
9995

10096
### Returns
10197

@@ -125,10 +121,8 @@ await client.collaborationAllowlistEntries.deleteCollaborationWhitelistEntryById
125121

126122
- collaborationWhitelistEntryId `string`
127123
- The ID of the entry in the list. Example: "213123"
128-
- headersInput `DeleteCollaborationWhitelistEntryByIdHeadersInput`
129-
- Headers of deleteCollaborationWhitelistEntryById method
130-
- cancellationToken `undefined | CancellationToken`
131-
- Token used for request cancellation.
124+
- optionalsInput `DeleteCollaborationWhitelistEntryByIdOptionalsInput`
125+
-
132126

133127
### Returns
134128

docs/collaborationAllowlistExemptTargets.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ await client.collaborationAllowlistExemptTargets.createCollaborationWhitelistExe
6262

6363
- requestBody `CreateCollaborationWhitelistExemptTargetRequestBody`
6464
- Request body of createCollaborationWhitelistExemptTarget method
65-
- headersInput `CreateCollaborationWhitelistExemptTargetHeadersInput`
66-
- Headers of createCollaborationWhitelistExemptTarget method
67-
- cancellationToken `undefined | CancellationToken`
68-
- Token used for request cancellation.
65+
- optionalsInput `CreateCollaborationWhitelistExemptTargetOptionalsInput`
66+
-
6967

7068
### Returns
7169

@@ -95,10 +93,8 @@ await client.collaborationAllowlistExemptTargets.getCollaborationWhitelistExempt
9593

9694
- collaborationWhitelistExemptTargetId `string`
9795
- The ID of the exemption to the list. Example: "984923"
98-
- headersInput `GetCollaborationWhitelistExemptTargetByIdHeadersInput`
99-
- Headers of getCollaborationWhitelistExemptTargetById method
100-
- cancellationToken `undefined | CancellationToken`
101-
- Token used for request cancellation.
96+
- optionalsInput `GetCollaborationWhitelistExemptTargetByIdOptionalsInput`
97+
-
10298

10399
### Returns
104100

@@ -128,10 +124,8 @@ await client.collaborationAllowlistExemptTargets.deleteCollaborationWhitelistExe
128124

129125
- collaborationWhitelistExemptTargetId `string`
130126
- The ID of the exemption to the list. Example: "984923"
131-
- headersInput `DeleteCollaborationWhitelistExemptTargetByIdHeadersInput`
132-
- Headers of deleteCollaborationWhitelistExemptTargetById method
133-
- cancellationToken `undefined | CancellationToken`
134-
- Token used for request cancellation.
127+
- optionalsInput `DeleteCollaborationWhitelistExemptTargetByIdOptionalsInput`
128+
-
135129

136130
### Returns
137131

docs/collections.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ await client.collections.getCollectionItems(favouriteCollection.id!);
5656

5757
- collectionId `string`
5858
- The ID of the collection. Example: "926489"
59-
- queryParams `GetCollectionItemsQueryParams`
60-
- Query parameters of getCollectionItems method
61-
- headersInput `GetCollectionItemsHeadersInput`
62-
- Headers of getCollectionItems method
63-
- cancellationToken `undefined | CancellationToken`
64-
- Token used for request cancellation.
59+
- optionalsInput `GetCollectionItemsOptionalsInput`
60+
-
6561

6662
### Returns
6763

0 commit comments

Comments
 (0)