// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.VectorStores
{
    internal static partial class VectorStoreFileAssociationStatusExtensions
    {
        public static string ToSerialString(this VectorStores.VectorStoreFileAssociationStatus value) => value switch
        {
            VectorStores.VectorStoreFileAssociationStatus.InProgress => "in_progress",
            VectorStores.VectorStoreFileAssociationStatus.Completed => "completed",
            VectorStores.VectorStoreFileAssociationStatus.Cancelled => "cancelled",
            VectorStores.VectorStoreFileAssociationStatus.Failed => "failed",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreFileAssociationStatus value.")
        };

        public static VectorStores.VectorStoreFileAssociationStatus ToVectorStoreFileAssociationStatus(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "in_progress"))
            {
                return VectorStores.VectorStoreFileAssociationStatus.InProgress;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed"))
            {
                return VectorStores.VectorStoreFileAssociationStatus.Completed;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "cancelled"))
            {
                return VectorStores.VectorStoreFileAssociationStatus.Cancelled;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "failed"))
            {
                return VectorStores.VectorStoreFileAssociationStatus.Failed;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreFileAssociationStatus value.");
        }
    }
}
