Skip to content

Commit 1970915

Browse files
author
github-actions[bot]
committed
feat: Updated OpenAPI spec
1 parent 227d9f2 commit 1970915

24 files changed

Lines changed: 1065 additions & 160 deletions

src/libs/Reverie/Generated/Reverie.Exceptions.g.cs

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception
1212
/// The HTTP status code of the response.
1313
/// </summary>
1414
public global::System.Net.HttpStatusCode StatusCode { get; }
15+
1516
/// <summary>
1617
/// The response body as a string, or <c>null</c> if the body could not be read.
1718
/// This is always populated for error responses regardless of the <c>ReadResponseAsString</c> setting.
1819
/// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read.
1920
/// </summary>
2021
public string? ResponseBody { get; set; }
22+
2123
/// <summary>
2224
/// The response headers.
2325
/// </summary>
2426
public global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>>? ResponseHeaders { get; set; }
27+
2528
/// <summary>
2629
/// Initializes a new instance of the <see cref="ApiException"/> class.
2730
/// </summary>
@@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl
4952
{
5053
StatusCode = statusCode;
5154
}
55+
56+
/// <summary>
57+
/// Constructs an <see cref="ApiException"/> instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain <see cref="ApiException"/> when the hierarchy is disabled.
58+
/// </summary>
59+
/// <param name="statusCode">The HTTP status code of the response.</param>
60+
/// <param name="message">The error message.</param>
61+
/// <param name="innerException">An inner exception, when one is available.</param>
62+
/// <param name="responseHeaders">The response headers; consulted for 429 <c>Retry-After</c> parsing when present.</param>
63+
public static global::Reverie.ApiException Create(
64+
global::System.Net.HttpStatusCode statusCode,
65+
string message,
66+
global::System.Exception? innerException = null,
67+
global::System.Collections.Generic.IDictionary<string, global::System.Collections.Generic.IEnumerable<string>>? responseHeaders = null)
68+
{
69+
return new global::Reverie.ApiException(message, innerException, statusCode);
70+
}
71+
72+
/// <summary>
73+
/// Convenience overload that constructs an <see cref="ApiException"/> with response body and headers populated.
74+
/// </summary>
75+
public static global::Reverie.ApiException Create(
76+
global::System.Net.HttpStatusCode statusCode,
77+
string message,
78+
global::System.Exception? innerException,
79+
string? responseBody,
80+
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>>? responseHeaders)
81+
{
82+
var exception = global::Reverie.ApiException.Create(statusCode, message, innerException, responseHeaders);
83+
exception.ResponseBody = responseBody;
84+
exception.ResponseHeaders = responseHeaders;
85+
return exception;
86+
}
87+
88+
/// <summary>
89+
/// Parses a <c>Retry-After</c> response header (delta-seconds or HTTP-date) into a <see cref="global::System.TimeSpan"/>.
90+
/// Returns <c>null</c> when the header is missing or unparseable. Public so consumer code that observes
91+
/// <see cref="ApiException"/> directly can recover the value without re-implementing the parser.
92+
/// </summary>
93+
public static global::System.TimeSpan? TryParseRetryAfter(
94+
global::System.Collections.Generic.IDictionary<string, global::System.Collections.Generic.IEnumerable<string>>? headers)
95+
{
96+
if (headers == null)
97+
{
98+
return null;
99+
}
100+
101+
global::System.Collections.Generic.IEnumerable<string>? values = null;
102+
foreach (var entry in headers)
103+
{
104+
if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase))
105+
{
106+
values = entry.Value;
107+
break;
108+
}
109+
}
110+
111+
if (values == null)
112+
{
113+
return null;
114+
}
115+
116+
string? raw = null;
117+
foreach (var value in values)
118+
{
119+
if (!string.IsNullOrWhiteSpace(value))
120+
{
121+
raw = value.Trim();
122+
break;
123+
}
124+
}
125+
126+
if (string.IsNullOrEmpty(raw))
127+
{
128+
return null;
129+
}
130+
131+
if (int.TryParse(
132+
raw,
133+
global::System.Globalization.NumberStyles.Integer,
134+
global::System.Globalization.CultureInfo.InvariantCulture,
135+
out var seconds) && seconds >= 0)
136+
{
137+
return global::System.TimeSpan.FromSeconds(seconds);
138+
}
139+
140+
if (global::System.DateTimeOffset.TryParse(
141+
raw,
142+
global::System.Globalization.CultureInfo.InvariantCulture,
143+
global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal,
144+
out var when))
145+
{
146+
var delta = when - global::System.DateTimeOffset.UtcNow;
147+
return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero;
148+
}
149+
150+
return null;
151+
}
52152
}
53153

