Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions src/libs/Chroma/Generated/Chroma.ChromaClient.Add.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::Chroma.HTTPValidationError>(
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_422,
statusCode: __response.StatusCode)
{
ResponseBody = __content_422,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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.");
}
}

Expand Down
53 changes: 31 additions & 22 deletions src/libs/Chroma/Generated/Chroma.ChromaClient.Count.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::Chroma.HTTPValidationError>(
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_422,
statusCode: __response.StatusCode)
{
ResponseBody = __content_422,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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.");
}
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/libs/Chroma/Generated/Chroma.ChromaClient.CountCollections.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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.");
}
}
}
Expand Down
53 changes: 31 additions & 22 deletions src/libs/Chroma/Generated/Chroma.ChromaClient.CreateCollection.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::Chroma.HTTPValidationError>(
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_422,
statusCode: __response.StatusCode)
{
ResponseBody = __content_422,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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.");
}
}

Expand Down
Loading
Loading