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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace tryAGI.OpenAI
{
public readonly partial struct OneOf<T1>
public readonly partial struct AnyOf<T1>
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
Expand Down Expand Up @@ -34,14 +34,14 @@ public string ToJson(
/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::tryAGI.OpenAI.OneOf<T1>? FromJson(
public static global::tryAGI.OpenAI.AnyOf<T1>? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::tryAGI.OpenAI.OneOf<T1>),
jsonSerializerContext) as global::tryAGI.OpenAI.OneOf<T1>?;
typeof(global::tryAGI.OpenAI.AnyOf<T1>),
jsonSerializerContext) as global::tryAGI.OpenAI.AnyOf<T1>?;
}

/// <summary>
Expand All @@ -51,26 +51,26 @@ public string ToJson(
[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.")]
[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.")]
#endif
public static global::tryAGI.OpenAI.OneOf<T1>? FromJson(
public static global::tryAGI.OpenAI.AnyOf<T1>? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.OneOf<T1>>(
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.AnyOf<T1>>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.OneOf<T1>?> FromJsonStreamAsync(
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::tryAGI.OpenAI.OneOf<T1>),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.OneOf<T1>?;
typeof(global::tryAGI.OpenAI.AnyOf<T1>),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.AnyOf<T1>?;
}

/// <summary>
Expand All @@ -80,11 +80,11 @@ public string ToJson(
[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.")]
[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.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.OneOf<T1>?> FromJsonStreamAsync(
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.OneOf<T1>?>(
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.AnyOf<T1>?>(
jsonStream,
jsonSerializerOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public readonly partial struct OneOf<T1> : global::System.IEquatable<OneOf<T1>>
public readonly partial struct AnyOf<T1> : global::System.IEquatable<AnyOf<T1>>
{
/// <summary>
///
Expand All @@ -28,17 +28,17 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public static implicit operator OneOf<T1>(T1 value) => new OneOf<T1>((T1?)value);
public static implicit operator AnyOf<T1>(T1 value) => new AnyOf<T1>((T1?)value);

/// <summary>
///
/// </summary>
public static implicit operator T1?(OneOf<T1> @this) => @this.Value1;
public static implicit operator T1?(AnyOf<T1> @this) => @this.Value1;

/// <summary>
///
/// </summary>
public OneOf(T1? value)
public AnyOf(T1? value)
{
Value1 = value;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null
/// <summary>
///
/// </summary>
public bool Equals(OneOf<T1> other)
public bool Equals(AnyOf<T1> other)
{
return
global::System.Collections.Generic.EqualityComparer<T1?>.Default.Equals(Value1, other.Value1)
Expand All @@ -135,15 +135,15 @@ public bool Equals(OneOf<T1> other)
/// <summary>
///
/// </summary>
public static bool operator ==(OneOf<T1> obj1, OneOf<T1> obj2)
public static bool operator ==(AnyOf<T1> obj1, AnyOf<T1> obj2)
{
return global::System.Collections.Generic.EqualityComparer<OneOf<T1>>.Default.Equals(obj1, obj2);
return global::System.Collections.Generic.EqualityComparer<AnyOf<T1>>.Default.Equals(obj1, obj2);
}

/// <summary>
///
/// </summary>
public static bool operator !=(OneOf<T1> obj1, OneOf<T1> obj2)
public static bool operator !=(AnyOf<T1> obj1, AnyOf<T1> obj2)
{
return !(obj1 == obj2);
}
Expand All @@ -153,7 +153,7 @@ public bool Equals(OneOf<T1> other)
/// </summary>
public override bool Equals(object? obj)
{
return obj is OneOf<T1> o && Equals(o);
return obj is AnyOf<T1> o && Equals(o);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace tryAGI.OpenAI
{
public readonly partial struct OneOf<T1, T2, T3>
public readonly partial struct AnyOf<T1, T2, T3>
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
Expand Down Expand Up @@ -34,14 +34,14 @@ public string ToJson(
/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::tryAGI.OpenAI.OneOf<T1, T2, T3>? FromJson(
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3>? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::tryAGI.OpenAI.OneOf<T1, T2, T3>),
jsonSerializerContext) as global::tryAGI.OpenAI.OneOf<T1, T2, T3>?;
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3>),
jsonSerializerContext) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3>?;
}

/// <summary>
Expand All @@ -51,26 +51,26 @@ public string ToJson(
[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.")]
[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.")]
#endif
public static global::tryAGI.OpenAI.OneOf<T1, T2, T3>? FromJson(
public static global::tryAGI.OpenAI.AnyOf<T1, T2, T3>? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.OneOf<T1, T2, T3>>(
return global::System.Text.Json.JsonSerializer.Deserialize<global::tryAGI.OpenAI.AnyOf<T1, T2, T3>>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.OneOf<T1, T2, T3>?> FromJsonStreamAsync(
public static async global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::tryAGI.OpenAI.OneOf<T1, T2, T3>),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.OneOf<T1, T2, T3>?;
typeof(global::tryAGI.OpenAI.AnyOf<T1, T2, T3>),
jsonSerializerContext).ConfigureAwait(false)) as global::tryAGI.OpenAI.AnyOf<T1, T2, T3>?;
}

/// <summary>
Expand All @@ -80,11 +80,11 @@ public string ToJson(
[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.")]
[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.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.OneOf<T1, T2, T3>?> FromJsonStreamAsync(
public static global::System.Threading.Tasks.ValueTask<global::tryAGI.OpenAI.AnyOf<T1, T2, T3>?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.OneOf<T1, T2, T3>?>(
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::tryAGI.OpenAI.AnyOf<T1, T2, T3>?>(
jsonStream,
jsonSerializerOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public readonly partial struct OneOf<T1, T2, T3> : global::System.IEquatable<OneOf<T1, T2, T3>>
public readonly partial struct AnyOf<T1, T2, T3> : global::System.IEquatable<AnyOf<T1, T2, T3>>
{
/// <summary>
///
Expand All @@ -28,17 +28,17 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public static implicit operator OneOf<T1, T2, T3>(T1 value) => new OneOf<T1, T2, T3>((T1?)value);
public static implicit operator AnyOf<T1, T2, T3>(T1 value) => new AnyOf<T1, T2, T3>((T1?)value);

/// <summary>
///
/// </summary>
public static implicit operator T1?(OneOf<T1, T2, T3> @this) => @this.Value1;
public static implicit operator T1?(AnyOf<T1, T2, T3> @this) => @this.Value1;

/// <summary>
///
/// </summary>
public OneOf(T1? value)
public AnyOf(T1? value)
{
Value1 = value;
}
Expand All @@ -63,17 +63,17 @@ public OneOf(T1? value)
/// <summary>
///
/// </summary>
public static implicit operator OneOf<T1, T2, T3>(T2 value) => new OneOf<T1, T2, T3>((T2?)value);
public static implicit operator AnyOf<T1, T2, T3>(T2 value) => new AnyOf<T1, T2, T3>((T2?)value);

/// <summary>
///
/// </summary>
public static implicit operator T2?(OneOf<T1, T2, T3> @this) => @this.Value2;
public static implicit operator T2?(AnyOf<T1, T2, T3> @this) => @this.Value2;

/// <summary>
///
/// </summary>
public OneOf(T2? value)
public AnyOf(T2? value)
{
Value2 = value;
}
Expand All @@ -98,25 +98,25 @@ public OneOf(T2? value)
/// <summary>
///
/// </summary>
public static implicit operator OneOf<T1, T2, T3>(T3 value) => new OneOf<T1, T2, T3>((T3?)value);
public static implicit operator AnyOf<T1, T2, T3>(T3 value) => new AnyOf<T1, T2, T3>((T3?)value);

/// <summary>
///
/// </summary>
public static implicit operator T3?(OneOf<T1, T2, T3> @this) => @this.Value3;
public static implicit operator T3?(AnyOf<T1, T2, T3> @this) => @this.Value3;

/// <summary>
///
/// </summary>
public OneOf(T3? value)
public AnyOf(T3? value)
{
Value3 = value;
}

/// <summary>
///
/// </summary>
public OneOf(
public AnyOf(
T1? value1,
T2? value2,
T3? value3
Expand Down Expand Up @@ -150,7 +150,7 @@ Value1 as object
/// </summary>
public bool Validate()
{
return IsValue1 && !IsValue2 && !IsValue3 || !IsValue1 && IsValue2 && !IsValue3 || !IsValue1 && !IsValue2 && IsValue3;
return IsValue1 || IsValue2 || IsValue3;
}

/// <summary>
Expand Down Expand Up @@ -237,7 +237,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null
/// <summary>
///
/// </summary>
public bool Equals(OneOf<T1, T2, T3> other)
public bool Equals(AnyOf<T1, T2, T3> other)
{
return
global::System.Collections.Generic.EqualityComparer<T1?>.Default.Equals(Value1, other.Value1) &&
Expand All @@ -249,15 +249,15 @@ public bool Equals(OneOf<T1, T2, T3> other)
/// <summary>
///
/// </summary>
public static bool operator ==(OneOf<T1, T2, T3> obj1, OneOf<T1, T2, T3> obj2)
public static bool operator ==(AnyOf<T1, T2, T3> obj1, AnyOf<T1, T2, T3> obj2)
{
return global::System.Collections.Generic.EqualityComparer<OneOf<T1, T2, T3>>.Default.Equals(obj1, obj2);
return global::System.Collections.Generic.EqualityComparer<AnyOf<T1, T2, T3>>.Default.Equals(obj1, obj2);
}

/// <summary>
///
/// </summary>
public static bool operator !=(OneOf<T1, T2, T3> obj1, OneOf<T1, T2, T3> obj2)
public static bool operator !=(AnyOf<T1, T2, T3> obj1, AnyOf<T1, T2, T3> obj2)
{
return !(obj1 == obj2);
}
Expand All @@ -267,7 +267,7 @@ public bool Equals(OneOf<T1, T2, T3> other)
/// </summary>
public override bool Equals(object? obj)
{
return obj is OneOf<T1, T2, T3> o && Equals(o);
return obj is AnyOf<T1, T2, T3> o && Equals(o);
}
}
}
Loading
Loading