Skip to content

EVE SDE Schema

Documentation for third-party developers

typeLists.jsonl

Schema

  • _key (required): integer
    Range: 4 .. 981
  • displayDescription: 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
  • displayName: 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
  • excludedCategoryIDs: array of integer
    Type: integer
    Range: 65 .. 65

  • excludedGroupIDs: array of integer
    Type: integer
    Range: 5 .. 4726
  • excludedTypeIDs: array of integer
    Type: integer
    Range: 578 .. 88001
  • includedCategoryIDs: array of integer
    Type: integer
    Range: 2 .. 2118
  • includedGroupIDs: array of integer
    Type: integer
    Range: 1 .. 5087
  • includedTypeIDs: array of integer
    Type: integer
    Range: 18 .. 93260
  • name (required): string

Code snippets

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

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

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

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

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

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

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

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

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

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

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

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

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

    public partial class DisplayDescription
    {
        [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 DisplayName
    {
        [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(MinMaxLengthCheckConverter1))]
        public string Zh { get; set; }
    }

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

    public static class Serialize
    {
        public static string ToJson(this TypeList 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 >= 40 && value.Length <= 140)
            {
                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 >= 40 && value.Length <= 140)
            {
                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 >= 40 && value.Length <= 115)
            {
                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 >= 40 && value.Length <= 115)
            {
                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 >= 48 && value.Length <= 147)
            {
                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 >= 48 && value.Length <= 147)
            {
                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 >= 56 && value.Length <= 147)
            {
                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 >= 56 && value.Length <= 147)
            {
                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 >= 19 && 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 >= 19 && value.Length <= 53)
            {
                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 >= 19 && value.Length <= 60)
            {
                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 >= 19 && value.Length <= 60)
            {
                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 >= 40 && value.Length <= 149)
            {
                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 >= 40 && value.Length <= 149)
            {
                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 >= 13 && value.Length <= 45)
            {
                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 <= 45)
            {
                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 >= 3 && value.Length <= 84)
            {
                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 <= 84)
            {
                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 >= 3 && value.Length <= 68)
            {
                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 <= 68)
            {
                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 >= 5 && value.Length <= 98)
            {
                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 <= 98)
            {
                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 >= 3 && value.Length <= 96)
            {
                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 <= 96)
            {
                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 >= 2 && value.Length <= 26)
            {
                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 <= 26)
            {
                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 >= 2 && value.Length <= 23)
            {
                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 <= 23)
            {
                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 >= 3 && value.Length <= 65)
            {
                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 <= 65)
            {
                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 >= 4 && value.Length <= 530)
            {
                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 <= 530)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

package model

import "encoding/json"

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

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

type TypeList struct {
    Key                 int64               `json:"_key"`
    DisplayDescription  *DisplayDescription `json:"displayDescription,omitempty"`
    DisplayName         *DisplayName        `json:"displayName,omitempty"`
    ExcludedCategoryIDs []int64             `json:"excludedCategoryIDs,omitempty"`
    ExcludedGroupIDs    []int64             `json:"excludedGroupIDs,omitempty"`
    ExcludedTypeIDs     []int64             `json:"excludedTypeIDs,omitempty"`
    IncludedCategoryIDs []int64             `json:"includedCategoryIDs,omitempty"`
    IncludedGroupIDs    []int64             `json:"includedGroupIDs,omitempty"`
    IncludedTypeIDs     []int64             `json:"includedTypeIDs,omitempty"`
    Name                string              `json:"name"`
}

type DisplayDescription 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 DisplayName 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":4,"maximum":981},"displayDescription":{"type":"object","properties":{"de":{"type":"string","minLength":40,"maxLength":140},"en":{"type":"string","minLength":40,"maxLength":115},"es":{"type":"string","minLength":48,"maxLength":147},"fr":{"type":"string","minLength":56,"maxLength":147},"ja":{"type":"string","minLength":19,"maxLength":53},"ko":{"type":"string","minLength":19,"maxLength":60},"ru":{"type":"string","minLength":40,"maxLength":149},"zh":{"type":"string","minLength":13,"maxLength":45}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"displayName":{"type":"object","properties":{"de":{"type":"string","minLength":3,"maxLength":84},"en":{"type":"string","minLength":3,"maxLength":68},"es":{"type":"string","minLength":5,"maxLength":98},"fr":{"type":"string","minLength":3,"maxLength":96},"ja":{"type":"string","minLength":2,"maxLength":26},"ko":{"type":"string","minLength":2,"maxLength":23},"ru":{"type":"string","minLength":3,"maxLength":65},"zh":{"type":"string","minLength":2,"maxLength":23}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"excludedCategoryIDs":{"type":"array","items":{"type":"integer","minimum":65,"maximum":65},"minItems":1,"maxItems":1},"excludedGroupIDs":{"type":"array","items":{"type":"integer","minimum":5,"maximum":4726},"minItems":1,"maxItems":125},"excludedTypeIDs":{"type":"array","items":{"type":"integer","minimum":578,"maximum":88001},"minItems":1,"maxItems":98},"includedCategoryIDs":{"type":"array","items":{"type":"integer","minimum":2,"maximum":2118},"minItems":1,"maxItems":12},"includedGroupIDs":{"type":"array","items":{"type":"integer","minimum":1,"maximum":5087},"minItems":1,"maxItems":68},"includedTypeIDs":{"type":"array","items":{"type":"integer","minimum":18,"maximum":93260},"minItems":1,"maxItems":486},"name":{"type":"string","minLength":4,"maxLength":530}},"required":["_key","name"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json     = Json { allowStructuredMapKeys = true }
// val typeList = json.parse(TypeList.serializer(), jsonString)

package model

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

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

    val displayDescription: DisplayDescription? = null,
    val displayName: DisplayName? = null,
    val excludedCategoryIDs: List<Long>? = null,
    val excludedGroupIDs: List<Long>? = null,
    val excludedTypeIDs: List<Long>? = null,
    val includedCategoryIDs: List<Long>? = null,
    val includedGroupIDs: List<Long>? = null,
    val includedTypeIDs: List<Long>? = null,
    val name: String
)

@Serializable
data class DisplayDescription (
    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 DisplayName (
    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:TypeList

class TypeList {
    private int $key; // json:_key Required
    private ?DisplayDescription $displayDescription; // json:displayDescription Optional
    private ?DisplayName $displayName; // json:displayName Optional
    private ?array $excludedCategoryIDs; // json:excludedCategoryIDs Optional
    private ?array $excludedGroupIDs; // json:excludedGroupIDs Optional
    private ?array $excludedTypeIDs; // json:excludedTypeIDs Optional
    private ?array $includedCategoryIDs; // json:includedCategoryIDs Optional
    private ?array $includedGroupIDs; // json:includedGroupIDs Optional
    private ?array $includedTypeIDs; // json:includedTypeIDs Optional
    private string $name; // json:name Required

    /**
     * @param int $key
     * @param DisplayDescription|null $displayDescription
     * @param DisplayName|null $displayName
     * @param array|null $excludedCategoryIDs
     * @param array|null $excludedGroupIDs
     * @param array|null $excludedTypeIDs
     * @param array|null $includedCategoryIDs
     * @param array|null $includedGroupIDs
     * @param array|null $includedTypeIDs
     * @param string $name
     */
    public function __construct(int $key, ?DisplayDescription $displayDescription, ?DisplayName $displayName, ?array $excludedCategoryIDs, ?array $excludedGroupIDs, ?array $excludedTypeIDs, ?array $includedCategoryIDs, ?array $includedGroupIDs, ?array $includedTypeIDs, string $name) {
        $this->key = $key;
        $this->displayDescription = $displayDescription;
        $this->displayName = $displayName;
        $this->excludedCategoryIDs = $excludedCategoryIDs;
        $this->excludedGroupIDs = $excludedGroupIDs;
        $this->excludedTypeIDs = $excludedTypeIDs;
        $this->includedCategoryIDs = $includedCategoryIDs;
        $this->includedGroupIDs = $includedGroupIDs;
        $this->includedTypeIDs = $includedTypeIDs;
        $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 (TypeList::validateKey($this->key))  {
            return $this->key; /*int*/
        }
        throw new Exception('never get to this TypeList::key');
    }

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

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

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

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

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

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

    /**
     * @throws Exception
     * @return ?DisplayDescription
     */
    public function getDisplayDescription(): ?DisplayDescription {
        if (TypeList::validateDisplayDescription($this->displayDescription))  {
            return $this->displayDescription;
        }
        throw new Exception('never get to getDisplayDescription TypeList::displayDescription');
    }

    /**
     * @return ?DisplayDescription
     */
    public static function sampleDisplayDescription(): ?DisplayDescription {
        return DisplayDescription::sample(); /*32:displayDescription*/
    }

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

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

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

    /**
     * @throws Exception
     * @return ?DisplayName
     */
    public function getDisplayName(): ?DisplayName {
        if (TypeList::validateDisplayName($this->displayName))  {
            return $this->displayName;
        }
        throw new Exception('never get to getDisplayName TypeList::displayName');
    }

    /**
     * @return ?DisplayName
     */
    public static function sampleDisplayName(): ?DisplayName {
        return DisplayName::sample(); /*33:displayName*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromExcludedCategoryIDs(?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 toExcludedCategoryIDs(): ?array {
        if (TypeList::validateExcludedCategoryIDs($this->excludedCategoryIDs))  {
            if (!is_null($this->excludedCategoryIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->excludedCategoryIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::excludedCategoryIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getExcludedCategoryIDs(): ?array {
        if (TypeList::validateExcludedCategoryIDs($this->excludedCategoryIDs))  {
            return $this->excludedCategoryIDs;
        }
        throw new Exception('never get to getExcludedCategoryIDs TypeList::excludedCategoryIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleExcludedCategoryIDs(): ?array {
        return  array(
            34 /*34:*/
        ); /* 34:excludedCategoryIDs*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromExcludedGroupIDs(?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 toExcludedGroupIDs(): ?array {
        if (TypeList::validateExcludedGroupIDs($this->excludedGroupIDs))  {
            if (!is_null($this->excludedGroupIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->excludedGroupIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::excludedGroupIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getExcludedGroupIDs(): ?array {
        if (TypeList::validateExcludedGroupIDs($this->excludedGroupIDs))  {
            return $this->excludedGroupIDs;
        }
        throw new Exception('never get to getExcludedGroupIDs TypeList::excludedGroupIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleExcludedGroupIDs(): ?array {
        return  array(
            35 /*35:*/
        ); /* 35:excludedGroupIDs*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromExcludedTypeIDs(?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 toExcludedTypeIDs(): ?array {
        if (TypeList::validateExcludedTypeIDs($this->excludedTypeIDs))  {
            if (!is_null($this->excludedTypeIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->excludedTypeIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::excludedTypeIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getExcludedTypeIDs(): ?array {
        if (TypeList::validateExcludedTypeIDs($this->excludedTypeIDs))  {
            return $this->excludedTypeIDs;
        }
        throw new Exception('never get to getExcludedTypeIDs TypeList::excludedTypeIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleExcludedTypeIDs(): ?array {
        return  array(
            36 /*36:*/
        ); /* 36:excludedTypeIDs*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromIncludedCategoryIDs(?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 toIncludedCategoryIDs(): ?array {
        if (TypeList::validateIncludedCategoryIDs($this->includedCategoryIDs))  {
            if (!is_null($this->includedCategoryIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->includedCategoryIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::includedCategoryIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getIncludedCategoryIDs(): ?array {
        if (TypeList::validateIncludedCategoryIDs($this->includedCategoryIDs))  {
            return $this->includedCategoryIDs;
        }
        throw new Exception('never get to getIncludedCategoryIDs TypeList::includedCategoryIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleIncludedCategoryIDs(): ?array {
        return  array(
            37 /*37:*/
        ); /* 37:includedCategoryIDs*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromIncludedGroupIDs(?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 toIncludedGroupIDs(): ?array {
        if (TypeList::validateIncludedGroupIDs($this->includedGroupIDs))  {
            if (!is_null($this->includedGroupIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->includedGroupIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::includedGroupIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getIncludedGroupIDs(): ?array {
        if (TypeList::validateIncludedGroupIDs($this->includedGroupIDs))  {
            return $this->includedGroupIDs;
        }
        throw new Exception('never get to getIncludedGroupIDs TypeList::includedGroupIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleIncludedGroupIDs(): ?array {
        return  array(
            38 /*38:*/
        ); /* 38:includedGroupIDs*/
    }

    /**
     * @param ?array $value
     * @throws Exception
     * @return ?array
     */
    public static function fromIncludedTypeIDs(?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 toIncludedTypeIDs(): ?array {
        if (TypeList::validateIncludedTypeIDs($this->includedTypeIDs))  {
            if (!is_null($this->includedTypeIDs)) {
                return array_map(function ($value) {
                    return $value; /*int*/
                }, $this->includedTypeIDs);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this TypeList::includedTypeIDs');
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getIncludedTypeIDs(): ?array {
        if (TypeList::validateIncludedTypeIDs($this->includedTypeIDs))  {
            return $this->includedTypeIDs;
        }
        throw new Exception('never get to getIncludedTypeIDs TypeList::includedTypeIDs');
    }

    /**
     * @return ?array
     */
    public static function sampleIncludedTypeIDs(): ?array {
        return  array(
            39 /*39:*/
        ); /* 39:includedTypeIDs*/
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function toName(): string {
        if (TypeList::validateName($this->name))  {
            return $this->name; /*string*/
        }
        throw new Exception('never get to this TypeList::name');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getName(): string {
        if (TypeList::validateName($this->name))  {
            return $this->name;
        }
        throw new Exception('never get to getName TypeList::name');
    }

    /**
     * @return string
     */
    public static function sampleName(): string {
        return 'TypeList::name::40'; /*40:name*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return TypeList::validateKey($this->key)
        || TypeList::validateDisplayDescription($this->displayDescription)
        || TypeList::validateDisplayName($this->displayName)
        || TypeList::validateExcludedCategoryIDs($this->excludedCategoryIDs)
        || TypeList::validateExcludedGroupIDs($this->excludedGroupIDs)
        || TypeList::validateExcludedTypeIDs($this->excludedTypeIDs)
        || TypeList::validateIncludedCategoryIDs($this->includedCategoryIDs)
        || TypeList::validateIncludedGroupIDs($this->includedGroupIDs)
        || TypeList::validateIncludedTypeIDs($this->includedTypeIDs)
        || TypeList::validateName($this->name);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'displayDescription'} = $this->toDisplayDescription();
        $out->{'displayName'} = $this->toDisplayName();
        $out->{'excludedCategoryIDs'} = $this->toExcludedCategoryIDs();
        $out->{'excludedGroupIDs'} = $this->toExcludedGroupIDs();
        $out->{'excludedTypeIDs'} = $this->toExcludedTypeIDs();
        $out->{'includedCategoryIDs'} = $this->toIncludedCategoryIDs();
        $out->{'includedGroupIDs'} = $this->toIncludedGroupIDs();
        $out->{'includedTypeIDs'} = $this->toIncludedTypeIDs();
        $out->{'name'} = $this->toName();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return TypeList
     * @throws Exception
     */
    public static function from(stdClass $obj): TypeList {
        return new TypeList(
         TypeList::fromKey($obj->{'_key'})
        ,TypeList::fromDisplayDescription($obj->{'displayDescription'})
        ,TypeList::fromDisplayName($obj->{'displayName'})
        ,TypeList::fromExcludedCategoryIDs($obj->{'excludedCategoryIDs'})
        ,TypeList::fromExcludedGroupIDs($obj->{'excludedGroupIDs'})
        ,TypeList::fromExcludedTypeIDs($obj->{'excludedTypeIDs'})
        ,TypeList::fromIncludedCategoryIDs($obj->{'includedCategoryIDs'})
        ,TypeList::fromIncludedGroupIDs($obj->{'includedGroupIDs'})
        ,TypeList::fromIncludedTypeIDs($obj->{'includedTypeIDs'})
        ,TypeList::fromName($obj->{'name'})
        );
    }

    /**
     * @return TypeList
     */
    public static function sample(): TypeList {
        return new TypeList(
         TypeList::sampleKey()
        ,TypeList::sampleDisplayDescription()
        ,TypeList::sampleDisplayName()
        ,TypeList::sampleExcludedCategoryIDs()
        ,TypeList::sampleExcludedGroupIDs()
        ,TypeList::sampleExcludedTypeIDs()
        ,TypeList::sampleIncludedCategoryIDs()
        ,TypeList::sampleIncludedGroupIDs()
        ,TypeList::sampleIncludedTypeIDs()
        ,TypeList::sampleName()
        );
    }
}

// This is a autogenerated file:DisplayDescription

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// This is a autogenerated file:DisplayName

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @return DisplayName
     */
    public static function sample(): DisplayName {
        return new DisplayName(
         DisplayName::sampleDe()
        ,DisplayName::sampleEn()
        ,DisplayName::sampleEs()
        ,DisplayName::sampleFr()
        ,DisplayName::sampleJa()
        ,DisplayName::sampleKo()
        ,DisplayName::sampleRu()
        ,DisplayName::sampleZh()
        );
    }
}
from typing import Any, Optional, List, TypeVar, Callable, Type, cast


T = TypeVar("T")


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


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


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


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


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


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


class DisplayDescription:
    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) -> 'DisplayDescription':
        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 DisplayDescription(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 DisplayName:
    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) -> 'DisplayName':
        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 DisplayName(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 TypeList:
    key: int
    display_description: Optional[DisplayDescription]
    display_name: Optional[DisplayName]
    excluded_category_i_ds: Optional[List[int]]
    excluded_group_i_ds: Optional[List[int]]
    excluded_type_i_ds: Optional[List[int]]
    included_category_i_ds: Optional[List[int]]
    included_group_i_ds: Optional[List[int]]
    included_type_i_ds: Optional[List[int]]
    name: str

    def __init__(self, key: int, display_description: Optional[DisplayDescription], display_name: Optional[DisplayName], excluded_category_i_ds: Optional[List[int]], excluded_group_i_ds: Optional[List[int]], excluded_type_i_ds: Optional[List[int]], included_category_i_ds: Optional[List[int]], included_group_i_ds: Optional[List[int]], included_type_i_ds: Optional[List[int]], name: str) -> None:
        self.key = key
        self.display_description = display_description
        self.display_name = display_name
        self.excluded_category_i_ds = excluded_category_i_ds
        self.excluded_group_i_ds = excluded_group_i_ds
        self.excluded_type_i_ds = excluded_type_i_ds
        self.included_category_i_ds = included_category_i_ds
        self.included_group_i_ds = included_group_i_ds
        self.included_type_i_ds = included_type_i_ds
        self.name = name

    @staticmethod
    def from_dict(obj: Any) -> 'TypeList':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        display_description = from_union([DisplayDescription.from_dict, from_none], obj.get("displayDescription"))
        display_name = from_union([DisplayName.from_dict, from_none], obj.get("displayName"))
        excluded_category_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("excludedCategoryIDs"))
        excluded_group_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("excludedGroupIDs"))
        excluded_type_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("excludedTypeIDs"))
        included_category_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("includedCategoryIDs"))
        included_group_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("includedGroupIDs"))
        included_type_i_ds = from_union([lambda x: from_list(from_int, x), from_none], obj.get("includedTypeIDs"))
        name = from_str(obj.get("name"))
        return TypeList(key, display_description, display_name, excluded_category_i_ds, excluded_group_i_ds, excluded_type_i_ds, included_category_i_ds, included_group_i_ds, included_type_i_ds, name)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        if self.display_description is not None:
            result["displayDescription"] = from_union([lambda x: to_class(DisplayDescription, x), from_none], self.display_description)
        if self.display_name is not None:
            result["displayName"] = from_union([lambda x: to_class(DisplayName, x), from_none], self.display_name)
        if self.excluded_category_i_ds is not None:
            result["excludedCategoryIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.excluded_category_i_ds)
        if self.excluded_group_i_ds is not None:
            result["excludedGroupIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.excluded_group_i_ds)
        if self.excluded_type_i_ds is not None:
            result["excludedTypeIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.excluded_type_i_ds)
        if self.included_category_i_ds is not None:
            result["includedCategoryIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.included_category_i_ds)
        if self.included_group_i_ds is not None:
            result["includedGroupIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.included_group_i_ds)
        if self.included_type_i_ds is not None:
            result["includedTypeIDs"] = from_union([lambda x: from_list(from_int, x), from_none], self.included_type_i_ds)
        result["name"] = from_str(self.name)
        return result


def type_list_from_dict(s: Any) -> TypeList:
    return TypeList.from_dict(s)


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

export interface TypeList {
    _key:                 number;
    displayDescription?:  DisplayDescription;
    displayName?:         DisplayName;
    excludedCategoryIDs?: number[];
    excludedGroupIDs?:    number[];
    excludedTypeIDs?:     number[];
    includedCategoryIDs?: number[];
    includedGroupIDs?:    number[];
    includedTypeIDs?:     number[];
    name:                 string;
    [property: string]: any;
}

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

export interface DisplayName {
    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 toTypeList(json: string): TypeList {
        return cast(JSON.parse(json), r("TypeList"));
    }

    public static typeListToJson(value: TypeList): string {
        return JSON.stringify(uncast(value, r("TypeList")), 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 = {
    "TypeList": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "displayDescription", js: "displayDescription", typ: u(undefined, r("DisplayDescription")) },
        { json: "displayName", js: "displayName", typ: u(undefined, r("DisplayName")) },
        { json: "excludedCategoryIDs", js: "excludedCategoryIDs", typ: u(undefined, a(0)) },
        { json: "excludedGroupIDs", js: "excludedGroupIDs", typ: u(undefined, a(0)) },
        { json: "excludedTypeIDs", js: "excludedTypeIDs", typ: u(undefined, a(0)) },
        { json: "includedCategoryIDs", js: "includedCategoryIDs", typ: u(undefined, a(0)) },
        { json: "includedGroupIDs", js: "includedGroupIDs", typ: u(undefined, a(0)) },
        { json: "includedTypeIDs", js: "includedTypeIDs", typ: u(undefined, a(0)) },
        { json: "name", js: "name", typ: "" },
    ], "any"),
    "DisplayDescription": 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"),
    "DisplayName": 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"),
};