Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 4, 2024
1 parent 81da0b0 commit ab69e07
Show file tree
Hide file tree
Showing 309 changed files with 19,394 additions and 1,028 deletions.
49 changes: 49 additions & 0 deletions src/libs/OpenAI/Generated/JsonConverters.CostsResultObject.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class CostsResultObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.CostsResultObject>
{
/// <inheritdoc />
public override global::OpenAI.CostsResultObject 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::OpenAI.CostsResultObjectExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

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

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class CostsResultObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.CostsResultObject?>
{
/// <inheritdoc />
public override global::OpenAI.CostsResultObject? 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::OpenAI.CostsResultObjectExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenAI.CostsResultObject? 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::OpenAI.CostsResultObjectExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class RealtimeClientEventConversationItemCreateTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.RealtimeClientEventConversationItemCreateType>
{
/// <inheritdoc />
public override global::OpenAI.RealtimeClientEventConversationItemCreateType 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::OpenAI.RealtimeClientEventConversationItemCreateTypeExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

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

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class RealtimeClientEventConversationItemCreateTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.RealtimeClientEventConversationItemCreateType?>
{
/// <inheritdoc />
public override global::OpenAI.RealtimeClientEventConversationItemCreateType? 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::OpenAI.RealtimeClientEventConversationItemCreateTypeExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenAI.RealtimeClientEventConversationItemCreateType? 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::OpenAI.RealtimeClientEventConversationItemCreateTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class RealtimeClientEventConversationItemDeleteTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.RealtimeClientEventConversationItemDeleteType>
{
/// <inheritdoc />
public override global::OpenAI.RealtimeClientEventConversationItemDeleteType 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::OpenAI.RealtimeClientEventConversationItemDeleteTypeExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

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

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class RealtimeClientEventConversationItemDeleteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.RealtimeClientEventConversationItemDeleteType?>
{
/// <inheritdoc />
public override global::OpenAI.RealtimeClientEventConversationItemDeleteType? 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::OpenAI.RealtimeClientEventConversationItemDeleteTypeExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenAI.RealtimeClientEventConversationItemDeleteType? 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::OpenAI.RealtimeClientEventConversationItemDeleteTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

namespace OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class RealtimeClientEventConversationItemTruncateTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.RealtimeClientEventConversationItemTruncateType>
{
/// <inheritdoc />
public override global::OpenAI.RealtimeClientEventConversationItemTruncateType 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::OpenAI.RealtimeClientEventConversationItemTruncateTypeExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenAI.RealtimeClientEventConversationItemTruncateTypeExtensions.ToValueString(value));
}
}
}
Loading

0 comments on commit ab69e07

Please sign in to comment.