Skip to content

Commit 57dbb9a

Browse files
committed
fix: feat: Add Hub Document API (part 2) (box/box-openapi#588)
1 parent b8d79eb commit 57dbb9a

File tree

16 files changed

+88
-4
lines changed

16 files changed

+88
-4
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "65f6eab", "specHash": "57b3004", "version": "10.7.0" }
1+
{ "engineHash": "65f6eab", "specHash": "ca63e5e", "version": "10.7.0" }

Box.Sdk.Gen.Net/Managers/HubItems/GetHubItemsV2025R0QueryParams.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ public class GetHubItemsV2025R0QueryParams {
1818
/// </summary>
1919
public string HubId { get; }
2020

21+
/// <summary>
22+
/// The unique identifier of an item list block within the Box Hub.
23+
///
24+
/// When provided, the response will only include items that belong
25+
/// to the specified item list, allowing you to filter results to
26+
/// items on a specific page or section.
27+
/// </summary>
28+
public string? ParentId { get; init; }
29+
2130
/// <summary>
2231
/// Defines the position marker at which to begin returning results. This is
2332
/// used when paginating using marker-based pagination.

Box.Sdk.Gen.Net/Managers/HubItems/HubItemsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public HubItemsManager(NetworkSession? networkSession = default) {
2828
/// </param>
2929
public async System.Threading.Tasks.Task<HubItemsV2025R0> GetHubItemsV2025R0Async(GetHubItemsV2025R0QueryParams queryParams, GetHubItemsV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
3030
headers = headers ?? new GetHubItemsV2025R0Headers();
31-
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "hub_id", StringUtils.ToStringRepresentation(queryParams.HubId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } });
31+
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "hub_id", StringUtils.ToStringRepresentation(queryParams.HubId) }, { "parent_id", StringUtils.ToStringRepresentation(queryParams.ParentId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } });
3232
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
3333
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/hub_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
3434
return SimpleJsonSerializer.Deserialize<HubItemsV2025R0>(NullableUtils.Unwrap(response.Data));

Box.Sdk.Gen.Net/Schemas/AiExtractStructured/AiExtractStructured.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public class AiExtractStructured : ISerializable {
3434
[JsonPropertyName("include_confidence_score")]
3535
public bool? IncludeConfidenceScore { get; init; }
3636

37+
/// <summary>
38+
/// A flag to indicate whether references for every extracted field should be returned.
39+
/// </summary>
40+
[JsonPropertyName("include_reference")]
41+
public bool? IncludeReference { get; init; }
42+
3743
[JsonPropertyName("ai_agent")]
3844
public AiExtractStructuredAgent? AiAgent { get; init; }
3945

Box.Sdk.Gen.Net/Schemas/AiExtractStructuredResponse/AiExtractStructuredResponse.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ public class AiExtractStructuredResponse : ISerializable {
3030
[JsonConverter(typeof(DictionaryObjectValuesConverter))]
3131
public Dictionary<string, object>? ConfidenceScore { get; init; }
3232

33+
/// <summary>
34+
/// The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.
35+
/// </summary>
36+
[JsonPropertyName("reference")]
37+
[JsonConverter(typeof(DictionaryObjectValuesConverter))]
38+
public Dictionary<string, object>? Reference { get; init; }
39+
3340
[JsonPropertyName("ai_agent_info")]
3441
public AiAgentInfo? AiAgentInfo { get; init; }
3542

Box.Sdk.Gen.Net/Schemas/V2025R0/HubItemOperationV2025R0/HubItemOperationV2025R0.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public class HubItemOperationV2025R0 : ISerializable {
1616
[JsonPropertyName("item")]
1717
public HubItemReferenceV2025R0 Item { get; }
1818

19+
/// <summary>
20+
/// The ID of the parent block to add the item to. Must be an Item List block. If not provided, the item will be added to the first page's first Item List block.
21+
/// </summary>
22+
[JsonPropertyName("parent_id")]
23+
public string? ParentId { get; init; }
24+
1925
public HubItemOperationV2025R0(HubItemOperationV2025R0ActionField action, HubItemReferenceV2025R0 item) {
2026
Action = action;
2127
Item = item;

Box.Sdk.Gen.NetFramework/Managers/HubItems/GetHubItemsV2025R0QueryParams.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ public class GetHubItemsV2025R0QueryParams {
1818
/// </summary>
1919
public string HubId { get; set; }
2020

21+
/// <summary>
22+
/// The unique identifier of an item list block within the Box Hub.
23+
///
24+
/// When provided, the response will only include items that belong
25+
/// to the specified item list, allowing you to filter results to
26+
/// items on a specific page or section.
27+
/// </summary>
28+
public string ParentId { get; set; }
29+
2130
/// <summary>
2231
/// Defines the position marker at which to begin returning results. This is
2332
/// used when paginating using marker-based pagination.

Box.Sdk.Gen.NetFramework/Managers/HubItems/HubItemsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public HubItemsManager(NetworkSession networkSession = default) {
2828
/// </param>
2929
public async System.Threading.Tasks.Task<HubItemsV2025R0> GetHubItemsV2025R0Async(GetHubItemsV2025R0QueryParams queryParams, GetHubItemsV2025R0Headers headers = default, System.Threading.CancellationToken cancellationToken = default) {
3030
headers = headers ?? new GetHubItemsV2025R0Headers();
31-
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string>() { { "hub_id", StringUtils.ToStringRepresentation(queryParams.HubId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } });
31+
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string>() { { "hub_id", StringUtils.ToStringRepresentation(queryParams.HubId) }, { "parent_id", StringUtils.ToStringRepresentation(queryParams.ParentId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } });
3232
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
3333
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/hub_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
3434
return SimpleJsonSerializer.Deserialize<HubItemsV2025R0>(NullableUtils.Unwrap(response.Data));

Box.Sdk.Gen.NetFramework/Schemas/AiExtractStructured/AiExtractStructured.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public class AiExtractStructured : ISerializable {
3434
[JsonPropertyName("include_confidence_score")]
3535
public bool? IncludeConfidenceScore { get; set; }
3636

37+
/// <summary>
38+
/// A flag to indicate whether references for every extracted field should be returned.
39+
/// </summary>
40+
[JsonPropertyName("include_reference")]
41+
public bool? IncludeReference { get; set; }
42+
3743
[JsonPropertyName("ai_agent")]
3844
public AiExtractStructuredAgent AiAgent { get; set; }
3945

Box.Sdk.Gen.NetFramework/Schemas/AiExtractStructuredResponse/AiExtractStructuredResponse.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ public class AiExtractStructuredResponse : ISerializable {
3030
[JsonConverter(typeof(DictionaryObjectValuesConverter))]
3131
public Dictionary<string, object> ConfidenceScore { get; set; }
3232

33+
/// <summary>
34+
/// The reference for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.
35+
/// </summary>
36+
[JsonPropertyName("reference")]
37+
[JsonConverter(typeof(DictionaryObjectValuesConverter))]
38+
public Dictionary<string, object> Reference { get; set; }
39+
3340
[JsonPropertyName("ai_agent_info")]
3441
public AiAgentInfo AiAgentInfo { get; set; }
3542

0 commit comments

Comments
 (0)