using System;

namespace SharpRSS.API.Contracts.Models
{
    public class ResultOr<TValue> : Result
    {
        public ResultOr(TValue? value, string message, ResultStatus status) : base(message, status)
        {
            Value = value;
        }

        public TValue? Value { get; }

        public static ResultOr<TValue> Ok(TValue? value) => new ResultOr<TValue>(value, "", ResultStatus.Ok);
        public static ResultOr<TValue> Failed(string message = "Failed", ResultStatus status = ResultStatus.Failed) => new ResultOr<TValue>(default, message, status);
    }
}