Skip to content

EVE SDE Schema

Documentation for third-party developers

dungeons.jsonl

Schema

  • _key (required): integer
    Range: 43 .. 14061
  • allowedShipsList: array of integer
    Type: integer
    Range: 238 .. 911
  • archetypeID (required): integer
    Range: 24 .. 81
  • description: 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 .. 500029

  • gameplayDescription: 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
  • 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

Code snippets

// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
//    using QuickType;
//
//    var dungeon = Dungeon.FromJson(jsonString);

namespace QuickType
{
    using System;
    using System.Collections.Generic;

    using System.Globalization;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    public partial class Dungeon
    {
        [JsonProperty("_key")]
        public long Key { get; set; }

        [JsonProperty("allowedShipsList", NullValueHandling = NullValueHandling.Ignore)]
        public long[] AllowedShipsList { get; set; }

        [JsonProperty("archetypeID")]
        public long ArchetypeId { get; set; }

        [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
        public Description Description { get; set; }

        [JsonProperty("factionID", NullValueHandling = NullValueHandling.Ignore)]
        public long? FactionId { get; set; }

        [JsonProperty("gameplayDescription", NullValueHandling = NullValueHandling.Ignore)]
        public GameplayDescription GameplayDescription { get; set; }

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

    public partial class Description
    {
        [JsonProperty("de")]
        [JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
        public string De { get; set; }

        [JsonProperty("en")]
        [JsonConverter(typeof(FluffyMinMaxLengthCheckConverter))]
        public string En { get; set; }

        [JsonProperty("es")]
        [JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
        public string Es { get; set; }

        [JsonProperty("fr")]
        [JsonConverter(typeof(StickyMinMaxLengthCheckConverter))]
        public string Fr { get; set; }

        [JsonProperty("ja")]
        [JsonConverter(typeof(IndigoMinMaxLengthCheckConverter))]
        public string Ja { get; set; }

        [JsonProperty("ko")]
        [JsonConverter(typeof(IndecentMinMaxLengthCheckConverter))]
        public string Ko { get; set; }

        [JsonProperty("ru")]
        [JsonConverter(typeof(HilariousMinMaxLengthCheckConverter))]
        public string Ru { get; set; }

        [JsonProperty("zh")]
        [JsonConverter(typeof(AmbitiousMinMaxLengthCheckConverter))]
        public string Zh { get; set; }
    }

    public partial class GameplayDescription
    {
        [JsonProperty("de")]
        [JsonConverter(typeof(CunningMinMaxLengthCheckConverter))]
        public string De { get; set; }

        [JsonProperty("en")]
        [JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
        public string En { get; set; }

        [JsonProperty("es")]
        [JsonConverter(typeof(FriskyMinMaxLengthCheckConverter))]
        public string Es { get; set; }

        [JsonProperty("fr")]
        [JsonConverter(typeof(MischievousMinMaxLengthCheckConverter))]
        public string Fr { get; set; }

        [JsonProperty("ja")]
        [JsonConverter(typeof(BraggadociousMinMaxLengthCheckConverter))]
        public string Ja { get; set; }

        [JsonProperty("ko")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter1))]
        public string Ko { get; set; }

        [JsonProperty("ru")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter2))]
        public string Ru { get; set; }

        [JsonProperty("zh")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter3))]
        public string Zh { get; set; }
    }

    public partial class Name
    {
        [JsonProperty("de")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter4))]
        public string De { get; set; }

        [JsonProperty("en")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter5))]
        public string En { get; set; }

        [JsonProperty("es")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter6))]
        public string Es { get; set; }

        [JsonProperty("fr")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter7))]
        public string Fr { get; set; }

        [JsonProperty("ja")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter8))]
        public string Ja { get; set; }

        [JsonProperty("ko")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter8))]
        public string Ko { get; set; }

        [JsonProperty("ru")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter9))]
        public string Ru { get; set; }

        [JsonProperty("zh")]
        [JsonConverter(typeof(MinMaxLengthCheckConverter10))]
        public string Zh { get; set; }
    }

    public partial class Dungeon
    {
        public static Dungeon FromJson(string json) => JsonConvert.DeserializeObject<Dungeon>(json, QuickType.Converter.Settings);
    }

    public static class Serialize
    {
        public static string ToJson(this Dungeon self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
    }

    internal static class Converter
    {
        public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
        {
            MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
            DateParseHandling = DateParseHandling.None,
            Converters =
            {
                new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
            },
        };
    }

    internal class PurpleMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 13 && value.Length <= 1169)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 13 && value.Length <= 1169)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class FluffyMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 8 && value.Length <= 1038)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 8 && value.Length <= 1038)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class TentacledMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 9 && value.Length <= 1124)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 9 && value.Length <= 1124)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class StickyMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 13 && value.Length <= 1117)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 13 && value.Length <= 1117)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class IndigoMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 2 && value.Length <= 460)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 2 && value.Length <= 460)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class IndecentMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 3 && value.Length <= 497)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 3 && value.Length <= 497)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class HilariousMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 8 && value.Length <= 1022)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 8 && value.Length <= 1022)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class AmbitiousMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 3 && value.Length <= 308)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 3 && value.Length <= 308)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class CunningMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 170 && value.Length <= 825)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 170 && value.Length <= 825)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MagentaMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 152 && value.Length <= 754)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 152 && value.Length <= 754)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class FriskyMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 172 && value.Length <= 850)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 172 && value.Length <= 850)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MischievousMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 180 && value.Length <= 844)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 180 && value.Length <= 844)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class BraggadociousMinMaxLengthCheckConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 84 && value.Length <= 459)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 84 && value.Length <= 459)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter1 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 66 && value.Length <= 500)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 66 && value.Length <= 500)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter2 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 172 && value.Length <= 823)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 172 && value.Length <= 823)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter3 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 51 && value.Length <= 419)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 51 && value.Length <= 419)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter4 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 4 && value.Length <= 63)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 4 && value.Length <= 63)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter5 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 4 && value.Length <= 53)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 4 && value.Length <= 53)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter6 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 5 && value.Length <= 74)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 5 && value.Length <= 74)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter7 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 4 && value.Length <= 73)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 4 && value.Length <= 73)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter8 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 2 && value.Length <= 42)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 2 && value.Length <= 42)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter9 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 4 && value.Length <= 93)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 4 && value.Length <= 93)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class MinMaxLengthCheckConverter10 : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(string);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 2 && value.Length <= 43)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 2 && value.Length <= 43)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

        public static readonly MinMaxLengthCheckConverter10 Singleton = new MinMaxLengthCheckConverter10();
    }
}
// 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:
//
//    dungeon, err := UnmarshalDungeon(bytes)
//    bytes, err = dungeon.Marshal()

