| 12345678910111213141516171819202122232425262728293031323334353637383940414243 | using System;using System.Collections.Generic;using Newtonsoft.Json;namespace InABox.Integration.Logikal{    public abstract class LogikalResponse : LogikalObject    {        public new abstract string ToString();        public LogikalResponse Always(Action<LogikalResponse> handler)        {            handler?.Invoke(this);            return this;        }        public LogikalResponse Error(Action<LogikalErrorResponse> handler, LogikalStatus status = LogikalStatus.IsError)        {            if (this is LogikalErrorResponse error && status.HasFlag(error.Status))            {                handler?.Invoke(error);                return null;            }            return this;        }        public T Success<T>(Action<T> handler) where T : LogikalResponse        {            if (this is T response)            {                handler?.Invoke(response);                return response;            }            return null;        }    }}
 |