Skip to content

Commit a53cff5

Browse files
feat: add AI agents warnings; allow for more types of metadata value (box/box-openapi#520) (#474)
1 parent 8dff7bb commit a53cff5

File tree

18 files changed

+484
-38
lines changed

18 files changed

+484
-38
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "525e333", "specHash": "f737b7b", "version": "1.9.0" }
1+
{ "engineHash": "c2a365c", "specHash": "6a332e7", "version": "1.9.0" }

Box.Sdk.Gen/Managers/FileMetadata/UpdateFileMetadataByIdRequestBody.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,8 @@ public class UpdateFileMetadataByIdRequestBody : ISerializable {
2828
[JsonPropertyName("path")]
2929
public string? Path { get; init; }
3030

31-
/// <summary>
32-
/// The value to be set or tested.
33-
///
34-
/// Required for `add`, `replace`, and `test` operations. For `add`,
35-
/// if the value exists already the previous value will be overwritten
36-
/// by the new value. For `replace`, the value must exist before
37-
/// replacing.
38-
///
39-
/// For `test`, the existing value at the `path` location must match
40-
/// the specified value.
41-
/// </summary>
4231
[JsonPropertyName("value")]
43-
public string? Value { get; init; }
32+
public MetadataInstanceValue? Value { get; init; }
4433

4534
/// <summary>
4635
/// The location in the metadata JSON object to move or copy a value

Box.Sdk.Gen/Managers/FolderMetadata/UpdateFolderMetadataByIdRequestBody.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,8 @@ public class UpdateFolderMetadataByIdRequestBody : ISerializable {
2828
[JsonPropertyName("path")]
2929
public string? Path { get; init; }
3030

31-
/// <summary>
32-
/// The value to be set or tested.
33-
///
34-
/// Required for `add`, `replace`, and `test` operations. For `add`,
35-
/// if the value exists already the previous value will be overwritten
36-
/// by the new value. For `replace`, the value must exist before
37-
/// replacing.
38-
///
39-
/// For `test`, the existing value at the `path` location must match
40-
/// the specified value.
41-
/// </summary>
4231
[JsonPropertyName("value")]
43-
public string? Value { get; init; }
32+
public MetadataInstanceValue? Value { get; init; }
4433

4534
/// <summary>
4635
/// The location in the metadata JSON object to move or copy a value

Box.Sdk.Gen/Managers/Transfer/ITransferManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ public interface ITransferManager {
2222
/// file-level are transferred during the operation, the collaborations are
2323
/// deleted when the original user is deleted.
2424
///
25-
/// This call will be performed synchronously which might lead to a slow response
26-
/// when the source user has a large number of items in all of its folders.
25+
/// If the user has a large number of items across all folders, the call will
26+
/// be run asynchronously. If the operation is not completed within 10 minutes,
27+
/// the user will receive a 200 OK response, and the operation will continue running.
2728
///
2829
/// If the destination path has a metadata cascade policy attached to any of
2930
/// the parent folders, a metadata cascade operation will be kicked off

Box.Sdk.Gen/Managers/Transfer/TransferManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ public TransferManager(NetworkSession? networkSession = default) {
2929
/// file-level are transferred during the operation, the collaborations are
3030
/// deleted when the original user is deleted.
3131
///
32-
/// This call will be performed synchronously which might lead to a slow response
33-
/// when the source user has a large number of items in all of its folders.
32+
/// If the user has a large number of items across all folders, the call will
33+
/// be run asynchronously. If the operation is not completed within 10 minutes,
34+
/// the user will receive a 200 OK response, and the operation will continue running.
3435
///
3536
/// If the destination path has a metadata cascade policy attached to any of
3637
/// the parent folders, a metadata cascade operation will be kicked off

Box.Sdk.Gen/Schemas/AiSingleAgentResponseFull/AiSingleAgentResponseFull.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
namespace Box.Sdk.Gen.Schemas {
88
public class AiSingleAgentResponseFull : AiSingleAgentResponse, ISerializable {
99
[JsonPropertyName("ask")]
10-
public AiStudioAgentAsk? Ask { get; init; }
10+
public AiStudioAgentAskResponse? Ask { get; init; }
1111

1212
[JsonPropertyName("text_gen")]
13-
public AiStudioAgentTextGen? TextGen { get; init; }
13+
public AiStudioAgentTextGenResponse? TextGen { get; init; }
1414

1515
[JsonPropertyName("extract")]
16-
public AiStudioAgentExtract? Extract { get; init; }
16+
public AiStudioAgentExtractResponse? Extract { get; init; }
1717

1818
public AiSingleAgentResponseFull(string id, string origin, string name, string accessState) : base(id, origin, name, accessState) {
1919

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using Box.Sdk.Gen;
2+
using System.Text.Json.Serialization;
3+
using Box.Sdk.Gen.Internal;
4+
using System.Collections.Generic;
5+
using Box.Sdk.Gen.Schemas;
6+
7+
namespace Box.Sdk.Gen.Schemas {
8+
public class AiStudioAgentAskResponse : ISerializable {
9+
[JsonInclude]
10+
[JsonPropertyName("_iscustom_instructionsSet")]
11+
protected bool _isCustomInstructionsSet { get; set; }
12+
13+
protected string? _customInstructions { get; set; }
14+
15+
/// <summary>
16+
/// The type of AI agent used to handle queries.
17+
/// </summary>
18+
[JsonPropertyName("type")]
19+
[JsonConverter(typeof(StringEnumConverter<AiStudioAgentAskResponseTypeField>))]
20+
public StringEnum<AiStudioAgentAskResponseTypeField> Type { get; }
21+
22+
/// <summary>
23+
/// The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
24+
/// </summary>
25+
[JsonPropertyName("access_state")]
26+
public string AccessState { get; }
27+
28+
/// <summary>
29+
/// The description of the AI Agent.
30+
/// </summary>
31+
[JsonPropertyName("description")]
32+
public string Description { get; }
33+
34+
/// <summary>
35+
/// Custom instructions for the agent.
36+
/// </summary>
37+
[JsonPropertyName("custom_instructions")]
38+
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
39+
40+
[JsonPropertyName("long_text")]
41+
public AiStudioAgentLongTextToolResponse? LongText { get; init; }
42+
43+
[JsonPropertyName("basic_text")]
44+
public AiStudioAgentBasicTextToolResponse? BasicText { get; init; }
45+
46+
[JsonPropertyName("long_text_multi")]
47+
public AiStudioAgentLongTextToolResponse? LongTextMulti { get; init; }
48+
49+
[JsonPropertyName("basic_text_multi")]
50+
public AiStudioAgentBasicTextToolResponse? BasicTextMulti { get; init; }
51+
52+
public AiStudioAgentAskResponse(string accessState, string description, AiStudioAgentAskResponseTypeField type = AiStudioAgentAskResponseTypeField.AiAgentAsk) {
53+
Type = type;
54+
AccessState = accessState;
55+
Description = description;
56+
}
57+
58+
[JsonConstructorAttribute]
59+
internal AiStudioAgentAskResponse(string accessState, string description, StringEnum<AiStudioAgentAskResponseTypeField> type) {
60+
Type = AiStudioAgentAskResponseTypeField.AiAgentAsk;
61+
AccessState = accessState;
62+
Description = description;
63+
}
64+
internal string? RawJson { get; set; } = default;
65+
66+
void ISerializable.SetJson(string json) {
67+
RawJson = json;
68+
}
69+
70+
string? ISerializable.GetJson() {
71+
return RawJson;
72+
}
73+
74+
/// <summary>
75+
/// Returns raw json response returned from the API.
76+
/// </summary>
77+
public Dictionary<string, object?>? GetRawData() {
78+
return SimpleJsonSerializer.GetAllFields(this);
79+
}
80+
81+
}
82+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.ComponentModel;
2+
using Box.Sdk.Gen.Schemas;
3+
using Box.Sdk.Gen.Internal;
4+
5+
namespace Box.Sdk.Gen.Schemas {
6+
public enum AiStudioAgentAskResponseTypeField {
7+
[Description("ai_agent_ask")]
8+
AiAgentAsk
9+
}
10+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
5+
using System.Text.Json.Serialization;
6+
using Box.Sdk.Gen.Internal;
7+
using Box.Sdk.Gen.Schemas;
8+
9+
namespace Box.Sdk.Gen.Schemas {
10+
public class AiStudioAgentBasicGenToolResponse : AiStudioAgentBasicGenTool, ISerializable {
11+
/// <summary>
12+
/// Warnings concerning tool
13+
/// </summary>
14+
[JsonPropertyName("warnings")]
15+
public IReadOnlyList<string>? Warnings { get; init; }
16+
17+
public AiStudioAgentBasicGenToolResponse() {
18+
19+
}
20+
internal new string? RawJson { get; set; } = default;
21+
22+
void ISerializable.SetJson(string json) {
23+
RawJson = json;
24+
}
25+
26+
string? ISerializable.GetJson() {
27+
return RawJson;
28+
}
29+
30+
/// <summary>
31+
/// Returns raw json response returned from the API.
32+
/// </summary>
33+
public new Dictionary<string, object?>? GetRawData() {
34+
return SimpleJsonSerializer.GetAllFields(this);
35+
}
36+
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
5+
using System.Text.Json.Serialization;
6+
using Box.Sdk.Gen.Internal;
7+
using Box.Sdk.Gen.Schemas;
8+
9+
namespace Box.Sdk.Gen.Schemas {
10+
public class AiStudioAgentBasicTextToolResponse : AiStudioAgentBasicTextTool, ISerializable {
11+
/// <summary>
12+
/// Warnings concerning tool
13+
/// </summary>
14+
[JsonPropertyName("warnings")]
15+
public IReadOnlyList<string>? Warnings { get; init; }
16+
17+
public AiStudioAgentBasicTextToolResponse() {
18+
19+
}
20+
internal new string? RawJson { get; set; } = default;
21+
22+
void ISerializable.SetJson(string json) {
23+
RawJson = json;
24+
}
25+
26+
string? ISerializable.GetJson() {
27+
return RawJson;
28+
}
29+
30+
/// <summary>
31+
/// Returns raw json response returned from the API.
32+
/// </summary>
33+
public new Dictionary<string, object?>? GetRawData() {
34+
return SimpleJsonSerializer.GetAllFields(this);
35+
}
36+
37+
}
38+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using Box.Sdk.Gen;
2+
using System.Text.Json.Serialization;
3+
using Box.Sdk.Gen.Internal;
4+
using System.Collections.Generic;
5+
using Box.Sdk.Gen.Schemas;
6+
7+
namespace Box.Sdk.Gen.Schemas {
8+
public class AiStudioAgentExtractResponse : ISerializable {
9+
[JsonInclude]
10+
[JsonPropertyName("_iscustom_instructionsSet")]
11+
protected bool _isCustomInstructionsSet { get; set; }
12+
13+
protected string? _customInstructions { get; set; }
14+
15+
/// <summary>
16+
/// The type of AI agent to be used for extraction.
17+
/// </summary>
18+
[JsonPropertyName("type")]
19+
[JsonConverter(typeof(StringEnumConverter<AiStudioAgentExtractResponseTypeField>))]
20+
public StringEnum<AiStudioAgentExtractResponseTypeField> Type { get; }
21+
22+
/// <summary>
23+
/// The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
24+
/// </summary>
25+
[JsonPropertyName("access_state")]
26+
public string AccessState { get; }
27+
28+
/// <summary>
29+
/// The description of the AI Agent.
30+
/// </summary>
31+
[JsonPropertyName("description")]
32+
public string Description { get; }
33+
34+
/// <summary>
35+
/// Custom instructions for the agent.
36+
/// </summary>
37+
[JsonPropertyName("custom_instructions")]
38+
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
39+
40+
[JsonPropertyName("long_text")]
41+
public AiStudioAgentLongTextToolResponse? LongText { get; init; }
42+
43+
[JsonPropertyName("basic_text")]
44+
public AiStudioAgentBasicTextToolResponse? BasicText { get; init; }
45+
46+
public AiStudioAgentExtractResponse(string accessState, string description, AiStudioAgentExtractResponseTypeField type = AiStudioAgentExtractResponseTypeField.AiAgentExtract) {
47+
Type = type;
48+
AccessState = accessState;
49+
Description = description;
50+
}
51+
52+
[JsonConstructorAttribute]
53+
internal AiStudioAgentExtractResponse(string accessState, string description, StringEnum<AiStudioAgentExtractResponseTypeField> type) {
54+
Type = AiStudioAgentExtractResponseTypeField.AiAgentExtract;
55+
AccessState = accessState;
56+
Description = description;
57+
}
58+
internal string? RawJson { get; set; } = default;
59+
60+
void ISerializable.SetJson(string json) {
61+
RawJson = json;
62+
}
63+
64+
string? ISerializable.GetJson() {
65+
return RawJson;
66+
}
67+
68+
/// <summary>
69+
/// Returns raw json response returned from the API.
70+
/// </summary>
71+
public Dictionary<string, object?>? GetRawData() {
72+
return SimpleJsonSerializer.GetAllFields(this);
73+
}
74+
75+
}
76+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.ComponentModel;
2+
using Box.Sdk.Gen.Schemas;
3+
using Box.Sdk.Gen.Internal;
4+
5+
namespace Box.Sdk.Gen.Schemas {
6+
public enum AiStudioAgentExtractResponseTypeField {
7+
[Description("ai_agent_extract")]
8+
AiAgentExtract
9+
}
10+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
5+
using System.Text.Json.Serialization;
6+
using Box.Sdk.Gen.Internal;
7+
using Box.Sdk.Gen.Schemas;
8+
9+
namespace Box.Sdk.Gen.Schemas {
10+
public class AiStudioAgentLongTextToolResponse : AiStudioAgentLongTextTool, ISerializable {
11+
/// <summary>
12+
/// Warnings concerning tool
13+
/// </summary>
14+
[JsonPropertyName("warnings")]
15+
public IReadOnlyList<string>? Warnings { get; init; }
16+
17+
public AiStudioAgentLongTextToolResponse() {
18+
19+
}
20+
internal new string? RawJson { get; set; } = default;
21+
22+
void ISerializable.SetJson(string json) {
23+
RawJson = json;
24+
}
25+
26+
string? ISerializable.GetJson() {
27+
return RawJson;
28+
}
29+
30+
/// <summary>
31+
/// Returns raw json response returned from the API.
32+
/// </summary>
33+
public new Dictionary<string, object?>? GetRawData() {
34+
return SimpleJsonSerializer.GetAllFields(this);
35+
}
36+
37+
}
38+
}

0 commit comments

Comments
 (0)