package model

import "encoding/json"

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

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

type Dungeon struct {
    Key                 int64                `json:"_key"`
    AllowedShipsList    []int64              `json:"allowedShipsList,omitempty"`
    ArchetypeID         int64                `json:"archetypeID"`
    Description         *Description         `json:"description,omitempty"`
    FactionID           *int64               `json:"factionID,omitempty"`
    GameplayDescription *GameplayDescription `json:"gameplayDescription,omitempty"`
    Name                Name                 `json:"name"`
}

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 GameplayDescription struct {
    De string `json:"de"`
    En string `json:"en"`
    Es string `json:"es"`
    Fr string `json:"fr"`
    Ja string `json:"ja"`
    Ko string `json:"ko"`
    Ru string `json:"ru"`
    Zh string `json:"zh"`
}

type Name struct {
    De string `json:"de"`
    En string `json:"en"`
    Es string `json:"es"`
    Fr string `json:"fr"`
    Ja string `json:"ja"`
    Ko string `json:"ko"`
    Ru string `json:"ru"`
    Zh string `json:"zh"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":43,"maximum":14061},"allowedShipsList":{"type":"array","items":{"type":"integer","minimum":238,"maximum":911},"minItems":1,"maxItems":2},"archetypeID":{"type":"integer","minimum":24,"maximum":81},"description":{"type":"object","properties":{"de":{"type":"string","minLength":13,"maxLength":1169},"en":{"type":"string","minLength":8,"maxLength":1038},"es":{"type":"string","minLength":9,"maxLength":1124},"fr":{"type":"string","minLength":13,"maxLength":1117},"ja":{"type":"string","minLength":2,"maxLength":460},"ko":{"type":"string","minLength":3,"maxLength":497},"ru":{"type":"string","minLength":8,"maxLength":1022},"zh":{"type":"string","minLength":3,"maxLength":308}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"factionID":{"type":"integer","minimum":500001,"maximum":500029},"gameplayDescription":{"type":"object","properties":{"de":{"type":"string","minLength":170,"maxLength":825},"en":{"type":"string","minLength":152,"maxLength":754},"es":{"type":"string","minLength":172,"maxLength":850},"fr":{"type":"string","minLength":180,"maxLength":844},"ja":{"type":"string","minLength":84,"maxLength":459},"ko":{"type":"string","minLength":66,"maxLength":500},"ru":{"type":"string","minLength":172,"maxLength":823},"zh":{"type":"string","minLength":51,"maxLength":419}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"name":{"type":"object","properties":{"de":{"type":"string","minLength":4,"maxLength":63},"en":{"type":"string","minLength":4,"maxLength":53},"es":{"type":"string","minLength":5,"maxLength":74},"fr":{"type":"string","minLength":4,"maxLength":73},"ja":{"type":"string","minLength":2,"maxLength":42},"ko":{"type":"string","minLength":2,"maxLength":42},"ru":{"type":"string","minLength":4,"maxLength":93},"zh":{"type":"string","minLength":2,"maxLength":43}},"required":["de","en","es","fr","ja","ko","ru","zh"]}},"required":["_key","archetypeID","name"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json    = Json { allowStructuredMapKeys = true }
// val dungeon = json.parse(Dungeon.serializer(), jsonString)

package model

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

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

    val allowedShipsList: List<Long>? = null,

    @SerialName("archetypeID")
    val archetypeId: Long,

    val description: Description? = null,

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

    val gameplayDescription: GameplayDescription? = null,
    val name: Name
)

@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 GameplayDescription (
    val de: String,
    val en: String,
    val es: String,
    val fr: String,
    val ja: String,
    val ko: String,
    val ru: String,
    val zh: String
)

@Serializable
data class Name (
    val de: String,
    val en: String,
    val es: String,
    val fr: String,
    val ja: String,
    val ko: String,
    val ru: String,
    val zh: String
)
<?php

// This is a autogenerated file:Dungeon

class Dungeon {
    private int $key; // json:_key Required
    private ?array $allowedShipsList; // json:allowedShipsList Optional
    private int $archetypeId; // json:archetypeID Required
    private ?Description $description; // json:description Optional
    private ?int $factionId; // json:factionID Optional
    private ?GameplayDescription $gameplayDescription; // json:gameplayDescription Optional
    private Name $name; // json:name Required

    /**
     * @param int $key
     * @param array|null $allowedShipsList
     * @param int $archetypeId
     * @param Description|null $description
     * @param int|null $factionId
     * @param GameplayDescription|null $gameplayDescription
     * @param Name $name
     */
    public function __construct(int $key, ?array $allowedShipsList, int $archetypeId, ?Description $description, ?int $factionId, ?GameplayDescription $gameplayDescription, Name $name) {
        $this->key = $key;
        $this->allowedShipsList = $allowedShipsList;
        $this->archetypeId = $archetypeId;
        $this->description = $description;
        $this->factionId = $factionId;
        $this->gameplayDescription = $gameplayDescription;
        $this->name = $name;
    }

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

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

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

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

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function toAllowedShipsList(): ?array {
        if (Dungeon::validateAllowedShipsList($this->allowedShipsList))  {
            if (!is_null($this->allowedShipsList)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->allowedShipsList);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this Dungeon::allowedShipsList');
    }

    /**
     * @param array|null
     * @return bool
     * @throws Exception
     */
    public static function validateAllowedShipsList(?array $value): bool {
        if (!is_null($value)) {
            if (!is_array($value)) {
                throw new Exception("Attribute Error:Dungeon::allowedShipsList");
            }
            array_walk($value, function($value_v) {
                if (!is_integer($value_v)) {
                    throw new Exception("Attribute Error:Dungeon::allowedShipsList");
                }
            });
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?array
     */
    public function getAllowedShipsList(): ?array {
        if (Dungeon::validateAllowedShipsList($this->allowedShipsList))  {
            return $this->allowedShipsList;
        }
        throw new Exception('never get to getAllowedShipsList Dungeon::allowedShipsList');
    }

    /**
     * @return ?array
     */
    public static function sampleAllowedShipsList(): ?array {
        return  array(
            32 /*32:*/
        ); /* 32:allowedShipsList*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toArchetypeId(): int {
        if (Dungeon::validateArchetypeId($this->archetypeId))  {
            return $this->archetypeId; /*int*/
        }
        throw new Exception('never get to this Dungeon::archetypeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getArchetypeId(): int {
        if (Dungeon::validateArchetypeId($this->archetypeId))  {
            return $this->archetypeId;
        }
        throw new Exception('never get to getArchetypeId Dungeon::archetypeId');
    }

    /**
     * @return int
     */
    public static function sampleArchetypeId(): int {
        return 33; /*33:archetypeId*/
    }

    /**
     * @param ?stdClass $value
     * @throws Exception
     * @return ?Description
     */
    public static function fromDescription(?stdClass $value): ?Description {
        if (!is_null($value)) {
            return Description::from($value); /*class*/
        } else {
            return null;
        }
    }

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

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

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

    /**
     * @return ?Description
     */
    public static function sampleDescription(): ?Description {
        return Description::sample(); /*34: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 (Dungeon::validateFactionId($this->factionId))  {
            if (!is_null($this->factionId)) {
                return $this->factionId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this Dungeon::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:Dungeon::factionId");
            }
        }
        return true;
    }

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

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

    /**
     * @param ?stdClass $value
     * @throws Exception
     * @return ?GameplayDescription
     */
    public static function fromGameplayDescription(?stdClass $value): ?GameplayDescription {
        if (!is_null($value)) {
            return GameplayDescription::from($value); /*class*/
        } else {
            return null;
        }
    }

    /**
     * @throws Exception
     * @return ?stdClass
     */
    public function toGameplayDescription(): ?stdClass {
        if (Dungeon::validateGameplayDescription($this->gameplayDescription))  {
            if (!is_null($this->gameplayDescription)) {
                return $this->gameplayDescription->to(); /*class*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this Dungeon::gameplayDescription');
    }

    /**
     * @param GameplayDescription|null
     * @return bool
     * @throws Exception
     */
    public static function validateGameplayDescription(?GameplayDescription $value): bool {
        if (!is_null($value)) {
            $value->validate();
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?GameplayDescription
     */
    public function getGameplayDescription(): ?GameplayDescription {
        if (Dungeon::validateGameplayDescription($this->gameplayDescription))  {
            return $this->gameplayDescription;
        }
        throw new Exception('never get to getGameplayDescription Dungeon::gameplayDescription');
    }

    /**
     * @return ?GameplayDescription
     */
    public static function sampleGameplayDescription(): ?GameplayDescription {
        return GameplayDescription::sample(); /*36:gameplayDescription*/
    }

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

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

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return Dungeon::validateKey($this->key)
        || Dungeon::validateAllowedShipsList($this->allowedShipsList)
        || Dungeon::validateArchetypeId($this->archetypeId)
        || Dungeon::validateDescription($this->description)
        || Dungeon::validateFactionId($this->factionId)
        || Dungeon::validateGameplayDescription($this->gameplayDescription)
        || Dungeon::validateName($this->name);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'allowedShipsList'} = $this->toAllowedShipsList();
        $out->{'archetypeID'} = $this->toArchetypeId();
        $out->{'description'} = $this->toDescription();
        $out->{'factionID'} = $this->toFactionId();
        $out->{'gameplayDescription'} = $this->toGameplayDescription();
        $out->{'name'} = $this->toName();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return Dungeon
     * @throws Exception
     */
    public static function from(stdClass $obj): Dungeon {
        return new Dungeon(
         Dungeon::fromKey($obj->{'_key'})
        ,Dungeon::fromAllowedShipsList($obj->{'allowedShipsList'})
        ,Dungeon::fromArchetypeId($obj->{'archetypeID'})
        ,Dungeon::fromDescription($obj->{'description'})
        ,Dungeon::fromFactionId($obj->{'factionID'})
        ,Dungeon::fromGameplayDescription($obj->{'gameplayDescription'})
        ,Dungeon::fromName($obj->{'name'})
        );
    }

    /**
     * @return Dungeon
     */
    public static function sample(): Dungeon {
        return new Dungeon(
         Dungeon::sampleKey()
        ,Dungeon::sampleAllowedShipsList()
        ,Dungeon::sampleArchetypeId()
        ,Dungeon::sampleDescription()
        ,Dungeon::sampleFactionId()
        ,Dungeon::sampleGameplayDescription()
        ,Dungeon::sampleName()
        );
    }
}

// This is a 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 a autogenerated file:GameplayDescription

class GameplayDescription {
    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 (GameplayDescription::validateDe($this->de))  {
            return $this->de; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::de');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getDe(): string {
        if (GameplayDescription::validateDe($this->de))  {
            return $this->de;
        }
        throw new Exception('never get to getDe GameplayDescription::de');
    }

    /**
     * @return string
     */
    public static function sampleDe(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateEn($this->en))  {
            return $this->en; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::en');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getEn(): string {
        if (GameplayDescription::validateEn($this->en))  {
            return $this->en;
        }
        throw new Exception('never get to getEn GameplayDescription::en');
    }

    /**
     * @return string
     */
    public static function sampleEn(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateEs($this->es))  {
            return $this->es; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::es');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getEs(): string {
        if (GameplayDescription::validateEs($this->es))  {
            return $this->es;
        }
        throw new Exception('never get to getEs GameplayDescription::es');
    }

    /**
     * @return string
     */
    public static function sampleEs(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateFr($this->fr))  {
            return $this->fr; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::fr');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getFr(): string {
        if (GameplayDescription::validateFr($this->fr))  {
            return $this->fr;
        }
        throw new Exception('never get to getFr GameplayDescription::fr');
    }

    /**
     * @return string
     */
    public static function sampleFr(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateJa($this->ja))  {
            return $this->ja; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::ja');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getJa(): string {
        if (GameplayDescription::validateJa($this->ja))  {
            return $this->ja;
        }
        throw new Exception('never get to getJa GameplayDescription::ja');
    }

    /**
     * @return string
     */
    public static function sampleJa(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateKo($this->ko))  {
            return $this->ko; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::ko');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getKo(): string {
        if (GameplayDescription::validateKo($this->ko))  {
            return $this->ko;
        }
        throw new Exception('never get to getKo GameplayDescription::ko');
    }

    /**
     * @return string
     */
    public static function sampleKo(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateRu($this->ru))  {
            return $this->ru; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::ru');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getRu(): string {
        if (GameplayDescription::validateRu($this->ru))  {
            return $this->ru;
        }
        throw new Exception('never get to getRu GameplayDescription::ru');
    }

    /**
     * @return string
     */
    public static function sampleRu(): string {
        return 'GameplayDescription::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 (GameplayDescription::validateZh($this->zh))  {
            return $this->zh; /*string*/
        }
        throw new Exception('never get to this GameplayDescription::zh');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getZh(): string {
        if (GameplayDescription::validateZh($this->zh))  {
            return $this->zh;
        }
        throw new Exception('never get to getZh GameplayDescription::zh');
    }

    /**
     * @return string
     */
    public static function sampleZh(): string {
        return 'GameplayDescription::zh::38'; /*38:zh*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return GameplayDescription::validateDe($this->de)
        || GameplayDescription::validateEn($this->en)
        || GameplayDescription::validateEs($this->es)
        || GameplayDescription::validateFr($this->fr)
        || GameplayDescription::validateJa($this->ja)
        || GameplayDescription::validateKo($this->ko)
        || GameplayDescription::validateRu($this->ru)
        || GameplayDescription::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 GameplayDescription
     * @throws Exception
     */
    public static function from(stdClass $obj): GameplayDescription {
        return new GameplayDescription(
         GameplayDescription::fromDe($obj->{'de'})
        ,GameplayDescription::fromEn($obj->{'en'})
        ,GameplayDescription::fromEs($obj->{'es'})
        ,GameplayDescription::fromFr($obj->{'fr'})
        ,GameplayDescription::fromJa($obj->{'ja'})
        ,GameplayDescription::fromKo($obj->{'ko'})
        ,GameplayDescription::fromRu($obj->{'ru'})
        ,GameplayDescription::fromZh($obj->{'zh'})
        );
    }

    /**
     * @return GameplayDescription
     */
    public static function sample(): GameplayDescription {
        return new GameplayDescription(
         GameplayDescription::sampleDe()
        ,GameplayDescription::sampleEn()
        ,GameplayDescription::sampleEs()
        ,GameplayDescription::sampleFr()
        ,GameplayDescription::sampleJa()
        ,GameplayDescription::sampleKo()
        ,GameplayDescription::sampleRu()
        ,GameplayDescription::sampleZh()
        );
    }
}

// This is a 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()
        );
    }
}
from typing import Any, List, Optional, TypeVar, Callable, Type, cast


T = TypeVar("T")


def from_str(x: Any) -> str:
    assert isinstance(x, str)
    return x


def from_int(x: Any) -> int:
    assert isinstance(x, int) and not isinstance(x, bool)
    return x


def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
    assert isinstance(x, list)
    return [f(y) for y in x]


def from_none(x: Any) -> Any:
    assert x is None
    return x


def from_union(fs, x):
    for f in fs:
        try:
            return f(x)
        except:
            pass
    assert False


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


class Description:
    de: str
    en: str
    es: str
    fr: str
    ja: str
    ko: str
    ru: str
    zh: str

    def __init__(self, de: str, en: str, es: str, fr: str, ja: str, ko: str, ru: str, zh: str) -> None:
        self.de = de
        self.en = en
        self.es = es
        self.fr = fr
        self.ja = ja
        self.ko = ko
        self.ru = ru
        self.zh = zh

    @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


class GameplayDescription:
    de: str
    en: str
    es: str
    fr: str
    ja: str
    ko: str
    ru: str
    zh: str

    def __init__(self, de: str, en: str, es: str, fr: str, ja: str, ko: str, ru: str, zh: str) -> None:
        self.de = de
        self.en = en
        self.es = es
        self.fr = fr
        self.ja = ja
        self.ko = ko
        self.ru = ru
        self.zh = zh

    @staticmethod
    def from_dict(obj: Any) -> 'GameplayDescription':
        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 GameplayDescription(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


class Name:
    de: str
    en: str
    es: str
    fr: str
    ja: str
    ko: str
    ru: str
    zh: str

    def __init__(self, de: str, en: str, es: str, fr: str, ja: str, ko: str, ru: str, zh: str) -> None:
        self.de = de
        self.en = en
        self.es = es
        self.fr = fr
        self.ja = ja
        self.ko = ko
        self.ru = ru
        self.zh = zh

    @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


class Dungeon:
    key: int
    allowed_ships_list: Optional[List[int]]
    archetype_id: int
    description: Optional[Description]
    faction_id: Optional[int]
    gameplay_description: Optional[GameplayDescription]
    name: Name

    def __init__(self, key: int, allowed_ships_list: Optional[List[int]], archetype_id: int, description: Optional[Description], faction_id: Optional[int], gameplay_description: Optional[GameplayDescription], name: Name) -> None:
        self.key = key
        self.allowed_ships_list = allowed_ships_list
        self.archetype_id = archetype_id
        self.description = description
        self.faction_id = faction_id
        self.gameplay_description = gameplay_description
        self.name = name

    @staticmethod
    def from_dict(obj: Any) -> 'Dungeon':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        allowed_ships_list = from_union([lambda x: from_list(from_int, x), from_none], obj.get("allowedShipsList"))
        archetype_id = from_int(obj.get("archetypeID"))
        description = from_union([Description.from_dict, from_none], obj.get("description"))
        faction_id = from_union([from_int, from_none], obj.get("factionID"))
        gameplay_description = from_union([GameplayDescription.from_dict, from_none], obj.get("gameplayDescription"))
        name = Name.from_dict(obj.get("name"))
        return Dungeon(key, allowed_ships_list, archetype_id, description, faction_id, gameplay_description, name)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        if self.allowed_ships_list is not None:
            result["allowedShipsList"] = from_union([lambda x: from_list(from_int, x), from_none], self.allowed_ships_list)
        result["archetypeID"] = from_int(self.archetype_id)
        if self.description is not None:
            result["description"] = from_union([lambda x: to_class(Description, x), from_none], self.description)
        if self.faction_id is not None:
            result["factionID"] = from_union([from_int, from_none], self.faction_id)
        if self.gameplay_description is not None:
            result["gameplayDescription"] = from_union([lambda x: to_class(GameplayDescription, x), from_none], self.gameplay_description)
        result["name"] = to_class(Name, self.name)
        return result


def dungeon_from_dict(s: Any) -> Dungeon:
    return Dungeon.from_dict(s)


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

export interface Dungeon {
    _key:                 number;
    allowedShipsList?:    number[];
    archetypeID:          number;
    description?:         Description;
    factionID?:           number;
    gameplayDescription?: GameplayDescription;
    name:                 Name;
    [property: string]: any;
}

export interface Description {
    de: string;
    en: string;
    es: string;
    fr: string;
    ja: string;
    ko: string;
    ru: string;
    zh: string;
    [property: string]: any;
}

export interface GameplayDescription {
    de: string;
    en: string;
    es: string;
    fr: string;
    ja: string;
    ko: string;
    ru: string;
    zh: string;
    [property: string]: any;
}

export interface Name {
    de: string;
    en: string;
    es: string;
    fr: string;
    ja: string;
    ko: string;
    ru: string;
    zh: string;
    [property: string]: any;
}

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

    public static dungeonToJson(value: Dungeon): string {
        return JSON.stringify(uncast(value, r("Dungeon")), 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 = {
    "Dungeon": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "allowedShipsList", js: "allowedShipsList", typ: u(undefined, a(0)) },
        { json: "archetypeID", js: "archetypeID", typ: 0 },
        { json: "description", js: "description", typ: u(undefined, r("Description")) },
        { json: "factionID", js: "factionID", typ: u(undefined, 0) },
        { json: "gameplayDescription", js: "gameplayDescription", typ: u(undefined, r("GameplayDescription")) },
        { json: "name", js: "name", typ: r("Name") },
    ], "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"),
    "GameplayDescription": o([
        { json: "de", js: "de", typ: "" },
        { json: "en", js: "en", typ: "" },
        { json: "es", js: "es", typ: "" },
        { json: "fr", js: "fr", typ: "" },
        { json: "ja", js: "ja", typ: "" },
        { json: "ko", js: "ko", typ: "" },
        { json: "ru", js: "ru", typ: "" },
        { json: "zh", js: "zh", typ: "" },
    ], "any"),
    "Name": o([
        { json: "de", js: "de", typ: "" },
        { json: "en", js: "en", typ: "" },
        { json: "es", js: "es", typ: "" },
        { json: "fr", js: "fr", typ: "" },
        { json: "ja", js: "ja", typ: "" },
        { json: "ko", js: "ko", typ: "" },
        { json: "ru", js: "ru", typ: "" },
        { json: "zh", js: "zh", typ: "" },
    ], "any"),
};