japanese-pokemon-cards-sdk-.../JpnCardsPokemon.Sdk/Api/Set.cs

74 lines
2.4 KiB
C#
Raw Normal View History

using System.Text.Json.Serialization;
2023-03-01 22:06:38 +01:00
using JpnCardsPokemon.Sdk.Utils.JsonConverter;
2023-03-01 22:06:38 +01:00
namespace JpnCardsPokemon.Sdk.Api;
2023-03-03 17:49:56 +01:00
/// <summary>
/// Represents a set object from the web api.
/// </summary>
public class Set
{
2023-03-03 17:49:56 +01:00
/// <summary>
/// The name of the set.
/// </summary>
public string? Name { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The internal identification number that the set is given. Used to query for information about this single set or
/// for all cards in this single set.
/// </summary>
public int Id { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The URL to a page which has more information about the set.
/// </summary>
[JsonPropertyName("source_url")]
public string? SourceUrl { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// A URL to the official set's image.
/// </summary>
[JsonPropertyName("image_url")]
public string? ImageUrl { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The language that the cards in the set are printed in.
/// </summary>
public string? Language { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The year the set was released.
/// </summary>
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
[JsonConverter(typeof(NoneIntJsonConverter))] // set hashes in card objects sometimes have "none" as year.
public int Year { get; set; }
// TODO: According to documentation the property currently is not supported.
// public DateOnly? Date { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The total number of cards in the set.
/// </summary>
[JsonPropertyName("card_count")]
public int TotalCardCount { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The number of cards in the set that is printed on the card. This differs from the set's
/// <see cref="TotalCardCount" /> in sets with Secret Rare cards.
/// </summary>
[JsonPropertyName("printed_count")]
2023-03-01 21:47:42 +01:00
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
public int PrintedCardCount { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// The shorthand code for the set.
/// </summary>
[JsonPropertyName("set_code")]
public string? SetCode { get; set; }
2023-03-03 17:49:56 +01:00
/// <summary>
/// A stable id for earch card. Output is an eight digit integer which is unique for each card. While the cards'
/// <see cref="Id" /> may change over time, the uuid should always remain stable and constant.
/// </summary>
public int Uuid { get; set; }
}