From 70c80ad420e01810b42399621defa41c255db51e Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Thu, 20 Feb 2025 06:41:57 -0800
Subject: [PATCH 01/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 496d04ed..231225d2 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "8a9cc1d", "specHash": "f20ba3f", "version": "0.5.0" }
+{ "engineHash": "22f85cc", "specHash": "f20ba3f", "version": "0.5.0" }
From 8d261e1de91809345b29f9afb1d015f1117fd8c6 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Fri, 21 Feb 2025 03:14:36 -0800
Subject: [PATCH 02/18] docs: Documentation for Java SDK (box/box-codegen#664)
---
.codegen.json | 2 +-
README.md | 79 +++++-
docs/Authentication.md | 365 +++++++++++++++++++++++++++
docs/Client.md | 178 +++++++++++++
docs/Configuration.md | 51 ++++
migration-guide.md | 560 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 1230 insertions(+), 5 deletions(-)
create mode 100644 docs/Authentication.md
create mode 100644 docs/Client.md
create mode 100644 docs/Configuration.md
create mode 100644 migration-guide.md
diff --git a/.codegen.json b/.codegen.json
index 231225d2..d197d53b 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "22f85cc", "specHash": "f20ba3f", "version": "0.5.0" }
+{ "engineHash": "5c674a3", "specHash": "f20ba3f", "version": "0.5.0" }
diff --git a/README.md b/README.md
index bcdd7420..c0b91691 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,15 @@
-# Box Java SDK GENERATED
+# Box Java SDK Gen
-We are excited to introduce the Beta Release of the latest generation of Box Java SDK, designed to elevate the developer experience and streamline your integration with the Box Content Cloud.
+[](http://opensource.box.com/badges)
+
+
+
+[](https://coveralls.io/github/box/box-java-sdk-gen?branch=main)
+
+We are excited to introduce the Beta Release of the latest generation of Box Java SDK Gen, designed to elevate the developer experience and streamline your integration with the Box Content Cloud.
With this SDK, you’ll have access to:
@@ -21,9 +27,18 @@ Embrace the new generation of Box SDKs and unlock the full potential of the Box
+- [Box Java SDK Gen](#box-java-sdk-gen)
+- [Table of contents](#table-of-contents)
- [Installing](#installing)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
+- [Upgrades](#upgrades)
+- [Integration Tests](#integration-tests)
+ - [Running integration tests locally](#running-integration-tests-locally)
+ - [Create Platform Application](#create-platform-application)
+ - [Export configuration](#export-configuration)
+ - [Start integration tests](#start-integration-tests)
+- [3rd Party Libraries \& Licenses](#3rd-party-libraries--licenses)
- [Questions, Bugs, and Feature Requests?](#questions-bugs-and-feature-requests)
- [Copyright and License](#copyright-and-license)
@@ -39,7 +54,23 @@ To generate a .jar file download the source code and run the following command:
.jar file will be generated in the build/libs directory.
-Unfortunately, .jar file is not yet available in any artifactory. It will be available there when SDK reaches beta phase.
+The SDK is also available on [Maven Central Repository](https://mvnrepository.com/artifact/com.box/box-java-sdk-gen). To include the SDK in your project, add the following dependency to your `pom.xml` file:
+
+```xml
+
+ com.box
+ box-java-sdk-gen
+ VERSION
+
+```
+
+To include the SDK in your project using Gradle, add the following dependency to your `build.gradle` file:
+
+```gradle
+implementation 'com.box:box-java-sdk-gen:VERSION'
+```
+
+Where `VERSION` is the version of the SDK you want to use. You can find the latest version in the [Maven Central Repository](https://mvnrepository.com/artifact/com.box/box-java-sdk-gen).
# Getting Started
@@ -55,13 +86,53 @@ The example below demonstrates how to authenticate with Developer Token and prin
```java
BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN");
BoxClient client = new BoxClient(auth);
+client.folders.getFolderItems("0").getEntries().forEach(item -> {
+ System.out.println(item.toString());
+});
```
# Documentation
Browse the [docs](docs/README.md) or see [API Reference](https://developer.box.com/reference/) for more information.
-## 3rd Party Libraries & Licenses
+# Upgrades
+
+The SDK is updated regularly to include new features, enhancements, and bug fixes. If you are upgrading from our legacy SDKs to this new generation SDKs is a straightforward process. Checkout the [migration guide](MIGRATION_GUIDE.md) and [changelog](CHANGELOG.md) for more information.
+
+# Integration Tests
+
+## Running integration tests locally
+
+### Create Platform Application
+
+To run integration tests locally you will need a `Custom App` created in the [Box Developer
+Console](https://app.box.com/developers/console) with `Server Authentication (with JWT)` selected as authentication method.
+Once created you can edit properties of the application:
+
+- In section `App Access Level` select `App + Enterprise Access`. You can enable all `Application Scopes`.
+- In section `Advanced Features` enable `Make API calls using the as-user header` and `Generate user access tokens`.
+
+Now select `Authorization` and submit application to be reviewed by account admin.
+
+### Export configuration
+
+1. Select `Configuration` tab and in the bottom in the section `App Settings`
+ download your app configuration settings as JSON.
+2. Encode configuration file to Base64, e.g. using command: `base64 -i path_to_json_file`
+3. Set environment variable: `JWT_CONFIG_BASE_64` with base64 encoded jwt configuration file
+4. Set environment variable: `BOX_FILE_REQUEST_ID` with ID of file request already created in the user account, `BOX_EXTERNAL_USER_EMAIL` with email of free external user which not belongs to any enterprise.
+5. Set environment variable: `WORKFLOW_FOLDER_ID` with the ID of the Relay workflow that deletes the file that triggered the workflow. The workflow should have a manual start to be able to start it from the API.
+6. Set environment variable: `APP_ITEM_ASSOCIATION_FILE_ID` to the ID of the file with associated app item and `APP_ITEM_ASSOCIATION_FOLDER_ID` to the ID of the folder with associated app item.
+
+### Start integration tests
+
+To run integration tests locally, you can use the following command:
+
+```console
+./gradlew test --stacktrace
+```
+
+# 3rd Party Libraries & Licenses
The Java SDK Gen uses third-party libraries that are required for usage. Their licenses are listed below:
diff --git a/docs/Authentication.md b/docs/Authentication.md
new file mode 100644
index 00000000..8c7fc6c0
--- /dev/null
+++ b/docs/Authentication.md
@@ -0,0 +1,365 @@
+# Authentication
+
+
+
+
+- [Authentication](#authentication)
+- [Authentication methods](#authentication-methods)
+ - [Developer Token](#developer-token)
+ - [JWT Auth](#jwt-auth)
+ - [Authenticate Enterprise](#authenticate-enterprise)
+ - [Authenticate user](#authenticate-user)
+ - [Client Credentials Grant](#client-credentials-grant)
+ - [Obtaining Service Account token](#obtaining-service-account-token)
+ - [Obtaining User token](#obtaining-user-token)
+ - [Switching between Service Account and User](#switching-between-service-account-and-user)
+ - [OAuth 2.0 Auth](#oauth-20-auth)
+ - [Authentication with OAuth2](#authentication-with-oauth2)
+ - [Injecting existing token into BoxOAuth](#injecting-existing-token-into-boxoauth)
+- [Retrieve current access token](#retrieve-current-access-token)
+- [Refresh access token](#refresh-access-token)
+- [Revoke token](#revoke-token)
+- [Downscope token](#downscope-token)
+- [Token storage](#token-storage)
+ - [In-memory token storage](#in-memory-token-storage)
+ - [Custom storage](#custom-storage)
+
+
+
+# Authentication methods
+
+## Developer Token
+
+The fastest way to get started using the API is with developer token. A
+developer token is simply a short-lived access token that cannot be refreshed
+and can only be used with your own account. Therefore, they're only useful for
+testing an app and aren't suitable for production. You can obtain a developer
+token from your application's [developer console][dev_console] page.
+
+To create a `BoxClient` with a developer token, construct an `BoxDeveloperTokenAuth`
+object with the `token` set to the developer token and construct the client with that.
+
+
+
+```java
+BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("YOUR-DEVELOPER-TOKEN");
+BoxClient client = new BoxClient(auth);
+```
+
+[dev_console]: https://app.box.com/developers/console
+
+## JWT Auth
+
+Before using JWT Auth make sure you set up correctly your Box platform app.
+The guide with all required steps can be found here: [Setup with JWT][jwt_guide]
+
+### Authenticate Enterprise
+
+JWT auth allows your application to authenticate itself with the Box API
+for a given enterprise. By default, your application has a [Service Account][service_account]
+that represents it and can perform API calls. The Service Account is separate
+from the Box accounts of the application developer and the enterprise admin of
+any enterprise that has authorized the app — files stored in that account are
+not accessible in any other account by default, and vice versa.
+
+If you generated your public and private keys automatically through the
+[Box Developer Console][dev_console], you can use the JSON file created there
+to configure your SDK instance and create a client to make calls as the
+Service Account. Call one of static `BoxJwtAuth` method:
+`JWTConfig.fromConfigFile("PATH_TO_CONFIG_FILE")` and pass JSON file local path
+or `JWTConfig.fromConfigJsonString(CONFIG_JSON_STRING)` and pass JSON config file content as string.
+
+```java
+JWTConfig config = JWTConfig.fromConfigFile("src/example/config/config.json");
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+Otherwise, you'll need to provide the necessary configuration fields directly to the `JWTConfig` constructor:
+
+```java
+JWTConfig config = new JWTConfig.JWTConfigBuilder("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "JWT_KEY_ID", "PRIVATE_KEY", "PRIVATE_KEY_PASSWORD")
+ .enterpriseId("123456")
+ .build();
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+### Authenticate user
+
+App auth applications also often have associated [App Users][app_user], which are
+created and managed directly by the application — they do not have normal login credentials,
+and can only be accessed through the Box API by the application that created them.
+You may authenticate as the Service Account to provision and manage users, or as an individual app user to
+make calls as that user. See the [API documentation](https://developer.box.com/)
+for detailed instructions on how to use app auth.
+
+Clients for making calls as an App User can be created with the same JSON JWT config file generated through the
+[Box Developer Console][dev_console]. Calling `jwtAuth.withUserSubject('USER_ID')` method will return a new auth object,
+which is authenticated as the user with provided id, leaving the original object unchanged.
+
+```java
+JWTConfig config = JWTConfig.fromConfigFile("src/example/config/config.json");
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxJWTAuth userAuth = auth.withUserSubject("USER_ID");
+BoxClient userClient = new BoxClient(userAuth);
+```
+
+Alternatively, clients for making calls as an App User can be created with the same `JWTConfig`
+constructor as in the above examples, similarly to creating a Service Account client. Simply pass the
+`userId` instead of `enterpriseId` when constructing the auth config instance:
+
+```java
+JWTConfig config = new JWTConfig.JWTConfigBuilder("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "JWT_KEY_ID", "PRIVATE_KEY", "PRIVATE_KEY_PASSWORD")
+ .userId("123456")
+ .build();
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+[jwt_guide]: https://developer.box.com/guides/authentication/jwt/jwt-setup/
+[service_account]: https://developer.box.com/guides/getting-started/user-types/service-account/
+[app_user]: https://developer.box.com/guides/getting-started/user-types/app-users/
+
+## Client Credentials Grant
+
+Before using Client Credentials Grant Auth make sure you set up correctly your Box platform app.
+The guide with all required steps can be found here: [Setup with Client Credentials Grant][ccg_guide]
+
+Client Credentials Grant Auth method allows you to obtain an access token by having client credentials
+and secret with enterprise or user ID, which allows you to work using service or user account.
+
+You can use `CCGAuth` to initialize a client object the same way as for other authentication types:
+
+```java
+CCGConfig config = new CCGConfig.CCGConfigBuilder("YOUR_CLIENT", "YOUR_CLIENT_SECRET")
+ .userId("USER_ID")
+ .build();
+BoxCCGAuth auth = new BoxCCGAuth(config);
+BoxClient client = new BoxClient(auth);
+
+UserFull user = client.users.getUserMe();
+System.out.println(user.getName());
+```
+
+Obtained token is valid for specified amount of time, it will be refreshed automatically by default.
+
+### Obtaining Service Account token
+
+The [Service Account](https://developer.box.com/guides/getting-started/user-types/service-account//)
+is separate from the Box accounts of the application developer and the
+enterprise admin of any enterprise that has authorized the app — files stored in that account
+are not accessible in any other account by default, and vice versa.
+To obtain service account you will have to provide enterprise ID with client id and secret:
+
+```java
+CCGConfig config = new CCGConfig.CCGConfigBuilder("YOUR_CLIENT", "YOUR_CLIENT_SECRET")
+ .enterpriseId("ENTERPRISE_ID")
+ .build();
+BoxCCGAuth auth = new BoxCCGAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+### Obtaining User token
+
+In order to enable obtaining user token you have to go to your application configuration that can be found
+[here][dev_console]. In `Configuration` tab, in section `Advanced Features`
+select `Generate user access tokens`. Do not forget to re-authorize application if it was already authorized.
+
+To obtain user account you will have to provide user ID with client id and secret.
+
+```java
+CCGConfig config = new CCGConfig.CCGConfigBuilder("YOUR_CLIENT", "YOUR_CLIENT_SECRET")
+ .userId("USER_ID")
+ .build();
+BoxCCGAuth auth = new BoxCCGAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+### Switching between Service Account and User
+
+You can easily switch to be authenticated as a Service Account or as a User.
+To create a new auth object authenticated as Service Account you can call:
+
+```java
+BoxCCGAuth enterpriseAuth = auth.withEnterpriseSubject("ENTERPRISE_ID");
+BoxClient enterpriseClient = new BoxClient(enterpriseAuth);
+```
+
+To authenticate with user subject call:
+
+```java
+BoxCCGAuth userAuth = auth.withUserSubject("USER_ID");
+BoxClient userClient = new BoxClient(userAuth);
+```
+
+The new token will be automatically fetched with a next API call.
+
+[ccg_guide]: https://developer.box.com/guides/authentication/client-credentials/client-credentials-setup/
+
+## OAuth 2.0 Auth
+
+### Authentication with OAuth2
+
+If your application needs to integrate with existing Box users who will provide
+their login credentials to grant your application access to their account, you
+will need to go through the standard OAuth2 login flow. A detailed guide for
+this process is available in the
+[Authentication with OAuth API documentation](https://developer.box.com/en/guides/authentication/oauth2/).
+
+Using an auth code is the most common way of authenticating with the Box API for
+existing Box users, to integrate with their accounts.
+Your application must provide a way for the user to login to Box (usually with a
+browser or web view) in order to obtain an auth code.
+
+
+
+```java
+BoxOAuth oauth = new OAuthConfig("CLIENT_ID", "CLIENT_SECRET");
+String authorizationUrl = auoauthth.getAuthorizeUrl();
+```
+
+After a user logs in and grants your application access to their Box account,
+they will be redirected to your application's `redirect_uri` which will contain
+an auth code. This auth code can then be used along with your client ID and
+client secret to establish an API connection.
+You need to provide the auth code to the SDK to obtain an access token.
+Calling `oauth.getTokensAuthorizationCodeGrant('code')` will exchange the auth code for an access token
+and save it in the `BoxOAuth` token storage. The SDK will automatically refresh the token when needed.
+All you need to do is create a client object with the `BoxOAuth` object and start making API calls.
+
+
+
+```java
+auth.getTokensAuthorizationCodeGrant("AUTHORIZATION_CODE");
+BoxClient client = new BoxClient(auth);
+```
+
+### Injecting existing token into BoxOAuth
+
+If you already have an access token and refresh token, you can inject them into the `BoxOAuth` token storage
+to avoid repeating the authentication process. This can be useful when you want to reuse the token
+between runs of your application.
+
+```java
+AccessToken accessToken = new AccessToken.AccessTokenBuilder()
+ .accessToken("ACCESS_TOKEN")
+ .refreshToken("REFRESH_TOKEN")
+ .build();
+auth.tokenStorage.store(accessToken);
+BoxClient client = new BoxClient(auth);
+```
+
+Alternatively, you can create a custom implementation of `TokenStorage` interface and pass it to the `BoxOAuth` object.
+See the [Custom storage](#custom-storage) section for more information.
+
+# Retrieve current access token
+
+After initializing the authentication object, the SDK will be able to retrieve the access token.
+To retrieve the current access token you can use the following code:
+
+
+
+```java
+auth.retrieveToken();
+```
+
+# Refresh access token
+
+Access tokens are short-lived and need to be refreshed periodically. The SDK will automatically refresh the token when needed.
+If you want to manually refresh the token, you can use the following code:
+
+
+
+```java
+auth.refreshToken();
+```
+
+# Revoke token
+
+Access tokens for a client can be revoked when needed. This call invalidates old token.
+For BoxCcgAuth and BoxJwtAuth you can still reuse the `auth` object to retrieve a new token.
+If you make any new call after revoking the token, a new token will be automatically retrieved.
+For BoxOAuth it would be necessary to manually go through the authentication process again.
+For BoxDeveloperTokenAuth, it is necessary to provide a DeveloperTokenConfig during initialization,
+containing the client ID and client secret.
+
+To revoke current client's tokens in the storage use the following code:
+
+
+
+```java
+auth.revokeToken();
+// client's tokens have been revoked
+```
+
+# Downscope token
+
+You can exchange a client's access token for one with a lower scope, in order
+to restrict the permissions for a child client or to pass to a less secure
+location (e.g. a browser-based app).
+
+A downscoped token does not include a refresh token.
+In such a scenario, to obtain a new downscoped token, refresh the original token
+and utilize the newly acquired token to obtain the downscoped token.
+
+More information about downscoping tokens can be found [here](https://developer.box.com/guides/authentication/tokens/downscope/).
+If you want to learn more about available scopes please go [here](https://developer.box.com/guides/api-calls/permissions-and-errors/scopes/#scopes-for-downscoping).
+
+For example to get a new token with only `item_preview` scope, restricted to a single file, suitable for the
+[Content Preview UI Element](https://developer.box.com/en/guides/embed/ui-elements/preview/) you can use the following code.
+You can also initialize `BoxDeveloperTokenAuth` with the retrieved access token and use it to create a new Client.
+
+
+
+```java
+String resource = "https://api.box.com/2.0/files/123456789";
+List scopes = List.of("item_preview");
+AccessToken downscopedToken = auth.downscopeToken(scopes, resource, null, null);
+BoxDeveloperTokenAuth downscopedAuth = new BoxDeveloperTokenAuth(downscopedToken.getAccessToken());
+BoxClient downscopedClient = new BoxClient(downscopedAuth);
+```
+
+# Token storage
+
+## In-memory token storage
+
+By default, the SDK stores the access token in volatile memory. When rerunning your application,
+the access token won't be reused from the previous run; a new token has to be obtained again.
+To use in-memory token storage, you don't need to do anything more than
+create an Auth class using AuthConfig, for example, for OAuth:
+
+```java
+OAuthConfig config = new OAuthConfig("CLIENT_ID", "CLIENT_SECRET");
+BoxOAuth auth = new BoxOAuth(config);
+```
+
+## Custom storage
+
+You can also provide a custom token storage class. All you need to do is create a class that implements `TokenStorage`
+interface and pass an instance of your class to the AuthConfig constructor.
+
+```java
+TokenStorage customTokenStorage = new TokenStorage() {
+ @Override
+ public void store(AccessToken accessToken) {
+ // Store the access token
+ }
+
+ @Override
+ public AccessToken get() {
+ // Retrieve the access token
+ return null;
+ }
+
+ @Override
+ public void clear() {
+ // Clear the access token
+ }
+};
+
+OAuthConfig config = new OAuthConfig.OAuthConfigBuilder("CLIENT_ID", "CLIENT_SECRET")
+ .tokenStorage(customTokenStorage)
+ .build();
+BoxOAuth auth = new BoxOAuth(config);
+```
diff --git a/docs/Client.md b/docs/Client.md
new file mode 100644
index 00000000..57226175
--- /dev/null
+++ b/docs/Client.md
@@ -0,0 +1,178 @@
+# Client
+
+This is the central entrypoint for all SDK interaction. The BoxClient houses all the API endpoints
+divided across resource managers.
+
+
+
+
+- [Client](#client)
+- [Make custom HTTP request](#make-custom-http-request)
+ - [JSON request](#json-request)
+ - [Multi-part request](#multi-part-request)
+ - [Binary response](#binary-response)
+- [Additional headers](#additional-headers)
+ - [As-User header](#as-user-header)
+ - [Suppress notifications](#suppress-notifications)
+ - [Custom headers](#custom-headers)
+- [Custom Base URLs](#custom-base-urls)
+- [Interceptors](#interceptors)
+
+
+
+# Make custom HTTP request
+
+You can make custom HTTP requests using the `client.makeRequest()` method.
+This method allows you to make any HTTP request to the Box API. It will automatically use authentication and
+network configuration settings from the client.
+The method accepts a `FetchOptions` object as an argument and returns a `FetchResponse` object.
+
+## JSON request
+
+The following example demonstrates how to make a custom POST request to create a new folder in the root folder.
+
+```java
+FetchOptions fetchOptions = new FetchOptions.FetchOptionsBuilder("https://api.box.com/2.0/users/me", "GET")
+ .params(new HashMap<>() {{
+ put("fields", "name");
+ }})
+ .build();
+FetchResponse response = client.makeRequest(fetchOptions);
+System.out.println("Status code: " + response.getStatus());
+System.out.println("Response body: " + response.getContent());
+```
+
+## Multi-part request
+
+The following example demonstrates how to make a custom multipart request that uploads a file to a folder.
+
+```java
+List multipartItems = List.of(
+ new MultipartItem.MultipartItemBuilder("attributes")
+ .data(JsonManager.serialize("{\"name\": \"newFileName\", \"parent\": { \"id\": \"0\" }}"))
+ .build(),
+ new MultipartItem.MultipartItemBuilder("file")
+ .fileStream(new FileInputStream(new File("file.txt")))
+ .build()
+);
+FetchOptions fetchOptions = new FetchOptions.FetchOptionsBuilder("https://upload.box.com/api/2.0/files/content", "POST")
+ .contentType("multipart/form-data")
+ .multipartData(multipartItems)
+ .build();
+
+FetchResponse response = client.makeRequest(fetchOptions);
+System.out.println("Status code: " + response.getStatus());
+System.out.println("Response body: " + response.getContent());
+```
+
+## Binary response
+
+The following example demonstrates how to make a custom request that expects a binary response.
+It is required to specify the `responseFormat` parameter in the `FetchOptions` object to "binary".
+
+```java
+FetchOptions fetchOptions = new FetchOptions.FetchOptionsBuilder("https://upload.box.com/api/2.0/files/12345/content", "GET")
+ .responseFormat(ResponseFormat.BINARY)
+ .build();
+FetchResponse response = client.makeRequest(fetchOptions);
+System.out.println("Status code: " + response.getStatus());
+System.out.println("Response body: " + response.getContent());
+```
+
+# Additional headers
+
+BoxClient provides a convenient methods, which allow passing additional headers, which will be included
+in every API call made by the client.
+
+## As-User header
+
+The As-User header is used by enterprise admins to make API calls on behalf of their enterprise's users.
+This requires the API request to pass an As-User: USER-ID header. For more details see the [documentation on As-User](https://developer.box.com/en/guides/authentication/oauth2/as-user/).
+
+The following example assume that the client has been instantiated with an access token belonging to an admin-level user
+or Service Account with appropriate privileges to make As-User calls.
+
+Calling the `client.withAsUserHeader()` method creates a new client to impersonate user with the provided ID.
+All calls made with the new client will be made in context of the impersonated user, leaving the original client unmodified.
+
+
+
+```java
+BoxClient userClient = client.withAsUserHeader('1234567');
+```
+
+## Suppress notifications
+
+If you are making administrative API calls (that is, your application has “Manage an Enterprise”
+scope, and the user signing in is a co-admin with the correct "Edit settings for your company"
+permission) then you can suppress both email and webhook notifications. This can be used, for
+example, for a virus-scanning tool to download copies of everyone’s files in an enterprise,
+without every collaborator on the file getting an email. All actions will still appear in users'
+updates feed and audit logs.
+
+> **Note:** This functionality is only available for approved applications.
+
+Calling the `client.withSuppressedNotifications()` method creates a new client.
+For all calls made with the new client the notifications will be suppressed.
+
+```java
+BoxClient newClient = client.withSuppressedNotifications();
+```
+
+## Custom headers
+
+You can also specify the custom set of headers, which will be included in every API call made by client.
+Calling the `client.withExtraHeaders()` method creates a new client, leaving the original client unmodified.
+
+```java
+BoxClient newClient = client.withExtraHeaders(new HashMap<>() {{
+ put("X-My-Header", "124");
+}});
+```
+
+# Custom Base URLs
+
+You can also specify the custom base URLs, which will be used for API calls made by client.
+Calling the `client.withCustomBaseUrls()` method creates a new client, leaving the original client unmodified.
+
+```java
+BaseUrls baseUrls = new BaseUrls.BaseUrlsBuilder()
+ .baseUrl("https://new-base-url.com")
+ .uploadUrl("https://my-company-upload-url.com")
+ .oauth2Url("https://my-company.com/oauth2")
+ .build();
+BoxClient clientWithCustomBaseUrl = client.withCustomBaseUrls(baseUrls);
+```
+
+# Interceptors
+
+You can specify custom interceptors - methods that will be called just before making a request and right after
+receiving a response from the server. Using these function allows you to modify the request payload and response.
+Interceptor interface accepts two methods with the following signatures:
+
+```java
+FetchOptions beforeRequest(FetchOptions fetchOptions)
+FetchResponse afterRequest(FetchResponse fetchResponse)
+```
+
+You can apply more than one interceptor to the client by passing a list of interceptors to apply.
+Calling the `client.withInterceptors()` method creates a new client, leaving the original client unmodified.
+
+```java
+List interceptors = new ArrayList<>() {
+ {
+ add(new Interceptor() {
+ @Override
+ public FetchOptions beforeRequest(FetchOptions fetchOptions) {
+ return fetchOptions;
+ }
+
+ @Override
+ public FetchResponse afterRequest(FetchResponse fetchResponse) {
+ return fetchResponse;
+ }
+ });
+ }
+};
+BoxClient clientWithInterceptor = client.withInterceptors(interceptors);
+```
diff --git a/docs/Configuration.md b/docs/Configuration.md
new file mode 100644
index 00000000..4f6326c7
--- /dev/null
+++ b/docs/Configuration.md
@@ -0,0 +1,51 @@
+# Configuration
+
+
+
+
+- [Configuration](#configuration)
+ - [Max retry attempts](#max-retry-attempts)
+ - [Custom retry strategy](#custom-retry-strategy)
+
+
+
+## Max retry attempts
+
+The default maximum number of retries in case of failed API call is 5.
+To change this number you should initialize `BoxRetryStrategy` with the new value and pass it to `NetworkSession`.
+
+```java
+BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN");
+NetworkSession session = new NetworkSession.NetworkSessionBuilder()
+ .retryStrategy(new BoxRetryStrategy.BoxRetryStrategyBuilder().maxAttempts(3).build())
+ .build();
+BoxClient client = new BoxClient.BoxClientBuilder(auth)
+ .networkSession(session)
+ .build();
+```
+
+## Custom retry strategy
+
+You can also implement your own retry strategy by subclassing `RetryStrategy` and overriding `shouldRetry` and `retryAfter` methods.
+This example shows how to set custom strategy that retries on 5xx status codes and waits 1 second between retries.
+
+```java
+BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN");
+RetryStrategy customRetryStrategy = new RetryStrategy() {
+ @Override
+ public boolean shouldRetry(FetchOptions fetchOptions, FetchResponse fetchResponse, int attemptNumber) {
+ return fetchResponse.status >= 500;
+ }
+
+ @Override
+ public double retryAfter(FetchOptions fetchOptions, FetchResponse fetchResponse, int attemptNumber) {
+ return 1.0;
+ }
+};
+NetworkSession session = new NetworkSession.NetworkSessionBuilder()
+ .retryStrategy(customRetryStrategy)
+ .build();
+BoxClient client = new BoxClient.BoxClientBuilder(auth)
+ .networkSession(session)
+ .build();
+```
diff --git a/migration-guide.md b/migration-guide.md
new file mode 100644
index 00000000..4616de62
--- /dev/null
+++ b/migration-guide.md
@@ -0,0 +1,560 @@
+# Migration guide from `box-java-sdk` to `box-java-sdk-gen`
+
+
+
+
+- [Migration guide from `box-java-sdk` to `box-java-sdk-gen`](#migration-guide-from-box-java-sdk-to-box-java-sdk-gen)
+ - [Introduction](#introduction)
+ - [Installation](#installation)
+ - [Maven](#maven)
+ - [Gradle](#gradle)
+ - [Key differences](#key-differences)
+ - [Manager approach](#manager-approach)
+ - [Immutable design](#immutable-design)
+ - [Consistent method signature](#consistent-method-signature)
+ - [Authentication](#authentication)
+ - [Developer Token](#developer-token)
+ - [JWT Auth](#jwt-auth)
+ - [Using JWT configuration file](#using-jwt-configuration-file)
+ - [Providing JWT configuration manually](#providing-jwt-configuration-manually)
+ - [Authenticate user](#authenticate-user)
+ - [Client Credentials Grant](#client-credentials-grant)
+ - [Obtaining Service Account token](#obtaining-service-account-token)
+ - [Obtaining User token](#obtaining-user-token)
+ - [Switching between Service Account and User](#switching-between-service-account-and-user)
+ - [OAuth 2.0 Auth](#oauth-20-auth)
+ - [Get Authorization URL](#get-authorization-url)
+ - [Authenticate](#authenticate)
+ - [Store token and retrieve token callbacks](#store-token-and-retrieve-token-callbacks)
+ - [Downscope token](#downscope-token)
+ - [Revoke token](#revoke-token)
+ - [Configuration](#configuration)
+ - [As-User header](#as-user-header)
+ - [Custom Base URLs](#custom-base-urls)
+
+
+
+## Introduction
+
+The new `box-java-sdk-gen` SDK library, which helps Java developers to conveniently integrate with Box API.
+In the contrary to the previous library (`box-java-sdk`), it is not manually maintained, but auto-generated
+based on Open API Specification. This means you can leverage the most up-to-date Box API features in your
+applications without delay. More information and benefits of using the new can be found in the
+[README](https://github.com/box/box-java-sdk-gen/blob/main/README.md) file.
+
+## Installation
+
+To install a new Box Java SDK GENERATED library, you can use Maven or Gradle. The library is available in the
+[Maven Central Repository](https://search.maven.org/artifact/com.box/box-java-sdk-gen).
+
+The new Box Java SDK GENERATED library could be used in the same project along with the legacy one.
+If you want to use a feature available only in the new SDK, you don't need to necessarily migrate all your code
+to use Box Java SDK GENERATED at once. You can use a new feature from the new library,
+while keeping the rest of your code unchanged. Note that it may be required to use fully qualified class names
+from the new SDK to avoid conflicts with the old one. However, we recommend to fully migrate to the new SDK eventually.
+
+### Maven
+
+To add a dependency to your Maven project, add the following to your `pom.xml` file:
+
+```xml
+
+ com.box
+ box-java-sdk-gen
+ VERSION
+
+```
+
+### Gradle
+
+To add a dependency to your Gradle project, add the following to your `build.gradle` file:
+
+```groovy
+implementation 'com.box:box-java-sdk-gen:VERSION'
+```
+
+## Key differences
+
+### Manager approach
+
+The main difference between the old SDK and the new one is the way how API methods are aggregated into objects.
+
+**Old (`box-java-sdk`)**
+
+Firstly, in the old SDK to be able to perform any action on an API object, e.g. `User`, you first had to create its class.
+To do it is required to call:
+
+```java
+BoxUser user = new BoxUser(api, "12345");
+```
+
+to create a class representing an already existing User with id '12345', or create a new one with a call:
+
+```java
+BoxUser.Info createdUserInfo = BoxUser.createAppUser(api, "A User");
+BoxUser user = new BoxUser(api, createdUserInfo.getID());
+```
+
+Then, you could perform any action on created class, which will affect the user, e.g.
+
+```java
+BoxUser.Info info = user.new Info();
+info.setName(name);
+user.updateInfo(info);
+```
+
+**New (`box-java-sdk-gen`)**
+
+In the new SDK the API methods are grouped into dedicated manager classes, e.g. `User` object
+has dedicated `UserManager` class. Each manager class instance is available in `BoxClient` object.
+The fields storing references to the managers are named in the plural form of the resource that the
+manager handles - `client.users` for `UsersManager`. If you want to perform any operation
+connected with a `User` you need to call a respective method of `UserManager`.
+For example, to get info about existing user you need to call:
+
+```java
+UserFull user = client.users.getUsersById("12345");
+```
+
+or to create a new user:
+
+```java
+CreateUserRequestBody requestBody =
+ new CreateUserRequestBody.CreateUserRequestBodyBuilder("John Doe").build();
+UserFull user = client.users.createUser(requestBody);
+```
+
+The `UserFull` object returned by both of these methods is a data class - it does not contain any methods to call.
+To perform any action on `User` object, you need to still use a `UserManager` method for that.
+Usually these methods have a first argument, which accepts id of the object you want to access,
+e.g. to update a user name, call method:
+
+```java
+UpdateUserByIdRequestBody requestBody =
+ new UpdateUserByIdRequestBody.UpdateUserByIdRequestBodyBuilder().name("Marry").build();
+UserFull updatedUser = client.users.updateUserById(user.getId(), requestBody);
+```
+
+### Immutable design
+
+The new SDK is designed to be mostly immutable. This means that methods,
+which used to modify the existing object in old SDK now return a new instance of the class with the modified state.
+This design pattern is used to avoid side effects and make the code more predictable and easier to reason about.
+Methods, which returns a new modified instance of an object, will always have a prefix `with` in their names, e.g.
+
+**New (`box-java-sdk-gen`)**
+
+```java
+BoxClient client = new BoxClient(auth);
+BoxClient asUserClient = client.withAsUserHeader("USER_ID");
+```
+
+### Consistent method signature
+
+To facilitate easier work with the new SDK, we have changed the API method signatures to be consistent and unified.
+
+**Old (`box-java-sdk`)**
+
+In the old SDK, API methods had numerous parameters, which were not grouped into any objects and were passed as separate arguments, e.g. the method for creating a sign request looked like this:
+
+```java
+public static BoxSignRequest.Info createSignRequest(BoxAPIConnection api, List sourceFiles,
+ List signers, String parentFolderId,
+ BoxSignRequestCreateParams optionalParams)
+```
+
+**New (`box-java-sdk-gen`)**
+
+In the new SDK, we have adopted an approach of aggregating parameters into types based on their nature (path, body, query, headers).
+This can be seen in the example corresponding to the above:
+
+```java
+public SignRequest createSignRequest(
+ SignRequestCreateRequest requestBody, CreateSignRequestHeaders headers)
+```
+
+According to the convention, if an API endpoint requires a parameter placed in the URL path, it will appear at the beginning of our method, such as `fileId` in this case. When a request allows for a body, as in `POST` or `PUT`, the method includes a parameter named `requestBody`. Following that, the method signature may include the `queryParams` parameter, followed by `headers`.
+
+The types of parameters `requestBody`, `queryParams`, and `headers` are specific to each endpoint and, in their definition, encompass all fields allowed by the API.
+
+It's worth noting here that when all fields of a particular type are optional, the entire parameter becomes optional as well. This allows us to pass only the parameters we actually want to provide when calling a given method, without the risk of not providing a sufficient number of parameters.
+
+## Authentication
+
+The Box Java SDK Gen library offers the same authentication methods as the legacy one.
+Let's see the differences of their usage:
+
+### Developer Token
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxAPIConnection api = new BoxAPIConnection("YOUR-DEVELOPER-TOKEN");
+```
+
+The new SDK provides a convenient `BoxDeveloperTokenAuth`, which allows authenticating
+using developer token without necessity to provide a Client ID and Client Secret
+
+**New (`box-java-sdk-gen`)**
+
+```java
+BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("YOUR-DEVELOPER-TOKEN");
+BoxClient client = new BoxClient(auth);
+```
+
+### JWT Auth
+
+#### Using JWT configuration file
+
+**Old (`box-java-sdk`)**
+
+The static method, which reads the JWT configuration file has been changed:
+
+```java
+Reader reader = new FileReader("src/example/config/config.json");
+BoxConfig boxConfig = BoxConfig.readFrom(reader);
+IAccessTokenCache tokenCache = new InMemoryLRUAccessTokenCache(100);
+BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(boxConfig, tokenCache);
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+TokenStorage tokenStorage = new InMemoryTokenStorage(); // or any other implementation of TokenStorage
+JWTConfig config = JWTConfig.fromConfigFile("src/example/config/config.json", tokenStorage);
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+#### Providing JWT configuration manually
+
+Some params in `JWTConfig` constructor have slightly different names than one in old `JWTAuth` class.
+
+**Old (`box-java-sdk`)**
+
+```java
+JWTEncryptionPreferences jwtPreferences = new JWTEncryptionPreferences();
+jwtPreferences.setPublicKeyID("PUBLIC-KEY-ID");
+jwtPreferences.setPrivateKeyPassword("PRIVATE-KEY-PASSWORD");
+jwtPreferences.setPrivateKey("PRIVATE-KEY");
+jwtPreferences.setEncryptionAlgorithm(EncryptionAlgorithm.RSA_SHA_256);
+
+IAccessTokenCache accessTokenCache = new InMemoryLRUAccessTokenCache(100);
+BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection
+ .getUserConnection("USER-ID", "CLIENT-ID","CLIENT-SECRET", jwtPreferences, accessTokenCache);
+
+BoxUser.Info userInfo = BoxUser.getCurrentUser(api).getInfo();
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+TokenStorage tokenStorage = new InMemoryTokenStorage();
+JWTConfig config = new JWTConfig.JWTConfigBuilder("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "JWT_KEY_ID", "PRIVATE_KEY", "PRIVATE_KEY_PASSWORD")
+ .enterpriseId("123456")
+ .tokenStorage(tokenStorage)
+ .build();
+BoxJWTAuth auth = new BoxJWTAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+#### Authenticate user
+
+In old SDK method for user authentication was named `BoxDeveloperEditionAPIConnection getUserConnection(String userId, BoxConfig boxConfig, IAccessTokenCache accessTokenCache)`
+and was accepting user id. The method was returning a new instance of `BoxDeveloperEditionAPIConnection` class, which was exchanging the existing token with the one with the user access.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection.getUserConnection("USER_ID", boxConfig, tokenCache);
+```
+
+**New (`box-java-sdk-gen`)**
+
+In new SDK, to authenticate as user you need to call
+`public BoxJWTAuth withUserSubject(String userId, TokenStorage tokenStorage)` method with id of the user
+to authenticate. The method returns a new instance of `BoxJWTAuth` class, which will perform authentication call
+in scope of the user on the first API call. The `tokenStorage` parameter is optional and allows to provide a custom
+token storage for the new instance of `BoxJWTAuth` class. The new auth instance can be used to create a new user client
+instance.
+
+```java
+BoxJWTAuth userAuth = auth.withUserSubject("USER_ID");
+BoxClient userClient = new BoxClient(userAuth);
+```
+
+### Client Credentials Grant
+
+#### Obtaining Service Account token
+
+To authenticate as enterprise, the only difference between the old and the new SDK,
+is using the `CCGConfig` as a middle step.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxCCGAPIConnection api = BoxCCGAPIConnection.applicationServiceAccountConnection(
+ "client_id",
+ "client_secret",
+ "enterprise_id"
+);
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+CCGConfig config = new CCGConfig.CCGConfigBuilder("YOUR_CLIENT", "YOUR_CLIENT_SECRET")
+ .enterpriseId("ENTERPRISE_ID")
+ .build();
+BoxCCGAuth auth = new BoxCCGAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+#### Obtaining User token
+
+To authenticate as user, the only difference between the old and the new SDK, is using the `CCGConfig` as a middle step.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxCCGAPIConnection api = BoxCCGAPIConnection.userConnection(
+ "client_id",
+ "client_secret",
+ "user_id"
+);
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+CCGConfig config = new CCGConfig.CCGConfigBuilder("YOUR_CLIENT", "YOUR_CLIENT_SECRET")
+ .userId("USER_ID")
+ .build();
+BoxCCGAuth auth = new BoxCCGAuth(config);
+BoxClient client = new BoxClient(auth);
+```
+
+### Switching between Service Account and User
+
+In old SDK, if you want to switch between the Service Account and User, you need to create another API connection.
+
+In the new SDK, to keep the immutability design, the methods switching authenticated subject were replaced with methods
+returning a new instance of `BoxCCGAuth` class. The new instance will fetch a new token on the next API call.
+The new auth instance can be used to create a new client instance. You can also specify `tokenStorage` parameter
+to provide a custom token storage for the new instance.
+The old instance of `BoxCCGAuth` class will remain unchanged and will still use the old token.
+
+**New (`box-java-sdk-gen`)**
+
+```java
+BoxCCGAuth userAuth = auth.withUserSubject("USER_ID");
+BoxClient userClient = new BoxClient(userAuth);
+```
+
+```java
+BoxCCGAuth entAuth = auth.withEnterpriseSubject("ENTERPRISE_ID");
+BoxClient entClient = new BoxClient(entAuth);
+```
+
+### OAuth 2.0 Auth
+
+#### Get Authorization URL
+
+To get authorization url in the new SDK, you need to first create the `BoxOAuth` class using
+`OAuthConfig` class. Then to get authorization url, call
+`public String getAuthorizeUrl(GetAuthorizeUrlOptions options)`. Note that this method accepts the instance of `GetAuthorizeUrlOptions` class, which allows specifying extra options to API call.
+
+**Old (`box-java-sdk`)**
+
+In the old SDK, we did not have any method to get the authorization URL. Instead, we had to manually create the URL.
+
+```java
+String authorizationUrl = "https://account.box.com/api/oauth2/authorize?client_id=[CLIENT_ID]&response_type=code";
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+BoxOAuth auth = new BoxOAuth(new OAuthConfig.OAuthConfigBuilder("CLIENT_ID", "CLIENT_SECRET").build());
+String authorizationUrl = auth.getAuthorizeUrl();
+```
+
+#### Authenticate
+
+The method for authenticating using the authorization code has been changed. With the old SDK, you had to provide the authorization code to the `BoxAPIConnection` class constructor. In the new SDK, you need to call the `public AccessToken getTokensAuthorizationCodeGrant(String authorizationCode)` method of the `BoxOAuth` class.
+The method now returns an AccessToken object with `accessToken` and `refreshToken` fields,
+while the old one was creating a new instance of `BoxAPIConnection` class.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxAPIConnection client = new BoxAPIConnection(
+ "[CLIENT_ID]",
+ "[CLIENT_SECRET]",
+ "[CODE]"
+);
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+auth.getTokensAuthorizationCodeGrant("AUTHORIZATION_CODE");
+BoxClient client = new BoxClient(auth);
+```
+
+### Store token and retrieve token callbacks
+
+In the new SDK you can define your own class delegated for storing and retrieving a token. It has to inherit from
+`TokenStorage` and implement all of its abstract methods. Next step would be to pass an instance of this class to the
+AuthConfig constructor.
+
+**New (`box-java-sdk-gen`)**
+
+```java
+TokenStorage customTokenStorage = new TokenStorage() {
+ @Override
+ public void store(AccessToken accessToken) {
+ // Store the access token
+ }
+
+ @Override
+ public AccessToken get() {
+ // Retrieve the access token
+ return null;
+ }
+
+ @Override
+ public void clear() {
+ // Clear the access token
+ }
+};
+
+OAuthConfig config = new OAuthConfig.OAuthConfigBuilder("CLIENT_ID", "CLIENT_SECRET")
+ .tokenStorage(customTokenStorage)
+ .build();
+BoxOAuth auth = new BoxOAuth(config);
+```
+
+or reuse one of the provided implementations: `InMemoryTokenStorage`:
+
+```java
+TokenStorage tokenStorage = new InMemoryTokenStorage();
+OAuthConfig config = new OAuthConfig.OAuthConfigBuilder("CLIENT_ID", "CLIENT_SECRET")
+ .tokenStorage(tokenStorage)
+ .build();
+BoxOAuth auth = new BoxOAuth(config);
+```
+
+### Downscope token
+
+The process of downscoping token in the new SDK is similar to the old one. The main difference is that in the new SDK
+you need to call `downscopeToken` method of the `BoxOAuth` class instead of `getLowerScopedToken` method of the `BoxAPIConnection` class.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxAPIConnection api = new BoxAPIConnection("YOUR-ACCESS-TOKEN");
+
+String resource = "https://api.box.com/2.0/files/RESOURCE-ID";
+List scopes = new ArrayList();
+scopes.add("item_preview");
+scopes.add("item_content_upload");
+
+ScopedToken token = api.getLowerScopedToken(scopes, resource);
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+String resource = "https://api.box.com/2.0/files/123456789";
+List scopes = List.of("item_preview");
+AccessToken downscopedToken = auth.downscopeToken(scopes, resource, null, null);
+BoxDeveloperTokenAuth downscopedAuth = new BoxDeveloperTokenAuth(downscopedToken.getAccessToken());
+BoxClient downscopedClient = new BoxClient(downscopedAuth);
+```
+
+### Revoke token
+
+To revoke current client's tokens in the new SDK, you need to call `revokeToken` method of the auth class instead of
+`revoke` method.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxAPIConnection api = new BoxAPIConnection("YOUR-ACCESS-TOKEN");
+api.revokeToken();
+```
+
+**New (`box-java-sdk-gen`)**
+
+```java
+client.auth.revokeToken()
+```
+
+## Configuration
+
+### As-User header
+
+The As-User header is used by enterprise admins to make API calls on behalf of their enterprise's users.
+This requires the API request to pass an `As-User: USER-ID` header. The following examples assume that the client has
+been instantiated with an access token with appropriate privileges to make As-User calls.
+
+In old SDK you could call client `asUser(String userID)` method to create a new client to impersonate the provided user.
+
+**Old (`box-java-sdk`)**
+
+```java
+BoxAPIConnection api = new BoxAPIConnection("YOUR-ACCESS-TOKEN");
+api.asUser("USER-ID");
+```
+
+**New (`box-java-sdk-gen`)**
+
+In the new SDK the method was renamed to `withAsUserHeader` in the `BoxClient` class,
+and returns a new instance of `BoxClient` class with the As-User header appended to all API calls made by the client.
+The method accepts only user id as a parameter.
+
+```java
+BoxClient userClient = client.withAsUserHeader("USER-ID");
+```
+
+Additionally `BoxClient` offers a `withExtraHeaders(Map extraHeaders)`
+method, which allows you to specify the custom set of headers, which will be included in every API call made by client.
+Calling the `client.withExtraHeaders()` method creates a new client, leaving the original client unmodified.
+
+```java
+BoxClient clientWithExtraHeaders = client.withExtraHeaders(new HashMap<>() {{
+ put("X-My-Header", "124");
+}});
+
+```
+
+### Custom Base URLs
+
+**Old (`box-java-sdk`)**
+
+In old SDK you could specify the custom base URLs, which will be used for API calls made by setting
+the new values of static variables of the `API` class.
+
+```java
+BoxAPIConnection api = new BoxAPIConnection("YOUR-DEVELOPER-TOKEN");
+api.setBaseAppUrl("https://example.app.com");
+api.setBaseURL("https://example.com");
+api.setUploadURL("https://upload.example.com");
+api.setTokenURL("https://example.com/token");
+```
+
+**New (`box-java-sdk-gen`)**
+
+In the new SDK this functionality has been implemented as part of the `BoxClient` class.
+By calling the `client.withCustomBaseUrls()` method, you can specify the custom base URLs that will be used for API
+calls made by client. Following the immutability pattern, this call creates a new client, leaving the original client unmodified.
+
+```java
+BaseUrls baseUrls = new BaseUrls.BaseUrlsBuilder()
+ .baseUrl("https://new-base-url.com")
+ .uploadUrl("https://my-company-upload-url.com")
+ .oauth2Url("https://my-company.com/oauth2")
+ .build();
+BoxClient clientWithCustomBaseUrl = client.withCustomBaseUrls(baseUrls);
+```
From 93edb0ab1d88eea22967703d08b52ebeff935a2a Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Fri, 21 Feb 2025 05:24:14 -0800
Subject: [PATCH 03/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index d197d53b..237394e4 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "5c674a3", "specHash": "f20ba3f", "version": "0.5.0" }
+{ "engineHash": "5c674a3", "specHash": "137a375", "version": "0.5.0" }
From 32fa1863ab8ce2ace2ba026e1ef3d3017c98a5d9 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Fri, 21 Feb 2025 05:26:06 -0800
Subject: [PATCH 04/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 237394e4..443e8125 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "5c674a3", "specHash": "137a375", "version": "0.5.0" }
+{ "engineHash": "5c674a3", "specHash": "06fc5f7", "version": "0.5.0" }
From 64686215d81970763633d188c9bc1e4c4dda1b75 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Mon, 24 Feb 2025 01:11:21 -0800
Subject: [PATCH 05/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 443e8125..a458348f 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "5c674a3", "specHash": "06fc5f7", "version": "0.5.0" }
+{ "engineHash": "89ce9ce", "specHash": "06fc5f7", "version": "0.5.0" }
From 7b1f518ece99bec8f97a365755ed85df7036653b Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Mon, 24 Feb 2025 05:09:32 -0800
Subject: [PATCH 06/18] test: reorder function calls to fix test samples
(box/box-codegen#666)
---
.codegen.json | 2 +-
docs/legalholdpolicies.md | 4 +-
docs/metadatatemplates.md | 2 +-
.../LegalHoldPoliciesITest.java | 48 +++++++--------
.../MetadataTemplatesITest.java | 59 +++++++++++++++++--
5 files changed, 82 insertions(+), 33 deletions(-)
diff --git a/.codegen.json b/.codegen.json
index a458348f..317e9c4d 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "89ce9ce", "specHash": "06fc5f7", "version": "0.5.0" }
+{ "engineHash": "ef00939", "specHash": "06fc5f7", "version": "0.5.0" }
diff --git a/docs/legalholdpolicies.md b/docs/legalholdpolicies.md
index 36849706..b08e2319 100644
--- a/docs/legalholdpolicies.md
+++ b/docs/legalholdpolicies.md
@@ -48,7 +48,7 @@ See the endpoint docs at
```
-client.getLegalHoldPolicies().createLegalHoldPolicy(new CreateLegalHoldPolicyRequestBody.CreateLegalHoldPolicyRequestBodyBuilder(legalHoldPolicyName).description(legalHoldDescription).isOngoing(true).build())
+client.getLegalHoldPolicies().createLegalHoldPolicy(new CreateLegalHoldPolicyRequestBody.CreateLegalHoldPolicyRequestBodyBuilder(legalHoldPolicyName).description(legalHoldDescription).filterStartedAt(filterStartedAt).filterEndedAt(filterEndedAt).isOngoing(false).build())
```
### Arguments
@@ -140,7 +140,7 @@ See the endpoint docs at
```
-client.getLegalHoldPolicies().deleteLegalHoldPolicyById(legalHoldPolicyId)
+client.getLegalHoldPolicies().deleteLegalHoldPolicyById(legalHoldPolicy.getId())
```
### Arguments
diff --git a/docs/metadatatemplates.md b/docs/metadatatemplates.md
index ab8ffebf..91937af8 100644
--- a/docs/metadatatemplates.md
+++ b/docs/metadatatemplates.md
@@ -252,7 +252,7 @@ See the endpoint docs at
```
-client.getMetadataTemplates().createMetadataTemplate(new CreateMetadataTemplateRequestBody.CreateMetadataTemplateRequestBodyBuilder("enterprise", templateKey).templateKey(templateKey).fields(Arrays.asList(new CreateMetadataTemplateRequestBodyFieldsField(CreateMetadataTemplateRequestBodyFieldsTypeField.STRING, "testName", "testName"))).build())
+client.getMetadataTemplates().createMetadataTemplate(new CreateMetadataTemplateRequestBody.CreateMetadataTemplateRequestBodyBuilder("enterprise", templateKey).templateKey(templateKey).fields(Arrays.asList(new CreateMetadataTemplateRequestBodyFieldsField(CreateMetadataTemplateRequestBodyFieldsTypeField.STRING, "testName", "testName"), new CreateMetadataTemplateRequestBodyFieldsField(CreateMetadataTemplateRequestBodyFieldsTypeField.FLOAT, "age", "age"), new CreateMetadataTemplateRequestBodyFieldsField(CreateMetadataTemplateRequestBodyFieldsTypeField.DATE, "birthDate", "birthDate"), new CreateMetadataTemplateRequestBodyFieldsField.CreateMetadataTemplateRequestBodyFieldsFieldBuilder(CreateMetadataTemplateRequestBodyFieldsTypeField.ENUM, "countryCode", "countryCode").options(Arrays.asList(new CreateMetadataTemplateRequestBodyFieldsOptionsField("US"), new CreateMetadataTemplateRequestBodyFieldsOptionsField("CA"))).build(), new CreateMetadataTemplateRequestBodyFieldsField.CreateMetadataTemplateRequestBodyFieldsFieldBuilder(CreateMetadataTemplateRequestBodyFieldsTypeField.MULTISELECT, "sports", "sports").options(Arrays.asList(new CreateMetadataTemplateRequestBodyFieldsOptionsField("basketball"), new CreateMetadataTemplateRequestBodyFieldsOptionsField("football"), new CreateMetadataTemplateRequestBodyFieldsOptionsField("tennis"))).build())).build())
```
### Arguments
diff --git a/src/test/java/com/box/sdkgen/test/legalholdpolicies/LegalHoldPoliciesITest.java b/src/test/java/com/box/sdkgen/test/legalholdpolicies/LegalHoldPoliciesITest.java
index 0c7d100e..c48120f5 100644
--- a/src/test/java/com/box/sdkgen/test/legalholdpolicies/LegalHoldPoliciesITest.java
+++ b/src/test/java/com/box/sdkgen/test/legalholdpolicies/LegalHoldPoliciesITest.java
@@ -14,6 +14,30 @@ public class LegalHoldPoliciesITest {
private static final BoxClient client = getDefaultClient();
+ @Test
+ public void testCreateNotOngoingLegalHoldPolicy() {
+ String legalHoldPolicyName = getUuid();
+ String legalHoldDescription = "test description";
+ String filterStartedAt = "2021-01-01T00:00:00-08:00";
+ String filterEndedAt = "2022-01-01T00:00:00-08:00";
+ LegalHoldPolicy legalHoldPolicy =
+ client
+ .getLegalHoldPolicies()
+ .createLegalHoldPolicy(
+ new CreateLegalHoldPolicyRequestBody.CreateLegalHoldPolicyRequestBodyBuilder(
+ legalHoldPolicyName)
+ .description(legalHoldDescription)
+ .filterStartedAt(filterStartedAt)
+ .filterEndedAt(filterEndedAt)
+ .isOngoing(false)
+ .build());
+ assert legalHoldPolicy.getPolicyName().equals(legalHoldPolicyName);
+ assert legalHoldPolicy.getDescription().equals(legalHoldDescription);
+ assert legalHoldPolicy.getFilterStartedAt().equals(filterStartedAt);
+ assert legalHoldPolicy.getFilterEndedAt().equals(filterEndedAt);
+ client.getLegalHoldPolicies().deleteLegalHoldPolicyById(legalHoldPolicy.getId());
+ }
+
@Test
public void testCreateUpdateGetDeleteLegalHoldPolicy() {
String legalHoldPolicyName = getUuid();
@@ -48,28 +72,4 @@ public void testCreateUpdateGetDeleteLegalHoldPolicy() {
assert updatedLegalHoldPolicy.getPolicyName().equals(updatedLegalHoldPolicyName);
client.getLegalHoldPolicies().deleteLegalHoldPolicyById(legalHoldPolicyId);
}
-
- @Test
- public void testCreateNotOngoingLegalHoldPolicy() {
- String legalHoldPolicyName = getUuid();
- String legalHoldDescription = "test description";
- String filterStartedAt = "2021-01-01T00:00:00-08:00";
- String filterEndedAt = "2022-01-01T00:00:00-08:00";
- LegalHoldPolicy legalHoldPolicy =
- client
- .getLegalHoldPolicies()
- .createLegalHoldPolicy(
- new CreateLegalHoldPolicyRequestBody.CreateLegalHoldPolicyRequestBodyBuilder(
- legalHoldPolicyName)
- .description(legalHoldDescription)
- .filterStartedAt(filterStartedAt)
- .filterEndedAt(filterEndedAt)
- .isOngoing(false)
- .build());
- assert legalHoldPolicy.getPolicyName().equals(legalHoldPolicyName);
- assert legalHoldPolicy.getDescription().equals(legalHoldDescription);
- assert legalHoldPolicy.getFilterStartedAt().equals(filterStartedAt);
- assert legalHoldPolicy.getFilterEndedAt().equals(filterEndedAt);
- client.getLegalHoldPolicies().deleteLegalHoldPolicyById(legalHoldPolicy.getId());
- }
}
diff --git a/src/test/java/com/box/sdkgen/test/metadatatemplates/MetadataTemplatesITest.java b/src/test/java/com/box/sdkgen/test/metadatatemplates/MetadataTemplatesITest.java
index c935c08c..6cd3151b 100644
--- a/src/test/java/com/box/sdkgen/test/metadatatemplates/MetadataTemplatesITest.java
+++ b/src/test/java/com/box/sdkgen/test/metadatatemplates/MetadataTemplatesITest.java
@@ -1,5 +1,6 @@
package com.box.sdkgen.test.metadatatemplates;
+import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
import static com.box.sdkgen.internal.utils.UtilsManager.getUuid;
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
@@ -12,6 +13,7 @@
import com.box.sdkgen.managers.filemetadata.DeleteFileMetadataByIdScope;
import com.box.sdkgen.managers.metadatatemplates.CreateMetadataTemplateRequestBody;
import com.box.sdkgen.managers.metadatatemplates.CreateMetadataTemplateRequestBodyFieldsField;
+import com.box.sdkgen.managers.metadatatemplates.CreateMetadataTemplateRequestBodyFieldsOptionsField;
import com.box.sdkgen.managers.metadatatemplates.CreateMetadataTemplateRequestBodyFieldsTypeField;
import com.box.sdkgen.managers.metadatatemplates.DeleteMetadataTemplateScope;
import com.box.sdkgen.managers.metadatatemplates.GetMetadataTemplateScope;
@@ -45,13 +47,60 @@ public void testMetadataTemplates() {
new CreateMetadataTemplateRequestBodyFieldsField(
CreateMetadataTemplateRequestBodyFieldsTypeField.STRING,
"testName",
- "testName")))
+ "testName"),
+ new CreateMetadataTemplateRequestBodyFieldsField(
+ CreateMetadataTemplateRequestBodyFieldsTypeField.FLOAT,
+ "age",
+ "age"),
+ new CreateMetadataTemplateRequestBodyFieldsField(
+ CreateMetadataTemplateRequestBodyFieldsTypeField.DATE,
+ "birthDate",
+ "birthDate"),
+ new CreateMetadataTemplateRequestBodyFieldsField
+ .CreateMetadataTemplateRequestBodyFieldsFieldBuilder(
+ CreateMetadataTemplateRequestBodyFieldsTypeField.ENUM,
+ "countryCode",
+ "countryCode")
+ .options(
+ Arrays.asList(
+ new CreateMetadataTemplateRequestBodyFieldsOptionsField(
+ "US"),
+ new CreateMetadataTemplateRequestBodyFieldsOptionsField(
+ "CA")))
+ .build(),
+ new CreateMetadataTemplateRequestBodyFieldsField
+ .CreateMetadataTemplateRequestBodyFieldsFieldBuilder(
+ CreateMetadataTemplateRequestBodyFieldsTypeField.MULTISELECT,
+ "sports",
+ "sports")
+ .options(
+ Arrays.asList(
+ new CreateMetadataTemplateRequestBodyFieldsOptionsField(
+ "basketball"),
+ new CreateMetadataTemplateRequestBodyFieldsOptionsField(
+ "football"),
+ new CreateMetadataTemplateRequestBodyFieldsOptionsField(
+ "tennis")))
+ .build()))
.build());
assert template.getTemplateKey().equals(templateKey);
assert template.getDisplayName().equals(templateKey);
- assert template.getFields().size() == 1;
+ assert template.getFields().size() == 5;
assert template.getFields().get(0).getKey().equals("testName");
assert template.getFields().get(0).getDisplayName().equals("testName");
+ assert convertToString(template.getFields().get(0).getType()).equals("string");
+ assert template.getFields().get(1).getKey().equals("age");
+ assert template.getFields().get(1).getDisplayName().equals("age");
+ assert convertToString(template.getFields().get(1).getType()).equals("float");
+ assert template.getFields().get(2).getKey().equals("birthDate");
+ assert template.getFields().get(2).getDisplayName().equals("birthDate");
+ assert convertToString(template.getFields().get(2).getType()).equals("date");
+ assert template.getFields().get(3).getKey().equals("countryCode");
+ assert template.getFields().get(3).getDisplayName().equals("countryCode");
+ assert convertToString(template.getFields().get(3).getType()).equals("enum");
+ assert template.getFields().get(4).getKey().equals("sports");
+ assert template.getFields().get(4).getDisplayName().equals("sports");
+ assert convertToString(template.getFields().get(4).getType()).equals("multiSelect");
MetadataTemplate updatedTemplate =
client
.getMetadataTemplates()
@@ -66,9 +115,9 @@ public void testMetadataTemplates() {
entryOf("type", "string"), entryOf("displayName", "newFieldName")))
.fieldKey("newfieldname")
.build()));
- assert updatedTemplate.getFields().size() == 2;
- assert updatedTemplate.getFields().get(1).getKey().equals("newfieldname");
- assert updatedTemplate.getFields().get(1).getDisplayName().equals("newFieldName");
+ assert updatedTemplate.getFields().size() == 6;
+ assert updatedTemplate.getFields().get(5).getKey().equals("newfieldname");
+ assert updatedTemplate.getFields().get(5).getDisplayName().equals("newFieldName");
MetadataTemplate getMetadataTemplate =
client.getMetadataTemplates().getMetadataTemplateById(template.getId());
assert getMetadataTemplate.getId().equals(template.getId());
From b4e78cbb0bb0f03232f6de4269dfee5ac5e77bca Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 26 Feb 2025 00:41:52 -0800
Subject: [PATCH 07/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 317e9c4d..09292f2e 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "ef00939", "specHash": "06fc5f7", "version": "0.5.0" }
+{ "engineHash": "77017fa", "specHash": "06fc5f7", "version": "0.5.0" }
From 0011e00284b19a633e955cc0a02ec2d9501eb4d0 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 26 Feb 2025 02:39:35 -0800
Subject: [PATCH 08/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 09292f2e..817d0551 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "77017fa", "specHash": "06fc5f7", "version": "0.5.0" }
+{ "engineHash": "271bf60", "specHash": "06fc5f7", "version": "0.5.0" }
From 83e991a21070efaf8df388ad19641af6cf1b9267 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Mon, 3 Mar 2025 06:07:37 -0800
Subject: [PATCH 09/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 817d0551..f1f5efbc 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "271bf60", "specHash": "06fc5f7", "version": "0.5.0" }
+{ "engineHash": "271bf60", "specHash": "6782a0d", "version": "0.5.0" }
From cffebd16dcc61261b7b06c6304a41c14ded08db5 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 5 Mar 2025 06:09:16 -0800
Subject: [PATCH 10/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index f1f5efbc..0a753934 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "271bf60", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "91ccaf2", "specHash": "6782a0d", "version": "0.5.0" }
From c7575099d4f690c198ed4498da8f75c5dc6f360b Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Thu, 6 Mar 2025 05:42:14 -0800
Subject: [PATCH 11/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 0a753934..d414b5d1 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "91ccaf2", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "ed65d4f", "specHash": "6782a0d", "version": "0.5.0" }
From f1ca79fc77c78ca33c4104669f811338030d5ef1 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Mon, 10 Mar 2025 03:12:01 -0700
Subject: [PATCH 12/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index d414b5d1..15f02852 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "ed65d4f", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "8f5e41b", "specHash": "6782a0d", "version": "0.5.0" }
From 8e8ea279eab5b11b79afa68461520f0380b8f419 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Mon, 10 Mar 2025 05:41:35 -0700
Subject: [PATCH 13/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 15f02852..6731ea16 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "8f5e41b", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "2b41544", "specHash": "6782a0d", "version": "0.5.0" }
From 772a12b65fd3d234ef3fffc5d5bdfc22f0192e49 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Tue, 11 Mar 2025 10:09:17 -0700
Subject: [PATCH 14/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 6731ea16..b7d4adeb 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "2b41544", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "41feeaa", "specHash": "6782a0d", "version": "0.5.0" }
From bb84e797b40f8b2e68adeb7e656b0c8467099ee1 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 12 Mar 2025 07:11:45 -0700
Subject: [PATCH 15/18] feat: add find app item for shared link endpoint
(box/box-openapi#514)
---
.codegen.json | 2 +-
docs/README.md | 1 +
docs/sharedlinksappitems.md | 32 +++++++
docs/sharedlinksweblinks.md | 2 +-
.../java/com/box/sdkgen/client/BoxClient.java | 17 ++++
.../GetSharedItemAppItemsHeaders.java | 51 +++++++++++
.../SharedLinksAppItemsManager.java | 85 +++++++++++++++++++
7 files changed, 188 insertions(+), 2 deletions(-)
create mode 100644 docs/sharedlinksappitems.md
create mode 100644 src/main/java/com/box/sdkgen/managers/sharedlinksappitems/GetSharedItemAppItemsHeaders.java
create mode 100644 src/main/java/com/box/sdkgen/managers/sharedlinksappitems/SharedLinksAppItemsManager.java
diff --git a/.codegen.json b/.codegen.json
index b7d4adeb..8c40fa3b 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "41feeaa", "specHash": "6782a0d", "version": "0.5.0" }
+{ "engineHash": "41feeaa", "specHash": "3dc6f70", "version": "0.5.0" }
diff --git a/docs/README.md b/docs/README.md
index 033b4226..47be0339 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -49,6 +49,7 @@ the SDK are available by topic:
* [Retentionpolicyassignments](retentionpolicyassignments.md)
* [Search](search.md)
* [Sessiontermination](sessiontermination.md)
+* [Sharedlinksappitems](sharedlinksappitems.md)
* [Sharedlinksfiles](sharedlinksfiles.md)
* [Sharedlinksfolders](sharedlinksfolders.md)
* [Sharedlinksweblinks](sharedlinksweblinks.md)
diff --git a/docs/sharedlinksappitems.md b/docs/sharedlinksappitems.md
new file mode 100644
index 00000000..9b2d3b65
--- /dev/null
+++ b/docs/sharedlinksappitems.md
@@ -0,0 +1,32 @@
+# SharedLinksAppItemsManager
+
+
+- [Find app item for shared link](#find-app-item-for-shared-link)
+
+## Find app item for shared link
+
+Returns the app item represented by a shared link.
+
+The link can originate from the current enterprise or another.
+
+This operation is performed by calling function `getSharedItemAppItems`.
+
+See the endpoint docs at
+[API Reference](https://developer.box.com/reference/get-shared-items--app-items/).
+
+*Currently we don't have an example for calling `getSharedItemAppItems` in integration tests*
+
+### Arguments
+
+- headers `GetSharedItemAppItemsHeaders`
+ - Headers of getSharedItemAppItems method
+
+
+### Returns
+
+This function returns a value of type `AppItem`.
+
+Returns a full app item resource if the shared link is valid and
+the user has access to it.
+
+
diff --git a/docs/sharedlinksweblinks.md b/docs/sharedlinksweblinks.md
index 9510d83c..c4a94f46 100644
--- a/docs/sharedlinksweblinks.md
+++ b/docs/sharedlinksweblinks.md
@@ -39,7 +39,7 @@ userClient.getSharedLinksWebLinks().findWebLinkForSharedLink(new FindWebLinkForS
This function returns a value of type `WebLink`.
-Returns a full file resource if the shared link is valid and
+Returns a full web link resource if the shared link is valid and
the user has access to it.
diff --git a/src/main/java/com/box/sdkgen/client/BoxClient.java b/src/main/java/com/box/sdkgen/client/BoxClient.java
index 5e16fea7..0e3ffb03 100644
--- a/src/main/java/com/box/sdkgen/client/BoxClient.java
+++ b/src/main/java/com/box/sdkgen/client/BoxClient.java
@@ -47,6 +47,7 @@
import com.box.sdkgen.managers.retentionpolicyassignments.RetentionPolicyAssignmentsManager;
import com.box.sdkgen.managers.search.SearchManager;
import com.box.sdkgen.managers.sessiontermination.SessionTerminationManager;
+import com.box.sdkgen.managers.sharedlinksappitems.SharedLinksAppItemsManager;
import com.box.sdkgen.managers.sharedlinksfiles.SharedLinksFilesManager;
import com.box.sdkgen.managers.sharedlinksfolders.SharedLinksFoldersManager;
import com.box.sdkgen.managers.sharedlinksweblinks.SharedLinksWebLinksManager;
@@ -159,6 +160,8 @@ public class BoxClient {
public final SharedLinksWebLinksManager sharedLinksWebLinks;
+ public final SharedLinksAppItemsManager sharedLinksAppItems;
+
public final UsersManager users;
public final SessionTerminationManager sessionTermination;
@@ -412,6 +415,11 @@ public BoxClient(Authentication auth) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
+ this.sharedLinksAppItems =
+ new SharedLinksAppItemsManager.SharedLinksAppItemsManagerBuilder()
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build();
this.users =
new UsersManager.UsersManagerBuilder()
.auth(this.auth)
@@ -785,6 +793,11 @@ protected BoxClient(BoxClientBuilder builder) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
+ this.sharedLinksAppItems =
+ new SharedLinksAppItemsManager.SharedLinksAppItemsManagerBuilder()
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build();
this.users =
new UsersManager.UsersManagerBuilder()
.auth(this.auth)
@@ -1187,6 +1200,10 @@ public SharedLinksWebLinksManager getSharedLinksWebLinks() {
return sharedLinksWebLinks;
}
+ public SharedLinksAppItemsManager getSharedLinksAppItems() {
+ return sharedLinksAppItems;
+ }
+
public UsersManager getUsers() {
return users;
}
diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/GetSharedItemAppItemsHeaders.java b/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/GetSharedItemAppItemsHeaders.java
new file mode 100644
index 00000000..53f4dcab
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/GetSharedItemAppItemsHeaders.java
@@ -0,0 +1,51 @@
+package com.box.sdkgen.managers.sharedlinksappitems;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+
+import java.util.Map;
+
+public class GetSharedItemAppItemsHeaders {
+
+ public final String boxapi;
+
+ public Map extraHeaders;
+
+ public GetSharedItemAppItemsHeaders(String boxapi) {
+ this.boxapi = boxapi;
+ this.extraHeaders = mapOf();
+ }
+
+ protected GetSharedItemAppItemsHeaders(GetSharedItemAppItemsHeadersBuilder builder) {
+ this.boxapi = builder.boxapi;
+ this.extraHeaders = builder.extraHeaders;
+ }
+
+ public String getBoxapi() {
+ return boxapi;
+ }
+
+ public Map getExtraHeaders() {
+ return extraHeaders;
+ }
+
+ public static class GetSharedItemAppItemsHeadersBuilder {
+
+ protected final String boxapi;
+
+ protected Map extraHeaders;
+
+ public GetSharedItemAppItemsHeadersBuilder(String boxapi) {
+ this.boxapi = boxapi;
+ this.extraHeaders = mapOf();
+ }
+
+ public GetSharedItemAppItemsHeadersBuilder extraHeaders(Map extraHeaders) {
+ this.extraHeaders = extraHeaders;
+ return this;
+ }
+
+ public GetSharedItemAppItemsHeaders build() {
+ return new GetSharedItemAppItemsHeaders(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/SharedLinksAppItemsManager.java b/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/SharedLinksAppItemsManager.java
new file mode 100644
index 00000000..00c5cf0d
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/sharedlinksappitems/SharedLinksAppItemsManager.java
@@ -0,0 +1,85 @@
+package com.box.sdkgen.managers.sharedlinksappitems;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
+import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
+import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
+
+import com.box.sdkgen.networking.auth.Authentication;
+import com.box.sdkgen.networking.fetchoptions.FetchOptions;
+import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
+import com.box.sdkgen.networking.fetchresponse.FetchResponse;
+import com.box.sdkgen.networking.network.NetworkSession;
+import com.box.sdkgen.schemas.appitem.AppItem;
+import com.box.sdkgen.serialization.json.JsonManager;
+import java.util.Map;
+
+public class SharedLinksAppItemsManager {
+
+ public Authentication auth;
+
+ public NetworkSession networkSession;
+
+ public SharedLinksAppItemsManager() {
+ this.networkSession = new NetworkSession();
+ }
+
+ protected SharedLinksAppItemsManager(SharedLinksAppItemsManagerBuilder builder) {
+ this.auth = builder.auth;
+ this.networkSession = builder.networkSession;
+ }
+
+ public AppItem getSharedItemAppItems(GetSharedItemAppItemsHeaders headers) {
+ Map headersMap =
+ prepareParams(
+ mergeMaps(
+ mapOf(entryOf("boxapi", convertToString(headers.getBoxapi()))),
+ headers.getExtraHeaders()));
+ FetchResponse response =
+ this.networkSession
+ .getNetworkClient()
+ .fetch(
+ new FetchOptions.FetchOptionsBuilder(
+ String.join(
+ "",
+ this.networkSession.getBaseUrls().getBaseUrl(),
+ "/2.0/shared_items#app_items"),
+ "GET")
+ .headers(headersMap)
+ .responseFormat(ResponseFormat.JSON)
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build());
+ return JsonManager.deserialize(response.getData(), AppItem.class);
+ }
+
+ public Authentication getAuth() {
+ return auth;
+ }
+
+ public NetworkSession getNetworkSession() {
+ return networkSession;
+ }
+
+ public static class SharedLinksAppItemsManagerBuilder {
+
+ protected Authentication auth;
+
+ protected NetworkSession networkSession;
+
+ public SharedLinksAppItemsManagerBuilder auth(Authentication auth) {
+ this.auth = auth;
+ return this;
+ }
+
+ public SharedLinksAppItemsManagerBuilder networkSession(NetworkSession networkSession) {
+ this.networkSession = networkSession;
+ return this;
+ }
+
+ public SharedLinksAppItemsManager build() {
+ return new SharedLinksAppItemsManager(this);
+ }
+ }
+}
From 19deff5deabaea3e683bd8bc82aa61463d81ec44 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 12 Mar 2025 07:39:33 -0700
Subject: [PATCH 16/18] fix: add verification_phone_number property to create
sign request (box/box-openapi#515)
---
.codegen.json | 2 +-
.../SignRequestCreateSigner.java | 21 +++++++++++++++++++
.../signrequestsigner/SignRequestSigner.java | 12 +++++++++++
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 8c40fa3b..03ebd091 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "41feeaa", "specHash": "3dc6f70", "version": "0.5.0" }
+{ "engineHash": "41feeaa", "specHash": "1080bb4", "version": "0.5.0" }
diff --git a/src/main/java/com/box/sdkgen/schemas/signrequestcreatesigner/SignRequestCreateSigner.java b/src/main/java/com/box/sdkgen/schemas/signrequestcreatesigner/SignRequestCreateSigner.java
index 110d1f4d..87dacef0 100644
--- a/src/main/java/com/box/sdkgen/schemas/signrequestcreatesigner/SignRequestCreateSigner.java
+++ b/src/main/java/com/box/sdkgen/schemas/signrequestcreatesigner/SignRequestCreateSigner.java
@@ -34,6 +34,9 @@ public class SignRequestCreateSigner extends SerializableObject {
@JsonProperty("login_required")
protected Boolean loginRequired;
+ @JsonProperty("verification_phone_number")
+ protected String verificationPhoneNumber;
+
protected String password;
@JsonProperty("signer_group_id")
@@ -56,6 +59,7 @@ protected SignRequestCreateSigner(SignRequestCreateSignerBuilder builder) {
this.redirectUrl = builder.redirectUrl;
this.declinedRedirectUrl = builder.declinedRedirectUrl;
this.loginRequired = builder.loginRequired;
+ this.verificationPhoneNumber = builder.verificationPhoneNumber;
this.password = builder.password;
this.signerGroupId = builder.signerGroupId;
this.suppressNotifications = builder.suppressNotifications;
@@ -93,6 +97,10 @@ public Boolean getLoginRequired() {
return loginRequired;
}
+ public String getVerificationPhoneNumber() {
+ return verificationPhoneNumber;
+ }
+
public String getPassword() {
return password;
}
@@ -122,6 +130,7 @@ public boolean equals(Object o) {
&& Objects.equals(redirectUrl, casted.redirectUrl)
&& Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl)
&& Objects.equals(loginRequired, casted.loginRequired)
+ && Objects.equals(verificationPhoneNumber, casted.verificationPhoneNumber)
&& Objects.equals(password, casted.password)
&& Objects.equals(signerGroupId, casted.signerGroupId)
&& Objects.equals(suppressNotifications, casted.suppressNotifications);
@@ -138,6 +147,7 @@ public int hashCode() {
redirectUrl,
declinedRedirectUrl,
loginRequired,
+ verificationPhoneNumber,
password,
signerGroupId,
suppressNotifications);
@@ -178,6 +188,10 @@ public String toString() {
+ loginRequired
+ '\''
+ ", "
+ + "verificationPhoneNumber='"
+ + verificationPhoneNumber
+ + '\''
+ + ", "
+ "password='"
+ password
+ '\''
@@ -210,6 +224,8 @@ public static class SignRequestCreateSignerBuilder {
protected Boolean loginRequired;
+ protected String verificationPhoneNumber;
+
protected String password;
protected String signerGroupId;
@@ -261,6 +277,11 @@ public SignRequestCreateSignerBuilder loginRequired(Boolean loginRequired) {
return this;
}
+ public SignRequestCreateSignerBuilder verificationPhoneNumber(String verificationPhoneNumber) {
+ this.verificationPhoneNumber = verificationPhoneNumber;
+ return this;
+ }
+
public SignRequestCreateSignerBuilder password(String password) {
this.password = password;
return this;
diff --git a/src/main/java/com/box/sdkgen/schemas/signrequestsigner/SignRequestSigner.java b/src/main/java/com/box/sdkgen/schemas/signrequestsigner/SignRequestSigner.java
index 30a5d298..7f5940ec 100644
--- a/src/main/java/com/box/sdkgen/schemas/signrequestsigner/SignRequestSigner.java
+++ b/src/main/java/com/box/sdkgen/schemas/signrequestsigner/SignRequestSigner.java
@@ -74,6 +74,7 @@ public boolean equals(Object o) {
&& Objects.equals(redirectUrl, casted.redirectUrl)
&& Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl)
&& Objects.equals(loginRequired, casted.loginRequired)
+ && Objects.equals(verificationPhoneNumber, casted.verificationPhoneNumber)
&& Objects.equals(password, casted.password)
&& Objects.equals(signerGroupId, casted.signerGroupId)
&& Objects.equals(suppressNotifications, casted.suppressNotifications)
@@ -95,6 +96,7 @@ public int hashCode() {
redirectUrl,
declinedRedirectUrl,
loginRequired,
+ verificationPhoneNumber,
password,
signerGroupId,
suppressNotifications,
@@ -140,6 +142,10 @@ public String toString() {
+ loginRequired
+ '\''
+ ", "
+ + "verificationPhoneNumber='"
+ + verificationPhoneNumber
+ + '\''
+ + ", "
+ "password='"
+ password
+ '\''
@@ -266,6 +272,12 @@ public SignRequestSignerBuilder loginRequired(Boolean loginRequired) {
return this;
}
+ @Override
+ public SignRequestSignerBuilder verificationPhoneNumber(String verificationPhoneNumber) {
+ this.verificationPhoneNumber = verificationPhoneNumber;
+ return this;
+ }
+
@Override
public SignRequestSignerBuilder password(String password) {
this.password = password;
From 63a4e3eab1742db71374d0021351c82e18ab8ff8 Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 12 Mar 2025 07:41:29 -0700
Subject: [PATCH 17/18] chore: Update .codegen.json with commit hash of codegen
and openapi spec
---
.codegen.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.codegen.json b/.codegen.json
index 03ebd091..4da081b2 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "41feeaa", "specHash": "1080bb4", "version": "0.5.0" }
+{ "engineHash": "41feeaa", "specHash": "314e2b1", "version": "0.5.0" }
From 71ca647338702ea366041e803f9b5bed026e411b Mon Sep 17 00:00:00 2001
From: box-sdk-build
Date: Wed, 12 Mar 2025 07:43:14 -0700
Subject: [PATCH 18/18] feat: add Integration Mappings Teams API
(box/box-openapi#517)
---
.codegen.json | 2 +-
docs/integrationmappings.md | 120 ++++++++++
.../CreateIntegrationMappingTeamsHeaders.java | 38 +++
...eteIntegrationMappingTeamsByIdHeaders.java | 38 +++
.../GetIntegrationMappingTeamsHeaders.java | 36 +++
...GetIntegrationMappingTeamsQueryParams.java | 94 ++++++++
...ppingTeamsQueryParamsBoxItemTypeField.java | 62 +++++
...gTeamsQueryParamsPartnerItemTypeField.java | 66 ++++++
.../IntegrationMappingsManager.java | 148 ++++++++++++
...ateIntegrationMappingTeamsByIdHeaders.java | 38 +++
...ntegrationMappingTeamsByIdRequestBody.java | 63 +++++
.../folderreference/FolderReference.java | 85 +++++++
.../FolderReferenceTypeField.java | 62 +++++
.../IntegrationMappingPartnerItemTeams.java | 92 ++++++++
...ationMappingPartnerItemTeamsTypeField.java | 63 +++++
...nMappingPartnerItemTeamsCreateRequest.java | 112 +++++++++
...artnerItemTeamsCreateRequestTypeField.java | 65 ++++++
...tegrationMappingPartnerItemTeamsUnion.java | 58 +++++
.../IntegrationMappingsTeams.java | 60 +++++
.../IntegrationMappingTeams.java | 219 ++++++++++++++++++
...ationMappingTeamsIntegrationTypeField.java | 62 +++++
.../IntegrationMappingTeamsCreateRequest.java | 63 +++++
22 files changed, 1645 insertions(+), 1 deletion(-)
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/CreateIntegrationMappingTeamsHeaders.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/DeleteIntegrationMappingTeamsByIdHeaders.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsHeaders.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParams.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsBoxItemTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdHeaders.java
create mode 100644 src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdRequestBody.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/folderreference/FolderReference.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/folderreference/FolderReferenceTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeams.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeamsTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequest.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequestTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamsunion/IntegrationMappingPartnerItemTeamsUnion.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingsteams/IntegrationMappingsTeams.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeams.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeamsIntegrationTypeField.java
create mode 100644 src/main/java/com/box/sdkgen/schemas/integrationmappingteamscreaterequest/IntegrationMappingTeamsCreateRequest.java
diff --git a/.codegen.json b/.codegen.json
index 4da081b2..8ee5890a 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "41feeaa", "specHash": "314e2b1", "version": "0.5.0" }
+{ "engineHash": "41feeaa", "specHash": "c303afc", "version": "0.5.0" }
diff --git a/docs/integrationmappings.md b/docs/integrationmappings.md
index fe093c85..56e35363 100644
--- a/docs/integrationmappings.md
+++ b/docs/integrationmappings.md
@@ -5,6 +5,10 @@
- [Create Slack integration mapping](#create-slack-integration-mapping)
- [Update Slack integration mapping](#update-slack-integration-mapping)
- [Delete Slack integration mapping](#delete-slack-integration-mapping)
+- [List Teams integration mappings](#list-teams-integration-mappings)
+- [Create Teams integration mapping](#create-teams-integration-mapping)
+- [Update Teams integration mapping](#update-teams-integration-mapping)
+- [Delete Teams integration mapping](#delete-teams-integration-mapping)
## List Slack integration mappings
@@ -133,3 +137,119 @@ This function returns a value of type `void`.
Empty body in response
+## List Teams integration mappings
+
+Lists [Teams integration mappings](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams) in a users' enterprise.
+You need Admin or Co-Admin role to
+use this endpoint.
+
+This operation is performed by calling function `getIntegrationMappingTeams`.
+
+See the endpoint docs at
+[API Reference](https://developer.box.com/reference/get-integration-mappings-teams/).
+
+*Currently we don't have an example for calling `getIntegrationMappingTeams` in integration tests*
+
+### Arguments
+
+- queryParams `GetIntegrationMappingTeamsQueryParams`
+ - Query parameters of getIntegrationMappingTeams method
+- headers `GetIntegrationMappingTeamsHeaders`
+ - Headers of getIntegrationMappingTeams method
+
+
+### Returns
+
+This function returns a value of type `IntegrationMappingsTeams`.
+
+Returns a collection of integration mappings
+
+
+## Create Teams integration mapping
+
+Creates a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams)
+by mapping a Teams channel to a Box item.
+You need Admin or Co-Admin role to
+use this endpoint.
+
+This operation is performed by calling function `createIntegrationMappingTeams`.
+
+See the endpoint docs at
+[API Reference](https://developer.box.com/reference/post-integration-mappings-teams/).
+
+*Currently we don't have an example for calling `createIntegrationMappingTeams` in integration tests*
+
+### Arguments
+
+- requestBody `IntegrationMappingTeamsCreateRequest`
+ - Request body of createIntegrationMappingTeams method
+- headers `CreateIntegrationMappingTeamsHeaders`
+ - Headers of createIntegrationMappingTeams method
+
+
+### Returns
+
+This function returns a value of type `IntegrationMappingTeams`.
+
+Returns the created integration mapping.
+
+
+## Update Teams integration mapping
+
+Updates a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams).
+Supports updating the Box folder ID and options.
+You need Admin or Co-Admin role to
+use this endpoint.
+
+This operation is performed by calling function `updateIntegrationMappingTeamsById`.
+
+See the endpoint docs at
+[API Reference](https://developer.box.com/reference/put-integration-mappings-teams-id/).
+
+*Currently we don't have an example for calling `updateIntegrationMappingTeamsById` in integration tests*
+
+### Arguments
+
+- integrationMappingId `String`
+ - An ID of an integration mapping Example: "11235432"
+- requestBody `UpdateIntegrationMappingTeamsByIdRequestBody`
+ - Request body of updateIntegrationMappingTeamsById method
+- headers `UpdateIntegrationMappingTeamsByIdHeaders`
+ - Headers of updateIntegrationMappingTeamsById method
+
+
+### Returns
+
+This function returns a value of type `IntegrationMappingTeams`.
+
+Returns the updated integration mapping object.
+
+
+## Delete Teams integration mapping
+
+Deletes a [Teams integration mapping](https://support.box.com/hc/en-us/articles/360044681474-Using-Box-for-Teams).
+You need Admin or Co-Admin role to
+use this endpoint.
+
+This operation is performed by calling function `deleteIntegrationMappingTeamsById`.
+
+See the endpoint docs at
+[API Reference](https://developer.box.com/reference/delete-integration-mappings-teams-id/).
+
+*Currently we don't have an example for calling `deleteIntegrationMappingTeamsById` in integration tests*
+
+### Arguments
+
+- integrationMappingId `String`
+ - An ID of an integration mapping Example: "11235432"
+- headers `DeleteIntegrationMappingTeamsByIdHeaders`
+ - Headers of deleteIntegrationMappingTeamsById method
+
+
+### Returns
+
+This function returns a value of type `void`.
+
+Empty body in response
+
+
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/CreateIntegrationMappingTeamsHeaders.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/CreateIntegrationMappingTeamsHeaders.java
new file mode 100644
index 00000000..17efc67e
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/CreateIntegrationMappingTeamsHeaders.java
@@ -0,0 +1,38 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+
+import java.util.Map;
+
+public class CreateIntegrationMappingTeamsHeaders {
+
+ public Map extraHeaders;
+
+ public CreateIntegrationMappingTeamsHeaders() {
+ this.extraHeaders = mapOf();
+ }
+
+ protected CreateIntegrationMappingTeamsHeaders(
+ CreateIntegrationMappingTeamsHeadersBuilder builder) {
+ this.extraHeaders = builder.extraHeaders;
+ }
+
+ public Map getExtraHeaders() {
+ return extraHeaders;
+ }
+
+ public static class CreateIntegrationMappingTeamsHeadersBuilder {
+
+ protected Map extraHeaders;
+
+ public CreateIntegrationMappingTeamsHeadersBuilder extraHeaders(
+ Map extraHeaders) {
+ this.extraHeaders = extraHeaders;
+ return this;
+ }
+
+ public CreateIntegrationMappingTeamsHeaders build() {
+ return new CreateIntegrationMappingTeamsHeaders(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/DeleteIntegrationMappingTeamsByIdHeaders.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/DeleteIntegrationMappingTeamsByIdHeaders.java
new file mode 100644
index 00000000..a7883690
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/DeleteIntegrationMappingTeamsByIdHeaders.java
@@ -0,0 +1,38 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+
+import java.util.Map;
+
+public class DeleteIntegrationMappingTeamsByIdHeaders {
+
+ public Map extraHeaders;
+
+ public DeleteIntegrationMappingTeamsByIdHeaders() {
+ this.extraHeaders = mapOf();
+ }
+
+ protected DeleteIntegrationMappingTeamsByIdHeaders(
+ DeleteIntegrationMappingTeamsByIdHeadersBuilder builder) {
+ this.extraHeaders = builder.extraHeaders;
+ }
+
+ public Map getExtraHeaders() {
+ return extraHeaders;
+ }
+
+ public static class DeleteIntegrationMappingTeamsByIdHeadersBuilder {
+
+ protected Map extraHeaders;
+
+ public DeleteIntegrationMappingTeamsByIdHeadersBuilder extraHeaders(
+ Map extraHeaders) {
+ this.extraHeaders = extraHeaders;
+ return this;
+ }
+
+ public DeleteIntegrationMappingTeamsByIdHeaders build() {
+ return new DeleteIntegrationMappingTeamsByIdHeaders(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsHeaders.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsHeaders.java
new file mode 100644
index 00000000..3d24b77e
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsHeaders.java
@@ -0,0 +1,36 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+
+import java.util.Map;
+
+public class GetIntegrationMappingTeamsHeaders {
+
+ public Map extraHeaders;
+
+ public GetIntegrationMappingTeamsHeaders() {
+ this.extraHeaders = mapOf();
+ }
+
+ protected GetIntegrationMappingTeamsHeaders(GetIntegrationMappingTeamsHeadersBuilder builder) {
+ this.extraHeaders = builder.extraHeaders;
+ }
+
+ public Map getExtraHeaders() {
+ return extraHeaders;
+ }
+
+ public static class GetIntegrationMappingTeamsHeadersBuilder {
+
+ protected Map extraHeaders;
+
+ public GetIntegrationMappingTeamsHeadersBuilder extraHeaders(Map extraHeaders) {
+ this.extraHeaders = extraHeaders;
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsHeaders build() {
+ return new GetIntegrationMappingTeamsHeaders(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParams.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParams.java
new file mode 100644
index 00000000..ddb4ce07
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParams.java
@@ -0,0 +1,94 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+
+public class GetIntegrationMappingTeamsQueryParams {
+
+ public EnumWrapper partnerItemType;
+
+ public String partnerItemId;
+
+ public String boxItemId;
+
+ public EnumWrapper boxItemType;
+
+ public GetIntegrationMappingTeamsQueryParams() {}
+
+ protected GetIntegrationMappingTeamsQueryParams(
+ GetIntegrationMappingTeamsQueryParamsBuilder builder) {
+ this.partnerItemType = builder.partnerItemType;
+ this.partnerItemId = builder.partnerItemId;
+ this.boxItemId = builder.boxItemId;
+ this.boxItemType = builder.boxItemType;
+ }
+
+ public EnumWrapper
+ getPartnerItemType() {
+ return partnerItemType;
+ }
+
+ public String getPartnerItemId() {
+ return partnerItemId;
+ }
+
+ public String getBoxItemId() {
+ return boxItemId;
+ }
+
+ public EnumWrapper getBoxItemType() {
+ return boxItemType;
+ }
+
+ public static class GetIntegrationMappingTeamsQueryParamsBuilder {
+
+ protected EnumWrapper
+ partnerItemType;
+
+ protected String partnerItemId;
+
+ protected String boxItemId;
+
+ protected EnumWrapper boxItemType;
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder partnerItemType(
+ GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField partnerItemType) {
+ this.partnerItemType =
+ new EnumWrapper(
+ partnerItemType);
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder partnerItemType(
+ EnumWrapper partnerItemType) {
+ this.partnerItemType = partnerItemType;
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder partnerItemId(String partnerItemId) {
+ this.partnerItemId = partnerItemId;
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder boxItemId(String boxItemId) {
+ this.boxItemId = boxItemId;
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder boxItemType(
+ GetIntegrationMappingTeamsQueryParamsBoxItemTypeField boxItemType) {
+ this.boxItemType =
+ new EnumWrapper(boxItemType);
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParamsBuilder boxItemType(
+ EnumWrapper boxItemType) {
+ this.boxItemType = boxItemType;
+ return this;
+ }
+
+ public GetIntegrationMappingTeamsQueryParams build() {
+ return new GetIntegrationMappingTeamsQueryParams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsBoxItemTypeField.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsBoxItemTypeField.java
new file mode 100644
index 00000000..ef6f1b69
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsBoxItemTypeField.java
@@ -0,0 +1,62 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum GetIntegrationMappingTeamsQueryParamsBoxItemTypeField implements Valuable {
+ FOLDER("folder");
+
+ private final String value;
+
+ GetIntegrationMappingTeamsQueryParamsBoxItemTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class GetIntegrationMappingTeamsQueryParamsBoxItemTypeFieldDeserializer
+ extends JsonDeserializer> {
+
+ public GetIntegrationMappingTeamsQueryParamsBoxItemTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(GetIntegrationMappingTeamsQueryParamsBoxItemTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class GetIntegrationMappingTeamsQueryParamsBoxItemTypeFieldSerializer
+ extends JsonSerializer> {
+
+ public GetIntegrationMappingTeamsQueryParamsBoxItemTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField.java
new file mode 100644
index 00000000..b9450751
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField.java
@@ -0,0 +1,66 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField implements Valuable {
+ CHANNEL("channel"),
+ TEAM("team");
+
+ private final String value;
+
+ GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class GetIntegrationMappingTeamsQueryParamsPartnerItemTypeFieldDeserializer
+ extends JsonDeserializer<
+ EnumWrapper> {
+
+ public GetIntegrationMappingTeamsQueryParamsPartnerItemTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(GetIntegrationMappingTeamsQueryParamsPartnerItemTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(
+ new EnumWrapper(value));
+ }
+ }
+
+ public static class GetIntegrationMappingTeamsQueryParamsPartnerItemTypeFieldSerializer
+ extends JsonSerializer<
+ EnumWrapper> {
+
+ public GetIntegrationMappingTeamsQueryParamsPartnerItemTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/IntegrationMappingsManager.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/IntegrationMappingsManager.java
index 76297e7c..404274fc 100644
--- a/src/main/java/com/box/sdkgen/managers/integrationmappings/IntegrationMappingsManager.java
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/IntegrationMappingsManager.java
@@ -14,6 +14,9 @@
import com.box.sdkgen.schemas.integrationmapping.IntegrationMapping;
import com.box.sdkgen.schemas.integrationmappings.IntegrationMappings;
import com.box.sdkgen.schemas.integrationmappingslackcreaterequest.IntegrationMappingSlackCreateRequest;
+import com.box.sdkgen.schemas.integrationmappingsteams.IntegrationMappingsTeams;
+import com.box.sdkgen.schemas.integrationmappingteams.IntegrationMappingTeams;
+import com.box.sdkgen.schemas.integrationmappingteamscreaterequest.IntegrationMappingTeamsCreateRequest;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;
@@ -180,6 +183,151 @@ public void deleteSlackIntegrationMappingById(
.build());
}
+ public IntegrationMappingsTeams getIntegrationMappingTeams() {
+ return getIntegrationMappingTeams(
+ new GetIntegrationMappingTeamsQueryParams(), new GetIntegrationMappingTeamsHeaders());
+ }
+
+ public IntegrationMappingsTeams getIntegrationMappingTeams(
+ GetIntegrationMappingTeamsQueryParams queryParams) {
+ return getIntegrationMappingTeams(queryParams, new GetIntegrationMappingTeamsHeaders());
+ }
+
+ public IntegrationMappingsTeams getIntegrationMappingTeams(
+ GetIntegrationMappingTeamsHeaders headers) {
+ return getIntegrationMappingTeams(new GetIntegrationMappingTeamsQueryParams(), headers);
+ }
+
+ public IntegrationMappingsTeams getIntegrationMappingTeams(
+ GetIntegrationMappingTeamsQueryParams queryParams,
+ GetIntegrationMappingTeamsHeaders headers) {
+ Map queryParamsMap =
+ prepareParams(
+ mapOf(
+ entryOf("partner_item_type", convertToString(queryParams.getPartnerItemType())),
+ entryOf("partner_item_id", convertToString(queryParams.getPartnerItemId())),
+ entryOf("box_item_id", convertToString(queryParams.getBoxItemId())),
+ entryOf("box_item_type", convertToString(queryParams.getBoxItemType()))));
+ Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
+ FetchResponse response =
+ this.networkSession
+ .getNetworkClient()
+ .fetch(
+ new FetchOptions.FetchOptionsBuilder(
+ String.join(
+ "",
+ this.networkSession.getBaseUrls().getBaseUrl(),
+ "/2.0/integration_mappings/teams"),
+ "GET")
+ .params(queryParamsMap)
+ .headers(headersMap)
+ .responseFormat(ResponseFormat.JSON)
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build());
+ return JsonManager.deserialize(response.getData(), IntegrationMappingsTeams.class);
+ }
+
+ public IntegrationMappingTeams createIntegrationMappingTeams(
+ IntegrationMappingTeamsCreateRequest requestBody) {
+ return createIntegrationMappingTeams(requestBody, new CreateIntegrationMappingTeamsHeaders());
+ }
+
+ public IntegrationMappingTeams createIntegrationMappingTeams(
+ IntegrationMappingTeamsCreateRequest requestBody,
+ CreateIntegrationMappingTeamsHeaders headers) {
+ Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
+ FetchResponse response =
+ this.networkSession
+ .getNetworkClient()
+ .fetch(
+ new FetchOptions.FetchOptionsBuilder(
+ String.join(
+ "",
+ this.networkSession.getBaseUrls().getBaseUrl(),
+ "/2.0/integration_mappings/teams"),
+ "POST")
+ .headers(headersMap)
+ .data(JsonManager.serialize(requestBody))
+ .contentType("application/json")
+ .responseFormat(ResponseFormat.JSON)
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build());
+ return JsonManager.deserialize(response.getData(), IntegrationMappingTeams.class);
+ }
+
+ public IntegrationMappingTeams updateIntegrationMappingTeamsById(String integrationMappingId) {
+ return updateIntegrationMappingTeamsById(
+ integrationMappingId,
+ new UpdateIntegrationMappingTeamsByIdRequestBody(),
+ new UpdateIntegrationMappingTeamsByIdHeaders());
+ }
+
+ public IntegrationMappingTeams updateIntegrationMappingTeamsById(
+ String integrationMappingId, UpdateIntegrationMappingTeamsByIdRequestBody requestBody) {
+ return updateIntegrationMappingTeamsById(
+ integrationMappingId, requestBody, new UpdateIntegrationMappingTeamsByIdHeaders());
+ }
+
+ public IntegrationMappingTeams updateIntegrationMappingTeamsById(
+ String integrationMappingId, UpdateIntegrationMappingTeamsByIdHeaders headers) {
+ return updateIntegrationMappingTeamsById(
+ integrationMappingId, new UpdateIntegrationMappingTeamsByIdRequestBody(), headers);
+ }
+
+ public IntegrationMappingTeams updateIntegrationMappingTeamsById(
+ String integrationMappingId,
+ UpdateIntegrationMappingTeamsByIdRequestBody requestBody,
+ UpdateIntegrationMappingTeamsByIdHeaders headers) {
+ Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
+ FetchResponse response =
+ this.networkSession
+ .getNetworkClient()
+ .fetch(
+ new FetchOptions.FetchOptionsBuilder(
+ String.join(
+ "",
+ this.networkSession.getBaseUrls().getBaseUrl(),
+ "/2.0/integration_mappings/teams/",
+ convertToString(integrationMappingId)),
+ "PUT")
+ .headers(headersMap)
+ .data(JsonManager.serialize(requestBody))
+ .contentType("application/json")
+ .responseFormat(ResponseFormat.JSON)
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build());
+ return JsonManager.deserialize(response.getData(), IntegrationMappingTeams.class);
+ }
+
+ public void deleteIntegrationMappingTeamsById(String integrationMappingId) {
+ deleteIntegrationMappingTeamsById(
+ integrationMappingId, new DeleteIntegrationMappingTeamsByIdHeaders());
+ }
+
+ public void deleteIntegrationMappingTeamsById(
+ String integrationMappingId, DeleteIntegrationMappingTeamsByIdHeaders headers) {
+ Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
+ FetchResponse response =
+ this.networkSession
+ .getNetworkClient()
+ .fetch(
+ new FetchOptions.FetchOptionsBuilder(
+ String.join(
+ "",
+ this.networkSession.getBaseUrls().getBaseUrl(),
+ "/2.0/integration_mappings/teams/",
+ convertToString(integrationMappingId)),
+ "DELETE")
+ .headers(headersMap)
+ .responseFormat(ResponseFormat.NO_CONTENT)
+ .auth(this.auth)
+ .networkSession(this.networkSession)
+ .build());
+ }
+
public Authentication getAuth() {
return auth;
}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdHeaders.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdHeaders.java
new file mode 100644
index 00000000..75b540f2
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdHeaders.java
@@ -0,0 +1,38 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
+
+import java.util.Map;
+
+public class UpdateIntegrationMappingTeamsByIdHeaders {
+
+ public Map extraHeaders;
+
+ public UpdateIntegrationMappingTeamsByIdHeaders() {
+ this.extraHeaders = mapOf();
+ }
+
+ protected UpdateIntegrationMappingTeamsByIdHeaders(
+ UpdateIntegrationMappingTeamsByIdHeadersBuilder builder) {
+ this.extraHeaders = builder.extraHeaders;
+ }
+
+ public Map getExtraHeaders() {
+ return extraHeaders;
+ }
+
+ public static class UpdateIntegrationMappingTeamsByIdHeadersBuilder {
+
+ protected Map extraHeaders;
+
+ public UpdateIntegrationMappingTeamsByIdHeadersBuilder extraHeaders(
+ Map extraHeaders) {
+ this.extraHeaders = extraHeaders;
+ return this;
+ }
+
+ public UpdateIntegrationMappingTeamsByIdHeaders build() {
+ return new UpdateIntegrationMappingTeamsByIdHeaders(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdRequestBody.java b/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdRequestBody.java
new file mode 100644
index 00000000..f7a9fe14
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/managers/integrationmappings/UpdateIntegrationMappingTeamsByIdRequestBody.java
@@ -0,0 +1,63 @@
+package com.box.sdkgen.managers.integrationmappings;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.schemas.folderreference.FolderReference;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
+
+public class UpdateIntegrationMappingTeamsByIdRequestBody extends SerializableObject {
+
+ @JsonProperty("box_item")
+ protected FolderReference boxItem;
+
+ public UpdateIntegrationMappingTeamsByIdRequestBody() {
+ super();
+ }
+
+ protected UpdateIntegrationMappingTeamsByIdRequestBody(
+ UpdateIntegrationMappingTeamsByIdRequestBodyBuilder builder) {
+ super();
+ this.boxItem = builder.boxItem;
+ }
+
+ public FolderReference getBoxItem() {
+ return boxItem;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ UpdateIntegrationMappingTeamsByIdRequestBody casted =
+ (UpdateIntegrationMappingTeamsByIdRequestBody) o;
+ return Objects.equals(boxItem, casted.boxItem);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(boxItem);
+ }
+
+ @Override
+ public String toString() {
+ return "UpdateIntegrationMappingTeamsByIdRequestBody{" + "boxItem='" + boxItem + '\'' + "}";
+ }
+
+ public static class UpdateIntegrationMappingTeamsByIdRequestBodyBuilder {
+
+ protected FolderReference boxItem;
+
+ public UpdateIntegrationMappingTeamsByIdRequestBodyBuilder boxItem(FolderReference boxItem) {
+ this.boxItem = boxItem;
+ return this;
+ }
+
+ public UpdateIntegrationMappingTeamsByIdRequestBody build() {
+ return new UpdateIntegrationMappingTeamsByIdRequestBody(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReference.java b/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReference.java
new file mode 100644
index 00000000..457c8f45
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReference.java
@@ -0,0 +1,85 @@
+package com.box.sdkgen.schemas.folderreference;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import java.util.Objects;
+
+public class FolderReference extends SerializableObject {
+
+ @JsonDeserialize(using = FolderReferenceTypeField.FolderReferenceTypeFieldDeserializer.class)
+ @JsonSerialize(using = FolderReferenceTypeField.FolderReferenceTypeFieldSerializer.class)
+ protected EnumWrapper type;
+
+ protected final String id;
+
+ public FolderReference(@JsonProperty("id") String id) {
+ super();
+ this.id = id;
+ this.type = new EnumWrapper(FolderReferenceTypeField.FOLDER);
+ }
+
+ protected FolderReference(FolderReferenceBuilder builder) {
+ super();
+ this.type = builder.type;
+ this.id = builder.id;
+ }
+
+ public EnumWrapper getType() {
+ return type;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FolderReference casted = (FolderReference) o;
+ return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, id);
+ }
+
+ @Override
+ public String toString() {
+ return "FolderReference{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}";
+ }
+
+ public static class FolderReferenceBuilder {
+
+ protected EnumWrapper type;
+
+ protected final String id;
+
+ public FolderReferenceBuilder(String id) {
+ this.id = id;
+ this.type = new EnumWrapper(FolderReferenceTypeField.FOLDER);
+ }
+
+ public FolderReferenceBuilder type(FolderReferenceTypeField type) {
+ this.type = new EnumWrapper(type);
+ return this;
+ }
+
+ public FolderReferenceBuilder type(EnumWrapper type) {
+ this.type = type;
+ return this;
+ }
+
+ public FolderReference build() {
+ return new FolderReference(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReferenceTypeField.java b/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReferenceTypeField.java
new file mode 100644
index 00000000..7bbfa19d
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/folderreference/FolderReferenceTypeField.java
@@ -0,0 +1,62 @@
+package com.box.sdkgen.schemas.folderreference;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum FolderReferenceTypeField implements Valuable {
+ FOLDER("folder");
+
+ private final String value;
+
+ FolderReferenceTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class FolderReferenceTypeFieldDeserializer
+ extends JsonDeserializer> {
+
+ public FolderReferenceTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(FolderReferenceTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class FolderReferenceTypeFieldSerializer
+ extends JsonSerializer> {
+
+ public FolderReferenceTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeams.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeams.java
new file mode 100644
index 00000000..dbfe4c3b
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeams.java
@@ -0,0 +1,92 @@
+package com.box.sdkgen.schemas.integrationmappingpartneritemteams;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import java.util.Objects;
+
+public class IntegrationMappingPartnerItemTeams extends SerializableObject {
+
+ @JsonDeserialize(
+ using =
+ IntegrationMappingPartnerItemTeamsTypeField
+ .IntegrationMappingPartnerItemTeamsTypeFieldDeserializer.class)
+ @JsonSerialize(
+ using =
+ IntegrationMappingPartnerItemTeamsTypeField
+ .IntegrationMappingPartnerItemTeamsTypeFieldSerializer.class)
+ protected final EnumWrapper type;
+
+ protected final String id;
+
+ @JsonProperty("tenant_id")
+ protected final String tenantId;
+
+ public IntegrationMappingPartnerItemTeams(
+ @JsonProperty("type") EnumWrapper type,
+ @JsonProperty("id") String id,
+ @JsonProperty("tenant_id") String tenantId) {
+ super();
+ this.type = type;
+ this.id = id;
+ this.tenantId = tenantId;
+ }
+
+ public IntegrationMappingPartnerItemTeams(
+ IntegrationMappingPartnerItemTeamsTypeField type, String id, String tenantId) {
+ super();
+ this.type = new EnumWrapper(type);
+ this.id = id;
+ this.tenantId = tenantId;
+ }
+
+ public EnumWrapper getType() {
+ return type;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IntegrationMappingPartnerItemTeams casted = (IntegrationMappingPartnerItemTeams) o;
+ return Objects.equals(type, casted.type)
+ && Objects.equals(id, casted.id)
+ && Objects.equals(tenantId, casted.tenantId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, id, tenantId);
+ }
+
+ @Override
+ public String toString() {
+ return "IntegrationMappingPartnerItemTeams{"
+ + "type='"
+ + type
+ + '\''
+ + ", "
+ + "id='"
+ + id
+ + '\''
+ + ", "
+ + "tenantId='"
+ + tenantId
+ + '\''
+ + "}";
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeamsTypeField.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeamsTypeField.java
new file mode 100644
index 00000000..fec163e7
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteams/IntegrationMappingPartnerItemTeamsTypeField.java
@@ -0,0 +1,63 @@
+package com.box.sdkgen.schemas.integrationmappingpartneritemteams;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum IntegrationMappingPartnerItemTeamsTypeField implements Valuable {
+ CHANNEL("channel"),
+ TEAM("team");
+
+ private final String value;
+
+ IntegrationMappingPartnerItemTeamsTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class IntegrationMappingPartnerItemTeamsTypeFieldDeserializer
+ extends JsonDeserializer> {
+
+ public IntegrationMappingPartnerItemTeamsTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(IntegrationMappingPartnerItemTeamsTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class IntegrationMappingPartnerItemTeamsTypeFieldSerializer
+ extends JsonSerializer> {
+
+ public IntegrationMappingPartnerItemTeamsTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequest.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequest.java
new file mode 100644
index 00000000..cd024aff
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequest.java
@@ -0,0 +1,112 @@
+package com.box.sdkgen.schemas.integrationmappingpartneritemteamscreaterequest;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import java.util.Objects;
+
+public class IntegrationMappingPartnerItemTeamsCreateRequest extends SerializableObject {
+
+ @JsonDeserialize(
+ using =
+ IntegrationMappingPartnerItemTeamsCreateRequestTypeField
+ .IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldDeserializer.class)
+ @JsonSerialize(
+ using =
+ IntegrationMappingPartnerItemTeamsCreateRequestTypeField
+ .IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldSerializer.class)
+ protected final EnumWrapper type;
+
+ protected final String id;
+
+ @JsonProperty("tenant_id")
+ protected final String tenantId;
+
+ @JsonProperty("team_id")
+ protected final String teamId;
+
+ public IntegrationMappingPartnerItemTeamsCreateRequest(
+ @JsonProperty("type")
+ EnumWrapper type,
+ @JsonProperty("id") String id,
+ @JsonProperty("tenant_id") String tenantId,
+ @JsonProperty("team_id") String teamId) {
+ super();
+ this.type = type;
+ this.id = id;
+ this.tenantId = tenantId;
+ this.teamId = teamId;
+ }
+
+ public IntegrationMappingPartnerItemTeamsCreateRequest(
+ IntegrationMappingPartnerItemTeamsCreateRequestTypeField type,
+ String id,
+ String tenantId,
+ String teamId) {
+ super();
+ this.type = new EnumWrapper(type);
+ this.id = id;
+ this.tenantId = tenantId;
+ this.teamId = teamId;
+ }
+
+ public EnumWrapper getType() {
+ return type;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public String getTeamId() {
+ return teamId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IntegrationMappingPartnerItemTeamsCreateRequest casted =
+ (IntegrationMappingPartnerItemTeamsCreateRequest) o;
+ return Objects.equals(type, casted.type)
+ && Objects.equals(id, casted.id)
+ && Objects.equals(tenantId, casted.tenantId)
+ && Objects.equals(teamId, casted.teamId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, id, tenantId, teamId);
+ }
+
+ @Override
+ public String toString() {
+ return "IntegrationMappingPartnerItemTeamsCreateRequest{"
+ + "type='"
+ + type
+ + '\''
+ + ", "
+ + "id='"
+ + id
+ + '\''
+ + ", "
+ + "tenantId='"
+ + tenantId
+ + '\''
+ + ", "
+ + "teamId='"
+ + teamId
+ + '\''
+ + "}";
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequestTypeField.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequestTypeField.java
new file mode 100644
index 00000000..66ffb2ac
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamscreaterequest/IntegrationMappingPartnerItemTeamsCreateRequestTypeField.java
@@ -0,0 +1,65 @@
+package com.box.sdkgen.schemas.integrationmappingpartneritemteamscreaterequest;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum IntegrationMappingPartnerItemTeamsCreateRequestTypeField implements Valuable {
+ CHANNEL("channel"),
+ TEAM("team");
+
+ private final String value;
+
+ IntegrationMappingPartnerItemTeamsCreateRequestTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldDeserializer
+ extends JsonDeserializer<
+ EnumWrapper> {
+
+ public IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(IntegrationMappingPartnerItemTeamsCreateRequestTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldSerializer
+ extends JsonSerializer<
+ EnumWrapper> {
+
+ public IntegrationMappingPartnerItemTeamsCreateRequestTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamsunion/IntegrationMappingPartnerItemTeamsUnion.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamsunion/IntegrationMappingPartnerItemTeamsUnion.java
new file mode 100644
index 00000000..939be6ae
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingpartneritemteamsunion/IntegrationMappingPartnerItemTeamsUnion.java
@@ -0,0 +1,58 @@
+package com.box.sdkgen.schemas.integrationmappingpartneritemteamsunion;
+
+import com.box.sdkgen.internal.OneOfOne;
+import com.box.sdkgen.schemas.integrationmappingpartneritemteams.IntegrationMappingPartnerItemTeams;
+import com.box.sdkgen.serialization.json.JsonManager;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import java.io.IOException;
+
+@JsonDeserialize(
+ using =
+ IntegrationMappingPartnerItemTeamsUnion.IntegrationMappingPartnerItemTeamsUnionDeserializer
+ .class)
+@JsonSerialize(using = OneOfOne.OneOfOneSerializer.class)
+public class IntegrationMappingPartnerItemTeamsUnion
+ extends OneOfOne {
+
+ public IntegrationMappingPartnerItemTeamsUnion(
+ IntegrationMappingPartnerItemTeams integrationMappingPartnerItemTeams) {
+ super(integrationMappingPartnerItemTeams);
+ }
+
+ public IntegrationMappingPartnerItemTeams getIntegrationMappingPartnerItemTeams() {
+ return value0;
+ }
+
+ static class IntegrationMappingPartnerItemTeamsUnionDeserializer
+ extends JsonDeserializer {
+
+ public IntegrationMappingPartnerItemTeamsUnionDeserializer() {
+ super();
+ }
+
+ @Override
+ public IntegrationMappingPartnerItemTeamsUnion deserialize(
+ JsonParser jp, DeserializationContext ctxt) throws IOException {
+ JsonNode node = JsonManager.jsonToSerializedData(jp);
+ JsonNode discriminant0 = node.get("type");
+ if (!(discriminant0 == null)) {
+ switch (discriminant0.asText()) {
+ case "channel":
+ return new IntegrationMappingPartnerItemTeamsUnion(
+ JsonManager.deserialize(node, IntegrationMappingPartnerItemTeams.class));
+ case "team":
+ return new IntegrationMappingPartnerItemTeamsUnion(
+ JsonManager.deserialize(node, IntegrationMappingPartnerItemTeams.class));
+ }
+ }
+ throw new JsonMappingException(
+ jp, "Unable to deserialize IntegrationMappingPartnerItemTeamsUnion");
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingsteams/IntegrationMappingsTeams.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingsteams/IntegrationMappingsTeams.java
new file mode 100644
index 00000000..7f77a843
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingsteams/IntegrationMappingsTeams.java
@@ -0,0 +1,60 @@
+package com.box.sdkgen.schemas.integrationmappingsteams;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.schemas.integrationmappingteams.IntegrationMappingTeams;
+import java.util.List;
+import java.util.Objects;
+
+public class IntegrationMappingsTeams extends SerializableObject {
+
+ protected List entries;
+
+ public IntegrationMappingsTeams() {
+ super();
+ }
+
+ protected IntegrationMappingsTeams(IntegrationMappingsTeamsBuilder builder) {
+ super();
+ this.entries = builder.entries;
+ }
+
+ public List getEntries() {
+ return entries;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IntegrationMappingsTeams casted = (IntegrationMappingsTeams) o;
+ return Objects.equals(entries, casted.entries);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(entries);
+ }
+
+ @Override
+ public String toString() {
+ return "IntegrationMappingsTeams{" + "entries='" + entries + '\'' + "}";
+ }
+
+ public static class IntegrationMappingsTeamsBuilder {
+
+ protected List entries;
+
+ public IntegrationMappingsTeamsBuilder entries(List entries) {
+ this.entries = entries;
+ return this;
+ }
+
+ public IntegrationMappingsTeams build() {
+ return new IntegrationMappingsTeams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeams.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeams.java
new file mode 100644
index 00000000..7470fda8
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeams.java
@@ -0,0 +1,219 @@
+package com.box.sdkgen.schemas.integrationmappingteams;
+
+import com.box.sdkgen.schemas.folderreference.FolderReference;
+import com.box.sdkgen.schemas.integrationmappingbase.IntegrationMappingBase;
+import com.box.sdkgen.schemas.integrationmappingbase.IntegrationMappingBaseTypeField;
+import com.box.sdkgen.schemas.integrationmappingpartneritemteamsunion.IntegrationMappingPartnerItemTeamsUnion;
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import java.util.Objects;
+
+public class IntegrationMappingTeams extends IntegrationMappingBase {
+
+ @JsonDeserialize(
+ using =
+ IntegrationMappingTeamsIntegrationTypeField
+ .IntegrationMappingTeamsIntegrationTypeFieldDeserializer.class)
+ @JsonSerialize(
+ using =
+ IntegrationMappingTeamsIntegrationTypeField
+ .IntegrationMappingTeamsIntegrationTypeFieldSerializer.class)
+ @JsonProperty("integration_type")
+ protected EnumWrapper integrationType;
+
+ @JsonProperty("is_overridden_by_manual_mapping")
+ protected Boolean isOverriddenByManualMapping;
+
+ @JsonProperty("partner_item")
+ protected final IntegrationMappingPartnerItemTeamsUnion partnerItem;
+
+ @JsonProperty("box_item")
+ protected final FolderReference boxItem;
+
+ @JsonProperty("created_at")
+ protected String createdAt;
+
+ @JsonProperty("modified_at")
+ protected String modifiedAt;
+
+ public IntegrationMappingTeams(
+ @JsonProperty("id") String id,
+ @JsonProperty("partner_item") IntegrationMappingPartnerItemTeamsUnion partnerItem,
+ @JsonProperty("box_item") FolderReference boxItem) {
+ super(id);
+ this.partnerItem = partnerItem;
+ this.boxItem = boxItem;
+ }
+
+ protected IntegrationMappingTeams(IntegrationMappingTeamsBuilder builder) {
+ super(builder);
+ this.integrationType = builder.integrationType;
+ this.isOverriddenByManualMapping = builder.isOverriddenByManualMapping;
+ this.partnerItem = builder.partnerItem;
+ this.boxItem = builder.boxItem;
+ this.createdAt = builder.createdAt;
+ this.modifiedAt = builder.modifiedAt;
+ }
+
+ public EnumWrapper getIntegrationType() {
+ return integrationType;
+ }
+
+ public Boolean getIsOverriddenByManualMapping() {
+ return isOverriddenByManualMapping;
+ }
+
+ public IntegrationMappingPartnerItemTeamsUnion getPartnerItem() {
+ return partnerItem;
+ }
+
+ public FolderReference getBoxItem() {
+ return boxItem;
+ }
+
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public String getModifiedAt() {
+ return modifiedAt;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IntegrationMappingTeams casted = (IntegrationMappingTeams) o;
+ return Objects.equals(id, casted.id)
+ && Objects.equals(type, casted.type)
+ && Objects.equals(integrationType, casted.integrationType)
+ && Objects.equals(isOverriddenByManualMapping, casted.isOverriddenByManualMapping)
+ && Objects.equals(partnerItem, casted.partnerItem)
+ && Objects.equals(boxItem, casted.boxItem)
+ && Objects.equals(createdAt, casted.createdAt)
+ && Objects.equals(modifiedAt, casted.modifiedAt);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ id,
+ type,
+ integrationType,
+ isOverriddenByManualMapping,
+ partnerItem,
+ boxItem,
+ createdAt,
+ modifiedAt);
+ }
+
+ @Override
+ public String toString() {
+ return "IntegrationMappingTeams{"
+ + "id='"
+ + id
+ + '\''
+ + ", "
+ + "type='"
+ + type
+ + '\''
+ + ", "
+ + "integrationType='"
+ + integrationType
+ + '\''
+ + ", "
+ + "isOverriddenByManualMapping='"
+ + isOverriddenByManualMapping
+ + '\''
+ + ", "
+ + "partnerItem='"
+ + partnerItem
+ + '\''
+ + ", "
+ + "boxItem='"
+ + boxItem
+ + '\''
+ + ", "
+ + "createdAt='"
+ + createdAt
+ + '\''
+ + ", "
+ + "modifiedAt='"
+ + modifiedAt
+ + '\''
+ + "}";
+ }
+
+ public static class IntegrationMappingTeamsBuilder extends IntegrationMappingBaseBuilder {
+
+ protected EnumWrapper integrationType;
+
+ protected Boolean isOverriddenByManualMapping;
+
+ protected final IntegrationMappingPartnerItemTeamsUnion partnerItem;
+
+ protected final FolderReference boxItem;
+
+ protected String createdAt;
+
+ protected String modifiedAt;
+
+ public IntegrationMappingTeamsBuilder(
+ String id, IntegrationMappingPartnerItemTeamsUnion partnerItem, FolderReference boxItem) {
+ super(id);
+ this.partnerItem = partnerItem;
+ this.boxItem = boxItem;
+ }
+
+ public IntegrationMappingTeamsBuilder integrationType(
+ IntegrationMappingTeamsIntegrationTypeField integrationType) {
+ this.integrationType =
+ new EnumWrapper(integrationType);
+ return this;
+ }
+
+ public IntegrationMappingTeamsBuilder integrationType(
+ EnumWrapper integrationType) {
+ this.integrationType = integrationType;
+ return this;
+ }
+
+ public IntegrationMappingTeamsBuilder isOverriddenByManualMapping(
+ Boolean isOverriddenByManualMapping) {
+ this.isOverriddenByManualMapping = isOverriddenByManualMapping;
+ return this;
+ }
+
+ public IntegrationMappingTeamsBuilder createdAt(String createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ public IntegrationMappingTeamsBuilder modifiedAt(String modifiedAt) {
+ this.modifiedAt = modifiedAt;
+ return this;
+ }
+
+ @Override
+ public IntegrationMappingTeamsBuilder type(IntegrationMappingBaseTypeField type) {
+ this.type = new EnumWrapper(type);
+ return this;
+ }
+
+ @Override
+ public IntegrationMappingTeamsBuilder type(EnumWrapper type) {
+ this.type = type;
+ return this;
+ }
+
+ public IntegrationMappingTeams build() {
+ return new IntegrationMappingTeams(this);
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeamsIntegrationTypeField.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeamsIntegrationTypeField.java
new file mode 100644
index 00000000..862b2778
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingteams/IntegrationMappingTeamsIntegrationTypeField.java
@@ -0,0 +1,62 @@
+package com.box.sdkgen.schemas.integrationmappingteams;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum IntegrationMappingTeamsIntegrationTypeField implements Valuable {
+ TEAMS("teams");
+
+ private final String value;
+
+ IntegrationMappingTeamsIntegrationTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class IntegrationMappingTeamsIntegrationTypeFieldDeserializer
+ extends JsonDeserializer> {
+
+ public IntegrationMappingTeamsIntegrationTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(IntegrationMappingTeamsIntegrationTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class IntegrationMappingTeamsIntegrationTypeFieldSerializer
+ extends JsonSerializer> {
+
+ public IntegrationMappingTeamsIntegrationTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/integrationmappingteamscreaterequest/IntegrationMappingTeamsCreateRequest.java b/src/main/java/com/box/sdkgen/schemas/integrationmappingteamscreaterequest/IntegrationMappingTeamsCreateRequest.java
new file mode 100644
index 00000000..42353e4d
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/integrationmappingteamscreaterequest/IntegrationMappingTeamsCreateRequest.java
@@ -0,0 +1,63 @@
+package com.box.sdkgen.schemas.integrationmappingteamscreaterequest;
+
+import com.box.sdkgen.internal.SerializableObject;
+import com.box.sdkgen.schemas.folderreference.FolderReference;
+import com.box.sdkgen.schemas.integrationmappingpartneritemteamscreaterequest.IntegrationMappingPartnerItemTeamsCreateRequest;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
+
+public class IntegrationMappingTeamsCreateRequest extends SerializableObject {
+
+ @JsonProperty("partner_item")
+ protected final IntegrationMappingPartnerItemTeamsCreateRequest partnerItem;
+
+ @JsonProperty("box_item")
+ protected final FolderReference boxItem;
+
+ public IntegrationMappingTeamsCreateRequest(
+ @JsonProperty("partner_item") IntegrationMappingPartnerItemTeamsCreateRequest partnerItem,
+ @JsonProperty("box_item") FolderReference boxItem) {
+ super();
+ this.partnerItem = partnerItem;
+ this.boxItem = boxItem;
+ }
+
+ public IntegrationMappingPartnerItemTeamsCreateRequest getPartnerItem() {
+ return partnerItem;
+ }
+
+ public FolderReference getBoxItem() {
+ return boxItem;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IntegrationMappingTeamsCreateRequest casted = (IntegrationMappingTeamsCreateRequest) o;
+ return Objects.equals(partnerItem, casted.partnerItem)
+ && Objects.equals(boxItem, casted.boxItem);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(partnerItem, boxItem);
+ }
+
+ @Override
+ public String toString() {
+ return "IntegrationMappingTeamsCreateRequest{"
+ + "partnerItem='"
+ + partnerItem
+ + '\''
+ + ", "
+ + "boxItem='"
+ + boxItem
+ + '\''
+ + "}";
+ }
+}