summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Caching/Wiki/CachedWikiMetadata.cs
blob: de1ea9db52936078c4e1de552346ff94604136f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Diagnostics.CodeAnalysis;
using MongoDB.Bson;

namespace StardewModdingAPI.Web.Framework.Caching.Wiki
{
    /// <summary>The model for cached wiki metadata.</summary>
    public class CachedWikiMetadata
    {
        /*********
        ** Accessors
        *********/
        /// <summary>The internal MongoDB ID.</summary>
        [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Named per MongoDB conventions.")]
        public ObjectId _id { get; set; }

        /// <summary>When the data was last updated.</summary>
        public DateTimeOffset LastUpdated { get; set; }

        /// <summary>The current stable Stardew Valley version.</summary>
        public string StableVersion { get; set; }

        /// <summary>The current beta Stardew Valley version.</summary>
        public string BetaVersion { get; set; }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        public CachedWikiMetadata() { }

        /// <summary>Construct an instance.</summary>
        /// <param name="stableVersion">The current stable Stardew Valley version.</param>
        /// <param name="betaVersion">The current beta Stardew Valley version.</param>
        public CachedWikiMetadata(string stableVersion, string betaVersion)
        {
            this.StableVersion = stableVersion;
            this.BetaVersion = betaVersion;
            this.LastUpdated = DateTimeOffset.UtcNow;;
        }
    }
}