Skip to content

EVE SDE Schema

Documentation for third-party developers

npcCharacters.jsonl

Schema

  • _key (required): integer
    Range: 3000001 .. 3020089
  • agent: object

    • agentTypeID (required): integer
      Range: 2 .. 13
    • divisionID (required): integer
      Range: 18 .. 37
    • isLocator (required): boolean
    • level (required): integer
      Range: 1 .. 5
  • ancestryID: integer
    Range: 1 .. 42

  • bloodlineID (required): integer
    Range: 1 .. 19
  • careerID: integer
    Range: 11 .. 161
  • ceo (required): boolean
  • corporationID (required): integer
    Range: 1000001 .. 1000440
  • description: string
  • gender (required): boolean
  • locationID: integer
    Range: 60000001 .. 60015187
  • 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
  • raceID (required): integer
    Range: 1 .. 16

  • schoolID: integer
    Range: 11 .. 23
  • skills: array of object

    • typeID (required): integer
      Range: 3363 .. 11858
  • specialityID: integer
    Range: 11 .. 161

  • startDate: string
    Format: date-time
  • uniqueName (required): boolean

Code snippets

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

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

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

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

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

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

        [JsonProperty("bloodlineID")]
        public long BloodlineId { get; set; }

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

        [JsonProperty("ceo")]
        public bool Ceo { get; set; }

        [JsonProperty("corporationID")]
        public long CorporationId { get; set; }

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

        [JsonProperty("gender")]
        public bool Gender { get; set; }

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

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

        [JsonProperty("raceID")]
        public long RaceId { get; set; }

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

        [JsonProperty("skills", NullValueHandling = NullValueHandling.Ignore)]
        public Skill[] Skills { get; set; }

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

        [JsonProperty("startDate", NullValueHandling = NullValueHandling.Ignore)]
        public DateTimeOffset? StartDate { get; set; }

        [JsonProperty("uniqueName")]
        public bool UniqueName { get; set; }
    }

    public partial class Agent
    {
        [JsonProperty("agentTypeID")]
        public long AgentTypeId { get; set; }

        [JsonProperty("divisionID")]
        public long DivisionId { get; set; }

        [JsonProperty("isLocator")]
        public bool IsLocator { get; set; }

        [JsonProperty("level")]
        public long Level { get; set; }
    }

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

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

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

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

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

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

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

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

    public partial class Skill
    {
        [JsonProperty("typeID")]
        public long TypeId { get; set; }
    }

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

    public static class Serialize
    {
        public static string ToJson(this NpcCharacter 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 >= 0 && value.Length <= 350)
            {
                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 >= 0 && value.Length <= 350)
            {
                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 >= 6 && value.Length <= 25)
            {
                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 >= 6 && value.Length <= 25)
            {
                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 >= 2 && value.Length <= 20)
            {
                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 <= 20)
            {
                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 >= 2 && value.Length <= 15)
            {
                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 <= 15)
            {
                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 <= 22)
            {
                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 <= 22)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

package model

import "time"

import "encoding/json"

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

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

type NpcCharacter struct {
    Key           int64      `json:"_key"`
    Agent         *Agent     `json:"agent,omitempty"`
    AncestryID    *int64     `json:"ancestryID,omitempty"`
    BloodlineID   int64      `json:"bloodlineID"`
    CareerID      *int64     `json:"careerID,omitempty"`
    Ceo           bool       `json:"ceo"`
    CorporationID int64      `json:"corporationID"`
    Description   *string    `json:"description,omitempty"`
    Gender        bool       `json:"gender"`
    LocationID    *int64     `json:"locationID,omitempty"`
    Name          Name       `json:"name"`
    RaceID        int64      `json:"raceID"`
    SchoolID      *int64     `json:"schoolID,omitempty"`
    Skills        []Skill    `json:"skills,omitempty"`
    SpecialityID  *int64     `json:"specialityID,omitempty"`
    StartDate     *time.Time `json:"startDate,omitempty"`
    UniqueName    bool       `json:"uniqueName"`
}

type Agent struct {
    AgentTypeID int64 `json:"agentTypeID"`
    DivisionID  int64 `json:"divisionID"`
    IsLocator   bool  `json:"isLocator"`
    Level       int64 `json:"level"`
}

type Name struct {
    De string `json:"de"`
    En string `json:"en"`
    Es string `json:"es"`
    Fr string `json:"fr"`
    Ja string `json:"ja"`
    Ko string `json:"ko"`
    Ru string `json:"ru"`
    Zh string `json:"zh"`
}

type Skill struct {
    TypeID int64 `json:"typeID"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":3000001,"maximum":3020089},"agent":{"type":"object","properties":{"agentTypeID":{"type":"integer","minimum":2,"maximum":13},"divisionID":{"type":"integer","minimum":18,"maximum":37},"isLocator":{"type":"boolean"},"level":{"type":"integer","minimum":1,"maximum":5}},"required":["agentTypeID","divisionID","isLocator","level"]},"ancestryID":{"type":"integer","minimum":1,"maximum":42},"bloodlineID":{"type":"integer","minimum":1,"maximum":19},"careerID":{"type":"integer","minimum":11,"maximum":161},"ceo":{"type":"boolean"},"corporationID":{"type":"integer","minimum":1000001,"maximum":1000440},"description":{"type":"string","minLength":0,"maxLength":350},"gender":{"type":"boolean"},"locationID":{"type":"integer","minimum":60000001,"maximum":60015187},"name":{"type":"object","properties":{"de":{"type":"string","minLength":6,"maxLength":25},"en":{"type":"string","minLength":6,"maxLength":25},"es":{"type":"string","minLength":6,"maxLength":25},"fr":{"type":"string","minLength":6,"maxLength":25},"ja":{"type":"string","minLength":2,"maxLength":20},"ko":{"type":"string","minLength":2,"maxLength":15},"ru":{"type":"string","minLength":6,"maxLength":25},"zh":{"type":"string","minLength":2,"maxLength":22}},"required":["de","en","es","fr","ja","ko","ru","zh"]},"raceID":{"type":"integer","minimum":1,"maximum":16},"schoolID":{"type":"integer","minimum":11,"maximum":23},"skills":{"type":"array","items":{"type":"object","properties":{"typeID":{"type":"integer","minimum":3363,"maximum":11858}},"required":["typeID"]},"minItems":2,"maxItems":8},"specialityID":{"type":"integer","minimum":11,"maximum":161},"startDate":{"type":"string","format":"date-time","minLength":19,"maxLength":19},"uniqueName":{"type":"boolean"}},"required":["_key","bloodlineID","ceo","corporationID","gender","name","raceID","uniqueName"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json         = Json { allowStructuredMapKeys = true }
// val npcCharacter = json.parse(NpcCharacter.serializer(), jsonString)

package model

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

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

    val agent: Agent? = null,

    @SerialName("ancestryID")
    val ancestryId: Long? = null,

    @SerialName("bloodlineID")
    val bloodlineId: Long,

    @SerialName("careerID")
    val careerId: Long? = null,

    val ceo: Boolean,

    @SerialName("corporationID")
    val corporationId: Long,

    val description: String? = null,
    val gender: Boolean,

    @SerialName("locationID")
    val locationId: Long? = null,

    val name: Name,

    @SerialName("raceID")
    val raceId: Long,

    @SerialName("schoolID")
    val schoolId: Long? = null,

    val skills: List<Skill>? = null,

    @SerialName("specialityID")
    val specialityId: Long? = null,

    val startDate: String? = null,
    val uniqueName: Boolean
)

@Serializable
data class Agent (
    @SerialName("agentTypeID")
    val agentTypeId: Long,

    @SerialName("divisionID")
    val divisionId: Long,

    val isLocator: Boolean,
    val level: Long
)

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

@Serializable
data class Skill (
    @SerialName("typeID")
    val typeId: Long
)
<?php

// This is a autogenerated file:NpcCharacter

class NpcCharacter {
    private int $key; // json:_key Required
    private ?Agent $agent; // json:agent Optional
    private ?int $ancestryId; // json:ancestryID Optional
    private int $bloodlineId; // json:bloodlineID Required
    private ?int $careerId; // json:careerID Optional
    private bool $ceo; // json:ceo Required
    private int $corporationId; // json:corporationID Required
    private ?string $description; // json:description Optional
    private bool $gender; // json:gender Required
    private ?int $locationId; // json:locationID Optional
    private Name $name; // json:name Required
    private int $raceId; // json:raceID Required
    private ?int $schoolId; // json:schoolID Optional
    private ?array $skills; // json:skills Optional
    private ?int $specialityId; // json:specialityID Optional
    private DateTime $startDate; // json:startDate Optional
    private bool $uniqueName; // json:uniqueName Required

    /**
     * @param int $key
     * @param Agent|null $agent
     * @param int|null $ancestryId
     * @param int $bloodlineId
     * @param int|null $careerId
     * @param bool $ceo
     * @param int $corporationId
     * @param string|null $description
     * @param bool $gender
     * @param int|null $locationId
     * @param Name $name
     * @param int $raceId
     * @param int|null $schoolId
     * @param array|null $skills
     * @param int|null $specialityId
     * @param DateTime $startDate
     * @param bool $uniqueName
     */
    public function __construct(int $key, ?Agent $agent, ?int $ancestryId, int $bloodlineId, ?int $careerId, bool $ceo, int $corporationId, ?string $description, bool $gender, ?int $locationId, Name $name, int $raceId, ?int $schoolId, ?array $skills, ?int $specialityId, DateTime $startDate, bool $uniqueName) {
        $this->key = $key;
        $this->agent = $agent;
        $this->ancestryId = $ancestryId;
        $this->bloodlineId = $bloodlineId;
        $this->careerId = $careerId;
        $this->ceo = $ceo;
        $this->corporationId = $corporationId;
        $this->description = $description;
        $this->gender = $gender;
        $this->locationId = $locationId;
        $this->name = $name;
        $this->raceId = $raceId;
        $this->schoolId = $schoolId;
        $this->skills = $skills;
        $this->specialityId = $specialityId;
        $this->startDate = $startDate;
        $this->uniqueName = $uniqueName;
    }

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

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

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

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

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

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

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

    /**
     * @throws Exception
     * @return ?Agent
     */
    public function getAgent(): ?Agent {
        if (NpcCharacter::validateAgent($this->agent))  {
            return $this->agent;
        }
        throw new Exception('never get to getAgent NpcCharacter::agent');
    }

    /**
     * @return ?Agent
     */
    public static function sampleAgent(): ?Agent {
        return Agent::sample(); /*32:agent*/
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function toAncestryId(): ?int {
        if (NpcCharacter::validateAncestryId($this->ancestryId))  {
            if (!is_null($this->ancestryId)) {
                return $this->ancestryId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::ancestryId');
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function getAncestryId(): ?int {
        if (NpcCharacter::validateAncestryId($this->ancestryId))  {
            return $this->ancestryId;
        }
        throw new Exception('never get to getAncestryId NpcCharacter::ancestryId');
    }

    /**
     * @return ?int
     */
    public static function sampleAncestryId(): ?int {
        return 33; /*33:ancestryId*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toBloodlineId(): int {
        if (NpcCharacter::validateBloodlineId($this->bloodlineId))  {
            return $this->bloodlineId; /*int*/
        }
        throw new Exception('never get to this NpcCharacter::bloodlineId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getBloodlineId(): int {
        if (NpcCharacter::validateBloodlineId($this->bloodlineId))  {
            return $this->bloodlineId;
        }
        throw new Exception('never get to getBloodlineId NpcCharacter::bloodlineId');
    }

    /**
     * @return int
     */
    public static function sampleBloodlineId(): int {
        return 34; /*34:bloodlineId*/
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function toCareerId(): ?int {
        if (NpcCharacter::validateCareerId($this->careerId))  {
            if (!is_null($this->careerId)) {
                return $this->careerId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::careerId');
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function getCareerId(): ?int {
        if (NpcCharacter::validateCareerId($this->careerId))  {
            return $this->careerId;
        }
        throw new Exception('never get to getCareerId NpcCharacter::careerId');
    }

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

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

    /**
     * @throws Exception
     * @return bool
     */
    public function toCeo(): bool {
        if (NpcCharacter::validateCeo($this->ceo))  {
            return $this->ceo; /*bool*/
        }
        throw new Exception('never get to this NpcCharacter::ceo');
    }

    /**
     * @param bool
     * @return bool
     * @throws Exception
     */
    public static function validateCeo(bool $value): bool {
        if (!is_bool($value)) {
            throw new Exception("Attribute Error:NpcCharacter::ceo");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function getCeo(): bool {
        if (NpcCharacter::validateCeo($this->ceo))  {
            return $this->ceo;
        }
        throw new Exception('never get to getCeo NpcCharacter::ceo');
    }

    /**
     * @return bool
     */
    public static function sampleCeo(): bool {
        return true; /*36:ceo*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toCorporationId(): int {
        if (NpcCharacter::validateCorporationId($this->corporationId))  {
            return $this->corporationId; /*int*/
        }
        throw new Exception('never get to this NpcCharacter::corporationId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getCorporationId(): int {
        if (NpcCharacter::validateCorporationId($this->corporationId))  {
            return $this->corporationId;
        }
        throw new Exception('never get to getCorporationId NpcCharacter::corporationId');
    }

    /**
     * @return int
     */
    public static function sampleCorporationId(): int {
        return 37; /*37:corporationId*/
    }

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

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateDescription(?string $value): bool {
        if (!is_null($value)) {
            if (!is_string($value)) {
                throw new Exception("Attribute Error:NpcCharacter::description");
            }
        }
        return true;
    }

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

    /**
     * @return ?string
     */
    public static function sampleDescription(): ?string {
        return 'NpcCharacter::description::38'; /*38:description*/
    }

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

    /**
     * @throws Exception
     * @return bool
     */
    public function toGender(): bool {
        if (NpcCharacter::validateGender($this->gender))  {
            return $this->gender; /*bool*/
        }
        throw new Exception('never get to this NpcCharacter::gender');
    }

    /**
     * @param bool
     * @return bool
     * @throws Exception
     */
    public static function validateGender(bool $value): bool {
        if (!is_bool($value)) {
            throw new Exception("Attribute Error:NpcCharacter::gender");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function getGender(): bool {
        if (NpcCharacter::validateGender($this->gender))  {
            return $this->gender;
        }
        throw new Exception('never get to getGender NpcCharacter::gender');
    }

    /**
     * @return bool
     */
    public static function sampleGender(): bool {
        return true; /*39:gender*/
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function toLocationId(): ?int {
        if (NpcCharacter::validateLocationId($this->locationId))  {
            if (!is_null($this->locationId)) {
                return $this->locationId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::locationId');
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function getLocationId(): ?int {
        if (NpcCharacter::validateLocationId($this->locationId))  {
            return $this->locationId;
        }
        throw new Exception('never get to getLocationId NpcCharacter::locationId');
    }

    /**
     * @return ?int
     */
    public static function sampleLocationId(): ?int {
        return 40; /*40:locationId*/
    }

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

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toRaceId(): int {
        if (NpcCharacter::validateRaceId($this->raceId))  {
            return $this->raceId; /*int*/
        }
        throw new Exception('never get to this NpcCharacter::raceId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getRaceId(): int {
        if (NpcCharacter::validateRaceId($this->raceId))  {
            return $this->raceId;
        }
        throw new Exception('never get to getRaceId NpcCharacter::raceId');
    }

    /**
     * @return int
     */
    public static function sampleRaceId(): int {
        return 42; /*42:raceId*/
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function toSchoolId(): ?int {
        if (NpcCharacter::validateSchoolId($this->schoolId))  {
            if (!is_null($this->schoolId)) {
                return $this->schoolId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::schoolId');
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function getSchoolId(): ?int {
        if (NpcCharacter::validateSchoolId($this->schoolId))  {
            return $this->schoolId;
        }
        throw new Exception('never get to getSchoolId NpcCharacter::schoolId');
    }

    /**
     * @return ?int
     */
    public static function sampleSchoolId(): ?int {
        return 43; /*43:schoolId*/
    }

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function toSkills(): ?array {
        if (NpcCharacter::validateSkills($this->skills))  {
            if (!is_null($this->skills)) {
                return array_map(function ($value) {
                    return $value->to(); /*class*/
                }, $this->skills);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::skills');
    }

    /**
     * @param array|null
     * @return bool
     * @throws Exception
     */
    public static function validateSkills(?array $value): bool {
        if (!is_null($value)) {
            if (!is_array($value)) {
                throw new Exception("Attribute Error:NpcCharacter::skills");
            }
            array_walk($value, function($value_v) {
                $value_v->validate();
            });
        }
        return true;
    }

    /**
     * @throws Exception
     * @return ?array
     */
    public function getSkills(): ?array {
        if (NpcCharacter::validateSkills($this->skills))  {
            return $this->skills;
        }
        throw new Exception('never get to getSkills NpcCharacter::skills');
    }

    /**
     * @return ?array
     */
    public static function sampleSkills(): ?array {
        return  array(
            Skill::sample() /*44:*/
        ); /* 44:skills*/
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function toSpecialityId(): ?int {
        if (NpcCharacter::validateSpecialityId($this->specialityId))  {
            if (!is_null($this->specialityId)) {
                return $this->specialityId; /*int*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::specialityId');
    }

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

    /**
     * @throws Exception
     * @return ?int
     */
    public function getSpecialityId(): ?int {
        if (NpcCharacter::validateSpecialityId($this->specialityId))  {
            return $this->specialityId;
        }
        throw new Exception('never get to getSpecialityId NpcCharacter::specialityId');
    }

    /**
     * @return ?int
     */
    public static function sampleSpecialityId(): ?int {
        return 45; /*45:specialityId*/
    }

    /**
     * @param ?string $value
     * @throws Exception
     * @return DateTime
     */
    public static function fromStartDate(?string $value): DateTime {
        if (!is_null($value)) {
            $tmp = DateTime::createFromFormat(DateTimeInterface::ISO8601, $value);
            if (!is_a($tmp, 'DateTime')) {
                throw new Exception('Attribute Error:NpcCharacter::');
            }
            return $tmp;
        } else {
            return null;
        }
    }

    /**
     * @throws Exception
     * @return ?string
     */
    public function toStartDate(): ?string {
        if (NpcCharacter::validateStartDate($this->startDate))  {
            if (!is_null($this->startDate)) {
                return $this->startDate->format(DateTimeInterface::ISO8601);
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this NpcCharacter::startDate');
    }

    /**
     * @param DateTime
     * @return bool
     * @throws Exception
     */
    public static function validateStartDate(DateTime $value): bool {
        if (!is_null($value)) {
            if (!is_a($value, 'DateTime')) {
                throw new Exception('Attribute Error:NpcCharacter::startDate');
            }
        }
        return true;
    }

    /**
     * @throws Exception
     * @return DateTime
     */
    public function getStartDate(): DateTime {
        if (NpcCharacter::validateStartDate($this->startDate))  {
            return $this->startDate;
        }
        throw new Exception('never get to getStartDate NpcCharacter::startDate');
    }

    /**
     * @return DateTime
     */
    public static function sampleStartDate(): DateTime {
        return DateTime::createFromFormat(DateTimeInterface::ISO8601, '2020-12-16T12:16:16+00:00');
    }

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

    /**
     * @throws Exception
     * @return bool
     */
    public function toUniqueName(): bool {
        if (NpcCharacter::validateUniqueName($this->uniqueName))  {
            return $this->uniqueName; /*bool*/
        }
        throw new Exception('never get to this NpcCharacter::uniqueName');
    }

    /**
     * @param bool
     * @return bool
     * @throws Exception
     */
    public static function validateUniqueName(bool $value): bool {
        if (!is_bool($value)) {
            throw new Exception("Attribute Error:NpcCharacter::uniqueName");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function getUniqueName(): bool {
        if (NpcCharacter::validateUniqueName($this->uniqueName))  {
            return $this->uniqueName;
        }
        throw new Exception('never get to getUniqueName NpcCharacter::uniqueName');
    }

    /**
     * @return bool
     */
    public static function sampleUniqueName(): bool {
        return true; /*47:uniqueName*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return NpcCharacter::validateKey($this->key)
        || NpcCharacter::validateAgent($this->agent)
        || NpcCharacter::validateAncestryId($this->ancestryId)
        || NpcCharacter::validateBloodlineId($this->bloodlineId)
        || NpcCharacter::validateCareerId($this->careerId)
        || NpcCharacter::validateCeo($this->ceo)
        || NpcCharacter::validateCorporationId($this->corporationId)
        || NpcCharacter::validateDescription($this->description)
        || NpcCharacter::validateGender($this->gender)
        || NpcCharacter::validateLocationId($this->locationId)
        || NpcCharacter::validateName($this->name)
        || NpcCharacter::validateRaceId($this->raceId)
        || NpcCharacter::validateSchoolId($this->schoolId)
        || NpcCharacter::validateSkills($this->skills)
        || NpcCharacter::validateSpecialityId($this->specialityId)
        || NpcCharacter::validateStartDate($this->startDate)
        || NpcCharacter::validateUniqueName($this->uniqueName);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'agent'} = $this->toAgent();
        $out->{'ancestryID'} = $this->toAncestryId();
        $out->{'bloodlineID'} = $this->toBloodlineId();
        $out->{'careerID'} = $this->toCareerId();
        $out->{'ceo'} = $this->toCeo();
        $out->{'corporationID'} = $this->toCorporationId();
        $out->{'description'} = $this->toDescription();
        $out->{'gender'} = $this->toGender();
        $out->{'locationID'} = $this->toLocationId();
        $out->{'name'} = $this->toName();
        $out->{'raceID'} = $this->toRaceId();
        $out->{'schoolID'} = $this->toSchoolId();
        $out->{'skills'} = $this->toSkills();
        $out->{'specialityID'} = $this->toSpecialityId();
        $out->{'startDate'} = $this->toStartDate();
        $out->{'uniqueName'} = $this->toUniqueName();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return NpcCharacter
     * @throws Exception
     */
    public static function from(stdClass $obj): NpcCharacter {
        return new NpcCharacter(
         NpcCharacter::fromKey($obj->{'_key'})
        ,NpcCharacter::fromAgent($obj->{'agent'})
        ,NpcCharacter::fromAncestryId($obj->{'ancestryID'})
        ,NpcCharacter::fromBloodlineId($obj->{'bloodlineID'})
        ,NpcCharacter::fromCareerId($obj->{'careerID'})
        ,NpcCharacter::fromCeo($obj->{'ceo'})
        ,NpcCharacter::fromCorporationId($obj->{'corporationID'})
        ,NpcCharacter::fromDescription($obj->{'description'})
        ,NpcCharacter::fromGender($obj->{'gender'})
        ,NpcCharacter::fromLocationId($obj->{'locationID'})
        ,NpcCharacter::fromName($obj->{'name'})
        ,NpcCharacter::fromRaceId($obj->{'raceID'})
        ,NpcCharacter::fromSchoolId($obj->{'schoolID'})
        ,NpcCharacter::fromSkills($obj->{'skills'})
        ,NpcCharacter::fromSpecialityId($obj->{'specialityID'})
        ,NpcCharacter::fromStartDate($obj->{'startDate'})
        ,NpcCharacter::fromUniqueName($obj->{'uniqueName'})
        );
    }

    /**
     * @return NpcCharacter
     */
    public static function sample(): NpcCharacter {
        return new NpcCharacter(
         NpcCharacter::sampleKey()
        ,NpcCharacter::sampleAgent()
        ,NpcCharacter::sampleAncestryId()
        ,NpcCharacter::sampleBloodlineId()
        ,NpcCharacter::sampleCareerId()
        ,NpcCharacter::sampleCeo()
        ,NpcCharacter::sampleCorporationId()
        ,NpcCharacter::sampleDescription()
        ,NpcCharacter::sampleGender()
        ,NpcCharacter::sampleLocationId()
        ,NpcCharacter::sampleName()
        ,NpcCharacter::sampleRaceId()
        ,NpcCharacter::sampleSchoolId()
        ,NpcCharacter::sampleSkills()
        ,NpcCharacter::sampleSpecialityId()
        ,NpcCharacter::sampleStartDate()
        ,NpcCharacter::sampleUniqueName()
        );
    }
}

// This is a autogenerated file:Agent

class Agent {
    private int $agentTypeId; // json:agentTypeID Required
    private int $divisionId; // json:divisionID Required
    private bool $isLocator; // json:isLocator Required
    private int $level; // json:level Required

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toAgentTypeId(): int {
        if (Agent::validateAgentTypeId($this->agentTypeId))  {
            return $this->agentTypeId; /*int*/
        }
        throw new Exception('never get to this Agent::agentTypeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getAgentTypeId(): int {
        if (Agent::validateAgentTypeId($this->agentTypeId))  {
            return $this->agentTypeId;
        }
        throw new Exception('never get to getAgentTypeId Agent::agentTypeId');
    }

    /**
     * @return int
     */
    public static function sampleAgentTypeId(): int {
        return 31; /*31:agentTypeId*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toDivisionId(): int {
        if (Agent::validateDivisionId($this->divisionId))  {
            return $this->divisionId; /*int*/
        }
        throw new Exception('never get to this Agent::divisionId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getDivisionId(): int {
        if (Agent::validateDivisionId($this->divisionId))  {
            return $this->divisionId;
        }
        throw new Exception('never get to getDivisionId Agent::divisionId');
    }

    /**
     * @return int
     */
    public static function sampleDivisionId(): int {
        return 32; /*32:divisionId*/
    }

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

    /**
     * @throws Exception
     * @return bool
     */
    public function toIsLocator(): bool {
        if (Agent::validateIsLocator($this->isLocator))  {
            return $this->isLocator; /*bool*/
        }
        throw new Exception('never get to this Agent::isLocator');
    }

    /**
     * @param bool
     * @return bool
     * @throws Exception
     */
    public static function validateIsLocator(bool $value): bool {
        if (!is_bool($value)) {
            throw new Exception("Attribute Error:Agent::isLocator");
        }
        return true;
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function getIsLocator(): bool {
        if (Agent::validateIsLocator($this->isLocator))  {
            return $this->isLocator;
        }
        throw new Exception('never get to getIsLocator Agent::isLocator');
    }

    /**
     * @return bool
     */
    public static function sampleIsLocator(): bool {
        return true; /*33:isLocator*/
    }

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

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

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

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

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

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return Agent::validateAgentTypeId($this->agentTypeId)
        || Agent::validateDivisionId($this->divisionId)
        || Agent::validateIsLocator($this->isLocator)
        || Agent::validateLevel($this->level);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'agentTypeID'} = $this->toAgentTypeId();
        $out->{'divisionID'} = $this->toDivisionId();
        $out->{'isLocator'} = $this->toIsLocator();
        $out->{'level'} = $this->toLevel();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return Agent
     * @throws Exception
     */
    public static function from(stdClass $obj): Agent {
        return new Agent(
         Agent::fromAgentTypeId($obj->{'agentTypeID'})
        ,Agent::fromDivisionId($obj->{'divisionID'})
        ,Agent::fromIsLocator($obj->{'isLocator'})
        ,Agent::fromLevel($obj->{'level'})
        );
    }

    /**
     * @return Agent
     */
    public static function sample(): Agent {
        return new Agent(
         Agent::sampleAgentTypeId()
        ,Agent::sampleDivisionId()
        ,Agent::sampleIsLocator()
        ,Agent::sampleLevel()
        );
    }
}

// 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()
        );
    }
}

// This is a autogenerated file:Skill

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

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

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

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

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

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

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

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

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

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

    /**
     * @return Skill
     */
    public static function sample(): Skill {
        return new Skill(
         Skill::sampleTypeId()
        );
    }
}
from typing import Any, Optional, List, TypeVar, Callable, Type, cast
from datetime import datetime
import dateutil.parser


T = TypeVar("T")


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


def from_bool(x: Any) -> bool:
    assert isinstance(x, bool)
    return x


def from_str(x: Any) -> str:
    assert isinstance(x, str)
    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 from_datetime(x: Any) -> datetime:
    return dateutil.parser.parse(x)


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


class Agent:
    agent_type_id: int
    division_id: int
    is_locator: bool
    level: int

    def __init__(self, agent_type_id: int, division_id: int, is_locator: bool, level: int) -> None:
        self.agent_type_id = agent_type_id
        self.division_id = division_id
        self.is_locator = is_locator
        self.level = level

    @staticmethod
    def from_dict(obj: Any) -> 'Agent':
        assert isinstance(obj, dict)
        agent_type_id = from_int(obj.get("agentTypeID"))
        division_id = from_int(obj.get("divisionID"))
        is_locator = from_bool(obj.get("isLocator"))
        level = from_int(obj.get("level"))
        return Agent(agent_type_id, division_id, is_locator, level)

    def to_dict(self) -> dict:
        result: dict = {}
        result["agentTypeID"] = from_int(self.agent_type_id)
        result["divisionID"] = from_int(self.division_id)
        result["isLocator"] = from_bool(self.is_locator)
        result["level"] = from_int(self.level)
        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 Skill:
    type_id: int

    def __init__(self, type_id: int) -> None:
        self.type_id = type_id

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

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


class NpcCharacter:
    key: int
    agent: Optional[Agent]
    ancestry_id: Optional[int]
    bloodline_id: int
    career_id: Optional[int]
    ceo: bool
    corporation_id: int
    description: Optional[str]
    gender: bool
    location_id: Optional[int]
    name: Name
    race_id: int
    school_id: Optional[int]
    skills: Optional[List[Skill]]
    speciality_id: Optional[int]
    start_date: Optional[datetime]
    unique_name: bool

    def __init__(self, key: int, agent: Optional[Agent], ancestry_id: Optional[int], bloodline_id: int, career_id: Optional[int], ceo: bool, corporation_id: int, description: Optional[str], gender: bool, location_id: Optional[int], name: Name, race_id: int, school_id: Optional[int], skills: Optional[List[Skill]], speciality_id: Optional[int], start_date: Optional[datetime], unique_name: bool) -> None:
        self.key = key
        self.agent = agent
        self.ancestry_id = ancestry_id
        self.bloodline_id = bloodline_id
        self.career_id = career_id
        self.ceo = ceo
        self.corporation_id = corporation_id
        self.description = description
        self.gender = gender
        self.location_id = location_id
        self.name = name
        self.race_id = race_id
        self.school_id = school_id
        self.skills = skills
        self.speciality_id = speciality_id
        self.start_date = start_date
        self.unique_name = unique_name

    @staticmethod
    def from_dict(obj: Any) -> 'NpcCharacter':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        agent = from_union([Agent.from_dict, from_none], obj.get("agent"))
        ancestry_id = from_union([from_int, from_none], obj.get("ancestryID"))
        bloodline_id = from_int(obj.get("bloodlineID"))
        career_id = from_union([from_int, from_none], obj.get("careerID"))
        ceo = from_bool(obj.get("ceo"))
        corporation_id = from_int(obj.get("corporationID"))
        description = from_union([from_str, from_none], obj.get("description"))
        gender = from_bool(obj.get("gender"))
        location_id = from_union([from_int, from_none], obj.get("locationID"))
        name = Name.from_dict(obj.get("name"))
        race_id = from_int(obj.get("raceID"))
        school_id = from_union([from_int, from_none], obj.get("schoolID"))
        skills = from_union([lambda x: from_list(Skill.from_dict, x), from_none], obj.get("skills"))
        speciality_id = from_union([from_int, from_none], obj.get("specialityID"))
        start_date = from_union([from_datetime, from_none], obj.get("startDate"))
        unique_name = from_bool(obj.get("uniqueName"))
        return NpcCharacter(key, agent, ancestry_id, bloodline_id, career_id, ceo, corporation_id, description, gender, location_id, name, race_id, school_id, skills, speciality_id, start_date, unique_name)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        if self.agent is not None:
            result["agent"] = from_union([lambda x: to_class(Agent, x), from_none], self.agent)
        if self.ancestry_id is not None:
            result["ancestryID"] = from_union([from_int, from_none], self.ancestry_id)
        result["bloodlineID"] = from_int(self.bloodline_id)
        if self.career_id is not None:
            result["careerID"] = from_union([from_int, from_none], self.career_id)
        result["ceo"] = from_bool(self.ceo)
        result["corporationID"] = from_int(self.corporation_id)
        if self.description is not None:
            result["description"] = from_union([from_str, from_none], self.description)
        result["gender"] = from_bool(self.gender)
        if self.location_id is not None:
            result["locationID"] = from_union([from_int, from_none], self.location_id)
        result["name"] = to_class(Name, self.name)
        result["raceID"] = from_int(self.race_id)
        if self.school_id is not None:
            result["schoolID"] = from_union([from_int, from_none], self.school_id)
        if self.skills is not None:
            result["skills"] = from_union([lambda x: from_list(lambda x: to_class(Skill, x), x), from_none], self.skills)
        if self.speciality_id is not None:
            result["specialityID"] = from_union([from_int, from_none], self.speciality_id)
        if self.start_date is not None:
            result["startDate"] = from_union([lambda x: x.isoformat(), from_none], self.start_date)
        result["uniqueName"] = from_bool(self.unique_name)
        return result


def npc_character_from_dict(s: Any) -> NpcCharacter:
    return NpcCharacter.from_dict(s)


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

export interface NpcCharacter {
    _key:          number;
    agent?:        Agent;
    ancestryID?:   number;
    bloodlineID:   number;
    careerID?:     number;
    ceo:           boolean;
    corporationID: number;
    description?:  string;
    gender:        boolean;
    locationID?:   number;
    name:          Name;
    raceID:        number;
    schoolID?:     number;
    skills?:       Skill[];
    specialityID?: number;
    startDate?:    Date;
    uniqueName:    boolean;
    [property: string]: any;
}

export interface Agent {
    agentTypeID: number;
    divisionID:  number;
    isLocator:   boolean;
    level:       number;
    [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;
}

export interface Skill {
    typeID: number;
    [property: string]: any;
}

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

    public static npcCharacterToJson(value: NpcCharacter): string {
        return JSON.stringify(uncast(value, r("NpcCharacter")), 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 = {
    "NpcCharacter": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "agent", js: "agent", typ: u(undefined, r("Agent")) },
        { json: "ancestryID", js: "ancestryID", typ: u(undefined, 0) },
        { json: "bloodlineID", js: "bloodlineID", typ: 0 },
        { json: "careerID", js: "careerID", typ: u(undefined, 0) },
        { json: "ceo", js: "ceo", typ: true },
        { json: "corporationID", js: "corporationID", typ: 0 },
        { json: "description", js: "description", typ: u(undefined, "") },
        { json: "gender", js: "gender", typ: true },
        { json: "locationID", js: "locationID", typ: u(undefined, 0) },
        { json: "name", js: "name", typ: r("Name") },
        { json: "raceID", js: "raceID", typ: 0 },
        { json: "schoolID", js: "schoolID", typ: u(undefined, 0) },
        { json: "skills", js: "skills", typ: u(undefined, a(r("Skill"))) },
        { json: "specialityID", js: "specialityID", typ: u(undefined, 0) },
        { json: "startDate", js: "startDate", typ: u(undefined, Date) },
        { json: "uniqueName", js: "uniqueName", typ: true },
    ], "any"),
    "Agent": o([
        { json: "agentTypeID", js: "agentTypeID", typ: 0 },
        { json: "divisionID", js: "divisionID", typ: 0 },
        { json: "isLocator", js: "isLocator", typ: true },
        { json: "level", js: "level", typ: 0 },
    ], "any"),
    "Name": o([
        { json: "de", js: "de", typ: "" },
        { json: "en", js: "en", typ: "" },
        { json: "es", js: "es", typ: "" },
        { json: "fr", js: "fr", typ: "" },
        { json: "ja", js: "ja", typ: "" },
        { json: "ko", js: "ko", typ: "" },
        { json: "ru", js: "ru", typ: "" },
        { json: "zh", js: "zh", typ: "" },
    ], "any"),
    "Skill": o([
        { json: "typeID", js: "typeID", typ: 0 },
    ], "any"),
};