Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Update openapi.yaml file in src/libs/OpenAI directory #127

Merged
merged 1 commit into from
Nov 19, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#nullable enable

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

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

return default;
}

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

writer.WriteStringValue(global::OpenAI.ProjectRateLimitListResponseObjectExtensions.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 ProjectRateLimitListResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.ProjectRateLimitListResponseObject?>
{
/// <inheritdoc />
public override global::OpenAI.ProjectRateLimitListResponseObject? 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.ProjectRateLimitListResponseObjectExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenAI.ProjectRateLimitListResponseObject? 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.ProjectRateLimitListResponseObjectExtensions.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 ProjectRateLimitObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.ProjectRateLimitObject>
{
/// <inheritdoc />
public override global::OpenAI.ProjectRateLimitObject 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.ProjectRateLimitObjectExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::OpenAI.ProjectRateLimitObjectExtensions.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 ProjectRateLimitObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::OpenAI.ProjectRateLimitObject?>
{
/// <inheritdoc />
public override global::OpenAI.ProjectRateLimitObject? 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.ProjectRateLimitObjectExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::OpenAI.ProjectRateLimitObject? 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.ProjectRateLimitObjectExtensions.ToValueString(value.Value));
}
}
}
}
4 changes: 4 additions & 0 deletions src/libs/OpenAI/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ namespace OpenAI
typeof(global::OpenAI.JsonConverters.ProjectApiKeyListResponseObjectNullableJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectListResponseObjectJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectListResponseObjectNullableJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectRateLimitObjectJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectRateLimitObjectNullableJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectRateLimitListResponseObjectJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectRateLimitListResponseObjectNullableJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectServiceAccountApiKeyObjectJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectServiceAccountApiKeyObjectNullableJsonConverter),
typeof(global::OpenAI.JsonConverters.ProjectServiceAccountCreateResponseObjectJsonConverter),
Expand Down
Loading