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
6 changes: 3 additions & 3 deletions src/libs/Writer/Generated/Writer..JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ namespace Writer

typeof(global::Writer.JsonConverters.GatewayGetFilesStatusNullableJsonConverter),

typeof(global::Writer.JsonConverters.OrderJsonConverter),
typeof(global::Writer.JsonConverters.GetApplicationsOrderJsonConverter),

typeof(global::Writer.JsonConverters.OrderNullableJsonConverter),
typeof(global::Writer.JsonConverters.GetApplicationsOrderNullableJsonConverter),

typeof(global::Writer.JsonConverters.ApplicationInputOptionsJsonConverter),

Expand Down Expand Up @@ -436,7 +436,7 @@ namespace Writer
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.FindGraphsWithFileStatusOrder))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.GatewayGetFilesOrder))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.GatewayGetFilesStatus))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.Order))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.GetApplicationsOrder))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Writer.ChatCompletionChunk>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Writer.StreamingData>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Writer.GenerateApplicationResponseChunk>))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ public partial class GenerationApiClient
{
partial void PrepareGetApplicationsArguments(
global::System.Net.Http.HttpClient httpClient,
ref global::Writer.Order? order,
ref global::Writer.GetApplicationsOrder? order,
ref global::System.Guid? before,
ref global::System.Guid? after,
ref int? limit,
ref global::Writer.ApplicationType? type);
partial void PrepareGetApplicationsRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::Writer.Order? order,
global::Writer.GetApplicationsOrder? order,
global::System.Guid? before,
global::System.Guid? after,
int? limit,
Expand Down Expand Up @@ -51,7 +51,7 @@ partial void ProcessGetApplicationsResponseContent(
/// --header "Authorization: Bearer &lt;token&gt;"
/// </remarks>
public async global::System.Threading.Tasks.Task<global::Writer.GetApplicationsResponse> GetApplicationsAsync(
global::Writer.Order? order = default,
global::Writer.GetApplicationsOrder? order = default,
global::System.Guid? before = default,
global::System.Guid? after = default,
int? limit = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial interface IGenerationApiClient
/// --header "Authorization: Bearer &lt;token&gt;"
/// </remarks>
global::System.Threading.Tasks.Task<global::Writer.GetApplicationsResponse> GetApplicationsAsync(
global::Writer.Order? order = default,
global::Writer.GetApplicationsOrder? order = default,
global::System.Guid? before = default,
global::System.Guid? after = default,
int? limit = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Writer.JsonConverters
{
/// <inheritdoc />
public sealed class OrderJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Writer.Order>
public sealed class GetApplicationsOrderJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Writer.GetApplicationsOrder>
{
/// <inheritdoc />
public override global::Writer.Order Read(
public override global::Writer.GetApplicationsOrder Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class OrderJsonConverter : global::System.Text.Json.Serialization.
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Writer.OrderExtensions.ToEnum(stringValue) ?? default;
return global::Writer.GetApplicationsOrderExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Writer.Order)numValue;
return (global::Writer.GetApplicationsOrder)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Writer.Order);
return default(global::Writer.GetApplicationsOrder);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,12 +42,12 @@ public sealed class OrderJsonConverter : global::System.Text.Json.Serialization.
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Writer.Order value,
global::Writer.GetApplicationsOrder value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Writer.OrderExtensions.ToValueString(value));
writer.WriteStringValue(global::Writer.GetApplicationsOrderExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Writer.JsonConverters
{
/// <inheritdoc />
public sealed class OrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Writer.Order?>
public sealed class GetApplicationsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Writer.GetApplicationsOrder?>
{
/// <inheritdoc />
public override global::Writer.Order? Read(
public override global::Writer.GetApplicationsOrder? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class OrderNullableJsonConverter : global::System.Text.Json.Serial
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Writer.OrderExtensions.ToEnum(stringValue);
return global::Writer.GetApplicationsOrderExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Writer.Order)numValue;
return (global::Writer.GetApplicationsOrder)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Writer.Order?);
return default(global::Writer.GetApplicationsOrder?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,7 +42,7 @@ public sealed class OrderNullableJsonConverter : global::System.Text.Json.Serial
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Writer.Order? value,
global::Writer.GetApplicationsOrder? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -53,7 +53,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::Writer.OrderExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::Writer.GetApplicationsOrderExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::Writer.Order? Type220 { get; set; }
public global::Writer.GetApplicationsOrder? Type220 { get; set; }
/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Writer
/// <summary>
/// Default Value: desc
/// </summary>
public enum Order
public enum GetApplicationsOrder
{
/// <summary>
///
Expand All @@ -21,29 +21,29 @@ public enum Order
/// <summary>
/// Enum extensions to do fast conversions without the reflection.
/// </summary>
public static class OrderExtensions
public static class GetApplicationsOrderExtensions
{
/// <summary>
/// Converts an enum to a string.
/// </summary>
public static string ToValueString(this Order value)
public static string ToValueString(this GetApplicationsOrder value)
{
return value switch
{
Order.Asc => "asc",
Order.Desc => "desc",
GetApplicationsOrder.Asc => "asc",
GetApplicationsOrder.Desc => "desc",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
/// <summary>
/// Converts an string to a enum.
/// </summary>
public static Order? ToEnum(string value)
public static GetApplicationsOrder? ToEnum(string value)
{
return value switch
{
"asc" => Order.Asc,
"desc" => Order.Desc,
"asc" => GetApplicationsOrder.Asc,
"desc" => GetApplicationsOrder.Desc,
_ => null,
};
}
Expand Down