Skip to content
Open
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": "7601181", "specHash": "54953fe", "version": "10.15.2" }
{ "engineHash": "2cee311", "specHash": "cc375ad", "version": "10.15.2" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ the SDK are available by topic:
* [Metadatataxonomies](metadatataxonomies.md)
* [Metadatatemplates](metadatatemplates.md)
* [Notes](notes.md)
* [Query](query.md)
* [Recentitems](recentitems.md)
* [Retentionpolicies](retentionpolicies.md)
* [Retentionpolicyassignments](retentionpolicyassignments.md)
Expand Down
63 changes: 63 additions & 0 deletions docs/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# QueryManager


- [Query for Box items](#query-for-box-items)
- [Create insights for Box items](#create-insights-for-box-items)

## Query for Box items

Runs a query to discover Box items using a logical predicate that can filter
across item fields and metadata templates. Results can be sorted, paginated,
and shaped to include additional item or metadata fields.

This operation is performed by calling function `createQueryV2026R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-query/).

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

### Arguments

- requestBody `QueryRequestBodyV2026R0`
- Request body of createQueryV2026R0 method
- headers `CreateQueryV2026R0Headers`
- Headers of createQueryV2026R0 method


### Returns

This function returns a value of type `QueryResultsV2026R0`.

Returns a paginated list of items matching the query.


## Create insights for Box items

Computes aggregated metrics over Box items matching a query predicate.
Filters are applied first, followed by optional grouping, after which the
requested metrics (such as `sum`, `avg`, `min`, `max`, and `count`) are
computed for each resulting group or over the entire filtered dataset.

This operation is performed by calling function `createQueryInsightV2026R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-query-insights/).

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

### Arguments

- requestBody `QueryInsightsRequestBodyV2026R0`
- Request body of createQueryInsightV2026R0 method
- headers `CreateQueryInsightV2026R0Headers`
- Headers of createQueryInsightV2026R0 method


### Returns

This function returns a value of type `QueryInsightsV2026R0`.

Returns the computed insight entries.


11 changes: 11 additions & 0 deletions src/main/java/com/box/sdkgen/client/BoxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import com.box.sdkgen.managers.metadatataxonomies.MetadataTaxonomiesManager;
import com.box.sdkgen.managers.metadatatemplates.MetadataTemplatesManager;
import com.box.sdkgen.managers.notes.NotesManager;
import com.box.sdkgen.managers.query.QueryManager;
import com.box.sdkgen.managers.recentitems.RecentItemsManager;
import com.box.sdkgen.managers.retentionpolicies.RetentionPoliciesManager;
import com.box.sdkgen.managers.retentionpolicyassignments.RetentionPolicyAssignmentsManager;
Expand Down Expand Up @@ -276,6 +277,8 @@ public class BoxClient {

public final NotesManager notes;

public final QueryManager query;

public BoxClient(Authentication auth) {
this.auth = auth;
this.networkSession = new NetworkSession.Builder().baseUrls(new BaseUrls()).build();
Expand Down Expand Up @@ -631,6 +634,8 @@ public BoxClient(Authentication auth) {
.build();
this.notes =
new NotesManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.query =
new QueryManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
}

protected BoxClient(Builder builder) {
Expand Down Expand Up @@ -988,6 +993,8 @@ protected BoxClient(Builder builder) {
.build();
this.notes =
new NotesManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.query =
new QueryManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
}

/**
Expand Down Expand Up @@ -1451,6 +1458,10 @@ public NotesManager getNotes() {
return notes;
}

public QueryManager getQuery() {
return query;
}

public static class Builder {

protected final Authentication auth;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.box.sdkgen.managers.query;

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

import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0;
import com.box.sdkgen.serialization.json.EnumWrapper;
import java.util.Map;

public class CreateQueryInsightV2026R0Headers {

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

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

public CreateQueryInsightV2026R0Headers() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
this.extraHeaders = mapOf();
}

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

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

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

public static class Builder {

protected EnumWrapper<BoxVersionHeaderV2026R0> boxVersion;

protected Map<String, String> extraHeaders;

public Builder() {}

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

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

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

public CreateQueryInsightV2026R0Headers build() {
if (this.boxVersion == null) {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
}
if (this.extraHeaders == null) {
this.extraHeaders = mapOf();
}
return new CreateQueryInsightV2026R0Headers(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.box.sdkgen.managers.query;

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

import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0;
import com.box.sdkgen.serialization.json.EnumWrapper;
import java.util.Map;

public class CreateQueryV2026R0Headers {

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

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

public CreateQueryV2026R0Headers() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
this.extraHeaders = mapOf();
}

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

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

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

public static class Builder {

protected EnumWrapper<BoxVersionHeaderV2026R0> boxVersion;

protected Map<String, String> extraHeaders;

public Builder() {}

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

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

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

public CreateQueryV2026R0Headers build() {
if (this.boxVersion == null) {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
}
if (this.extraHeaders == null) {
this.extraHeaders = mapOf();
}
return new CreateQueryV2026R0Headers(this);
}
}
}
Loading
Loading