// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Responses
{
    public readonly partial struct ResponseErrorCode : IEquatable<ResponseErrorCode>
    {
        private readonly string _value;
        private const string ServerErrorValue = "server_error";
        private const string RateLimitExceededValue = "rate_limit_exceeded";
        private const string InvalidPromptValue = "invalid_prompt";
        private const string VectorStoreTimeoutValue = "vector_store_timeout";
        private const string InvalidImageValue = "invalid_image";
        private const string InvalidImageFormatValue = "invalid_image_format";
        private const string InvalidBase64ImageValue = "invalid_base64_image";
        private const string InvalidImageUrlValue = "invalid_image_url";
        private const string ImageTooLargeValue = "image_too_large";
        private const string ImageTooSmallValue = "image_too_small";
        private const string ImageParseErrorValue = "image_parse_error";
        private const string ImageContentPolicyViolationValue = "image_content_policy_violation";
        private const string InvalidImageModeValue = "invalid_image_mode";
        private const string ImageFileTooLargeValue = "image_file_too_large";
        private const string UnsupportedImageMediaTypeValue = "unsupported_image_media_type";
        private const string EmptyImageFileValue = "empty_image_file";
        private const string FailedToDownloadImageValue = "failed_to_download_image";
        private const string ImageFileNotFoundValue = "image_file_not_found";

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

            _value = value;
        }

        public static ResponseErrorCode ServerError { get; } = new ResponseErrorCode(ServerErrorValue);

        public static ResponseErrorCode RateLimitExceeded { get; } = new ResponseErrorCode(RateLimitExceededValue);

        public static ResponseErrorCode InvalidPrompt { get; } = new ResponseErrorCode(InvalidPromptValue);

        public static ResponseErrorCode VectorStoreTimeout { get; } = new ResponseErrorCode(VectorStoreTimeoutValue);

        public static ResponseErrorCode InvalidImage { get; } = new ResponseErrorCode(InvalidImageValue);

        public static ResponseErrorCode InvalidImageFormat { get; } = new ResponseErrorCode(InvalidImageFormatValue);

        public static ResponseErrorCode InvalidBase64Image { get; } = new ResponseErrorCode(InvalidBase64ImageValue);

        public static ResponseErrorCode InvalidImageUrl { get; } = new ResponseErrorCode(InvalidImageUrlValue);

        public static ResponseErrorCode ImageTooLarge { get; } = new ResponseErrorCode(ImageTooLargeValue);

        public static ResponseErrorCode ImageTooSmall { get; } = new ResponseErrorCode(ImageTooSmallValue);

        public static ResponseErrorCode ImageParseError { get; } = new ResponseErrorCode(ImageParseErrorValue);

        public static ResponseErrorCode ImageContentPolicyViolation { get; } = new ResponseErrorCode(ImageContentPolicyViolationValue);

        public static ResponseErrorCode InvalidImageMode { get; } = new ResponseErrorCode(InvalidImageModeValue);

        public static ResponseErrorCode ImageFileTooLarge { get; } = new ResponseErrorCode(ImageFileTooLargeValue);

        public static ResponseErrorCode UnsupportedImageMediaType { get; } = new ResponseErrorCode(UnsupportedImageMediaTypeValue);

        public static ResponseErrorCode EmptyImageFile { get; } = new ResponseErrorCode(EmptyImageFileValue);

        public static ResponseErrorCode FailedToDownloadImage { get; } = new ResponseErrorCode(FailedToDownloadImageValue);

        public static ResponseErrorCode ImageFileNotFound { get; } = new ResponseErrorCode(ImageFileNotFoundValue);

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

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

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

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

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