diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-03 21:21:28 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-03 21:21:28 -0500 |
commit | 2b1f607d41b3d4d071c0db0671dbc99b6982909f (patch) | |
tree | a854b7465c73a38c12b3b841515e39d9154217a7 /src/SMAPI.Web/Framework/Storage/UploadResult.cs | |
parent | 0aad3f545af854619c641dc8b57ac0cf12971c8e (diff) | |
download | SMAPI-2b1f607d41b3d4d071c0db0671dbc99b6982909f.tar.gz SMAPI-2b1f607d41b3d4d071c0db0671dbc99b6982909f.tar.bz2 SMAPI-2b1f607d41b3d4d071c0db0671dbc99b6982909f.zip |
encapsulate file storage, also handle Pastebin rate limits in JSON validator
Diffstat (limited to 'src/SMAPI.Web/Framework/Storage/UploadResult.cs')
-rw-r--r-- | src/SMAPI.Web/Framework/Storage/UploadResult.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Framework/Storage/UploadResult.cs b/src/SMAPI.Web/Framework/Storage/UploadResult.cs new file mode 100644 index 00000000..483c1769 --- /dev/null +++ b/src/SMAPI.Web/Framework/Storage/UploadResult.cs @@ -0,0 +1,33 @@ +namespace StardewModdingAPI.Web.Framework.Storage +{ + /// <summary>The result of an attempt to upload a file.</summary> + internal class UploadResult + { + /********* + ** Accessors + *********/ + /// <summary>Whether the file upload succeeded.</summary> + public bool Succeeded { get; } + + /// <summary>The file ID, if applicable.</summary> + public string ID { get; } + + /// <summary>The upload error, if any.</summary> + public string UploadError { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="succeeded">Whether the file upload succeeded.</param> + /// <param name="id">The file ID, if applicable.</param> + /// <param name="uploadError">The upload error, if any.</param> + public UploadResult(bool succeeded, string id, string uploadError) + { + this.Succeeded = succeeded; + this.ID = id; + this.UploadError = uploadError; + } + } +} |