openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6b3c8b0a3d3208218dc3cbcd295502024988a956

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Generated/Models/Chat/ChatCompletionCollectionOrder.cs

48lines · modecode

1// <auto-generated/>
2
3#nullable disable
4
5using System;
6using System.ComponentModel;
7using System.Diagnostics.CodeAnalysis;
8using OpenAI;
9
10namespace OpenAI.Chat
11{
12 [Experimental("OPENAI001")]
13 public readonly partial struct ChatCompletionCollectionOrder : IEquatable<ChatCompletionCollectionOrder>
14 {
15 private readonly string _value;
16 private const string AscendingValue = "asc";
17 private const string DescendingValue = "desc";
18
19 public ChatCompletionCollectionOrder(string value)
20 {
21 Argument.AssertNotNull(value, nameof(value));
22
23 _value = value;
24 }
25
26 public static ChatCompletionCollectionOrder Ascending { get; } = new ChatCompletionCollectionOrder(AscendingValue);
27
28 public static ChatCompletionCollectionOrder Descending { get; } = new ChatCompletionCollectionOrder(DescendingValue);
29
30 public static bool operator ==(ChatCompletionCollectionOrder left, ChatCompletionCollectionOrder right) => left.Equals(right);
31
32 public static bool operator !=(ChatCompletionCollectionOrder left, ChatCompletionCollectionOrder right) => !left.Equals(right);
33
34 public static implicit operator ChatCompletionCollectionOrder(string value) => new ChatCompletionCollectionOrder(value);
35
36 public static implicit operator ChatCompletionCollectionOrder?(string value) => value == null ? null : new ChatCompletionCollectionOrder(value);
37
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 public override bool Equals(object obj) => obj is ChatCompletionCollectionOrder other && Equals(other);
40
41 public bool Equals(ChatCompletionCollectionOrder other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
42
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
45
46 public override string ToString() => _value;
47 }
48}