// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.RealtimeConversation
{
    public readonly partial struct ConversationIncompleteReason : IEquatable<ConversationIncompleteReason>
    {
        private readonly string _value;
        private const string TurnDetectedValue = "turn_detected";
        private const string ClientCancelledValue = "client_cancelled";
        private const string MaxOutputTokensValue = "max_output_tokens";
        private const string ContentFilterValue = "content_filter";

        public ConversationIncompleteReason(string value)
        {
            Argument.AssertNotNull(value, nameof(value));

            _value = value;
        }

        public static ConversationIncompleteReason TurnDetected { get; } = new ConversationIncompleteReason(TurnDetectedValue);

        public static ConversationIncompleteReason ClientCancelled { get; } = new ConversationIncompleteReason(ClientCancelledValue);

        public static ConversationIncompleteReason MaxOutputTokens { get; } = new ConversationIncompleteReason(MaxOutputTokensValue);

        public static ConversationIncompleteReason ContentFilter { get; } = new ConversationIncompleteReason(ContentFilterValue);

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

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

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

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

        public bool Equals(ConversationIncompleteReason 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;
    }
}
