Skip to content

Commit 90c3805

Browse files
HavenDVgithub-actions[bot]
andauthored
feat: Updated OpenAPI spec (#219)
Co-authored-by: github-actions[bot] <[email protected]>
1 parent 22cb9bc commit 90c3805

16 files changed

+2692
-1761
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#nullable enable
2+
3+
namespace tryAGI.OpenAI
4+
{
5+
public readonly partial struct AnyOf<T1, T2, T3, T4, T5, T6>
6+
{
7+
/// <summary>
8+
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
9+
/// </summary>
10+
public string ToJson(
11+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
12+
{
13+
return global::System.Text.Json.JsonSerializer.Serialize(
14+
this,
15+
this.GetType(),
16+
jsonSerializerContext);
17+
}
18+
19+
/// <summary>
20+
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
21+
/// </summary>
22+
#if NET8_0_OR_GREATER
23+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
24+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
25+
#endif
26+
public string ToJson(
27+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
28+
{
29+
return global::System.Text.Json.JsonSerializer.Serialize(
30+
this,
31+
jsonSerializerOptions);
32+
}
33+
34+
/// <summary>
35+
/// Deserializes a JSON string using the provided JsonSerializerContext.
36+
/// </summary>
37+
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>? FromJson(
38+
string json,
39+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
40+
{
41+
return global::System.Text.Json.JsonSerializer.Deserialize(
42+
json,
43+
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>),
44+
jsonSerializerContext) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>?;
45+
}
46+
47+
/// <summary>
48+
/// Deserializes a JSON string using the provided JsonSerializerOptions.
49+
/// </summary>
50+
#if NET8_0_OR_GREATER
51+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
52+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
53+
#endif
54+
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>? FromJson(
55+
string json,
56+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
57+
{
58+
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>>(
59+
json,
60+
jsonSerializerOptions);
61+
}
62+
63+
/// <summary>
64+
/// Deserializes a JSON stream using the provided JsonSerializerContext.
65+
/// </summary>
66+
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>?> FromJsonStreamAsync(
67+
global::System.IO.Stream jsonStream,
68+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
69+
{
70+
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
71+
jsonStream,
72+
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>),
73+
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>?;
74+
}
75+
76+
/// <summary>
77+
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
78+
/// </summary>
79+
#if NET8_0_OR_GREATER
80+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
81+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
82+
#endif
83+
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>?> FromJsonStreamAsync(
84+
global::System.IO.Stream jsonStream,
85+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
86+
{
87+
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.AnyOf<T1, T2, T3, T4, T5, T6>?>(
88+
jsonStream,
89+
jsonSerializerOptions);
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)