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
182 changes: 113 additions & 69 deletions src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.OutputItems.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class OutputSearchModelsServerToolItemTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.OutputSearchModelsServerToolItemType>
{
/// <inheritdoc />
public override global::OpenRouter.OutputSearchModelsServerToolItemType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.OutputSearchModelsServerToolItemTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::OpenRouter.OutputSearchModelsServerToolItemType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.OutputSearchModelsServerToolItemType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.OutputSearchModelsServerToolItemType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::OpenRouter.OutputSearchModelsServerToolItemTypeExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace OpenRouter.JsonConverters
{
/// <inheritdoc />
public sealed class OutputSearchModelsServerToolItemTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenRouter.OutputSearchModelsServerToolItemType?>
{
/// <inheritdoc />
public override global::OpenRouter.OutputSearchModelsServerToolItemType? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::OpenRouter.OutputSearchModelsServerToolItemTypeExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::OpenRouter.OutputSearchModelsServerToolItemType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::OpenRouter.OutputSearchModelsServerToolItemType?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenRouter.OutputSearchModelsServerToolItemType? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::OpenRouter.OutputSearchModelsServerToolItemTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ namespace OpenRouter

typeof(global::OpenRouter.JsonConverters.OutputCodeInterpreterServerToolItemTypeNullableJsonConverter),

typeof(global::OpenRouter.JsonConverters.OutputSearchModelsServerToolItemTypeJsonConverter),

typeof(global::OpenRouter.JsonConverters.OutputSearchModelsServerToolItemTypeNullableJsonConverter),

typeof(global::OpenRouter.JsonConverters.OutputFileSearchServerToolItemTypeJsonConverter),

typeof(global::OpenRouter.JsonConverters.OutputFileSearchServerToolItemTypeNullableJsonConverter),
Expand Down Expand Up @@ -2057,6 +2061,7 @@ namespace OpenRouter
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputBashServerToolItemType), TypeInfoPropertyName = "OutputBashServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputBrowserUseServerToolItemType), TypeInfoPropertyName = "OutputBrowserUseServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputCodeInterpreterServerToolItemType), TypeInfoPropertyName = "OutputCodeInterpreterServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputSearchModelsServerToolItemType), TypeInfoPropertyName = "OutputSearchModelsServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputFileSearchServerToolItemType), TypeInfoPropertyName = "OutputFileSearchServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputImageGenerationServerToolItemType), TypeInfoPropertyName = "OutputImageGenerationServerToolItemType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputMcpServerToolItemType), TypeInfoPropertyName = "OutputMcpServerToolItemType2")]
Expand Down Expand Up @@ -2090,6 +2095,7 @@ namespace OpenRouter
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputItemsVariant19))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputItemsVariant20))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputItemsVariant21))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputItemsVariant22))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OutputItemsDiscriminator))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.UsageCostDetails))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.Usage))]
Expand Down
Loading