using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Web.Framework.Clients.Pastebin
{
/// The response for a get-paste request.
internal class PasteInfo
{
/*********
** Accessors
*********/
/// Whether the log was successfully fetched.
[MemberNotNullWhen(true, nameof(PasteInfo.Content))]
[MemberNotNullWhen(false, nameof(PasteInfo.Error))]
public bool Success => this.Error == null || this.Content != null;
/// The fetched paste content (if is true).
public string? Content { get; internal set; }
/// The error message (if is false).
public string? Error { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The fetched paste content.
/// The error message, if it failed.
public PasteInfo(string? content, string? error)
{
this.Content = content;
this.Error = error;
}
}
}