using System;


namespace AIRuntime.Runtime.Providers.Fallback
{
    /// <summary>
    /// Captures a classified provider failure.
    /// </summary>
    public sealed class ProviderFailure
    {
        public string ProviderName
        {
            get;
        }


        public ProviderFailureKind Kind
        {
            get;
        }


        public string Message
        {
            get;
        }


        public Exception Exception
        {
            get;
        }


        public bool ShouldFallback
        {
            get;
        }


        public ProviderFailure(
            string providerName,
            ProviderFailureKind kind,
            string message,
            Exception exception,
            bool shouldFallback)
        {
            ProviderName =
                providerName ??
                string.Empty;


            Kind =
                kind;


            Message =
                message ??
                string.Empty;


            Exception =
                exception;


            ShouldFallback =
                shouldFallback;
        }
    }
}