schools.jsonl
Schema
_key(required): integer
Range: 11 .. 38careerAgents: array of integer
Type:integer
Range: 3018920 .. 3020232careerID(required): integer
Range: 11 .. 167-
characterDescription: objectde(required): stringen(required): stringes(required): stringfr(required): stringja(required): stringko(required): stringru(required): stringzh(required): string
-
corporationID(required): integer
Range: 1000044 .. 1000178 -
description: objectde(required): stringen(required): stringes(required): stringfr(required): stringja(required): stringko(required): stringru(required): stringzh(required): string
-
iconID: integer
Range: 1447 .. 1458 isStarterSpaceSchool: boolean-
name(required): objectde(required): stringen(required): stringes(required): stringfr(required): stringja(required): stringko(required): stringru(required): stringzh(required): string
-
raceID(required): integer
Range: 1 .. 16 startingStations: array of integer
Type:integer
Range: 60015001 .. 60015164title: objectde(required): stringen(required): stringes(required): stringfr(required): stringja(required): stringko(required): stringru(required): stringzh(required): string
Code snippets
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
// using QuickType;
//
// var school = School.FromJson(jsonString);
#nullable enable
#pragma warning disable CS8618
#pragma warning disable CS8601
#pragma warning disable CS8602
#pragma warning disable CS8603
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Globalization;
public partial class School
{
[JsonPropertyName("_key")]
public long Key { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("careerAgents")]
public long[]? CareerAgents { get; set; }
[JsonPropertyName("careerID")]
public long CareerId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("characterDescription")]
public CharacterDescription? CharacterDescription { get; set; }
[JsonPropertyName("corporationID")]
public long CorporationId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public Description? Description { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("iconID")]
public long? IconId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("isStarterSpaceSchool")]
public bool? IsStarterSpaceSchool { get; set; }
[JsonPropertyName("name")]
public Name Name { get; set; }
[JsonPropertyName("raceID")]
public long RaceId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("startingStations")]
public long[]? StartingStations { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("title")]
public Title? Title { get; set; }
}
public partial class CharacterDescription
{
[JsonPropertyName("de")]
[JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonPropertyName("en")]
[JsonConverter(typeof(FluffyMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonPropertyName("es")]
[JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonPropertyName("fr")]
[JsonConverter(typeof(StickyMinMaxLengthCheckConverter))]
public string Fr { get; set; }
[JsonPropertyName("ja")]
[JsonConverter(typeof(IndigoMinMaxLengthCheckConverter))]
public string Ja { get; set; }
[JsonPropertyName("ko")]
[JsonConverter(typeof(IndecentMinMaxLengthCheckConverter))]
public string Ko { get; set; }
[JsonPropertyName("ru")]
[JsonConverter(typeof(HilariousMinMaxLengthCheckConverter))]
public string Ru { get; set; }
[JsonPropertyName("zh")]
[JsonConverter(typeof(AmbitiousMinMaxLengthCheckConverter))]
public string Zh { get; set; }
}
public partial class Description
{
[JsonPropertyName("de")]
[JsonConverter(typeof(CunningMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonPropertyName("en")]
[JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonPropertyName("es")]
[JsonConverter(typeof(FriskyMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonPropertyName("fr")]
[JsonConverter(typeof(MischievousMinMaxLengthCheckConverter))]
public string Fr { get; set; }
[JsonPropertyName("ja")]
[JsonConverter(typeof(BraggadociousMinMaxLengthCheckConverter))]
public string Ja { get; set; }
[JsonPropertyName("ko")]
[JsonConverter(typeof(MinMaxLengthCheckConverter1))]
public string Ko { get; set; }
[JsonPropertyName("ru")]
[JsonConverter(typeof(MinMaxLengthCheckConverter2))]
public string Ru { get; set; }
[JsonPropertyName("zh")]
[JsonConverter(typeof(MinMaxLengthCheckConverter3))]
public string Zh { get; set; }
}
public partial class Name
{
[JsonPropertyName("de")]
[JsonConverter(typeof(MinMaxLengthCheckConverter4))]
public string De { get; set; }
[JsonPropertyName("en")]
[JsonConverter(typeof(MinMaxLengthCheckConverter5))]
public string En { get; set; }
[JsonPropertyName("es")]
[JsonConverter(typeof(MinMaxLengthCheckConverter6))]
public string Es { get; set; }
[JsonPropertyName("fr")]
[JsonConverter(typeof(MinMaxLengthCheckConverter7))]
public string Fr { get; set; }
[JsonPropertyName("ja")]
[JsonConverter(typeof(MinMaxLengthCheckConverter8))]
public string Ja { get; set; }
[JsonPropertyName("ko")]
[JsonConverter(typeof(MinMaxLengthCheckConverter9))]
public string Ko { get; set; }
[JsonPropertyName("ru")]
[JsonConverter(typeof(MinMaxLengthCheckConverter10))]
public string Ru { get; set; }
[JsonPropertyName("zh")]
[JsonConverter(typeof(MinMaxLengthCheckConverter11))]
public string Zh { get; set; }
}
public partial class Title
{
[JsonPropertyName("de")]
[JsonConverter(typeof(MinMaxLengthCheckConverter12))]
public string De { get; set; }
[JsonPropertyName("en")]
[JsonConverter(typeof(MinMaxLengthCheckConverter13))]
public string En { get; set; }
[JsonPropertyName("es")]
[JsonConverter(typeof(MinMaxLengthCheckConverter14))]
public string Es { get; set; }
[JsonPropertyName("fr")]
[JsonConverter(typeof(MinMaxLengthCheckConverter15))]
public string Fr { get; set; }
[JsonPropertyName("ja")]
[JsonConverter(typeof(MinMaxLengthCheckConverter16))]
public string Ja { get; set; }
[JsonPropertyName("ko")]
[JsonConverter(typeof(MinMaxLengthCheckConverter17))]
public string Ko { get; set; }
[JsonPropertyName("ru")]
[JsonConverter(typeof(MinMaxLengthCheckConverter18))]
public string Ru { get; set; }
[JsonPropertyName("zh")]
[JsonConverter(typeof(MinMaxLengthCheckConverter19))]
public string Zh { get; set; }
}
public partial class School
{
public static School FromJson(string json) => JsonSerializer.Deserialize<School>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this School self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
{
Converters =
{
new DateOnlyConverter(),
new TimeOnlyConverter(),
IsoDateTimeOffsetConverter.Singleton
},
};
}
internal class PurpleMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 99 && value.Length <= 184)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 99 && value.Length <= 184)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly PurpleMinMaxLengthCheckConverter Singleton = new PurpleMinMaxLengthCheckConverter();
}
internal class FluffyMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 93 && value.Length <= 164)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 93 && value.Length <= 164)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly FluffyMinMaxLengthCheckConverter Singleton = new FluffyMinMaxLengthCheckConverter();
}
internal class TentacledMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 113 && value.Length <= 224)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 113 && value.Length <= 224)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly TentacledMinMaxLengthCheckConverter Singleton = new TentacledMinMaxLengthCheckConverter();
}
internal class StickyMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 108 && value.Length <= 212)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 108 && value.Length <= 212)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly StickyMinMaxLengthCheckConverter Singleton = new StickyMinMaxLengthCheckConverter();
}
internal class IndigoMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 31 && value.Length <= 69)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 31 && value.Length <= 69)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndigoMinMaxLengthCheckConverter Singleton = new IndigoMinMaxLengthCheckConverter();
}
internal class IndecentMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 45 && value.Length <= 58)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 45 && value.Length <= 58)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndecentMinMaxLengthCheckConverter Singleton = new IndecentMinMaxLengthCheckConverter();
}
internal class HilariousMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 95 && value.Length <= 171)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 95 && value.Length <= 171)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly HilariousMinMaxLengthCheckConverter Singleton = new HilariousMinMaxLengthCheckConverter();
}
internal class AmbitiousMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 27 && value.Length <= 54)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 27 && value.Length <= 54)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly AmbitiousMinMaxLengthCheckConverter Singleton = new AmbitiousMinMaxLengthCheckConverter();
}
internal class CunningMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 83 && value.Length <= 572)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 83 && value.Length <= 572)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly CunningMinMaxLengthCheckConverter Singleton = new CunningMinMaxLengthCheckConverter();
}
internal class MagentaMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 77 && value.Length <= 477)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 77 && value.Length <= 477)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MagentaMinMaxLengthCheckConverter Singleton = new MagentaMinMaxLengthCheckConverter();
}
internal class FriskyMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 91 && value.Length <= 501)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 91 && value.Length <= 501)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly FriskyMinMaxLengthCheckConverter Singleton = new FriskyMinMaxLengthCheckConverter();
}
internal class MischievousMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 77 && value.Length <= 579)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 77 && value.Length <= 579)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MischievousMinMaxLengthCheckConverter Singleton = new MischievousMinMaxLengthCheckConverter();
}
internal class BraggadociousMinMaxLengthCheckConverter : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 24 && value.Length <= 179)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 24 && value.Length <= 179)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly BraggadociousMinMaxLengthCheckConverter Singleton = new BraggadociousMinMaxLengthCheckConverter();
}
internal class MinMaxLengthCheckConverter1 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 38 && value.Length <= 274)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 38 && value.Length <= 274)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter1 Singleton = new MinMaxLengthCheckConverter1();
}
internal class MinMaxLengthCheckConverter2 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 82 && value.Length <= 462)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 82 && value.Length <= 462)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter2 Singleton = new MinMaxLengthCheckConverter2();
}
internal class MinMaxLengthCheckConverter3 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 19 && value.Length <= 167)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 19 && value.Length <= 167)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter3 Singleton = new MinMaxLengthCheckConverter3();
}
internal class MinMaxLengthCheckConverter4 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 16 && value.Length <= 46)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 16 && value.Length <= 46)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter4 Singleton = new MinMaxLengthCheckConverter4();
}
internal class MinMaxLengthCheckConverter5 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 16 && value.Length <= 41)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 16 && value.Length <= 41)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter5 Singleton = new MinMaxLengthCheckConverter5();
}
internal class MinMaxLengthCheckConverter6 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 17 && value.Length <= 51)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 17 && value.Length <= 51)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter6 Singleton = new MinMaxLengthCheckConverter6();
}
internal class MinMaxLengthCheckConverter7 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 16 && value.Length <= 53)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 16 && value.Length <= 53)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter7 Singleton = new MinMaxLengthCheckConverter7();
}
internal class MinMaxLengthCheckConverter8 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 4 && value.Length <= 24)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 4 && value.Length <= 24)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter8 Singleton = new MinMaxLengthCheckConverter8();
}
internal class MinMaxLengthCheckConverter9 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 4 && value.Length <= 18)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 4 && value.Length <= 18)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter9 Singleton = new MinMaxLengthCheckConverter9();
}
internal class MinMaxLengthCheckConverter10 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 18 && value.Length <= 48)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 18 && value.Length <= 48)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter10 Singleton = new MinMaxLengthCheckConverter10();
}
internal class MinMaxLengthCheckConverter11 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 4 && value.Length <= 11)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 4 && value.Length <= 11)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter11 Singleton = new MinMaxLengthCheckConverter11();
}
internal class MinMaxLengthCheckConverter12 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 15 && value.Length <= 40)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 15 && value.Length <= 40)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter12 Singleton = new MinMaxLengthCheckConverter12();
}
internal class MinMaxLengthCheckConverter13 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 17 && value.Length <= 29)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 17 && value.Length <= 29)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter13 Singleton = new MinMaxLengthCheckConverter13();
}
internal class MinMaxLengthCheckConverter14 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 17 && value.Length <= 32)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 17 && value.Length <= 32)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter14 Singleton = new MinMaxLengthCheckConverter14();
}
internal class MinMaxLengthCheckConverter15 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 18 && value.Length <= 30)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 18 && value.Length <= 30)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter15 Singleton = new MinMaxLengthCheckConverter15();
}
internal class MinMaxLengthCheckConverter16 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 4 && value.Length <= 12)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 4 && value.Length <= 12)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter16 Singleton = new MinMaxLengthCheckConverter16();
}
internal class MinMaxLengthCheckConverter17 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 3 && value.Length <= 9)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 3 && value.Length <= 9)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter17 Singleton = new MinMaxLengthCheckConverter17();
}
internal class MinMaxLengthCheckConverter18 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 16 && value.Length <= 34)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 16 && value.Length <= 34)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter18 Singleton = new MinMaxLengthCheckConverter18();
}
internal class MinMaxLengthCheckConverter19 : JsonConverter<string>
{
public override bool CanConvert(Type t) => t == typeof(string);
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
if (value.Length >= 3 && value.Length <= 7)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
{
if (value.Length >= 3 && value.Length <= 7)
{
JsonSerializer.Serialize(writer, value, options);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter19 Singleton = new MinMaxLengthCheckConverter19();
}
public class DateOnlyConverter : JsonConverter<DateOnly>
{
private readonly string serializationFormat;
public DateOnlyConverter() : this(null) { }
public DateOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
}
public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return DateOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
public class TimeOnlyConverter : JsonConverter<TimeOnly>
{
private readonly string serializationFormat;
public TimeOnlyConverter() : this(null) { }
public TimeOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
}
public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return TimeOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
{
public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
private string? _dateTimeFormat;
private CultureInfo? _culture;
public DateTimeStyles DateTimeStyles
{
get => _dateTimeStyles;
set => _dateTimeStyles = value;
}
public string? DateTimeFormat
{
get => _dateTimeFormat ?? string.Empty;
set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
}
public CultureInfo Culture
{
get => _culture ?? CultureInfo.CurrentCulture;
set => _culture = value;
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
{
string text;
if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
|| (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
{
value = value.ToUniversalTime();
}
text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
writer.WriteStringValue(text);
}
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
string? dateText = reader.GetString();
if (string.IsNullOrEmpty(dateText) == false)
{
if (!string.IsNullOrEmpty(_dateTimeFormat))
{
return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
}
else
{
return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
}
}
else
{
return default(DateTimeOffset);
}
}
public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
}
}
#pragma warning restore CS8618
#pragma warning restore CS8601
#pragma warning restore CS8602
#pragma warning restore CS8603
// Code generated from JSON Schema using quicktype. DO NOT EDIT.
// To parse and unparse this JSON data, add this code to your project and do:
//
// school, err := UnmarshalSchool(bytes)
// bytes, err = school.Marshal()
package model
import "encoding/json"
func UnmarshalSchool(data []byte) (School, error) {
var r School
err := json.Unmarshal(data, &r)
return r, err
}
func (r *School) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type School struct {
Key int64 `json:"_key"`
CareerAgents []int64 `json:"careerAgents,omitempty"`
CareerID int64 `json:"careerID"`
CharacterDescription *CharacterDescription `json:"characterDescription,omitempty"`
CorporationID int64 `json:"corporationID"`
Description *Description `json:"description,omitempty"`
IconID *int64 `json:"iconID,omitempty"`
IsStarterSpaceSchool *bool `json:"isStarterSpaceSchool,omitempty"`
Name Name `json:"name"`
RaceID int64 `json:"raceID"`
StartingStations []int64 `json:"startingStations,omitempty"`
Title *Title `json:"title,omitempty"`
}
type CharacterDescription struct {
De string `json:"de"`
En string `json:"en"`
Es string `json:"es"`
Fr string `json:"fr"`
Ja string `json:"ja"`
Ko string `json:"ko"`
Ru string `json:"ru"`
Zh string `json:"zh"`
}
type Description struct {
De string `json:"de"`
En string `json:"en"`
Es string `json:"es"`
Fr string `json:"fr"`
Ja string `json:"ja"`
Ko string `json:"ko"`
Ru string `json:"ru"`
Zh string `json:"zh"`
}
type Name struct {
De string `json:"de"`
En string `json:"en"`
Es string `json:"es"`
Fr string `json:"fr"`
Ja string `json:"ja"`
Ko string `json:"ko"`
Ru string `json:"ru"`
Zh string `json:"zh"`
}
type Title struct {
De string `json:"de"`
En string `json:"en"`
Es string `json:"es"`
Fr string `json:"fr"`
Ja string `json:"ja"`
Ko string `json:"ko"`
Ru string `json:"ru"`
Zh string `json:"zh"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":11,"maximum":38},"careerAgents":{"type":"array","items":{"type":"integer","minimum":3018920,"maximum":3020232},"minItems":5,"maxItems":5},"careerID":{"type":"integer","minimum":11,"maximum":167},"characterDescription":{"type":"object","properties":{"de":{"type":"string","minLength":99,"maxLength":184},"en":{"type":"string","minLength":93,"maxLength":164},"es":{"type":"string","minLength":113,"maxLength":224},"fr":{"type":"string","minLength":108,"maxLength":212},"ja":{"type":"string","minLength":31,"maxLength":69},"ko":{"type":"string","minLength":45,"maxLength":58},"ru":{"type":"string","minLength":95,"maxLength":171},"zh":{"type":"string","minLength":27,"maxLength":54}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"corporationID":{"type":"integer","minimum":1000044,"maximum":1000178},"description":{"type":"object","properties":{"de":{"type":"string","minLength":83,"maxLength":572},"en":{"type":"string","minLength":77,"maxLength":477},"es":{"type":"string","minLength":91,"maxLength":501},"fr":{"type":"string","minLength":77,"maxLength":579},"ja":{"type":"string","minLength":24,"maxLength":179},"ko":{"type":"string","minLength":38,"maxLength":274},"ru":{"type":"string","minLength":82,"maxLength":462},"zh":{"type":"string","minLength":19,"maxLength":167}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"iconID":{"type":"integer","minimum":1447,"maximum":1458},"isStarterSpaceSchool":{"type":"boolean"},"name":{"type":"object","properties":{"de":{"type":"string","minLength":16,"maxLength":46},"en":{"type":"string","minLength":16,"maxLength":41},"es":{"type":"string","minLength":17,"maxLength":51},"fr":{"type":"string","minLength":16,"maxLength":53},"ja":{"type":"string","minLength":4,"maxLength":24},"ko":{"type":"string","minLength":4,"maxLength":18},"ru":{"type":"string","minLength":18,"maxLength":48},"zh":{"type":"string","minLength":4,"maxLength":11}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"raceID":{"type":"integer","minimum":1,"maximum":16},"startingStations":{"type":"array","items":{"type":"integer","minimum":60015001,"maximum":60015164},"minItems":1,"maxItems":5},"title":{"type":"object","properties":{"de":{"type":"string","minLength":15,"maxLength":40},"en":{"type":"string","minLength":17,"maxLength":29},"es":{"type":"string","minLength":17,"maxLength":32},"fr":{"type":"string","minLength":18,"maxLength":30},"ja":{"type":"string","minLength":4,"maxLength":12},"ko":{"type":"string","minLength":3,"maxLength":9},"ru":{"type":"string","minLength":16,"maxLength":34},"zh":{"type":"string","minLength":3,"maxLength":7}},"required":["de","en","es","fr","ja","ko","ru","zh"]}},"required":["_key","careerID","corporationID","name","raceID"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json = Json { allowStructuredMapKeys = true }
// val school = json.parse(School.serializer(), jsonString)
package model
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
@Serializable
data class School (
@SerialName("_key")
val key: Long,
val careerAgents: List<Long>? = null,
@SerialName("careerID")
val careerId: Long,
val characterDescription: CharacterDescription? = null,
@SerialName("corporationID")
val corporationId: Long,
val description: Description? = null,
@SerialName("iconID")
val iconId: Long? = null,
val isStarterSpaceSchool: Boolean? = null,
val name: Name,
@SerialName("raceID")
val raceId: Long,
val startingStations: List<Long>? = null,
val title: Title? = null
)
@Serializable
data class CharacterDescription (
val de: String,
val en: String,
val es: String,
val fr: String,
val ja: String,
val ko: String,
val ru: String,
val zh: String
)
@Serializable
data class Description (
val de: String,
val en: String,
val es: String,
val fr: String,
val ja: String,
val ko: String,
val ru: String,
val zh: String
)
@Serializable
data class Name (
val de: String,
val en: String,
val es: String,
val fr: String,
val ja: String,
val ko: String,
val ru: String,
val zh: String
)
@Serializable
data class Title (
val de: String,
val en: String,
val es: String,
val fr: String,
val ja: String,
val ko: String,
val ru: String,
val zh: String
)
<?php
// This is an autogenerated file:School
class School {
private int $key; // json:_key Required
private ?array $careerAgents; // json:careerAgents Optional
private int $careerId; // json:careerID Required
private ?CharacterDescription $characterDescription; // json:characterDescription Optional
private int $corporationId; // json:corporationID Required
private ?Description $description; // json:description Optional
private ?int $iconId; // json:iconID Optional
private ?bool $isStarterSpaceSchool; // json:isStarterSpaceSchool Optional
private Name $name; // json:name Required
private int $raceId; // json:raceID Required
private ?array $startingStations; // json:startingStations Optional
private ?Title $title; // json:title Optional
/**
* @param int $key
* @param array|null $careerAgents
* @param int $careerId
* @param CharacterDescription|null $characterDescription
* @param int $corporationId
* @param Description|null $description
* @param int|null $iconId
* @param bool|null $isStarterSpaceSchool
* @param Name $name
* @param int $raceId
* @param array|null $startingStations
* @param Title|null $title
*/
public function __construct(int $key, ?array $careerAgents, int $careerId, ?CharacterDescription $characterDescription, int $corporationId, ?Description $description, ?int $iconId, ?bool $isStarterSpaceSchool, Name $name, int $raceId, ?array $startingStations, ?Title $title) {
$this->key = $key;
$this->careerAgents = $careerAgents;
$this->careerId = $careerId;
$this->characterDescription = $characterDescription;
$this->corporationId = $corporationId;
$this->description = $description;
$this->iconId = $iconId;
$this->isStarterSpaceSchool = $isStarterSpaceSchool;
$this->name = $name;
$this->raceId = $raceId;
$this->startingStations = $startingStations;
$this->title = $title;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromKey(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toKey(): int {
if (School::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this School::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:School::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (School::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey School::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCareerAgents(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return $value; /*int*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCareerAgents(): ?array {
if (School::validateCareerAgents($this->careerAgents)) {
if (!is_null($this->careerAgents)) {
return array_map(function ($value) {
return $value; /*int*/
}, $this->careerAgents);
} else {
return null;
}
}
throw new Exception('never get to this School::careerAgents');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCareerAgents(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:School::careerAgents");
}
array_walk($value, function($value_v) {
if (!is_integer($value_v)) {
throw new Exception("Attribute Error:School::careerAgents");
}
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCareerAgents(): ?array {
if (School::validateCareerAgents($this->careerAgents)) {
return $this->careerAgents;
}
throw new Exception('never get to getCareerAgents School::careerAgents');
}
/**
* @return ?array
*/
public static function sampleCareerAgents(): ?array {
return array(
32 /*32:*/
); /* 32:careerAgents*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromCareerId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toCareerId(): int {
if (School::validateCareerId($this->careerId)) {
return $this->careerId; /*int*/
}
throw new Exception('never get to this School::careerId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateCareerId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:School::careerId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getCareerId(): int {
if (School::validateCareerId($this->careerId)) {
return $this->careerId;
}
throw new Exception('never get to getCareerId School::careerId');
}
/**
* @return int
*/
public static function sampleCareerId(): int {
return 33; /*33:careerId*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?CharacterDescription
*/
public static function fromCharacterDescription(?stdClass $value): ?CharacterDescription {
if (!is_null($value)) {
return CharacterDescription::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toCharacterDescription(): ?stdClass {
if (School::validateCharacterDescription($this->characterDescription)) {
if (!is_null($this->characterDescription)) {
return $this->characterDescription->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this School::characterDescription');
}
/**
* @param CharacterDescription|null
* @return bool
* @throws Exception
*/
public static function validateCharacterDescription(?CharacterDescription $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?CharacterDescription
*/
public function getCharacterDescription(): ?CharacterDescription {
if (School::validateCharacterDescription($this->characterDescription)) {
return $this->characterDescription;
}
throw new Exception('never get to getCharacterDescription School::characterDescription');
}
/**
* @return ?CharacterDescription
*/
public static function sampleCharacterDescription(): ?CharacterDescription {
return CharacterDescription::sample(); /*34:characterDescription*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromCorporationId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toCorporationId(): int {
if (School::validateCorporationId($this->corporationId)) {
return $this->corporationId; /*int*/
}
throw new Exception('never get to this School::corporationId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateCorporationId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:School::corporationId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getCorporationId(): int {
if (School::validateCorporationId($this->corporationId)) {
return $this->corporationId;
}
throw new Exception('never get to getCorporationId School::corporationId');
}
/**
* @return int
*/
public static function sampleCorporationId(): int {
return 35; /*35:corporationId*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Description
*/
public static function fromDescription(?stdClass $value): ?Description {
if (!is_null($value)) {
return Description::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toDescription(): ?stdClass {
if (School::validateDescription($this->description)) {
if (!is_null($this->description)) {
return $this->description->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this School::description');
}
/**
* @param Description|null
* @return bool
* @throws Exception
*/
public static function validateDescription(?Description $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Description
*/
public function getDescription(): ?Description {
if (School::validateDescription($this->description)) {
return $this->description;
}
throw new Exception('never get to getDescription School::description');
}
/**
* @return ?Description
*/
public static function sampleDescription(): ?Description {
return Description::sample(); /*36:description*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromIconId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toIconId(): ?int {
if (School::validateIconId($this->iconId)) {
if (!is_null($this->iconId)) {
return $this->iconId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this School::iconId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateIconId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:School::iconId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getIconId(): ?int {
if (School::validateIconId($this->iconId)) {
return $this->iconId;
}
throw new Exception('never get to getIconId School::iconId');
}
/**
* @return ?int
*/
public static function sampleIconId(): ?int {
return 37; /*37:iconId*/
}
/**
* @param ?bool $value
* @throws Exception
* @return ?bool
*/
public static function fromIsStarterSpaceSchool(?bool $value): ?bool {
if (!is_null($value)) {
return $value; /*bool*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?bool
*/
public function toIsStarterSpaceSchool(): ?bool {
if (School::validateIsStarterSpaceSchool($this->isStarterSpaceSchool)) {
if (!is_null($this->isStarterSpaceSchool)) {
return $this->isStarterSpaceSchool; /*bool*/
} else {
return null;
}
}
throw new Exception('never get to this School::isStarterSpaceSchool');
}
/**
* @param bool|null
* @return bool
* @throws Exception
*/
public static function validateIsStarterSpaceSchool(?bool $value): bool {
if (!is_null($value)) {
if (!is_bool($value)) {
throw new Exception("Attribute Error:School::isStarterSpaceSchool");
}
}
return true;
}
/**
* @throws Exception
* @return ?bool
*/
public function getIsStarterSpaceSchool(): ?bool {
if (School::validateIsStarterSpaceSchool($this->isStarterSpaceSchool)) {
return $this->isStarterSpaceSchool;
}
throw new Exception('never get to getIsStarterSpaceSchool School::isStarterSpaceSchool');
}
/**
* @return ?bool
*/
public static function sampleIsStarterSpaceSchool(): ?bool {
return true; /*38:isStarterSpaceSchool*/
}
/**
* @param stdClass $value
* @throws Exception
* @return Name
*/
public static function fromName(stdClass $value): Name {
return Name::from($value); /*class*/
}
/**
* @throws Exception
* @return stdClass
*/
public function toName(): stdClass {
if (School::validateName($this->name)) {
return $this->name->to(); /*class*/
}
throw new Exception('never get to this School::name');
}
/**
* @param Name
* @return bool
* @throws Exception
*/
public static function validateName(Name $value): bool {
$value->validate();
return true;
}
/**
* @throws Exception
* @return Name
*/
public function getName(): Name {
if (School::validateName($this->name)) {
return $this->name;
}
throw new Exception('never get to getName School::name');
}
/**
* @return Name
*/
public static function sampleName(): Name {
return Name::sample(); /*39:name*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromRaceId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toRaceId(): int {
if (School::validateRaceId($this->raceId)) {
return $this->raceId; /*int*/
}
throw new Exception('never get to this School::raceId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateRaceId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:School::raceId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getRaceId(): int {
if (School::validateRaceId($this->raceId)) {
return $this->raceId;
}
throw new Exception('never get to getRaceId School::raceId');
}
/**
* @return int
*/
public static function sampleRaceId(): int {
return 40; /*40:raceId*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromStartingStations(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return $value; /*int*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toStartingStations(): ?array {
if (School::validateStartingStations($this->startingStations)) {
if (!is_null($this->startingStations)) {
return array_map(function ($value) {
return $value; /*int*/
}, $this->startingStations);
} else {
return null;
}
}
throw new Exception('never get to this School::startingStations');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateStartingStations(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:School::startingStations");
}
array_walk($value, function($value_v) {
if (!is_integer($value_v)) {
throw new Exception("Attribute Error:School::startingStations");
}
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getStartingStations(): ?array {
if (School::validateStartingStations($this->startingStations)) {
return $this->startingStations;
}
throw new Exception('never get to getStartingStations School::startingStations');
}
/**
* @return ?array
*/
public static function sampleStartingStations(): ?array {
return array(
41 /*41:*/
); /* 41:startingStations*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Title
*/
public static function fromTitle(?stdClass $value): ?Title {
if (!is_null($value)) {
return Title::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toTitle(): ?stdClass {
if (School::validateTitle($this->title)) {
if (!is_null($this->title)) {
return $this->title->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this School::title');
}
/**
* @param Title|null
* @return bool
* @throws Exception
*/
public static function validateTitle(?Title $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Title
*/
public function getTitle(): ?Title {
if (School::validateTitle($this->title)) {
return $this->title;
}
throw new Exception('never get to getTitle School::title');
}
/**
* @return ?Title
*/
public static function sampleTitle(): ?Title {
return Title::sample(); /*42:title*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return School::validateKey($this->key)
|| School::validateCareerAgents($this->careerAgents)
|| School::validateCareerId($this->careerId)
|| School::validateCharacterDescription($this->characterDescription)
|| School::validateCorporationId($this->corporationId)
|| School::validateDescription($this->description)
|| School::validateIconId($this->iconId)
|| School::validateIsStarterSpaceSchool($this->isStarterSpaceSchool)
|| School::validateName($this->name)
|| School::validateRaceId($this->raceId)
|| School::validateStartingStations($this->startingStations)
|| School::validateTitle($this->title);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'careerAgents'} = $this->toCareerAgents();
$out->{'careerID'} = $this->toCareerId();
$out->{'characterDescription'} = $this->toCharacterDescription();
$out->{'corporationID'} = $this->toCorporationId();
$out->{'description'} = $this->toDescription();
$out->{'iconID'} = $this->toIconId();
$out->{'isStarterSpaceSchool'} = $this->toIsStarterSpaceSchool();
$out->{'name'} = $this->toName();
$out->{'raceID'} = $this->toRaceId();
$out->{'startingStations'} = $this->toStartingStations();
$out->{'title'} = $this->toTitle();
return $out;
}
/**
* @param stdClass $obj
* @return School
* @throws Exception
*/
public static function from(stdClass $obj): School {
return new School(
School::fromKey($obj->{'_key'})
,School::fromCareerAgents($obj->{'careerAgents'})
,School::fromCareerId($obj->{'careerID'})
,School::fromCharacterDescription($obj->{'characterDescription'})
,School::fromCorporationId($obj->{'corporationID'})
,School::fromDescription($obj->{'description'})
,School::fromIconId($obj->{'iconID'})
,School::fromIsStarterSpaceSchool($obj->{'isStarterSpaceSchool'})
,School::fromName($obj->{'name'})
,School::fromRaceId($obj->{'raceID'})
,School::fromStartingStations($obj->{'startingStations'})
,School::fromTitle($obj->{'title'})
);
}
/**
* @return School
*/
public static function sample(): School {
return new School(
School::sampleKey()
,School::sampleCareerAgents()
,School::sampleCareerId()
,School::sampleCharacterDescription()
,School::sampleCorporationId()
,School::sampleDescription()
,School::sampleIconId()
,School::sampleIsStarterSpaceSchool()
,School::sampleName()
,School::sampleRaceId()
,School::sampleStartingStations()
,School::sampleTitle()
);
}
}
// This is an autogenerated file:CharacterDescription
class CharacterDescription {
private string $de; // json:de Required
private string $en; // json:en Required
private string $es; // json:es Required
private string $fr; // json:fr Required
private string $ja; // json:ja Required
private string $ko; // json:ko Required
private string $ru; // json:ru Required
private string $zh; // json:zh Required
/**
* @param string $de
* @param string $en
* @param string $es
* @param string $fr
* @param string $ja
* @param string $ko
* @param string $ru
* @param string $zh
*/
public function __construct(string $de, string $en, string $es, string $fr, string $ja, string $ko, string $ru, string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromDe(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toDe(): string {
if (CharacterDescription::validateDe($this->de)) {
return $this->de; /*string*/
}
throw new Exception('never get to this CharacterDescription::de');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateDe(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::de");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getDe(): string {
if (CharacterDescription::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe CharacterDescription::de');
}
/**
* @return string
*/
public static function sampleDe(): string {
return 'CharacterDescription::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (CharacterDescription::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this CharacterDescription::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (CharacterDescription::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn CharacterDescription::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'CharacterDescription::en::32'; /*32:en*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEs(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEs(): string {
if (CharacterDescription::validateEs($this->es)) {
return $this->es; /*string*/
}
throw new Exception('never get to this CharacterDescription::es');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEs(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::es");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEs(): string {
if (CharacterDescription::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs CharacterDescription::es');
}
/**
* @return string
*/
public static function sampleEs(): string {
return 'CharacterDescription::es::33'; /*33:es*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromFr(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toFr(): string {
if (CharacterDescription::validateFr($this->fr)) {
return $this->fr; /*string*/
}
throw new Exception('never get to this CharacterDescription::fr');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateFr(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::fr");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getFr(): string {
if (CharacterDescription::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr CharacterDescription::fr');
}
/**
* @return string
*/
public static function sampleFr(): string {
return 'CharacterDescription::fr::34'; /*34:fr*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromJa(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toJa(): string {
if (CharacterDescription::validateJa($this->ja)) {
return $this->ja; /*string*/
}
throw new Exception('never get to this CharacterDescription::ja');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateJa(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::ja");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getJa(): string {
if (CharacterDescription::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa CharacterDescription::ja');
}
/**
* @return string
*/
public static function sampleJa(): string {
return 'CharacterDescription::ja::35'; /*35:ja*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromKo(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toKo(): string {
if (CharacterDescription::validateKo($this->ko)) {
return $this->ko; /*string*/
}
throw new Exception('never get to this CharacterDescription::ko');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateKo(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::ko");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getKo(): string {
if (CharacterDescription::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo CharacterDescription::ko');
}
/**
* @return string
*/
public static function sampleKo(): string {
return 'CharacterDescription::ko::36'; /*36:ko*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromRu(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toRu(): string {
if (CharacterDescription::validateRu($this->ru)) {
return $this->ru; /*string*/
}
throw new Exception('never get to this CharacterDescription::ru');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateRu(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::ru");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getRu(): string {
if (CharacterDescription::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu CharacterDescription::ru');
}
/**
* @return string
*/
public static function sampleRu(): string {
return 'CharacterDescription::ru::37'; /*37:ru*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromZh(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toZh(): string {
if (CharacterDescription::validateZh($this->zh)) {
return $this->zh; /*string*/
}
throw new Exception('never get to this CharacterDescription::zh');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateZh(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:CharacterDescription::zh");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getZh(): string {
if (CharacterDescription::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh CharacterDescription::zh');
}
/**
* @return string
*/
public static function sampleZh(): string {
return 'CharacterDescription::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return CharacterDescription::validateDe($this->de)
|| CharacterDescription::validateEn($this->en)
|| CharacterDescription::validateEs($this->es)
|| CharacterDescription::validateFr($this->fr)
|| CharacterDescription::validateJa($this->ja)
|| CharacterDescription::validateKo($this->ko)
|| CharacterDescription::validateRu($this->ru)
|| CharacterDescription::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return CharacterDescription
* @throws Exception
*/
public static function from(stdClass $obj): CharacterDescription {
return new CharacterDescription(
CharacterDescription::fromDe($obj->{'de'})
,CharacterDescription::fromEn($obj->{'en'})
,CharacterDescription::fromEs($obj->{'es'})
,CharacterDescription::fromFr($obj->{'fr'})
,CharacterDescription::fromJa($obj->{'ja'})
,CharacterDescription::fromKo($obj->{'ko'})
,CharacterDescription::fromRu($obj->{'ru'})
,CharacterDescription::fromZh($obj->{'zh'})
);
}
/**
* @return CharacterDescription
*/
public static function sample(): CharacterDescription {
return new CharacterDescription(
CharacterDescription::sampleDe()
,CharacterDescription::sampleEn()
,CharacterDescription::sampleEs()
,CharacterDescription::sampleFr()
,CharacterDescription::sampleJa()
,CharacterDescription::sampleKo()
,CharacterDescription::sampleRu()
,CharacterDescription::sampleZh()
);
}
}
// This is an autogenerated file:Description
class Description {
private string $de; // json:de Required
private string $en; // json:en Required
private string $es; // json:es Required
private string $fr; // json:fr Required
private string $ja; // json:ja Required
private string $ko; // json:ko Required
private string $ru; // json:ru Required
private string $zh; // json:zh Required
/**
* @param string $de
* @param string $en
* @param string $es
* @param string $fr
* @param string $ja
* @param string $ko
* @param string $ru
* @param string $zh
*/
public function __construct(string $de, string $en, string $es, string $fr, string $ja, string $ko, string $ru, string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromDe(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toDe(): string {
if (Description::validateDe($this->de)) {
return $this->de; /*string*/
}
throw new Exception('never get to this Description::de');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateDe(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::de");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getDe(): string {
if (Description::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Description::de');
}
/**
* @return string
*/
public static function sampleDe(): string {
return 'Description::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Description::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Description::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Description::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Description::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Description::en::32'; /*32:en*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEs(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEs(): string {
if (Description::validateEs($this->es)) {
return $this->es; /*string*/
}
throw new Exception('never get to this Description::es');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEs(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::es");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEs(): string {
if (Description::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Description::es');
}
/**
* @return string
*/
public static function sampleEs(): string {
return 'Description::es::33'; /*33:es*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromFr(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toFr(): string {
if (Description::validateFr($this->fr)) {
return $this->fr; /*string*/
}
throw new Exception('never get to this Description::fr');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateFr(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::fr");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getFr(): string {
if (Description::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Description::fr');
}
/**
* @return string
*/
public static function sampleFr(): string {
return 'Description::fr::34'; /*34:fr*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromJa(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toJa(): string {
if (Description::validateJa($this->ja)) {
return $this->ja; /*string*/
}
throw new Exception('never get to this Description::ja');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateJa(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::ja");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getJa(): string {
if (Description::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Description::ja');
}
/**
* @return string
*/
public static function sampleJa(): string {
return 'Description::ja::35'; /*35:ja*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromKo(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toKo(): string {
if (Description::validateKo($this->ko)) {
return $this->ko; /*string*/
}
throw new Exception('never get to this Description::ko');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateKo(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::ko");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getKo(): string {
if (Description::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Description::ko');
}
/**
* @return string
*/
public static function sampleKo(): string {
return 'Description::ko::36'; /*36:ko*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromRu(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toRu(): string {
if (Description::validateRu($this->ru)) {
return $this->ru; /*string*/
}
throw new Exception('never get to this Description::ru');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateRu(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::ru");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getRu(): string {
if (Description::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Description::ru');
}
/**
* @return string
*/
public static function sampleRu(): string {
return 'Description::ru::37'; /*37:ru*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromZh(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toZh(): string {
if (Description::validateZh($this->zh)) {
return $this->zh; /*string*/
}
throw new Exception('never get to this Description::zh');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateZh(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Description::zh");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getZh(): string {
if (Description::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Description::zh');
}
/**
* @return string
*/
public static function sampleZh(): string {
return 'Description::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Description::validateDe($this->de)
|| Description::validateEn($this->en)
|| Description::validateEs($this->es)
|| Description::validateFr($this->fr)
|| Description::validateJa($this->ja)
|| Description::validateKo($this->ko)
|| Description::validateRu($this->ru)
|| Description::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Description
* @throws Exception
*/
public static function from(stdClass $obj): Description {
return new Description(
Description::fromDe($obj->{'de'})
,Description::fromEn($obj->{'en'})
,Description::fromEs($obj->{'es'})
,Description::fromFr($obj->{'fr'})
,Description::fromJa($obj->{'ja'})
,Description::fromKo($obj->{'ko'})
,Description::fromRu($obj->{'ru'})
,Description::fromZh($obj->{'zh'})
);
}
/**
* @return Description
*/
public static function sample(): Description {
return new Description(
Description::sampleDe()
,Description::sampleEn()
,Description::sampleEs()
,Description::sampleFr()
,Description::sampleJa()
,Description::sampleKo()
,Description::sampleRu()
,Description::sampleZh()
);
}
}
// This is an autogenerated file:Name
class Name {
private string $de; // json:de Required
private string $en; // json:en Required
private string $es; // json:es Required
private string $fr; // json:fr Required
private string $ja; // json:ja Required
private string $ko; // json:ko Required
private string $ru; // json:ru Required
private string $zh; // json:zh Required
/**
* @param string $de
* @param string $en
* @param string $es
* @param string $fr
* @param string $ja
* @param string $ko
* @param string $ru
* @param string $zh
*/
public function __construct(string $de, string $en, string $es, string $fr, string $ja, string $ko, string $ru, string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromDe(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toDe(): string {
if (Name::validateDe($this->de)) {
return $this->de; /*string*/
}
throw new Exception('never get to this Name::de');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateDe(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::de");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getDe(): string {
if (Name::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Name::de');
}
/**
* @return string
*/
public static function sampleDe(): string {
return 'Name::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Name::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Name::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Name::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Name::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Name::en::32'; /*32:en*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEs(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEs(): string {
if (Name::validateEs($this->es)) {
return $this->es; /*string*/
}
throw new Exception('never get to this Name::es');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEs(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::es");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEs(): string {
if (Name::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Name::es');
}
/**
* @return string
*/
public static function sampleEs(): string {
return 'Name::es::33'; /*33:es*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromFr(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toFr(): string {
if (Name::validateFr($this->fr)) {
return $this->fr; /*string*/
}
throw new Exception('never get to this Name::fr');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateFr(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::fr");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getFr(): string {
if (Name::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Name::fr');
}
/**
* @return string
*/
public static function sampleFr(): string {
return 'Name::fr::34'; /*34:fr*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromJa(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toJa(): string {
if (Name::validateJa($this->ja)) {
return $this->ja; /*string*/
}
throw new Exception('never get to this Name::ja');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateJa(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ja");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getJa(): string {
if (Name::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Name::ja');
}
/**
* @return string
*/
public static function sampleJa(): string {
return 'Name::ja::35'; /*35:ja*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromKo(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toKo(): string {
if (Name::validateKo($this->ko)) {
return $this->ko; /*string*/
}
throw new Exception('never get to this Name::ko');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateKo(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ko");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getKo(): string {
if (Name::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Name::ko');
}
/**
* @return string
*/
public static function sampleKo(): string {
return 'Name::ko::36'; /*36:ko*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromRu(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toRu(): string {
if (Name::validateRu($this->ru)) {
return $this->ru; /*string*/
}
throw new Exception('never get to this Name::ru');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateRu(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ru");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getRu(): string {
if (Name::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Name::ru');
}
/**
* @return string
*/
public static function sampleRu(): string {
return 'Name::ru::37'; /*37:ru*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromZh(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toZh(): string {
if (Name::validateZh($this->zh)) {
return $this->zh; /*string*/
}
throw new Exception('never get to this Name::zh');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateZh(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::zh");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getZh(): string {
if (Name::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Name::zh');
}
/**
* @return string
*/
public static function sampleZh(): string {
return 'Name::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Name::validateDe($this->de)
|| Name::validateEn($this->en)
|| Name::validateEs($this->es)
|| Name::validateFr($this->fr)
|| Name::validateJa($this->ja)
|| Name::validateKo($this->ko)
|| Name::validateRu($this->ru)
|| Name::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Name
* @throws Exception
*/
public static function from(stdClass $obj): Name {
return new Name(
Name::fromDe($obj->{'de'})
,Name::fromEn($obj->{'en'})
,Name::fromEs($obj->{'es'})
,Name::fromFr($obj->{'fr'})
,Name::fromJa($obj->{'ja'})
,Name::fromKo($obj->{'ko'})
,Name::fromRu($obj->{'ru'})
,Name::fromZh($obj->{'zh'})
);
}
/**
* @return Name
*/
public static function sample(): Name {
return new Name(
Name::sampleDe()
,Name::sampleEn()
,Name::sampleEs()
,Name::sampleFr()
,Name::sampleJa()
,Name::sampleKo()
,Name::sampleRu()
,Name::sampleZh()
);
}
}
// This is an autogenerated file:Title
class Title {
private string $de; // json:de Required
private string $en; // json:en Required
private string $es; // json:es Required
private string $fr; // json:fr Required
private string $ja; // json:ja Required
private string $ko; // json:ko Required
private string $ru; // json:ru Required
private string $zh; // json:zh Required
/**
* @param string $de
* @param string $en
* @param string $es
* @param string $fr
* @param string $ja
* @param string $ko
* @param string $ru
* @param string $zh
*/
public function __construct(string $de, string $en, string $es, string $fr, string $ja, string $ko, string $ru, string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromDe(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toDe(): string {
if (Title::validateDe($this->de)) {
return $this->de; /*string*/
}
throw new Exception('never get to this Title::de');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateDe(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::de");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getDe(): string {
if (Title::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Title::de');
}
/**
* @return string
*/
public static function sampleDe(): string {
return 'Title::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Title::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Title::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Title::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Title::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Title::en::32'; /*32:en*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEs(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEs(): string {
if (Title::validateEs($this->es)) {
return $this->es; /*string*/
}
throw new Exception('never get to this Title::es');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEs(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::es");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEs(): string {
if (Title::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Title::es');
}
/**
* @return string
*/
public static function sampleEs(): string {
return 'Title::es::33'; /*33:es*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromFr(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toFr(): string {
if (Title::validateFr($this->fr)) {
return $this->fr; /*string*/
}
throw new Exception('never get to this Title::fr');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateFr(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::fr");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getFr(): string {
if (Title::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Title::fr');
}
/**
* @return string
*/
public static function sampleFr(): string {
return 'Title::fr::34'; /*34:fr*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromJa(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toJa(): string {
if (Title::validateJa($this->ja)) {
return $this->ja; /*string*/
}
throw new Exception('never get to this Title::ja');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateJa(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::ja");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getJa(): string {
if (Title::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Title::ja');
}
/**
* @return string
*/
public static function sampleJa(): string {
return 'Title::ja::35'; /*35:ja*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromKo(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toKo(): string {
if (Title::validateKo($this->ko)) {
return $this->ko; /*string*/
}
throw new Exception('never get to this Title::ko');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateKo(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::ko");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getKo(): string {
if (Title::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Title::ko');
}
/**
* @return string
*/
public static function sampleKo(): string {
return 'Title::ko::36'; /*36:ko*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromRu(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toRu(): string {
if (Title::validateRu($this->ru)) {
return $this->ru; /*string*/
}
throw new Exception('never get to this Title::ru');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateRu(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::ru");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getRu(): string {
if (Title::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Title::ru');
}
/**
* @return string
*/
public static function sampleRu(): string {
return 'Title::ru::37'; /*37:ru*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromZh(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toZh(): string {
if (Title::validateZh($this->zh)) {
return $this->zh; /*string*/
}
throw new Exception('never get to this Title::zh');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateZh(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Title::zh");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getZh(): string {
if (Title::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Title::zh');
}
/**
* @return string
*/
public static function sampleZh(): string {
return 'Title::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Title::validateDe($this->de)
|| Title::validateEn($this->en)
|| Title::validateEs($this->es)
|| Title::validateFr($this->fr)
|| Title::validateJa($this->ja)
|| Title::validateKo($this->ko)
|| Title::validateRu($this->ru)
|| Title::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Title
* @throws Exception
*/
public static function from(stdClass $obj): Title {
return new Title(
Title::fromDe($obj->{'de'})
,Title::fromEn($obj->{'en'})
,Title::fromEs($obj->{'es'})
,Title::fromFr($obj->{'fr'})
,Title::fromJa($obj->{'ja'})
,Title::fromKo($obj->{'ko'})
,Title::fromRu($obj->{'ru'})
,Title::fromZh($obj->{'zh'})
);
}
/**
* @return Title
*/
public static function sample(): Title {
return new Title(
Title::sampleDe()
,Title::sampleEn()
,Title::sampleEs()
,Title::sampleFr()
,Title::sampleJa()
,Title::sampleKo()
,Title::sampleRu()
,Title::sampleZh()
);
}
}
from dataclasses import dataclass
from typing import Any, TypeVar, Callable, Type, cast
T = TypeVar("T")
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_int(x: Any) -> int:
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_list(f: Callable[[Any], T], x: Any) -> list[T]:
assert isinstance(x, list)
return [f(y) for y in x]
def from_none(x: Any) -> Any:
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False
def from_bool(x: Any) -> bool:
assert isinstance(x, bool)
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
@dataclass
class CharacterDescription:
de: str
en: str
es: str
fr: str
ja: str
ko: str
ru: str
zh: str
@staticmethod
def from_dict(obj: Any) -> 'CharacterDescription':
assert isinstance(obj, dict)
de = from_str(obj.get("de"))
en = from_str(obj.get("en"))
es = from_str(obj.get("es"))
fr = from_str(obj.get("fr"))
ja = from_str(obj.get("ja"))
ko = from_str(obj.get("ko"))
ru = from_str(obj.get("ru"))
zh = from_str(obj.get("zh"))
return CharacterDescription(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
result["de"] = from_str(self.de)
result["en"] = from_str(self.en)
result["es"] = from_str(self.es)
result["fr"] = from_str(self.fr)
result["ja"] = from_str(self.ja)
result["ko"] = from_str(self.ko)
result["ru"] = from_str(self.ru)
result["zh"] = from_str(self.zh)
return result
@dataclass
class Description:
de: str
en: str
es: str
fr: str
ja: str
ko: str
ru: str
zh: str
@staticmethod
def from_dict(obj: Any) -> 'Description':
assert isinstance(obj, dict)
de = from_str(obj.get("de"))
en = from_str(obj.get("en"))
es = from_str(obj.get("es"))
fr = from_str(obj.get("fr"))
ja = from_str(obj.get("ja"))
ko = from_str(obj.get("ko"))
ru = from_str(obj.get("ru"))
zh = from_str(obj.get("zh"))
return Description(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
result["de"] = from_str(self.de)
result["en"] = from_str(self.en)
result["es"] = from_str(self.es)
result["fr"] = from_str(self.fr)
result["ja"] = from_str(self.ja)
result["ko"] = from_str(self.ko)
result["ru"] = from_str(self.ru)
result["zh"] = from_str(self.zh)
return result
@dataclass
class Name:
de: str
en: str
es: str
fr: str
ja: str
ko: str
ru: str
zh: str
@staticmethod
def from_dict(obj: Any) -> 'Name':
assert isinstance(obj, dict)
de = from_str(obj.get("de"))
en = from_str(obj.get("en"))
es = from_str(obj.get("es"))
fr = from_str(obj.get("fr"))
ja = from_str(obj.get("ja"))
ko = from_str(obj.get("ko"))
ru = from_str(obj.get("ru"))
zh = from_str(obj.get("zh"))
return Name(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
result["de"] = from_str(self.de)
result["en"] = from_str(self.en)
result["es"] = from_str(self.es)
result["fr"] = from_str(self.fr)
result["ja"] = from_str(self.ja)
result["ko"] = from_str(self.ko)
result["ru"] = from_str(self.ru)
result["zh"] = from_str(self.zh)
return result
@dataclass
class Title:
de: str
en: str
es: str
fr: str
ja: str
ko: str
ru: str
zh: str
@staticmethod
def from_dict(obj: Any) -> 'Title':
assert isinstance(obj, dict)
de = from_str(obj.get("de"))
en = from_str(obj.get("en"))
es = from_str(obj.get("es"))
fr = from_str(obj.get("fr"))
ja = from_str(obj.get("ja"))
ko = from_str(obj.get("ko"))
ru = from_str(obj.get("ru"))
zh = from_str(obj.get("zh"))
return Title(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
result["de"] = from_str(self.de)
result["en"] = from_str(self.en)
result["es"] = from_str(self.es)
result["fr"] = from_str(self.fr)
result["ja"] = from_str(self.ja)
result["ko"] = from_str(self.ko)
result["ru"] = from_str(self.ru)
result["zh"] = from_str(self.zh)
return result
@dataclass
class School:
key: int
career_id: int
corporation_id: int
name: Name
race_id: int
career_agents: list[int] | None = None
character_description: CharacterDescription | None = None
description: Description | None = None
icon_id: int | None = None
is_starter_space_school: bool | None = None
starting_stations: list[int] | None = None
title: Title | None = None
@staticmethod
def from_dict(obj: Any) -> 'School':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
career_id = from_int(obj.get("careerID"))
corporation_id = from_int(obj.get("corporationID"))
name = Name.from_dict(obj.get("name"))
race_id = from_int(obj.get("raceID"))
career_agents = from_union([lambda x: from_list(from_int, x), from_none], obj.get("careerAgents"))
character_description = from_union([CharacterDescription.from_dict, from_none], obj.get("characterDescription"))
description = from_union([Description.from_dict, from_none], obj.get("description"))
icon_id = from_union([from_int, from_none], obj.get("iconID"))
is_starter_space_school = from_union([from_bool, from_none], obj.get("isStarterSpaceSchool"))
starting_stations = from_union([lambda x: from_list(from_int, x), from_none], obj.get("startingStations"))
title = from_union([Title.from_dict, from_none], obj.get("title"))
return School(key, career_id, corporation_id, name, race_id, career_agents, character_description, description, icon_id, is_starter_space_school, starting_stations, title)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
result["careerID"] = from_int(self.career_id)
result["corporationID"] = from_int(self.corporation_id)
result["name"] = to_class(Name, self.name)
result["raceID"] = from_int(self.race_id)
if self.career_agents is not None:
result["careerAgents"] = from_union([lambda x: from_list(from_int, x), from_none], self.career_agents)
if self.character_description is not None:
result["characterDescription"] = from_union([lambda x: to_class(CharacterDescription, x), from_none], self.character_description)
if self.description is not None:
result["description"] = from_union([lambda x: to_class(Description, x), from_none], self.description)
if self.icon_id is not None:
result["iconID"] = from_union([from_int, from_none], self.icon_id)
if self.is_starter_space_school is not None:
result["isStarterSpaceSchool"] = from_union([from_bool, from_none], self.is_starter_space_school)
if self.starting_stations is not None:
result["startingStations"] = from_union([lambda x: from_list(from_int, x), from_none], self.starting_stations)
if self.title is not None:
result["title"] = from_union([lambda x: to_class(Title, x), from_none], self.title)
return result
def school_from_dict(s: Any) -> School:
return School.from_dict(s)
def school_to_dict(x: School) -> Any:
return to_class(School, x)
// To parse this data:
//
// import { Convert, School } from "./School";
//
// const school = Convert.toSchool(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface School {
_key: number;
careerAgents?: [number, number, number, number, number, ...number[]];
careerID: number;
characterDescription?: CharacterDescription;
corporationID: number;
description?: Description;
iconID?: number;
isStarterSpaceSchool?: boolean;
name: Name;
raceID: number;
startingStations?: [number, ...number[]];
title?: Title;
[property: string]: unknown;
}
export interface CharacterDescription {
de: string;
en: string;
es: string;
fr: string;
ja: string;
ko: string;
ru: string;
zh: string;
[property: string]: unknown;
}
export interface Description {
de: string;
en: string;
es: string;
fr: string;
ja: string;
ko: string;
ru: string;
zh: string;
[property: string]: unknown;
}
export interface Name {
de: string;
en: string;
es: string;
fr: string;
ja: string;
ko: string;
ru: string;
zh: string;
[property: string]: unknown;
}
export interface Title {
de: string;
en: string;
es: string;
fr: string;
ja: string;
ko: string;
ru: string;
zh: string;
[property: string]: unknown;
}
// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
public static toSchool(json: string): School {
return cast(JSON.parse(json), r("School"));
}
public static schoolToJson(value: School): string {
return JSON.stringify(uncast(value, r("School")), null, 2);
}
}
function invalidValue(typ: any, val: any, key: any, parent: any = ''): never {
const prettyTyp = prettyTypeName(typ);
const parentText = parent ? ` on ${parent}` : '';
const keyText = key ? ` for key "${key}"` : '';
throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
}
function prettyTypeName(typ: any): string {
if (Array.isArray(typ)) {
if (typ.length === 2 && typ[0] === undefined) {
return `an optional ${prettyTypeName(typ[1])}`;
} else {
return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
}
} else if (typeof typ === "object" && typ.literal !== undefined) {
return typ.literal;
} else {
return typeof typ;
}
}
function jsonToJSProps(typ: any): any {
if (typ.jsonToJS === undefined) {
const map: any = {};
typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
typ.jsonToJS = map;
}
return typ.jsonToJS;
}
function jsToJSONProps(typ: any): any {
if (typ.jsToJSON === undefined) {
const map: any = {};
typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
typ.jsToJSON = map;
}
return typ.jsToJSON;
}
function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
function transformPrimitive(typ: string, val: any): any {
if (typeof typ === typeof val) return val;
return invalidValue(typ, val, key, parent);
}
function transformUnion(typs: any[], val: any): any {
// val must validate against one typ in typs
const l = typs.length;
for (let i = 0; i < l; i++) {
const typ = typs[i];
try {
return transform(val, typ, getProps);
} catch (_) {}
}
return invalidValue(typs, val, key, parent);
}
function transformEnum(cases: string[], val: any): any {
if (cases.indexOf(val) !== -1) return val;
return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
}
function transformArray(typ: any, val: any): any {
// val must be an array with no invalid elements
if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
return val.map(el => transform(el, typ, getProps));
}
function transformDate(val: any): any {
if (val === null) {
return null;
}
const d = new Date(val);
if (isNaN(d.valueOf())) {
return invalidValue(l("Date"), val, key, parent);
}
return d;
}
function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
if (val === null || typeof val !== "object" || Array.isArray(val)) {
return invalidValue(l(ref || "object"), val, key, parent);
}
const result: any = {};
Object.getOwnPropertyNames(props).forEach(key => {
const prop = props[key];
const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
result[prop.key] = transform(v, prop.typ, getProps, key, ref);
});
Object.getOwnPropertyNames(val).forEach(key => {
if (!Object.prototype.hasOwnProperty.call(props, key)) {
result[key] = transform(val[key], additional, getProps, key, ref);
}
});
return result;
}
if (typ === "any") return val;
if (typ === null) {
if (val === null) return val;
return invalidValue(typ, val, key, parent);
}
if (typ === false) return invalidValue(typ, val, key, parent);
let ref: any = undefined;
while (typeof typ === "object" && typ.ref !== undefined) {
ref = typ.ref;
typ = typeMap[typ.ref];
}
if (Array.isArray(typ)) return transformEnum(typ, val);
if (typeof typ === "object") {
return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
: typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val)
: typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val)
: invalidValue(typ, val, key, parent);
}
// Numbers can be parsed by Date but shouldn't be.
if (typ === Date && typeof val !== "number") return transformDate(val);
return transformPrimitive(typ, val);
}
function cast<T>(val: any, typ: any): T {
return transform(val, typ, jsonToJSProps);
}
function uncast<T>(val: T, typ: any): any {
return transform(val, typ, jsToJSONProps);
}
function l(typ: any) {
return { literal: typ };
}
function a(typ: any) {
return { arrayItems: typ };
}
function u(...typs: any[]) {
return { unionMembers: typs };
}
function o(props: any[], additional: any) {
return { props, additional };
}
function m(additional: any) {
return { props: [], additional };
}
function r(name: string) {
return { ref: name };
}
const typeMap: any = {
"School": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "careerAgents", js: "careerAgents", typ: u(undefined, a(0)) },
{ json: "careerID", js: "careerID", typ: 0 },
{ json: "characterDescription", js: "characterDescription", typ: u(undefined, r("CharacterDescription")) },
{ json: "corporationID", js: "corporationID", typ: 0 },
{ json: "description", js: "description", typ: u(undefined, r("Description")) },
{ json: "iconID", js: "iconID", typ: u(undefined, 0) },
{ json: "isStarterSpaceSchool", js: "isStarterSpaceSchool", typ: u(undefined, true) },
{ json: "name", js: "name", typ: r("Name") },
{ json: "raceID", js: "raceID", typ: 0 },
{ json: "startingStations", js: "startingStations", typ: u(undefined, a(0)) },
{ json: "title", js: "title", typ: u(undefined, r("Title")) },
], "any"),
"CharacterDescription": o([
{ json: "de", js: "de", typ: "" },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: "" },
{ json: "fr", js: "fr", typ: "" },
{ json: "ja", js: "ja", typ: "" },
{ json: "ko", js: "ko", typ: "" },
{ json: "ru", js: "ru", typ: "" },
{ json: "zh", js: "zh", typ: "" },
], "any"),
"Description": o([
{ json: "de", js: "de", typ: "" },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: "" },
{ json: "fr", js: "fr", typ: "" },
{ json: "ja", js: "ja", typ: "" },
{ json: "ko", js: "ko", typ: "" },
{ json: "ru", js: "ru", typ: "" },
{ json: "zh", js: "zh", typ: "" },
], "any"),
"Name": o([
{ json: "de", js: "de", typ: "" },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: "" },
{ json: "fr", js: "fr", typ: "" },
{ json: "ja", js: "ja", typ: "" },
{ json: "ko", js: "ko", typ: "" },
{ json: "ru", js: "ru", typ: "" },
{ json: "zh", js: "zh", typ: "" },
], "any"),
"Title": o([
{ json: "de", js: "de", typ: "" },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: "" },
{ json: "fr", js: "fr", typ: "" },
{ json: "ja", js: "ja", typ: "" },
{ json: "ko", js: "ko", typ: "" },
{ json: "ru", js: "ru", typ: "" },
{ json: "zh", js: "zh", typ: "" },
], "any"),
};