54154
/// <summary>
@@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
88188
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
89189
{
90190
}
191+
192+
/// <summary>
193+
/// Constructs an <see cref="ApiException{T}"/> whose runtime type matches the response status code when the typed exception hierarchy is enabled.
194+
/// </summary>
195+
/// <param name="statusCode">The HTTP status code of the response.</param>
196+
/// <param name="message">The error message.</param>
197+
/// <param name="innerException">An inner exception, when one is available.</param>
198+
/// <param name="responseHeaders">The response headers; consulted for 429 <c>Retry-After</c> parsing when present.</param>
199+
public static new global::Reverie.ApiException<T> Create(
200+
global::System.Net.HttpStatusCode statusCode,
201+
string message,
202+
global::System.Exception? innerException = null,
203+
global::System.Collections.Generic.IDictionary<string, global::System.Collections.Generic.IEnumerable<string>>? responseHeaders = null)
204+
{
205+
return new global::Reverie.ApiException<T>(message, innerException, statusCode);
206+
}
207+
208+
/// <summary>
209+
/// Convenience overload that constructs an <see cref="ApiException{T}"/> with response body, object, and headers populated.
210+
/// </summary>
211+
public static global::Reverie.ApiException<T> Create(
212+
global::System.Net.HttpStatusCode statusCode,
213+
string message,
214+
global::System.Exception? innerException,
215+
string? responseBody,
216+
T? responseObject,
217+
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>>? responseHeaders)
218+
{
219+
var exception = global::Reverie.ApiException<T>.Create(statusCode, message, innerException, responseHeaders);
220+
exception.ResponseBody = responseBody;
221+
exception.ResponseObject = responseObject;
222+
exception.ResponseHeaders = responseHeaders;
223+
return exception;
224+
}
91225
}
92226
}

src/libs/Reverie/Generated/Reverie.Models.BatchStatusResponse.Json.g.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public string ToJson(
1616
jsonSerializerContext);
1717
}
1818

