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
9 changes: 0 additions & 9 deletions src/Custom/Conversations/IncludedConversationItemProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace OpenAI.Conversations
// - Renamed.
// - Implemented in custom code due to a bug in the code generator that skips generation for this type when only
// protocol methods are generated.
[Experimental("OPENAI001")]
[CodeGenType("IncludeEnum")]
public readonly partial struct IncludedConversationItemProperty : IEquatable<IncludedConversationItemProperty>
{
Expand Down Expand Up @@ -50,14 +49,6 @@ public IncludedConversationItemProperty(string value)

public static IncludedConversationItemProperty MessageOutputTextLogprobs { get; } = new IncludedConversationItemProperty(MessageOutputTextLogprobsValue);

public static bool operator ==(IncludedConversationItemProperty left, IncludedConversationItemProperty right) => left.Equals(right);

public static bool operator !=(IncludedConversationItemProperty left, IncludedConversationItemProperty right) => !left.Equals(right);

public static implicit operator IncludedConversationItemProperty(string value) => new IncludedConversationItemProperty(value);

public static implicit operator IncludedConversationItemProperty?(string value) => value == null ? null : new IncludedConversationItemProperty(value);

[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is IncludedConversationItemProperty other && Equals(other);

Expand Down
11 changes: 11 additions & 0 deletions src/Custom/Videos/Internal/InternalOrderEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.TypeSpec.Generator.Customizations;

namespace OpenAI.Videos;

// CUSTOM:
// - Renamed.
// - Made internal until we support the convenience methods.
[CodeGenType("OrderEnum")]
internal readonly partial struct InternalOrderEnum
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other tip / suggestion I have is to use the access decorator to set this type to internal. Though I don't see us using that anywhere else, so feel free to ignore and see what Jose thinks!

{
}
11 changes: 11 additions & 0 deletions src/Custom/Videos/Internal/InternalVideoContentVariant.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.TypeSpec.Generator.Customizations;

namespace OpenAI.Videos;

// CUSTOM:
// - Renamed.
// - Made internal until we support the convenience methods.
[CodeGenType("VideoContentVariant")]
internal readonly partial struct InternalVideoContentVariant
{
}
31 changes: 0 additions & 31 deletions src/Generated/Models/OrderEnum.Serialization.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/Generated/Models/OrderEnum.cs

This file was deleted.

36 changes: 0 additions & 36 deletions src/Generated/Models/VideoContentVariant.Serialization.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/Generated/Models/VideoContentVariant.cs

This file was deleted.

43 changes: 43 additions & 0 deletions src/Generated/Models/Videos/InternalOrderEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace OpenAI.Videos
{
internal readonly partial struct InternalOrderEnum : IEquatable<InternalOrderEnum>
{
private readonly string _value;
private const string AscValue = "asc";
private const string DescValue = "desc";

public InternalOrderEnum(string value)
{
_value = value;
}

internal static InternalOrderEnum Asc { get; } = new InternalOrderEnum(AscValue);

internal static InternalOrderEnum Desc { get; } = new InternalOrderEnum(DescValue);

public static bool operator ==(InternalOrderEnum left, InternalOrderEnum right) => left.Equals(right);

public static bool operator !=(InternalOrderEnum left, InternalOrderEnum right) => !left.Equals(right);

public static implicit operator InternalOrderEnum(string value) => new InternalOrderEnum(value);

public static implicit operator InternalOrderEnum?(string value) => value == null ? null : new InternalOrderEnum(value);

[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is InternalOrderEnum other && Equals(other);

public bool Equals(InternalOrderEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;

public override string ToString() => _value;
}
}
46 changes: 46 additions & 0 deletions src/Generated/Models/Videos/InternalVideoContentVariant.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace OpenAI.Videos
{
internal readonly partial struct InternalVideoContentVariant : IEquatable<InternalVideoContentVariant>
{
private readonly string _value;
private const string VideoValue = "video";
private const string ThumbnailValue = "thumbnail";
private const string SpritesheetValue = "spritesheet";

public InternalVideoContentVariant(string value)
{
_value = value;
}

internal static InternalVideoContentVariant Video { get; } = new InternalVideoContentVariant(VideoValue);

internal static InternalVideoContentVariant Thumbnail { get; } = new InternalVideoContentVariant(ThumbnailValue);

internal static InternalVideoContentVariant Spritesheet { get; } = new InternalVideoContentVariant(SpritesheetValue);

public static bool operator ==(InternalVideoContentVariant left, InternalVideoContentVariant right) => left.Equals(right);

public static bool operator !=(InternalVideoContentVariant left, InternalVideoContentVariant right) => !left.Equals(right);

public static implicit operator InternalVideoContentVariant(string value) => new InternalVideoContentVariant(value);

public static implicit operator InternalVideoContentVariant?(string value) => value == null ? null : new InternalVideoContentVariant(value);

[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is InternalVideoContentVariant other && Equals(other);

public bool Equals(InternalVideoContentVariant other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;

public override string ToString() => _value;
}
}