Skip to content

Commit

Permalink
feat: add Hubs Beta (box/box-openapi#453) (#333)
Browse files Browse the repository at this point in the history
Co-authored-by: box-sdk-build <[email protected]>
  • Loading branch information
box-sdk-build and box-sdk-build authored Sep 6, 2024
1 parent cfd8988 commit 40359c7
Show file tree
Hide file tree
Showing 12 changed files with 908 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "2994c4a", "specHash": "739d87b", "version": "1.5.1" }
{ "engineHash": "2994c4a", "specHash": "6ca858e", "version": "1.5.1" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ General explanations of the available functionality and examples of how to use
the SDK are available by topic:

- [Ai](ai.md)
- [App item associations](appItemAssociations.md)
- [Authorization](authorization.md)
- [Avatars](avatars.md)
- [Chunked uploads](chunkedUploads.md)
Expand Down
64 changes: 64 additions & 0 deletions docs/appItemAssociations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# AppItemAssociationsManager

- [List file app item associations](#list-file-app-item-associations)
- [List folder app item associations](#list-folder-app-item-associations)

## List file app item associations

**This is a beta feature, which means that its availability might be limited.**
Returns all app items the file is associated with. This includes app items
associated with ancestors of the file. Assuming the context user has access
to the file, the type/ids are revealed even if the context user does not
have **View** permission on the app item.

This operation is performed by calling function `getFileAppItemAssociations`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-files-id-app-item-associations/).

_Currently we don't have an example for calling `getFileAppItemAssociations` in integration tests_

### Arguments

- fileId `string`
- 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"
- optionalsInput `GetFileAppItemAssociationsOptionalsInput`
-

### Returns

This function returns a value of type `AppItemAssociations`.

Returns a collection of app item objects. If there are no
app items on this file, an empty collection will be returned.
This list includes app items on ancestors of this File.

## List folder app item associations

**This is a beta feature, which means that its availability might be limited.**
Returns all app items the folder is associated with. This includes app items
associated with ancestors of the folder. Assuming the context user has access
to the folder, the type/ids are revealed even if the context user does not
have **View** permission on the app item.

This operation is performed by calling function `getFolderAppItemAssociations`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-folders-id-app-item-associations/).

_Currently we don't have an example for calling `getFolderAppItemAssociations` in integration tests_

### Arguments

- folderId `string`
- The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345"
- optionalsInput `GetFolderAppItemAssociationsOptionalsInput`
-

### Returns

This function returns a value of type `AppItemAssociations`.

Returns a collection of app item objects. If there are no
app items on this folder an empty collection will be returned.
This list includes app items on ancestors of this folder.
7 changes: 7 additions & 0 deletions src/client.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BaseUrlsInput } from './networking/baseUrls.generated.js';
import { AuthorizationManager } from './managers/authorization.generated.js';
import { FilesManager } from './managers/files.generated.js';
import { TrashedFilesManager } from './managers/trashedFiles.generated.js';
import { AppItemAssociationsManager } from './managers/appItemAssociations.generated.js';
import { DownloadsManager } from './managers/downloads.generated.js';
import { UploadsManager } from './managers/uploads.generated.js';
import { ChunkedUploadsManager } from './managers/chunkedUploads.generated.js';
Expand Down Expand Up @@ -90,6 +91,7 @@ export class BoxClient {
readonly authorization: AuthorizationManager;
readonly files: FilesManager;
readonly trashedFiles: TrashedFilesManager;
readonly appItemAssociations: AppItemAssociationsManager;
readonly downloads: DownloadsManager;
readonly uploads: UploadsManager;
readonly chunkedUploads: ChunkedUploadsManager;
Expand Down Expand Up @@ -162,6 +164,7 @@ export class BoxClient {
| 'authorization'
| 'files'
| 'trashedFiles'
| 'appItemAssociations'
| 'downloads'
| 'uploads'
| 'chunkedUploads'
Expand Down Expand Up @@ -256,6 +259,10 @@ export class BoxClient {
auth: this.auth,
networkSession: this.networkSession,
});
this.appItemAssociations = new AppItemAssociationsManager({
auth: this.auth,
networkSession: this.networkSession,
});
this.downloads = new DownloadsManager({
auth: this.auth,
networkSession: this.networkSession,
Expand Down
Loading

0 comments on commit 40359c7

Please sign in to comment.