19+
/// <summary>
20+
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
21+
/// </summary>
22+
public string ToJson()
23+
{
24+
return ToJson(global::Reverie.SourceGenerationContext.Default);
25+
}
26+
1927
/// <summary>
2028
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
2129
/// </summary>
@@ -26,6 +34,11 @@ public string ToJson(
2634
public string ToJson(
2735
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
2836
{
37+
if (jsonSerializerOptions is null)
38+
{
39+
return ToJson(global::Reverie.SourceGenerationContext.Default);
40+
}
41+
2942
return global::System.Text.Json.JsonSerializer.Serialize(
3043
this,
3144
jsonSerializerOptions);
@@ -44,6 +57,17 @@ public string ToJson(
4457
jsonSerializerContext) as global::Reverie.BatchStatusResponse;
4558
}
4659

60+
/// <summary>
61+
/// Deserializes a JSON string using the generated default JsonSerializerContext.
62+
/// </summary>
63+
public static global::Reverie.BatchStatusResponse? FromJson(
64+
string json)
65+
{
66+
return FromJson(
67+
json,
68+
global::Reverie.SourceGenerationContext.Default);
69+
}
70+
4771
/// <summary>
4872
/// Deserializes a JSON string using the provided JsonSerializerOptions.
4973
/// </summary>
@@ -55,6 +79,13 @@ public string ToJson(
5579
string json,
5680
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
5781
{
82+
if (jsonSerializerOptions is null)
83+
{
84+
return FromJson(
85+
json,
86+
global::Reverie.SourceGenerationContext.Default);
87+
}
88+
5889
return global::System.Text.Json.JsonSerializer.Deserialize<global::Reverie.BatchStatusResponse>(
5990
json,
6091
jsonSerializerOptions);
@@ -73,6 +104,17 @@ public string ToJson(
73104
jsonSerializerContext).ConfigureAwait(false)) as global::Reverie.BatchStatusResponse;
74105
}
75106

107+
/// <summary>
108+
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
109+
/// </summary>
110+
public static global::System.Threading.Tasks.ValueTask<global::Reverie.BatchStatusResponse?> FromJsonStreamAsync(
111+
global::System.IO.Stream jsonStream)
112+
{
113+
return FromJsonStreamAsync(
114+
jsonStream,
115+
global::Reverie.SourceGenerationContext.Default);
116+
}
117+
76118
/// <summary>
77119
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
78120
/// </summary>
@@ -84,6 +126,13 @@ public string ToJson(
84126
global::System.IO.Stream jsonStream,
85127
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
86128
{
129+
if (jsonSerializerOptions is null)
130+
{
131+
return FromJsonStreamAsync(
132+
jsonStream,
133+
global::Reverie.SourceGenerationContext.Default);
134+
}
135+
87136
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Reverie.BatchStatusResponse?>(
88137
jsonStream,
89138
jsonSerializerOptions);

src/libs/Reverie/Generated/Reverie.Models.BatchTranscriptResponse.Json.g.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public string ToJson(
1616
jsonSerializerContext);
1717
}
1818

19+
/// <summary>
20+
/// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
21+
/// </summary>
22+
public string ToJson()
23+
{
24+
return ToJson(global::Reverie.SourceGenerationContext.Default);
25+
}
26+
1927
/// <summary>
2028
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
2129
/// </summary>
@@ -26,6 +34,11 @@ public string ToJson(
2634
public string ToJson(
2735
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
2836
{
37+
if (jsonSerializerOptions is null)
38+
{
39+
return ToJson(global::Reverie.SourceGenerationContext.Default);
40+
}
41+
2942
return global::System.Text.Json.JsonSerializer.Serialize(
3043
this,
3144
jsonSerializerOptions);
@@ -44,6 +57,17 @@ public string ToJson(
4457
jsonSerializerContext) as global::Reverie.BatchTranscriptResponse;
4558
}
4659

60+
/// <summary>
61+
/// Deserializes a JSON string using the generated default JsonSerializerContext.
62+
/// </summary>
63+
public static global::Reverie.BatchTranscriptResponse? FromJson(
64+
string json)
65+
{
66+
return FromJson(
67+
json,
68+
global::Reverie.SourceGenerationContext.Default);
69+
}
70+
4771
/// <summary>
4872
/// Deserializes a JSON string using the provided JsonSerializerOptions.
4973
/// </summary>
@@ -55,6 +79,13 @@ public string ToJson(
5579
string json,
5680
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
5781
{
82+
if (jsonSerializerOptions is null)
83+
{
84+
return FromJson(
85+
json,
86+
global::Reverie.SourceGenerationContext.Default);
87+
}
88+
5889
return global::System.Text.Json.JsonSerializer.Deserialize<global::Reverie.BatchTranscriptResponse>(
5990
json,
6091
jsonSerializerOptions);
@@ -73,6 +104,17 @@ public string ToJson(
73104
jsonSerializerContext).ConfigureAwait(false)) as global::Reverie.BatchTranscriptResponse;
74105
}
75106

107+
/// <summary>
108+
/// Deserializes a JSON stream using the generated default JsonSerializerContext.
109+
/// </summary>
110+
public static global::System.Threading.Tasks.ValueTask<global::Reverie.BatchTranscriptResponse?> FromJsonStreamAsync(
111+
global::System.IO.Stream jsonStream)
112+
{
113+
return FromJsonStreamAsync(
114+
jsonStream,
115+
global::Reverie.SourceGenerationContext.Default);
116+
}
117+
76118
/// <summary>
77119
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
78120
/// </summary>
@@ -84,6 +126,13 @@ public string ToJson(
84126
global::System.IO.Stream jsonStream,
85127
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
86128
{
129+
if (jsonSerializerOptions is null)
130+
{
131+
return FromJsonStreamAsync(
132+
jsonStream,
133+
global::Reverie.SourceGenerationContext.Default);
134+
}
135+
87136
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Reverie.BatchTranscriptResponse?>(
88137
jsonStream,
89138
jsonSerializerOptions);

0 commit comments

Comments
 (0)