namespace Wino.Mail.Api.Contracts.Common; public sealed class ApiEnvelope { public bool IsSuccess { get; init; } public string? ErrorCode { get; init; } public T? Result { get; init; } public QuotaInfoDto? Quota { get; init; } public static ApiEnvelope Success(T result, QuotaInfoDto? quota = null) => new() { IsSuccess = true, Result = result, Quota = quota, }; public static ApiEnvelope Failure(string errorCode, QuotaInfoDto? quota = null) => new() { IsSuccess = false, ErrorCode = errorCode, Quota = quota, }; }