Skip to content

EVE SDE Schema

Documentation for third-party developers

skillPlans.jsonl

Schema

  • _key (required): integer
    Range: 4 .. 47
  • careerPathID: integer
    Range: 4 .. 7
  • description (required): object

    • de (required): string
    • en (required): string
    • es (required): string
    • fr (required): string
    • ja (required): string
    • ko (required): string
    • ru (required): string
    • zh (required): string
  • factionID: integer
    Range: 500001 .. 500004

  • internalName (required): string
  • milestones (required): array of object

    • level: integer
      Range: 1 .. 4
    • typeID (required): integer
      Range: 523 .. 33180
  • name (required): object

    • de (required): string
    • en (required): string
    • es (required): string
    • fr (required): string
    • ja (required): string
    • ko (required): string
    • ru (required): string
    • zh (required): string
  • npcCorporationDivision: integer
    Range: 25 .. 29

  • skillRequirements (required): array of object
    • level (required): integer
      Range: 1 .. 5
    • typeID (required): integer
      Range: 3300 .. 60378

Code snippets

// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
//    using QuickType;
//
//    var skillPlan = SkillPlan.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 SkillPlan
    {
        [JsonPropertyName("_key")]
        public long Key { get; set; }

        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        [JsonPropertyName("careerPathID")]
        public long? CareerPathId { get; set; }

        [JsonPropertyName("description")]
        public Description Description { get; set; }

        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        [JsonPropertyName("factionID")]
        public long? FactionId { get; set; }

        [JsonPropertyName("internalName")]
        [JsonConverter(typeof(CunningMinMaxLengthCheckConverter))]
        public string InternalName { get; set; }

        [JsonPropertyName("milestones")]
        public Milestone[] Milestones { get; set; }

        [JsonPropertyName("name")]
        public Name Name { get; set; }

        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        [JsonPropertyName("npcCorporationDivision")]
        public long? NpcCorporationDivision { get; set; }

        [JsonPropertyName("skillRequirements")]
        public SkillRequirement[] SkillRequirements { get; set; }
    }

    public partial class Description
    {
        [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 Milestone
    {
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        [JsonPropertyName("level")]
        public long? Level { get; set; }

        [JsonPropertyName("typeID")]
        public long TypeId { get; set; }
    }

    public partial class Name
    {
        [JsonPropertyName("de")]
        [JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
        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 SkillRequirement
    {
        [JsonPropertyName("level")]
        public long Level { get; set; }

        [JsonPropertyName("typeID")]
        public long TypeId { get; set; }
    }

    public partial class SkillPlan
    {
        public static SkillPlan FromJson(string json) => JsonSerializer.Deserialize<SkillPlan>(json, QuickType.Converter.Settings);
    }

    public static class Serialize
    {
        public static string ToJson(this SkillPlan 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 >= 105 && value.Length <= 1148)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 105 && value.Length <= 1148)
            {
                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 >= 78 && value.Length <= 1005)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 78 && value.Length <= 1005)
            {
                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 >= 115 && value.Length <= 1114)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 115 && value.Length <= 1114)
            {
                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 >= 119 && value.Length <= 1208)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 119 && value.Length <= 1208)
            {
                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 >= 40 && value.Length <= 679)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 40 && value.Length <= 679)
            {
                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 >= 32 && value.Length <= 580)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 32 && value.Length <= 580)
            {
                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 >= 64 && value.Length <= 1150)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 64 && value.Length <= 1150)
            {
                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 >= 28 && value.Length <= 525)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
        {
            if (value.Length >= 28 && value.Length <= 525)
            {
                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 >= 18 && value.Length <= 45)
            {
                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 <= 45)
            {
                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 >= 3 && 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 >= 3 && value.Length <= 32)
            {
                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 >= 3 && value.Length <= 38)
            {
                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 <= 38)
            {
                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 >= 3 && 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 >= 3 && value.Length <= 34)
            {
                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 >= 3 && value.Length <= 25)
            {
                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 <= 25)
            {
                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 >= 3 && value.Length <= 14)
            {
                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 <= 14)
            {
                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 >= 3 && value.Length <= 35)
            {
                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 <= 35)
            {
                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 >= 3 && value.Length <= 13)
            {
                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 <= 13)
            {
                JsonSerializer.Serialize(writer, value, options);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

        public static readonly MinMaxLengthCheckConverter3 Singleton = new MinMaxLengthCheckConverter3();
    }

    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:
//
//    skillPlan, err := UnmarshalSkillPlan(bytes)
//    bytes, err = skillPlan.Marshal()

package model

import "encoding/json"

func UnmarshalSkillPlan(data []byte) (SkillPlan, error) {
    var r SkillPlan
    err := json.Unmarshal(data, &r)
    return r, err
}

func (r *SkillPlan) Marshal() ([]byte, error) {
    return json.Marshal(r)
}

type SkillPlan struct {
    Key                    int64              `json:"_key"`
    CareerPathID           *int64             `json:"careerPathID,omitempty"`
    Description            Description        `json:"description"`
    FactionID              *int64             `json:"factionID,omitempty"`
    InternalName           string             `json:"internalName"`
    Milestones             []Milestone        `json:"milestones"`
    Name                   Name               `json:"name"`
    NpcCorporationDivision *int64             `json:"npcCorporationDivision,omitempty"`
    SkillRequirements      []SkillRequirement `json:"skillRequirements"`
}

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 Milestone struct {
    Level  *int64 `json:"level,omitempty"`
    TypeID int64  `json:"typeID"`
}

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 SkillRequirement struct {
    Level  int64 `json:"level"`
    TypeID int64 `json:"typeID"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":4,"maximum":47},"careerPathID":{"type":"integer","minimum":4,"maximum":7},"description":{"type":"object","properties":{"de":{"type":"string","minLength":105,"maxLength":1148},"en":{"type":"string","minLength":78,"maxLength":1005},"es":{"type":"string","minLength":115,"maxLength":1114},"fr":{"type":"string","minLength":119,"maxLength":1208},"ja":{"type":"string","minLength":40,"maxLength":679},"ko":{"type":"string","minLength":32,"maxLength":580},"ru":{"type":"string","minLength":64,"maxLength":1150},"zh":{"type":"string","minLength":28,"maxLength":525}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"factionID":{"type":"integer","minimum":500001,"maximum":500004},"internalName":{"type":"string","minLength":18,"maxLength":45},"milestones":{"type":"array","items":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":4},"typeID":{"type":"integer","minimum":523,"maximum":33180}},"required":["typeID"]},"minItems":2,"maxItems":5},"name":{"type":"object","properties":{"de":{"type":"string","minLength":3,"maxLength":32},"en":{"type":"string","minLength":3,"maxLength":32},"es":{"type":"string","minLength":3,"maxLength":38},"fr":{"type":"string","minLength":3,"maxLength":34},"ja":{"type":"string","minLength":3,"maxLength":25},"ko":{"type":"string","minLength":3,"maxLength":14},"ru":{"type":"string","minLength":3,"maxLength":35},"zh":{"type":"string","minLength":3,"maxLength":13}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"npcCorporationDivision":{"type":"integer","minimum":25,"maximum":29},"skillRequirements":{"type":"array","items":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":5},"typeID":{"type":"integer","minimum":3300,"maximum":60378}},"required":["level","typeID"]},"minItems":3,"maxItems":112}},"required":["_key","description","internalName","milestones","name","skillRequirements"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json      = Json { allowStructuredMapKeys = true }
// val skillPlan = json.parse(SkillPlan.serializer(), jsonString)

package model

import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*

@Serializable
data class SkillPlan (
    @SerialName("_key")
    val key: Long,

    @SerialName("careerPathID")
    val careerPathId: Long? = null,

    val description: Description,

    @SerialName("factionID")
    val factionId: Long? = null,

    val internalName: String,
    val milestones: List<Milestone>,
    val name: Name,
    val npcCorporationDivision: Long? = null,
    val skillRequirements: List<SkillRequirement>
)

@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 Milestone (
    val level: Long? = null,

    @SerialName("typeID")
    val typeId: Long
)

@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 SkillRequirement (
    val level: Long,

    @SerialName("typeID")
    val typeId: Long
)
<?php

// This is an autogenerated file:SkillPlan

class SkillPlan {
    private int $key; // json:_key Required
    private ?int $careerPathId; // json:careerPathID Optional
    private Description $description; // json:description Required
    private ?int $factionId; // json:factionID Optional
    private string $internalName; // json:internalName Required
    private array $milestones; // json:milestones Required
    private Name $name; // json:name Required
    private ?int $npcCorporationDivision; // json:npcCorporationDivision Optional
    private array $skillRequirements; // json:skillRequirements Required

    /**
     * @param int $key
     * @param int|null $careerPathId
     * @param Description $description
     * @param int|null $factionId
     * @param string $internalName
     * @param array $milestones
     * @param Name $name
     * @param int|null $npcCorporationDivision
     * @param array $skillRequirements
     */
    public function __construct(int $key, ?int $careerPathId, Description $description, ?int $factionId, string $internalName, array $milestones, Name $name, ?int $npcCorporationDivision, array $skillRequirements) {
        $this->key = $key;
        $this->careerPathId = $careerPathId;
        $this->description = $description;
        $this->factionId = $factionId;
        $this->internalName = $internalName;
        $this->milestones = $milestones;
        $this->name = $name;
        $this->npcCorporationDivision = $npcCorporationDivision;
        $this->skillRequirements = $skillRequirements;
    }

    /**
     * @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 (SkillPlan::validateKey($this->key))  {
            return $this->key; /*int*/
        }
        throw new Exception('never get to this SkillPlan::key');
    }

    /**
     * @param int
     * @return bool
     * @throws Exception
     */
    public static function validateKey(int $value): bool {
        if (!is_integer($value)) {
            throw new Exception("Attribute Error:SkillPlan::key");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return int
     */
    public function getKey(): int {
        if (SkillPlan::validateKey($this->key))  {
            return $this->key;
        }
        throw new Exception('never get to getKey SkillPlan::key');
    }

    /**
     * @return int
     */
    public static function sampleKey(): int {
        return 31; /*31:key*/
    }

    /**
     * @param ?int $value
     * @throws Exception
     * @return ?int
     */
    public static function fromCareerPathId(?int $value): ?int {
        if (!is_null($value)) {
            return $value; /*int*/
        } else {
            return  null;
        }
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function toCareerPathId(): ?int {
        if (SkillPlan::validateCareerPathId($this->careerPathId))  {
            if (!is_null($this->careerPathId)) {
                return $this->careerPathId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this SkillPlan::careerPathId');
    }

    /**
     * @param int|null
     * @return bool
     * @throws Exception
     */
    public static function validateCareerPathId(?int $value): bool {
        if (!is_null($value)) {
            if (!is_integer($value)) {
                throw new Exception("Attribute Error:SkillPlan::careerPathId");
            }
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function getCareerPathId(): ?int {
        if (SkillPlan::validateCareerPathId($this->careerPathId))  {
            return $this->careerPathId;
        }
        throw new Exception('never get to getCareerPathId SkillPlan::careerPathId');
    }

    /**
     * @return ?int
     */
    public static function sampleCareerPathId(): ?int {
        return 32; /*32:careerPathId*/
    }

    /**
     * @param stdClass $value
     * @throws Exception
     * @return Description
     */
    public static function fromDescription(stdClass $value): Description {
        return Description::from($value); /*class*/
    }

    /**
     * @throws Exception
     * @return stdClass
     */
    public function toDescription(): stdClass {
        if (SkillPlan::validateDescription($this->description))  {
            return $this->description->to(); /*class*/
        }
        throw new Exception('never get to this SkillPlan::description');
    }

    /**
     * @param Description
     * @return bool
     * @throws Exception
     */
    public static function validateDescription(Description $value): bool {
        $value->validate();
        return true;
    }

    /**
     * @throws Exception
     * @return Description
     */
    public function getDescription(): Description {
        if (SkillPlan::validateDescription($this->description))  {
            return $this->description;
        }
        throw new Exception('never get to getDescription SkillPlan::description');
    }

    /**
     * @return Description
     */
    public static function sampleDescription(): Description {
        return Description::sample(); /*33:description*/
    }

    /**
     * @param ?int $value
     * @throws Exception
     * @return ?int
     */
    public static function fromFactionId(?int $value): ?int {
        if (!is_null($value)) {
            return $value; /*int*/
        } else {
            return  null;
        }
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function toFactionId(): ?int {
        if (SkillPlan::validateFactionId($this->factionId))  {
            if (!is_null($this->factionId)) {
                return $this->factionId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this SkillPlan::factionId');
    }

    /**
     * @param int|null
     * @return bool
     * @throws Exception
     */
    public static function validateFactionId(?int $value): bool {
        if (!is_null($value)) {
            if (!is_integer($value)) {
                throw new Exception("Attribute Error:SkillPlan::factionId");
            }
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function getFactionId(): ?int {
        if (SkillPlan::validateFactionId($this->factionId))  {
            return $this->factionId;
        }
        throw new Exception('never get to getFactionId SkillPlan::factionId');
    }

    /**
     * @return ?int
     */
    public static function sampleFactionId(): ?int {
        return 34; /*34:factionId*/
    }

    /**
     * @param string $value
     * @throws Exception
     * @return string
     */
    public static function fromInternalName(string $value): string {
        return $value; /*string*/
    }

    /**
     * @throws Exception
     * @return string
     */
    public function toInternalName(): string {
        if (SkillPlan::validateInternalName($this->internalName))  {
            return $this->internalName; /*string*/
        }
        throw new Exception('never get to this SkillPlan::internalName');
    }

    /**
     * @param string
     * @return bool
     * @throws Exception
     */
    public static function validateInternalName(string $value): bool {
        if (!is_string($value)) {
            throw new Exception("Attribute Error:SkillPlan::internalName");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return string
     */
    public function getInternalName(): string {
        if (SkillPlan::validateInternalName($this->internalName))  {
            return $this->internalName;
        }
        throw new Exception('never get to getInternalName SkillPlan::internalName');
    }

    /**
     * @return string
     */
    public static function sampleInternalName(): string {
        return 'SkillPlan::internalName::35'; /*35:internalName*/
    }

    /**
     * @param array $value
     * @throws Exception
     * @return array
     */
    public static function fromMilestones(array $value): array {
        return  array_map(function ($value) {
            return Milestone::from($value); /*class*/
        }, $value);
    }

    /**
     * @throws Exception
     * @return array
     */
    public function toMilestones(): array {
        if (SkillPlan::validateMilestones($this->milestones))  {
            return array_map(function ($value) {
                return $value->to(); /*class*/
            }, $this->milestones);
        }
        throw new Exception('never get to this SkillPlan::milestones');
    }

    /**
     * @param array
     * @return bool
     * @throws Exception
     */
    public static function validateMilestones(array $value): bool {
        if (!is_array($value)) {
            throw new Exception("Attribute Error:SkillPlan::milestones");
        }
        array_walk($value, function($value_v) {
            $value_v->validate();
        });
        return true;
    }

    /**
     * @throws Exception
     * @return array
     */
    public function getMilestones(): array {
        if (SkillPlan::validateMilestones($this->milestones))  {
            return $this->milestones;
        }
        throw new Exception('never get to getMilestones SkillPlan::milestones');
    }

    /**
     * @return array
     */
    public static function sampleMilestones(): array {
        return  array(
            Milestone::sample() /*36:*/
        ); /* 36:milestones*/
    }

    /**
     * @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 (SkillPlan::validateName($this->name))  {
            return $this->name->to(); /*class*/
        }
        throw new Exception('never get to this SkillPlan::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 (SkillPlan::validateName($this->name))  {
            return $this->name;
        }
        throw new Exception('never get to getName SkillPlan::name');
    }

    /**
     * @return Name
     */
    public static function sampleName(): Name {
        return Name::sample(); /*37:name*/
    }

    /**
     * @param ?int $value
     * @throws Exception
     * @return ?int
     */
    public static function fromNpcCorporationDivision(?int $value): ?int {
        if (!is_null($value)) {
            return $value; /*int*/
        } else {
            return  null;
        }
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function toNpcCorporationDivision(): ?int {
        if (SkillPlan::validateNpcCorporationDivision($this->npcCorporationDivision))  {
            if (!is_null($this->npcCorporationDivision)) {
                return $this->npcCorporationDivision; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this SkillPlan::npcCorporationDivision');
    }

    /**
     * @param int|null
     * @return bool
     * @throws Exception
     */
    public static function validateNpcCorporationDivision(?int $value): bool {
        if (!is_null($value)) {
            if (!is_integer($value)) {
                throw new Exception("Attribute Error:SkillPlan::npcCorporationDivision");
            }
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function getNpcCorporationDivision(): ?int {
        if (SkillPlan::validateNpcCorporationDivision($this->npcCorporationDivision))  {
            return $this->npcCorporationDivision;
        }
        throw new Exception('never get to getNpcCorporationDivision SkillPlan::npcCorporationDivision');
    }

    /**
     * @return ?int
     */
    public static function sampleNpcCorporationDivision(): ?int {
        return 38; /*38:npcCorporationDivision*/
    }

    /**
     * @param array $value
     * @throws Exception
     * @return array
     */
    public static function fromSkillRequirements(array $value): array {
        return  array_map(function ($value) {
            return SkillRequirement::from($value); /*class*/
        }, $value);
    }

    /**
     * @throws Exception
     * @return array
     */
    public function toSkillRequirements(): array {
        if (SkillPlan::validateSkillRequirements($this->skillRequirements))  {
            return array_map(function ($value) {
                return $value->to(); /*class*/
            }, $this->skillRequirements);
        }
        throw new Exception('never get to this SkillPlan::skillRequirements');
    }

    /**
     * @param array
     * @return bool
     * @throws Exception
     */
    public static function validateSkillRequirements(array $value): bool {
        if (!is_array($value)) {
            throw new Exception("Attribute Error:SkillPlan::skillRequirements");
        }
        array_walk($value, function($value_v) {
            $value_v->validate();
        });
        return true;
    }

    /**
     * @throws Exception
     * @return array
     */
    public function getSkillRequirements(): array {
        if (SkillPlan::validateSkillRequirements($this->skillRequirements))  {
            return $this->skillRequirements;
        }
        throw new Exception('never get to getSkillRequirements SkillPlan::skillRequirements');
    }

    /**
     * @return array
     */
    public static function sampleSkillRequirements(): array {
        return  array(
            SkillRequirement::sample() /*39:*/
        ); /* 39:skillRequirements*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return SkillPlan::validateKey($this->key)
        || SkillPlan::validateCareerPathId($this->careerPathId)
        || SkillPlan::validateDescription($this->description)
        || SkillPlan::validateFactionId($this->factionId)
        || SkillPlan::validateInternalName($this->internalName)
        || SkillPlan::validateMilestones($this->milestones)
        || SkillPlan::validateName($this->name)
        || SkillPlan::validateNpcCorporationDivision($this->npcCorporationDivision)
        || SkillPlan::validateSkillRequirements($this->skillRequirements);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'careerPathID'} = $this->toCareerPathId();
        $out->{'description'} = $this->toDescription();
        $out->{'factionID'} = $this->toFactionId();
        $out->{'internalName'} = $this->toInternalName();
        $out->{'milestones'} = $this->toMilestones();
        $out->{'name'} = $this->toName();
        $out->{'npcCorporationDivision'} = $this->toNpcCorporationDivision();
        $out->{'skillRequirements'} = $this->toSkillRequirements();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return SkillPlan
     * @throws Exception
     */
    public static function from(stdClass $obj): SkillPlan {
        return new SkillPlan(
         SkillPlan::fromKey($obj->{'_key'})
        ,SkillPlan::fromCareerPathId($obj->{'careerPathID'})
        ,SkillPlan::fromDescription($obj->{'description'})
        ,SkillPlan::fromFactionId($obj->{'factionID'})
        ,SkillPlan::fromInternalName($obj->{'internalName'})
        ,SkillPlan::fromMilestones($obj->{'milestones'})
        ,SkillPlan::fromName($obj->{'name'})
        ,SkillPlan::fromNpcCorporationDivision($obj->{'npcCorporationDivision'})
        ,SkillPlan::fromSkillRequirements($obj->{'skillRequirements'})
        );
    }

    /**
     * @return SkillPlan
     */
    public static function sample(): SkillPlan {
        return new SkillPlan(
         SkillPlan::sampleKey()
        ,SkillPlan::sampleCareerPathId()
        ,SkillPlan::sampleDescription()
        ,SkillPlan::sampleFactionId()
        ,SkillPlan::sampleInternalName()
        ,SkillPlan::sampleMilestones()
        ,SkillPlan::sampleName()
        ,SkillPlan::sampleNpcCorporationDivision()
        ,SkillPlan::sampleSkillRequirements()
        );
    }
}

// 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:Milestone

class Milestone {
    private ?int $level; // json:level Optional
    private int $typeId; // json:typeID Required

    /**
     * @param int|null $level
     * @param int $typeId
     */
    public function __construct(?int $level, int $typeId) {
        $this->level = $level;
        $this->typeId = $typeId;
    }

    /**
     * @param ?int $value
     * @throws Exception
     * @return ?int
     */
    public static function fromLevel(?int $value): ?int {
        if (!is_null($value)) {
            return $value; /*int*/
        } else {
            return  null;
        }
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function toLevel(): ?int {
        if (Milestone::validateLevel($this->level))  {
            if (!is_null($this->level)) {
                return $this->level; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this Milestone::level');
    }

    /**
     * @param int|null
     * @return bool
     * @throws Exception
     */
    public static function validateLevel(?int $value): bool {
        if (!is_null($value)) {
            if (!is_integer($value)) {
                throw new Exception("Attribute Error:Milestone::level");
            }
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?int
     */
    public function getLevel(): ?int {
        if (Milestone::validateLevel($this->level))  {
            return $this->level;
        }
        throw new Exception('never get to getLevel Milestone::level');
    }

    /**
     * @return ?int
     */
    public static function sampleLevel(): ?int {
        return 31; /*31:level*/
    }

    /**
     * @param int $value
     * @throws Exception
     * @return int
     */
    public static function fromTypeId(int $value): int {
        return $value; /*int*/
    }

    /**
     * @throws Exception
     * @return int
     */
    public function toTypeId(): int {
        if (Milestone::validateTypeId($this->typeId))  {
            return $this->typeId; /*int*/
        }
        throw new Exception('never get to this Milestone::typeId');
    }

    /**
     * @param int
     * @return bool
     * @throws Exception
     */
    public static function validateTypeId(int $value): bool {
        if (!is_integer($value)) {
            throw new Exception("Attribute Error:Milestone::typeId");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return int
     */
    public function getTypeId(): int {
        if (Milestone::validateTypeId($this->typeId))  {
            return $this->typeId;
        }
        throw new Exception('never get to getTypeId Milestone::typeId');
    }

    /**
     * @return int
     */
    public static function sampleTypeId(): int {
        return 32; /*32:typeId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return Milestone::validateLevel($this->level)
        || Milestone::validateTypeId($this->typeId);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'level'} = $this->toLevel();
        $out->{'typeID'} = $this->toTypeId();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return Milestone
     * @throws Exception
     */
    public static function from(stdClass $obj): Milestone {
        return new Milestone(
         Milestone::fromLevel($obj->{'level'})
        ,Milestone::fromTypeId($obj->{'typeID'})
        );
    }

    /**
     * @return Milestone
     */
    public static function sample(): Milestone {
        return new Milestone(
         Milestone::sampleLevel()
        ,Milestone::sampleTypeId()
        );
    }
}

// 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:SkillRequirement

class SkillRequirement {
    private int $level; // json:level Required
    private int $typeId; // json:typeID Required

    /**
     * @param int $level
     * @param int $typeId
     */
    public function __construct(int $level, int $typeId) {
        $this->level = $level;
        $this->typeId = $typeId;
    }

    /**
     * @param int $value
     * @throws Exception
     * @return int
     */
    public static function fromLevel(int $value): int {
        return $value; /*int*/
    }

    /**
     * @throws Exception
     * @return int
     */
    public function toLevel(): int {
        if (SkillRequirement::validateLevel($this->level))  {
            return $this->level; /*int*/
        }
        throw new Exception('never get to this SkillRequirement::level');
    }

    /**
     * @param int
     * @return bool
     * @throws Exception
     */
    public static function validateLevel(int $value): bool {
        if (!is_integer($value)) {
            throw new Exception("Attribute Error:SkillRequirement::level");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return int
     */
    public function getLevel(): int {
        if (SkillRequirement::validateLevel($this->level))  {
            return $this->level;
        }
        throw new Exception('never get to getLevel SkillRequirement::level');
    }

    /**
     * @return int
     */
    public static function sampleLevel(): int {
        return 31; /*31:level*/
    }

    /**
     * @param int $value
     * @throws Exception
     * @return int
     */
    public static function fromTypeId(int $value): int {
        return $value; /*int*/
    }

    /**
     * @throws Exception
     * @return int
     */
    public function toTypeId(): int {
        if (SkillRequirement::validateTypeId($this->typeId))  {
            return $this->typeId; /*int*/
        }
        throw new Exception('never get to this SkillRequirement::typeId');
    }

    /**
     * @param int
     * @return bool
     * @throws Exception
     */
    public static function validateTypeId(int $value): bool {
        if (!is_integer($value)) {
            throw new Exception("Attribute Error:SkillRequirement::typeId");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return int
     */
    public function getTypeId(): int {
        if (SkillRequirement::validateTypeId($this->typeId))  {
            return $this->typeId;
        }
        throw new Exception('never get to getTypeId SkillRequirement::typeId');
    }

    /**
     * @return int
     */
    public static function sampleTypeId(): int {
        return 32; /*32:typeId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return SkillRequirement::validateLevel($this->level)
        || SkillRequirement::validateTypeId($this->typeId);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'level'} = $this->toLevel();
        $out->{'typeID'} = $this->toTypeId();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return SkillRequirement
     * @throws Exception
     */
    public static function from(stdClass $obj): SkillRequirement {
        return new SkillRequirement(
         SkillRequirement::fromLevel($obj->{'level'})
        ,SkillRequirement::fromTypeId($obj->{'typeID'})
        );
    }

    /**
     * @return SkillRequirement
     */
    public static function sample(): SkillRequirement {
        return new SkillRequirement(
         SkillRequirement::sampleLevel()
        ,SkillRequirement::sampleTypeId()
        );
    }
}
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_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_list(f: Callable[[Any], T], x: Any) -> list[T]:
    assert isinstance(x, list)
    return [f(y) for y in x]


def to_class(c: Type[T], x: Any) -> dict:
    assert isinstance(x, c)
    return cast(Any, x).to_dict()


@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 Milestone:
    type_id: int
    level: int | None = None

    @staticmethod
    def from_dict(obj: Any) -> 'Milestone':
        assert isinstance(obj, dict)
        type_id = from_int(obj.get("typeID"))
        level = from_union([from_int, from_none], obj.get("level"))
        return Milestone(type_id, level)

    def to_dict(self) -> dict:
        result: dict = {}
        result["typeID"] = from_int(self.type_id)
        if self.level is not None:
            result["level"] = from_union([from_int, from_none], self.level)
        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 SkillRequirement:
    level: int
    type_id: int

    @staticmethod
    def from_dict(obj: Any) -> 'SkillRequirement':
        assert isinstance(obj, dict)
        level = from_int(obj.get("level"))
        type_id = from_int(obj.get("typeID"))
        return SkillRequirement(level, type_id)

    def to_dict(self) -> dict:
        result: dict = {}
        result["level"] = from_int(self.level)
        result["typeID"] = from_int(self.type_id)
        return result


@dataclass
class SkillPlan:
    key: int
    description: Description
    internal_name: str
    milestones: list[Milestone]
    name: Name
    skill_requirements: list[SkillRequirement]
    career_path_id: int | None = None
    faction_id: int | None = None
    npc_corporation_division: int | None = None

    @staticmethod
    def from_dict(obj: Any) -> 'SkillPlan':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        description = Description.from_dict(obj.get("description"))
        internal_name = from_str(obj.get("internalName"))
        milestones = from_list(Milestone.from_dict, obj.get("milestones"))
        name = Name.from_dict(obj.get("name"))
        skill_requirements = from_list(SkillRequirement.from_dict, obj.get("skillRequirements"))
        career_path_id = from_union([from_int, from_none], obj.get("careerPathID"))
        faction_id = from_union([from_int, from_none], obj.get("factionID"))
        npc_corporation_division = from_union([from_int, from_none], obj.get("npcCorporationDivision"))
        return SkillPlan(key, description, internal_name, milestones, name, skill_requirements, career_path_id, faction_id, npc_corporation_division)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        result["description"] = to_class(Description, self.description)
        result["internalName"] = from_str(self.internal_name)
        result["milestones"] = from_list(lambda x: to_class(Milestone, x), self.milestones)
        result["name"] = to_class(Name, self.name)
        result["skillRequirements"] = from_list(lambda x: to_class(SkillRequirement, x), self.skill_requirements)
        if self.career_path_id is not None:
            result["careerPathID"] = from_union([from_int, from_none], self.career_path_id)
        if self.faction_id is not None:
            result["factionID"] = from_union([from_int, from_none], self.faction_id)
        if self.npc_corporation_division is not None:
            result["npcCorporationDivision"] = from_union([from_int, from_none], self.npc_corporation_division)
        return result


def skill_plan_from_dict(s: Any) -> SkillPlan:
    return SkillPlan.from_dict(s)


def skill_plan_to_dict(x: SkillPlan) -> Any:
    return to_class(SkillPlan, x)
// To parse this data:
//
//   import { Convert, SkillPlan } from "./SkillPlan";
//
//   const skillPlan = Convert.toSkillPlan(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.

export interface SkillPlan {
    _key:                    number;
    careerPathID?:           number;
    description:             Description;
    factionID?:              number;
    internalName:            string;
    milestones:              [Milestone, Milestone, ...Milestone[]];
    name:                    Name;
    npcCorporationDivision?: number;
    skillRequirements:       [SkillRequirement, SkillRequirement, SkillRequirement, ...SkillRequirement[]];
    [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 Milestone {
    level?: number;
    typeID: number;
    [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 SkillRequirement {
    level:  number;
    typeID: number;
    [property: string]: unknown;
}

// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
    public static toSkillPlan(json: string): SkillPlan {
        return cast(JSON.parse(json), r("SkillPlan"));
    }

    public static skillPlanToJson(value: SkillPlan): string {
        return JSON.stringify(uncast(value, r("SkillPlan")), 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 = {
    "SkillPlan": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "careerPathID", js: "careerPathID", typ: u(undefined, 0) },
        { json: "description", js: "description", typ: r("Description") },
        { json: "factionID", js: "factionID", typ: u(undefined, 0) },
        { json: "internalName", js: "internalName", typ: "" },
        { json: "milestones", js: "milestones", typ: a(r("Milestone")) },
        { json: "name", js: "name", typ: r("Name") },
        { json: "npcCorporationDivision", js: "npcCorporationDivision", typ: u(undefined, 0) },
        { json: "skillRequirements", js: "skillRequirements", typ: a(r("SkillRequirement")) },
    ], "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"),
    "Milestone": o([
        { json: "level", js: "level", typ: u(undefined, 0) },
        { json: "typeID", js: "typeID", typ: 0 },
    ], "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"),
    "SkillRequirement": o([
        { json: "level", js: "level", typ: 0 },
        { json: "typeID", js: "typeID", typ: 0 },
    ], "any"),
};