// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using OpenAI;

namespace OpenAI.Images
{
    [Experimental("OPENAI001")]
    public readonly partial struct GeneratedImageFileFormat : IEquatable<GeneratedImageFileFormat>
    {
        private readonly string _value;
        private const string PngValue = "png";
        private const string JpegValue = "jpeg";
        private const string WebpValue = "webp";

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

            _value = value;
        }

        public static GeneratedImageFileFormat Png { get; } = new GeneratedImageFileFormat(PngValue);

        public static GeneratedImageFileFormat Jpeg { get; } = new GeneratedImageFileFormat(JpegValue);

        public static GeneratedImageFileFormat Webp { get; } = new GeneratedImageFileFormat(WebpValue);

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

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

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

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

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