Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update .codegen.json with commit hash of codegen and openapi spec #330

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7cc0a2d
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 14, 2024
ac5b9fe
fix: Support status codes with no content (box/box-codegen#604)
box-sdk-build Nov 15, 2024
a0af6ba
chore: Adding support for changelog spellcheck (box/box-codegen#602)
box-sdk-build Nov 15, 2024
713e476
docs: Update collaboration resource (box/box-openapi#483)
box-sdk-build Nov 18, 2024
ce6b304
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 19, 2024
82fdeab
Auto resolve conflict by keeping our changes
Nov 19, 2024
098f1bb
Auto resolve conflict by keeping our changes
Nov 19, 2024
4853db0
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 20, 2024
8056a95
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 20, 2024
818b010
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 20, 2024
6bb7907
Auto resolve conflict by keeping our changes
Nov 20, 2024
6b32cfe
test: fix collection test (box/box-codegen#614)
box-sdk-build Nov 21, 2024
8ea528c
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 21, 2024
ff3c518
Auto resolve conflict by keeping our changes
Nov 21, 2024
73fd87e
feat: Support nullable fields in TypeScript (box/box-codegen#612)
box-sdk-build Nov 24, 2024
ec1ef36
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 25, 2024
5dc07f1
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 25, 2024
7008883
test: Fix test for `createAiExtractStructured` (box/box-codegen#618)
box-sdk-build Nov 26, 2024
c0ea93a
feat: Expose fetch method (box/box-codegen#610)
box-sdk-build Nov 27, 2024
891bf37
Auto resolve conflict by keeping our changes
Nov 28, 2024
d6b2ca4
feat(python3): split manual code (box/box-codegen#606)
box-sdk-build Nov 28, 2024
81145c8
fix: fix returned type in GetSdValueByKey (box/box-codegen#622)
box-sdk-build Nov 29, 2024
bb8c907
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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": "1c0a1c0", "specHash": "544d370", "version": "1.4.0" }
{ "engineHash": "d435f50", "specHash": "544d370", "version": "1.4.0" }
54 changes: 52 additions & 2 deletions Box.Sdk.Gen.Tests.Integration/Test/Client/ClientManagerTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Box.Sdk.Gen.Internal;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using Box.Sdk.Gen;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Managers;
Expand All @@ -15,6 +15,56 @@ public class ClientManagerTests {
public ClientManagerTests() {
client = new CommonsManager().GetDefaultClient();
}
[TestMethod]
public async System.Threading.Tasks.Task TestMakeRequestJsonCrud() {
string newFolderName = Utils.GetUUID();
string requestBodyPost = string.Concat("{\"name\": \"", newFolderName, "\", \"parent\": { \"id\": \"0\"}}");
FetchResponse createFolderResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(method: "post", url: "https://api.box.com/2.0/folders") { Data = JsonUtils.JsonToSerializedData(text: requestBodyPost) });
Assert.IsTrue(createFolderResponse.Status == 201);
SerializedData createdFolder = NullableUtils.Unwrap(createFolderResponse.Data);
Assert.IsTrue(JsonUtils.GetSdValueByKey(obj: createdFolder, key: "name") == newFolderName);
string updatedName = Utils.GetUUID();
string requestBodyPut = string.Concat("{\"name\": \"", updatedName, "\"}");
FetchResponse updateFolderResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(method: "put", url: string.Concat("https://api.box.com/2.0/folders/", JsonUtils.GetSdValueByKey(obj: createdFolder, key: "id"))) { Data = JsonUtils.JsonToSerializedData(text: requestBodyPut) });
Assert.IsTrue(updateFolderResponse.Status == 200);
SerializedData updatedFolder = NullableUtils.Unwrap(updateFolderResponse.Data);
Assert.IsTrue(JsonUtils.GetSdValueByKey(obj: updatedFolder, key: "name") == updatedName);
Assert.IsTrue(JsonUtils.GetSdValueByKey(obj: updatedFolder, key: "id") == JsonUtils.GetSdValueByKey(obj: createdFolder, key: "id"));
FetchResponse getFolderResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(url: string.Concat("https://api.box.com/2.0/folders/", JsonUtils.GetSdValueByKey(obj: createdFolder, key: "id")), method: "GET"));
Assert.IsTrue(getFolderResponse.Status == 200);
SerializedData receivedFolder = NullableUtils.Unwrap(getFolderResponse.Data);
Assert.IsTrue(JsonUtils.GetSdValueByKey(obj: receivedFolder, key: "name") == updatedName);
Assert.IsTrue(JsonUtils.GetSdValueByKey(obj: receivedFolder, key: "id") == JsonUtils.GetSdValueByKey(obj: updatedFolder, key: "id"));
FetchResponse deleteFolderResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(url: string.Concat("https://api.box.com/2.0/folders/", JsonUtils.GetSdValueByKey(obj: receivedFolder, key: "id")), method: "DELETE"));
Assert.IsTrue(deleteFolderResponse.Status == 204);
}

[TestMethod]
public async System.Threading.Tasks.Task TestMakeRequestMultipart() {
string newFolderName = Utils.GetUUID();
FolderFull newFolder = await client.Folders.CreateFolderAsync(requestBody: new CreateFolderRequestBody(name: newFolderName, parent: new CreateFolderRequestBodyParentField(id: "0")));
string newFolderId = newFolder.Id;
string newFileName = string.Concat(Utils.GetUUID(), ".pdf");
System.IO.Stream fileContentStream = Utils.GenerateByteStream(size: 1024 * 1024);
string multipartAttributes = string.Concat("{\"name\": \"", newFileName, "\", \"parent\": { \"id\":", newFolderId, "}}");
FetchResponse uploadFileResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(method: "POST", url: "https://upload.box.com/api/2.0/files/content", contentType: "multipart/form-data") { MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "attributes") { Data = JsonUtils.JsonToSerializedData(text: multipartAttributes) },new MultipartItem(partName: "file") { FileStream = fileContentStream }}) });
Assert.IsTrue(uploadFileResponse.Status == 201);
await client.Folders.DeleteFolderByIdAsync(folderId: newFolderId, queryParams: new DeleteFolderByIdQueryParams() { Recursive = true });
}

[TestMethod]
public async System.Threading.Tasks.Task TestMakeRequestBinaryFormat() {
string newFileName = Utils.GetUUID();
byte[] fileBuffer = Utils.GenerateByteBuffer(size: 1024 * 1024);
System.IO.Stream fileContentStream = Utils.GenerateByteStreamFromBuffer(buffer: fileBuffer);
Files uploadedFiles = await client.Uploads.UploadFileAsync(requestBody: new UploadFileRequestBody(attributes: new UploadFileRequestBodyAttributesField(name: newFileName, parent: new UploadFileRequestBodyAttributesParentField(id: "0")), file: fileContentStream));
FileFull uploadedFile = NullableUtils.Unwrap(uploadedFiles.Entries)[0];
FetchResponse downloadFileResponse = await client.MakeRequestAsync(fetchOptions: new FetchOptions(method: "GET", url: string.Concat("https://api.box.com/2.0/files/", uploadedFile.Id, "/content"), responseFormat: Box.Sdk.Gen.ResponseFormat.Binary));
Assert.IsTrue(downloadFileResponse.Status == 200);
Assert.IsTrue(Utils.BufferEquals(buffer1: await Utils.ReadByteStreamAsync(byteStream: NullableUtils.Unwrap(downloadFileResponse.Content)), buffer2: fileBuffer));
await client.Files.DeleteFileByIdAsync(fileId: uploadedFile.Id);
}

[TestMethod]
public async System.Threading.Tasks.Task TestWithAsUserHeader() {
string userName = Utils.GetUUID();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Box.Sdk.Gen.Internal;
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Managers;
Expand All @@ -20,6 +20,7 @@ public async System.Threading.Tasks.Task TestGetFolderInfo() {
FolderFull rootFolder = await client.Folders.GetFolderByIdAsync(folderId: "0");
Assert.IsTrue(rootFolder.Id == "0");
Assert.IsTrue(rootFolder.Name == "All Files");
Assert.IsTrue(StringUtils.ToStringRepresentation(rootFolder.Type?.Value) == "folder");
}

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Box/CcgAuth/BoxCcgAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BoxCcgAuth : IAuthentication {
/// <summary>
/// The type of the subject ID provided. Must be either 'user' or 'enterprise'.
/// </summary>
internal StringEnum<PostOAuth2TokenBoxSubjectTypeField>? SubjectType { get; }
internal PostOAuth2TokenBoxSubjectTypeField? SubjectType { get; }

public BoxCcgAuth(CcgConfig config) {
Config = config;
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Box/JwtAuth/BoxJwtAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
if (Utils.IsBrowser()) {
throw new BoxSdkException(message: "JWT auth is not supported in browser environment.");
}
JwtAlgorithm alg = this.Config.Algorithm?.Value != null ? NullableUtils.Unwrap(this.Config.Algorithm?.Value) : JwtAlgorithm.Rs256;
JwtAlgorithm alg = this.Config.Algorithm != null ? NullableUtils.Unwrap(this.Config.Algorithm) : JwtAlgorithm.Rs256;
Dictionary<string, object> claims = new Dictionary<string, object>() { { "exp", Utils.GetEpochTimeInSeconds() + 30 }, { "box_sub_type", this.SubjectType } };

Check warning on line 49 in Box.Sdk.Gen/Box/JwtAuth/BoxJwtAuth.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Possible null reference argument for parameter 'value' in 'void Dictionary<string, object>.Add(string key, object value)'.
JwtSignOptions jwtOptions = new JwtSignOptions(algorithm: alg, audience: "https://api.box.com/oauth2/token", subject: this.SubjectId, issuer: this.Config.ClientId, jwtid: Utils.GetUUID(), keyid: this.Config.JwtKeyId);

Check warning on line 50 in Box.Sdk.Gen/Box/JwtAuth/BoxJwtAuth.cs

View workflow job for this annotation

GitHub Actions / .NET 6

Possible null reference argument for parameter 'subject' in 'JwtSignOptions.JwtSignOptions(JwtAlgorithm algorithm, string audience, string subject, string issuer, string jwtid, string keyid)'.
JwtKey jwtKey = new JwtKey(key: this.Config.PrivateKey, passphrase: this.Config.PrivateKeyPassphrase);
string assertion = JwtUtils.CreateJwtAssertion(claims: claims, key: jwtKey, options: jwtOptions);
AuthorizationManager authManager = new AuthorizationManager(networkSession: networkSession != null ? NullableUtils.Unwrap(networkSession) : new NetworkSession());
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Box/JwtAuth/JwtConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class JwtConfig {
/// </summary>
public string? UserId { get; init; }

internal StringEnum<JwtAlgorithm>? Algorithm { get; }
internal JwtAlgorithm? Algorithm { get; }

public ITokenStorage TokenStorage { get; }

Expand Down
16 changes: 15 additions & 1 deletion Box.Sdk.Gen/Client/BoxClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Box.Sdk.Gen.Managers;
using Box.Sdk.Gen.Internal;

namespace Box.Sdk.Gen {
public class BoxClient : IBoxClient {
Expand Down Expand Up @@ -223,6 +224,19 @@ public BoxClient(IAuthentication auth, NetworkSession? networkSession = default)
IntegrationMappings = new IntegrationMappingsManager(networkSession: this.NetworkSession) { Auth = this.Auth };
Ai = new AiManager(networkSession: this.NetworkSession) { Auth = this.Auth };
}
/// <summary>
/// Make a custom http request using the client authentication and network session.
/// </summary>
/// <param name="fetchOptions">
/// Options to be passed to the fetch call
/// </param>
public async System.Threading.Tasks.Task<FetchResponse> MakeRequestAsync(FetchOptions fetchOptions) {
IAuthentication auth = fetchOptions.Auth == null ? this.Auth : NullableUtils.Unwrap(fetchOptions.Auth);
NetworkSession networkSession = fetchOptions.NetworkSession == null ? this.NetworkSession : NullableUtils.Unwrap(fetchOptions.NetworkSession);
FetchOptions enrichedFetchOptions = new FetchOptions(url: fetchOptions.Url, method: fetchOptions.Method, contentType: fetchOptions.ContentType, responseFormat: fetchOptions.ResponseFormat) { Auth = auth, NetworkSession = networkSession, Parameters = fetchOptions.Parameters, Headers = fetchOptions.Headers, Data = fetchOptions.Data, FileStream = fetchOptions.FileStream, MultipartData = fetchOptions.MultipartData };
return await HttpClientAdapter.FetchAsync(enrichedFetchOptions).ConfigureAwait(false);
}

/// <summary>
/// Create 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.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Box.Sdk.Gen/Internal/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Text.Json;
using System.Globalization;

namespace Box.Sdk.Gen.Internal
Expand Down
20 changes: 10 additions & 10 deletions Box.Sdk.Gen/Managers/Ai/AiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public AiManager(NetworkSession? networkSession = default) {
public async System.Threading.Tasks.Task<AiResponseFull> CreateAiAskAsync(AiAsk requestBody, CreateAiAskHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiAskHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/ask"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponseFull>(response.Data);
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/ask"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponseFull>(NullableUtils.Unwrap(response.Data));
}

/// <summary>
Expand All @@ -47,8 +47,8 @@ public async System.Threading.Tasks.Task<AiResponseFull> CreateAiAskAsync(AiAsk
public async System.Threading.Tasks.Task<AiResponse> CreateAiTextGenAsync(AiTextGen requestBody, CreateAiTextGenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiTextGenHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/text_gen"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponse>(response.Data);
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/text_gen"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponse>(NullableUtils.Unwrap(response.Data));
}

/// <summary>
Expand All @@ -67,8 +67,8 @@ public async System.Threading.Tasks.Task<AiAgentAskOrAiAgentExtractOrAiAgentExtr
headers = headers ?? new GetAiAgentDefaultConfigHeaders();
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "mode", StringUtils.ToStringRepresentation(queryParams.Mode?.Value) }, { "language", StringUtils.ToStringRepresentation(queryParams.Language) }, { "model", StringUtils.ToStringRepresentation(queryParams.Model) } });
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai_agent_default"), networkSession: this.NetworkSession) { Method = "GET", Parameters = queryParamsMap, Headers = headersMap, ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.DeserializeWithoutRawJson<AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen>(response.Data);
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai_agent_default"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.DeserializeWithoutRawJson<AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen>(NullableUtils.Unwrap(response.Data));
}

/// <summary>
Expand All @@ -87,8 +87,8 @@ public async System.Threading.Tasks.Task<AiAgentAskOrAiAgentExtractOrAiAgentExtr
public async System.Threading.Tasks.Task<AiResponse> CreateAiExtractAsync(AiExtract requestBody, CreateAiExtractHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiExtractHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponse>(response.Data);
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiResponse>(NullableUtils.Unwrap(response.Data));
}

/// <summary>
Expand All @@ -109,8 +109,8 @@ public async System.Threading.Tasks.Task<AiResponse> CreateAiExtractAsync(AiExtr
public async System.Threading.Tasks.Task<AiExtractResponse> CreateAiExtractStructuredAsync(AiExtractStructured requestBody, CreateAiExtractStructuredHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiExtractStructuredHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract_structured"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiExtractResponse>(response.Data);
FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract_structured"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
return SimpleJsonSerializer.Deserialize<AiExtractResponse>(NullableUtils.Unwrap(response.Data));
}

}
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Managers/Ai/CreateAiAskHeaders.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Box.Sdk.Gen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Managers {
public class CreateAiAskHeaders {
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Managers/Ai/CreateAiExtractHeaders.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Box.Sdk.Gen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Managers {
public class CreateAiExtractHeaders {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Box.Sdk.Gen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Managers {
public class CreateAiExtractStructuredHeaders {
Expand Down
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Managers/Ai/CreateAiTextGenHeaders.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Box.Sdk.Gen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Box.Sdk.Gen.Schemas;
using Box.Sdk.Gen.Internal;
using Box.Sdk.Gen.Schemas;

namespace Box.Sdk.Gen.Managers {
public class CreateAiTextGenHeaders {
Expand Down
Loading
Loading