Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "192deac", "specHash": "fa34496", "version": "10.1.0" }
{ "engineHash": "d3a15eb", "specHash": "cf21406", "version": "10.1.0" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ the SDK are available by topic:
* [Docgentemplate](docgentemplate.md)
* [Downloads](downloads.md)
* [Emailaliases](emailaliases.md)
* [Enterpriseconfigurations](enterpriseconfigurations.md)
* [Events](events.md)
* [Externalusers](externalusers.md)
* [Fileclassifications](fileclassifications.md)
Expand Down
33 changes: 33 additions & 0 deletions docs/enterpriseconfigurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EnterpriseConfigurationsManager


- [Get enterprise configuration](#get-enterprise-configuration)

## Get enterprise configuration

Retrieves the configuration for an enterprise.

This operation is performed by calling function `getEnterpriseConfigurationByIdV2025R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/get-enterprise-configurations-id/).

*Currently we don't have an example for calling `getEnterpriseConfigurationByIdV2025R0` in integration tests*

### Arguments

- enterpriseId `String`
- The ID of the enterprise. Example: "3442311"
- queryParams `GetEnterpriseConfigurationByIdV2025R0QueryParams`
- Query parameters of getEnterpriseConfigurationByIdV2025R0 method
- headers `GetEnterpriseConfigurationByIdV2025R0Headers`
- Headers of getEnterpriseConfigurationByIdV2025R0 method


### Returns

This function returns a value of type `EnterpriseConfigurationV2025R0`.

Returns the enterprise configuration.


17 changes: 17 additions & 0 deletions src/main/java/com/box/sdkgen/client/BoxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.box.sdkgen.managers.docgentemplate.DocgenTemplateManager;
import com.box.sdkgen.managers.downloads.DownloadsManager;
import com.box.sdkgen.managers.emailaliases.EmailAliasesManager;
import com.box.sdkgen.managers.enterpriseconfigurations.EnterpriseConfigurationsManager;
import com.box.sdkgen.managers.events.EventsManager;
import com.box.sdkgen.managers.externalusers.ExternalUsersManager;
import com.box.sdkgen.managers.fileclassifications.FileClassificationsManager;
Expand Down Expand Up @@ -248,6 +249,8 @@ public class BoxClient {

public final DocgenManager docgen;

public final EnterpriseConfigurationsManager enterpriseConfigurations;

public final HubsManager hubs;

public final HubCollaborationsManager hubCollaborations;
Expand Down Expand Up @@ -572,6 +575,11 @@ public BoxClient(Authentication auth) {
.build();
this.docgen =
new DocgenManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.enterpriseConfigurations =
new EnterpriseConfigurationsManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.hubs =
new HubsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.hubCollaborations =
Expand Down Expand Up @@ -907,6 +915,11 @@ protected BoxClient(Builder builder) {
.build();
this.docgen =
new DocgenManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.enterpriseConfigurations =
new EnterpriseConfigurationsManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.hubs =
new HubsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.hubCollaborations =
Expand Down Expand Up @@ -1336,6 +1349,10 @@ public DocgenManager getDocgen() {
return docgen;
}

public EnterpriseConfigurationsManager getEnterpriseConfigurations() {
return enterpriseConfigurations;
}

public HubsManager getHubs() {
return hubs;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
package com.box.sdkgen.managers.enterpriseconfigurations;

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.v2025r0.enterpriseconfigurationv2025r0.EnterpriseConfigurationV2025R0;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;

public class EnterpriseConfigurationsManager {

public Authentication auth;

public NetworkSession networkSession;

public EnterpriseConfigurationsManager() {
this.networkSession = new NetworkSession();
}

protected EnterpriseConfigurationsManager(Builder builder) {
this.auth = builder.auth;
this.networkSession = builder.networkSession;
}

/**
* Retrieves the configuration for an enterprise.
*
* @param enterpriseId The ID of the enterprise. Example: "3442311"
* @param queryParams Query parameters of getEnterpriseConfigurationByIdV2025R0 method
*/
public EnterpriseConfigurationV2025R0 getEnterpriseConfigurationByIdV2025R0(
String enterpriseId, GetEnterpriseConfigurationByIdV2025R0QueryParams queryParams) {
return getEnterpriseConfigurationByIdV2025R0(
enterpriseId, queryParams, new GetEnterpriseConfigurationByIdV2025R0Headers());
}

/**
* Retrieves the configuration for an enterprise.
*
* @param enterpriseId The ID of the enterprise. Example: "3442311"
* @param queryParams Query parameters of getEnterpriseConfigurationByIdV2025R0 method
* @param headers Headers of getEnterpriseConfigurationByIdV2025R0 method
*/
public EnterpriseConfigurationV2025R0 getEnterpriseConfigurationByIdV2025R0(
String enterpriseId,
GetEnterpriseConfigurationByIdV2025R0QueryParams queryParams,
GetEnterpriseConfigurationByIdV2025R0Headers headers) {
Map<String, String> queryParamsMap =
prepareParams(mapOf(entryOf("categories", convertToString(queryParams.getCategories()))));
Map<String, String> headersMap =
prepareParams(
mergeMaps(
mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
headers.getExtraHeaders()));
FetchResponse response =
this.networkSession
.getNetworkClient()
.fetch(
new FetchOptions.Builder(
String.join(
"",
this.networkSession.getBaseUrls().getBaseUrl(),
"/2.0/enterprise_configurations/",
convertToString(enterpriseId)),
"GET")
.params(queryParamsMap)
.headers(headersMap)
.responseFormat(ResponseFormat.JSON)
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(response.getData(), EnterpriseConfigurationV2025R0.class);
}

public Authentication getAuth() {
return auth;
}

public NetworkSession getNetworkSession() {
return networkSession;
}

public static class Builder {

protected Authentication auth;

protected NetworkSession networkSession;

public Builder() {
this.networkSession = new NetworkSession();
}

public Builder auth(Authentication auth) {
this.auth = auth;
return this;
}

public Builder networkSession(NetworkSession networkSession) {
this.networkSession = networkSession;
return this;
}

public EnterpriseConfigurationsManager build() {
return new EnterpriseConfigurationsManager(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.box.sdkgen.managers.enterpriseconfigurations;

import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;

import com.box.sdkgen.parameters.v2025r0.boxversionheaderv2025r0.BoxVersionHeaderV2025R0;
import com.box.sdkgen.serialization.json.EnumWrapper;
import java.util.Map;

public class GetEnterpriseConfigurationByIdV2025R0Headers {

/** Version header. */
public EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;

/** Extra headers that will be included in the HTTP request. */
public Map<String, String> extraHeaders;

public GetEnterpriseConfigurationByIdV2025R0Headers() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
this.extraHeaders = mapOf();
}

protected GetEnterpriseConfigurationByIdV2025R0Headers(Builder builder) {
this.boxVersion = builder.boxVersion;
this.extraHeaders = builder.extraHeaders;
}

public EnumWrapper<BoxVersionHeaderV2025R0> getBoxVersion() {
return boxVersion;
}

public Map<String, String> getExtraHeaders() {
return extraHeaders;
}

public static class Builder {

protected EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;

protected Map<String, String> extraHeaders;

public Builder() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
this.extraHeaders = mapOf();
}

public Builder boxVersion(BoxVersionHeaderV2025R0 boxVersion) {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(boxVersion);
return this;
}

public Builder boxVersion(EnumWrapper<BoxVersionHeaderV2025R0> boxVersion) {
this.boxVersion = boxVersion;
return this;
}

public Builder extraHeaders(Map<String, String> extraHeaders) {
this.extraHeaders = extraHeaders;
return this;
}

public GetEnterpriseConfigurationByIdV2025R0Headers build() {
return new GetEnterpriseConfigurationByIdV2025R0Headers(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.box.sdkgen.managers.enterpriseconfigurations;

public class GetEnterpriseConfigurationByIdV2025R0QueryParams {

/**
* The comma-delimited list of the enterprise configuration categories. Allowed values:
* `security`, `content_and_sharing`, `user_settings`, `shield`.
*/
public final String categories;

public GetEnterpriseConfigurationByIdV2025R0QueryParams(String categories) {
this.categories = categories;
}

public String getCategories() {
return categories;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Objects;

/** A mini representation of a enterprise, used when nested within another resource. */
/** A representation of a enterprise, used when nested within another resource. */
@JsonFilter("nullablePropertyFilter")
public class EnterpriseBase extends SerializableObject {

Expand Down
Loading