// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Responses
{
    internal readonly partial struct InternalToolType : IEquatable<InternalToolType>
    {
        private readonly string _value;
        private const string FileSearchValue = "file_search";
        private const string FunctionValue = "function";
        private const string ComputerUsePreviewValue = "computer_use_preview";
        private const string WebSearchPreviewValue = "web_search_preview";
        private const string McpValue = "mcp";
        private const string CodeInterpreterValue = "code_interpreter";
        private const string ImageGenerationValue = "image_generation";
        private const string LocalShellValue = "local_shell";

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

            _value = value;
        }

        internal static InternalToolType FileSearch { get; } = new InternalToolType(FileSearchValue);

        internal static InternalToolType Function { get; } = new InternalToolType(FunctionValue);

        internal static InternalToolType ComputerUsePreview { get; } = new InternalToolType(ComputerUsePreviewValue);

        internal static InternalToolType WebSearchPreview { get; } = new InternalToolType(WebSearchPreviewValue);

        internal static InternalToolType Mcp { get; } = new InternalToolType(McpValue);

        internal static InternalToolType CodeInterpreter { get; } = new InternalToolType(CodeInterpreterValue);

        internal static InternalToolType ImageGeneration { get; } = new InternalToolType(ImageGenerationValue);

        internal static InternalToolType LocalShell { get; } = new InternalToolType(LocalShellValue);

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

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

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

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

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