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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace Speechify
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.Error))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(int))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetricOp), TypeInfoPropertyName = "StoreAggregateMetricOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetric))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Speechify.StoreAggregateMetric>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreDocumentSource))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreDocument))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.QueryStoreDocumentsResponse))]
Expand All @@ -39,10 +42,7 @@ namespace Speechify
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreOrderBy))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreDocumentQuery))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Speechify.StoreWhereClause>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetricOp), TypeInfoPropertyName = "StoreAggregateMetricOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetric))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateQuery))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Speechify.StoreAggregateMetric>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateGroup))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary<string, double?>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateResponse))]
Expand All @@ -61,14 +61,14 @@ namespace Speechify
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.ErrorCode?), TypeInfoPropertyName = "NullableErrorCode2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetricOp?), TypeInfoPropertyName = "NullableStoreAggregateMetricOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreWhereClauseOp?), TypeInfoPropertyName = "NullableStoreWhereClauseOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreOrderByDirection?), TypeInfoPropertyName = "NullableStoreOrderByDirection2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreAggregateMetricOp?), TypeInfoPropertyName = "NullableStoreAggregateMetricOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreBatchWriteOp?), TypeInfoPropertyName = "NullableStoreBatchWriteOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Speechify.StoreBatchResultOp?), TypeInfoPropertyName = "NullableStoreBatchResultOp2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreAggregateMetric>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreDocument>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreWhereClause>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreAggregateMetric>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreAggregateGroup>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreBatchWrite>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Speechify.StoreBatchResult>))]
Expand Down Expand Up @@ -142,6 +142,10 @@ public override bool CanConvert(global::System.Type typeToConvert)

|| typeToConvert == typeof(global::Speechify.ErrorCode?)

|| typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp)

|| typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp?)

|| typeToConvert == typeof(global::Speechify.StoreWhereClauseOp)

|| typeToConvert == typeof(global::Speechify.StoreWhereClauseOp?)
Expand All @@ -150,10 +154,6 @@ public override bool CanConvert(global::System.Type typeToConvert)

|| typeToConvert == typeof(global::Speechify.StoreOrderByDirection?)

|| typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp)

|| typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp?)

|| typeToConvert == typeof(global::Speechify.StoreBatchWriteOp)

|| typeToConvert == typeof(global::Speechify.StoreBatchWriteOp?)
Expand All @@ -177,6 +177,16 @@ public override bool CanConvert(global::System.Type typeToConvert)
return new global::Speechify.JsonConverters.ErrorCodeNullableJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp))
{
return new global::Speechify.JsonConverters.StoreAggregateMetricOpJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp?))
{
return new global::Speechify.JsonConverters.StoreAggregateMetricOpNullableJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreWhereClauseOp))
{
return new global::Speechify.JsonConverters.StoreWhereClauseOpJsonConverter();
Expand All @@ -197,16 +207,6 @@ public override bool CanConvert(global::System.Type typeToConvert)
return new global::Speechify.JsonConverters.StoreOrderByDirectionNullableJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp))
{
return new global::Speechify.JsonConverters.StoreAggregateMetricOpJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreAggregateMetricOp?))
{
return new global::Speechify.JsonConverters.StoreAggregateMetricOpNullableJsonConverter();
}

if (typeToConvert == typeof(global::Speechify.StoreBatchWriteOp))
{
return new global::Speechify.JsonConverters.StoreBatchWriteOpJsonConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,80 @@ partial void ProcessCreateResponseContent(
h => h.Key,
h => h.Value));
}
// Rate limit or concurrency limit exceeded. `error.code` says which ceiling, and they need different responses: `rate_limited` is the request-rate budget (slow down), `concurrency_limit_reached` is a workspace-wide concurrency ceiling (fewer at once, or raise it), and `conversation_turn_in_progress` is contention over one named conversation (keep one message in flight on it). Every 429 carries `Retry-After` and the request-rate budget headers; the active-call cap also carries `RateLimit-Remaining-Calls: 0`.
if ((int)__response.StatusCode == 429)
{
string? __content_429 = null;
global::System.Exception? __exception_429 = null;
global::Speechify.Error? __value_429 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_429 = global::Speechify.Error.FromJson(__content_429, JsonSerializerContext);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_429 = global::Speechify.Error.FromJson(__content_429, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_429 = __ex;
}


throw global::Speechify.ApiException<global::Speechify.Error>.Create(
statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
responseBody: __content_429,
responseObject: __value_429,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// An unexpected server-side error occurred. Safe to retry with exponential backoff for idempotent requests.
if ((int)__response.StatusCode == 500)
{
string? __content_500 = null;
global::System.Exception? __exception_500 = null;
global::Speechify.Error? __value_500 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_500 = global::Speechify.Error.FromJson(__content_500, JsonSerializerContext);
}
else
{
__content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_500 = global::Speechify.Error.FromJson(__content_500, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_500 = __ex;
}


throw global::Speechify.ApiException<global::Speechify.Error>.Create(
statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
responseBody: __content_500,
responseObject: __value_500,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}

if (__effectiveReadResponseAsString)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,80 @@ partial void ProcessDeleteResponseContent(
h => h.Key,
h => h.Value));
}
// Rate limit or concurrency limit exceeded. `error.code` says which ceiling, and they need different responses: `rate_limited` is the request-rate budget (slow down), `concurrency_limit_reached` is a workspace-wide concurrency ceiling (fewer at once, or raise it), and `conversation_turn_in_progress` is contention over one named conversation (keep one message in flight on it). Every 429 carries `Retry-After` and the request-rate budget headers; the active-call cap also carries `RateLimit-Remaining-Calls: 0`.
if ((int)__response.StatusCode == 429)
{
string? __content_429 = null;
global::System.Exception? __exception_429 = null;
global::Speechify.Error? __value_429 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_429 = global::Speechify.Error.FromJson(__content_429, JsonSerializerContext);
}
else
{
__content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_429 = global::Speechify.Error.FromJson(__content_429, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_429 = __ex;
}


throw global::Speechify.ApiException<global::Speechify.Error>.Create(
statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
responseBody: __content_429,
responseObject: __value_429,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// An unexpected server-side error occurred. Safe to retry with exponential backoff for idempotent requests.
if ((int)__response.StatusCode == 500)
{
string? __content_500 = null;
global::System.Exception? __exception_500 = null;
global::Speechify.Error? __value_500 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_500 = global::Speechify.Error.FromJson(__content_500, JsonSerializerContext);
}
else
{
__content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_500 = global::Speechify.Error.FromJson(__content_500, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_500 = __ex;
}


throw global::Speechify.ApiException<global::Speechify.Error>.Create(
statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
responseBody: __content_500,
responseObject: __value_500,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}

if (__effectiveReadResponseAsString)
{
Expand Down
Loading