osu/osu.Game/Online/API/Requests/Responses/APIChangelogBuild.cs

52 lines
1.5 KiB
C#
Raw Normal View History

2019-05-12 15:36:05 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-07-19 17:07:24 +00:00
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace osu.Game.Online.API.Requests.Responses
{
2019-05-21 04:34:35 +00:00
public class APIChangelogBuild : IEquatable<APIChangelogBuild>
2018-07-19 17:07:24 +00:00
{
[JsonProperty("id")]
public long Id { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
[JsonProperty("display_version")]
public string DisplayVersion { get; set; }
[JsonProperty("users")]
public long Users { get; set; }
[JsonProperty("created_at")]
public DateTimeOffset CreatedAt { get; set; }
2018-07-19 17:07:24 +00:00
[JsonProperty("update_stream")]
public APIUpdateStream UpdateStream { get; set; }
2018-07-19 17:07:24 +00:00
[JsonProperty("changelog_entries")]
public List<APIChangelogEntry> ChangelogEntries { get; set; }
[JsonProperty("versions")]
public VersionNavigation Versions { get; set; }
2019-07-04 07:16:17 +00:00
public string Url => $"https://osu.ppy.sh/home/changelog/{UpdateStream.Name}/{Version}";
public class VersionNavigation
{
[JsonProperty("next")]
public APIChangelogBuild Next { get; set; }
[JsonProperty("previous")]
public APIChangelogBuild Previous { get; set; }
}
2019-05-21 05:02:34 +00:00
public bool Equals(APIChangelogBuild other) => Id == other?.Id;
2019-05-21 04:34:35 +00:00
public override string ToString() => $"{UpdateStream.DisplayName} {DisplayVersion}";
2018-07-19 17:07:24 +00:00
}
}