using System.Diagnostics.CodeAnalysis;
namespace StardewModdingAPI.Web.Framework.Storage
{
/// The result of an attempt to upload a file.
internal class UploadResult
{
/*********
** Accessors
*********/
/// Whether the file upload succeeded.
[MemberNotNullWhen(true, nameof(UploadResult.ID))]
[MemberNotNullWhen(false, nameof(UploadResult.UploadError))]
public bool Succeeded => this.ID != null && this.UploadError == null;
/// The file ID, if applicable.
public string? ID { get; }
/// The upload error, if any.
public string? UploadError { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The file ID, if applicable.
/// The upload error, if any.
public UploadResult(string? id, string? uploadError)
{
this.ID = id;
this.UploadError = uploadError;
}
}
}