Skip to content

Commit 1cbb124

Browse files
feat: Add Archive Public API (box/box-openapi#540) (#674)
1 parent 52c4e2f commit 1cbb124

11 files changed

+792
-21
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "43a5daf", "specHash": "eaa9cf0", "version": "1.16.0" }
1+
{ "engineHash": "ac37b50", "specHash": "c27c421", "version": "1.16.0" }

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ the SDK are available by topic:
88
- [Ai](ai.md)
99
- [Ai studio](aiStudio.md)
1010
- [App item associations](appItemAssociations.md)
11+
- [Archives](archives.md)
1112
- [Authorization](authorization.md)
1213
- [Avatars](avatars.md)
1314
- [Chunked uploads](chunkedUploads.md)

docs/archives.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# ArchivesManager
2+
3+
- [List archives](#list-archives)
4+
- [Create archive](#create-archive)
5+
- [Delete archive](#delete-archive)
6+
7+
## List archives
8+
9+
Retrieves archives for an enterprise.
10+
11+
This operation is performed by calling function `getArchivesV2025R0`.
12+
13+
See the endpoint docs at
14+
[API Reference](https://developer.box.com/reference/v2025.0/get-archives/).
15+
16+
_Currently we don't have an example for calling `getArchivesV2025R0` in integration tests_
17+
18+
### Arguments
19+
20+
- queryParams `GetArchivesV2025R0QueryParams`
21+
- Query parameters of getArchivesV2025R0 method
22+
- headersInput `GetArchivesV2025R0HeadersInput`
23+
- Headers of getArchivesV2025R0 method
24+
- cancellationToken `undefined | CancellationToken`
25+
- Token used for request cancellation.
26+
27+
### Returns
28+
29+
This function returns a value of type `ArchivesV2025R0`.
30+
31+
Returns a list of archives in the enterprise.
32+
33+
## Create archive
34+
35+
Creates an archive.
36+
37+
This operation is performed by calling function `createArchiveV2025R0`.
38+
39+
See the endpoint docs at
40+
[API Reference](https://developer.box.com/reference/v2025.0/post-archives/).
41+
42+
_Currently we don't have an example for calling `createArchiveV2025R0` in integration tests_
43+
44+
### Arguments
45+
46+
- requestBody `CreateArchiveV2025R0RequestBody`
47+
- Request body of createArchiveV2025R0 method
48+
- optionalsInput `CreateArchiveV2025R0OptionalsInput`
49+
50+
### Returns
51+
52+
This function returns a value of type `ArchiveV2025R0`.
53+
54+
Returns a new archive object.
55+
56+
## Delete archive
57+
58+
Permanently deletes an archive.
59+
60+
This operation is performed by calling function `deleteArchiveByIdV2025R0`.
61+
62+
See the endpoint docs at
63+
[API Reference](https://developer.box.com/reference/v2025.0/delete-archives-id/).
64+
65+
_Currently we don't have an example for calling `deleteArchiveByIdV2025R0` in integration tests_
66+
67+
### Arguments
68+
69+
- archiveId `string`
70+
- The ID of the archive. Example: "982312"
71+
- optionalsInput `DeleteArchiveByIdV2025R0OptionalsInput`
72+
73+
### Returns
74+
75+
This function returns a value of type `undefined`.
76+
77+
Returns an empty response when the archive has been deleted.

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client.generated.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import { HubsManager } from './managers/hubs.generated.js';
8080
import { HubCollaborationsManager } from './managers/hubCollaborations.generated.js';
8181
import { HubItemsManager } from './managers/hubItems.generated.js';
8282
import { ShieldListsManager } from './managers/shieldLists.generated.js';
83+
import { ArchivesManager } from './managers/archives.generated.js';
8384
import { Authentication } from './networking/auth.generated.js';
8485
import { NetworkSession } from './networking/network.generated.js';
8586
import { BoxSdkError } from './box/errors.js';
@@ -179,6 +180,7 @@ export class BoxClient {
179180
readonly hubCollaborations: HubCollaborationsManager;
180181
readonly hubItems: HubItemsManager;
181182
readonly shieldLists: ShieldListsManager;
183+
readonly archives: ArchivesManager;
182184
constructor(
183185
fields: Omit<
184186
BoxClient,
@@ -260,6 +262,7 @@ export class BoxClient {
260262
| 'hubCollaborations'
261263
| 'hubItems'
262264
| 'shieldLists'
265+
| 'archives'
263266
| 'networkSession'
264267
| 'makeRequest'
265268
| 'withAsUserHeader'
@@ -596,6 +599,10 @@ export class BoxClient {
596599
auth: this.auth,
597600
networkSession: this.networkSession,
598601
});
602+
this.archives = new ArchivesManager({
603+
auth: this.auth,
604+
networkSession: this.networkSession,
605+
});
599606
}
600607
/**
601608
* Make a custom http request using the client authentication and network session.

0 commit comments

Comments
 (0)