diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Add.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Add.g.cs index dad1ef7..9029a69 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Add.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Add.g.cs @@ -86,20 +86,29 @@ partial void ProcessAddResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessAddResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessAddResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessAddResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Count.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Count.g.cs index 8f9a294..006eb43 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Count.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Count.g.cs @@ -72,20 +72,29 @@ partial void ProcessCountResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -117,8 +126,12 @@ partial void ProcessCountResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) as int? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -132,18 +145,24 @@ partial void ProcessCountResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) as int? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) as int? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -156,16 +175,6 @@ partial void ProcessCountResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) as int? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.CountCollections.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.CountCollections.g.cs index 9d7029a..92a5f3a 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.CountCollections.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.CountCollections.g.cs @@ -103,8 +103,12 @@ partial void ProcessCountCollectionsResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) as int? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -118,18 +122,24 @@ partial void ProcessCountCollectionsResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) as int? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) as int? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -142,16 +152,6 @@ partial void ProcessCountCollectionsResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) as int? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateCollection.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateCollection.g.cs index 9fa2780..131f904 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateCollection.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateCollection.g.cs @@ -100,20 +100,29 @@ partial void ProcessCreateCollectionResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -145,8 +154,12 @@ partial void ProcessCreateCollectionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -160,18 +173,24 @@ partial void ProcessCreateCollectionResponseContent( h => h.Value), }; } - - return - global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -184,16 +203,6 @@ partial void ProcessCreateCollectionResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateDatabase.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateDatabase.g.cs index 6b896c2..8c6970d 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateDatabase.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateDatabase.g.cs @@ -91,20 +91,29 @@ partial void ProcessCreateDatabaseResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -136,8 +145,12 @@ partial void ProcessCreateDatabaseResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Database.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -151,18 +164,24 @@ partial void ProcessCreateDatabaseResponseContent( h => h.Value), }; } - - return - global::Chroma.Database.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Database.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -175,16 +194,6 @@ partial void ProcessCreateDatabaseResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Database.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateTenant.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateTenant.g.cs index 03f41da..1c4493d 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateTenant.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.CreateTenant.g.cs @@ -80,20 +80,29 @@ partial void ProcessCreateTenantResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -125,8 +134,12 @@ partial void ProcessCreateTenantResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Tenant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -140,18 +153,24 @@ partial void ProcessCreateTenantResponseContent( h => h.Value), }; } - - return - global::Chroma.Tenant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Tenant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -164,16 +183,6 @@ partial void ProcessCreateTenantResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Tenant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Delete.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Delete.g.cs index 6a0958b..c2d9308 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Delete.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Delete.g.cs @@ -86,20 +86,29 @@ partial void ProcessDeleteResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessDeleteResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessDeleteResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessDeleteResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.DeleteCollection.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.DeleteCollection.g.cs index 609aac6..bb97fde 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.DeleteCollection.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.DeleteCollection.g.cs @@ -92,20 +92,29 @@ partial void ProcessDeleteCollectionResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -137,8 +146,12 @@ partial void ProcessDeleteCollectionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -152,18 +165,24 @@ partial void ProcessDeleteCollectionResponseContent( h => h.Value), }; } - - return - global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -176,16 +195,6 @@ partial void ProcessDeleteCollectionResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Get.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Get.g.cs index b9e45cf..99fc10e 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Get.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Get.g.cs @@ -86,20 +86,29 @@ partial void ProcessGetResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessGetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.GetResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessGetResponseContent( h => h.Value), }; } - - return - global::Chroma.GetResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.GetResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessGetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.GetResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetCollection.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetCollection.g.cs index d16c239..2d4ce0c 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetCollection.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetCollection.g.cs @@ -92,20 +92,29 @@ partial void ProcessGetCollectionResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -137,8 +146,12 @@ partial void ProcessGetCollectionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -152,18 +165,24 @@ partial void ProcessGetCollectionResponseContent( h => h.Value), }; } - - return - global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -176,16 +195,6 @@ partial void ProcessGetCollectionResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetDatabase.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetDatabase.g.cs index 62404cd..5865240 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetDatabase.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetDatabase.g.cs @@ -83,20 +83,29 @@ partial void ProcessGetDatabaseResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -128,8 +137,12 @@ partial void ProcessGetDatabaseResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Database.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -143,18 +156,24 @@ partial void ProcessGetDatabaseResponseContent( h => h.Value), }; } - - return - global::Chroma.Database.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Database.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -167,16 +186,6 @@ partial void ProcessGetDatabaseResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Database.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetNearestNeighbors.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetNearestNeighbors.g.cs index aba1323..a32a154 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetNearestNeighbors.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetNearestNeighbors.g.cs @@ -86,20 +86,29 @@ partial void ProcessGetNearestNeighborsResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessGetNearestNeighborsResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.QueryResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessGetNearestNeighborsResponseContent( h => h.Value), }; } - - return - global::Chroma.QueryResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.QueryResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessGetNearestNeighborsResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.QueryResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetTenant.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetTenant.g.cs index 2b19671..0c16b98 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.GetTenant.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.GetTenant.g.cs @@ -72,20 +72,29 @@ partial void ProcessGetTenantResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -117,8 +126,12 @@ partial void ProcessGetTenantResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Tenant.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -132,18 +145,24 @@ partial void ProcessGetTenantResponseContent( h => h.Value), }; } - - return - global::Chroma.Tenant.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Tenant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -156,16 +175,6 @@ partial void ProcessGetTenantResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Tenant.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Heartbeat.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Heartbeat.g.cs index 2ba1714..3af28e2 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Heartbeat.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Heartbeat.g.cs @@ -83,8 +83,12 @@ partial void ProcessHeartbeatResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) as global::System.Collections.Generic.Dictionary ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -98,18 +102,24 @@ partial void ProcessHeartbeatResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) as global::System.Collections.Generic.Dictionary ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.Dictionary ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -122,16 +132,6 @@ partial void ProcessHeartbeatResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.Dictionary ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.ListCollections.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.ListCollections.g.cs index 70d539d..f4a7300 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.ListCollections.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.ListCollections.g.cs @@ -103,8 +103,12 @@ partial void ProcessListCollectionsResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -118,18 +122,24 @@ partial void ProcessListCollectionsResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -142,16 +152,6 @@ partial void ProcessListCollectionsResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.PreFlightChecks.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.PreFlightChecks.g.cs index 61cfa47..1828f2e 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.PreFlightChecks.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.PreFlightChecks.g.cs @@ -83,8 +83,10 @@ partial void ProcessPreFlightChecksResponseContent( try { __response.EnsureSuccessStatusCode(); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -98,16 +100,22 @@ partial void ProcessPreFlightChecksResponseContent( h => h.Value), }; } - - return __content; } else { try { __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -120,14 +128,6 @@ partial void ProcessPreFlightChecksResponseContent( h => h.Value), }; } - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Reset.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Reset.g.cs index 892e7d5..1ebea8d 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Reset.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Reset.g.cs @@ -83,8 +83,12 @@ partial void ProcessResetResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -98,18 +102,24 @@ partial void ProcessResetResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -122,16 +132,6 @@ partial void ProcessResetResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Root.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Root.g.cs index 637c8fe..a107f3c 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Root.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Root.g.cs @@ -83,8 +83,12 @@ partial void ProcessRootResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) as global::System.Collections.Generic.Dictionary ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -98,18 +102,24 @@ partial void ProcessRootResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) as global::System.Collections.Generic.Dictionary ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.Dictionary ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -122,16 +132,6 @@ partial void ProcessRootResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.Dictionary ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Update.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Update.g.cs index 09eaf9b..c6588e1 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Update.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Update.g.cs @@ -86,20 +86,29 @@ partial void ProcessUpdateResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessUpdateResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessUpdateResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessUpdateResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.UpdateCollection.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.UpdateCollection.g.cs index cfc9f60..9e42298 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.UpdateCollection.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.UpdateCollection.g.cs @@ -86,20 +86,29 @@ partial void ProcessUpdateCollectionResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessUpdateCollectionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessUpdateCollectionResponseContent( h => h.Value), }; } - - return - global::Chroma.Collection.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessUpdateCollectionResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Chroma.Collection.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Upsert.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Upsert.g.cs index 4dcfb55..87d3a68 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Upsert.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Upsert.g.cs @@ -86,20 +86,29 @@ partial void ProcessUpsertResponseContent( if ((int)__response.StatusCode == 422) { string? __content_422 = null; + global::System.Exception? __exception_422 = null; global::Chroma.HTTPValidationError? __value_422 = null; - if (ReadResponseAsString) + try { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Chroma.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } } - else + catch (global::System.Exception __ex) { - var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - __value_422 = await global::Chroma.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + __exception_422 = __ex; } throw new global::Chroma.ApiException( message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, statusCode: __response.StatusCode) { ResponseBody = __content_422, @@ -131,8 +140,12 @@ partial void ProcessUpsertResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +159,24 @@ partial void ProcessUpsertResponseContent( h => h.Value), }; } - - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(bool?), JsonSerializerContext) as bool? ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +189,6 @@ partial void ProcessUpsertResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(bool?), JsonSerializerContext).ConfigureAwait(false) as bool? ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Chroma/Generated/Chroma.ChromaClient.Version.g.cs b/src/libs/Chroma/Generated/Chroma.ChromaClient.Version.g.cs index abcb228..66066dd 100644 --- a/src/libs/Chroma/Generated/Chroma.ChromaClient.Version.g.cs +++ b/src/libs/Chroma/Generated/Chroma.ChromaClient.Version.g.cs @@ -83,8 +83,10 @@ partial void ProcessVersionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -98,16 +100,22 @@ partial void ProcessVersionResponseContent( h => h.Value), }; } - - return __content; } else { try { __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Chroma.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -120,14 +128,6 @@ partial void ProcessVersionResponseContent( h => h.Value), }; } - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; } } } diff --git a/src/libs/Chroma/Generated/Chroma.Exceptions.g.cs b/src/libs/Chroma/Generated/Chroma.Exceptions.g.cs index aa8e1ea..f2f0829 100644 --- a/src/libs/Chroma/Generated/Chroma.Exceptions.g.cs +++ b/src/libs/Chroma/Generated/Chroma.Exceptions.g.cs @@ -43,7 +43,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) { StatusCode = statusCode; } @@ -83,7 +83,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } }