Skip to content

EVE SDE Schema

Documentation for third-party developers

skinMaterials.jsonl

Schema

  • _key (required): integer
    Range: 1 .. 3163
  • displayName: object

    • de: string
    • en (required): string
    • es: string
    • fr: string
    • ja: string
    • ko: string
    • ru: string
    • zh: string
  • materialSetID (required): integer
    Range: 1 .. 3568

  • skinMaterialID (required): integer
    Range: 1 .. 3163

Code snippets

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

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

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

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

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

        [JsonProperty("materialSetID")]
        public long MaterialSetId { get; set; }

        [JsonProperty("skinMaterialID")]
        public long SkinMaterialId { get; set; }
    }

    public partial class DisplayName
    {
        [JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
        public string De { get; set; }

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

        [JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
        public string Es { get; set; }

        [JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(StickyMinMaxLengthCheckConverter))]
        public string Fr { get; set; }

        [JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(IndigoMinMaxLengthCheckConverter))]
        public string Ja { get; set; }

        [JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(IndecentMinMaxLengthCheckConverter))]
        public string Ko { get; set; }

        [JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
        public string Ru { get; set; }

        [JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(HilariousMinMaxLengthCheckConverter))]
        public string Zh { get; set; }
    }

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

    public static class Serialize
    {
        public static string ToJson(this SkinMaterial 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 >= 3 && value.Length <= 38)
            {
                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 <= 38)
            {
                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 >= 3 && value.Length <= 34)
            {
                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 <= 34)
            {
                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 >= 3 && value.Length <= 48)
            {
                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 <= 48)
            {
                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 >= 3 && value.Length <= 42)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 3 && value.Length <= 42)
            {
                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 <= 24)
            {
                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 <= 24)
            {
                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 >= 2 && value.Length <= 21)
            {
                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 <= 21)
            {
                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 >= 2 && value.Length <= 18)
            {
                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 <= 18)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

package model

import "encoding/json"

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

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

type SkinMaterial struct {
    Key            int64        `json:"_key"`
    DisplayName    *DisplayName `json:"displayName,omitempty"`
    MaterialSetID  int64        `json:"materialSetID"`
    SkinMaterialID int64        `json:"skinMaterialID"`
}

type DisplayName struct {
    De *string `json:"de,omitempty"`
    En string  `json:"en"`
    Es *string `json:"es,omitempty"`
    Fr *string `json:"fr,omitempty"`
    Ja *string `json:"ja,omitempty"`
    Ko *string `json:"ko,omitempty"`
    Ru *string `json:"ru,omitempty"`
    Zh *string `json:"zh,omitempty"`
}
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "_key": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3163
        },
        "displayName": {
            "type": "object",
            "properties": {
                "de": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 38
                },
                "en": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 34
                },
                "es": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 48
                },
                "fr": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 42
                },
                "ja": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 24
                },
                "ko": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 21
                },
                "ru": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 48
                },
                "zh": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 18
                }
            },
            "required": [
                "en"
            ]
        },
        "materialSetID": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3568
        },
        "skinMaterialID": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3163
        }
    },
    "required": [
        "_key",
        "materialSetID",
        "skinMaterialID"
    ]
}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json         = Json { allowStructuredMapKeys = true }
// val skinMaterial = json.parse(SkinMaterial.serializer(), jsonString)

package model

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

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

    val displayName: DisplayName? = null,

    @SerialName("materialSetID")
    val materialSetId: Long,

    @SerialName("skinMaterialID")
    val skinMaterialId: Long
)

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

// This is a autogenerated file:SkinMaterial

class SkinMaterial {
    private int $key; // json:_key Required
    private ?DisplayName $displayName; // json:displayName Optional
    private int $materialSetId; // json:materialSetID Required
    private int $skinMaterialId; // json:skinMaterialID Required

    /**
     * @param int $key
     * @param DisplayName|null $displayName
     * @param int $materialSetId
     * @param int $skinMaterialId
     */
    public function __construct(int $key, ?DisplayName $displayName, int $materialSetId, int $skinMaterialId) {
        $this->key = $key;
        $this->displayName = $displayName;
        $this->materialSetId = $materialSetId;
        $this->skinMaterialId = $skinMaterialId;
    }

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

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

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

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

    /**
     * @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 (SkinMaterial::validateDisplayName($this->displayName))  {
            if (!is_null($this->displayName)) {
                return $this->displayName->to(); /*class*/
            } else {
                return  null;
            }
        }
        throw new Exception('never get to this SkinMaterial::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 (SkinMaterial::validateDisplayName($this->displayName))  {
            return $this->displayName;
        }
        throw new Exception('never get to getDisplayName SkinMaterial::displayName');
    }

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toMaterialSetId(): int {
        if (SkinMaterial::validateMaterialSetId($this->materialSetId))  {
            return $this->materialSetId; /*int*/
        }
        throw new Exception('never get to this SkinMaterial::materialSetId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getMaterialSetId(): int {
        if (SkinMaterial::validateMaterialSetId($this->materialSetId))  {
            return $this->materialSetId;
        }
        throw new Exception('never get to getMaterialSetId SkinMaterial::materialSetId');
    }

    /**
     * @return int
     */
    public static function sampleMaterialSetId(): int {
        return 33; /*33:materialSetId*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toSkinMaterialId(): int {
        if (SkinMaterial::validateSkinMaterialId($this->skinMaterialId))  {
            return $this->skinMaterialId; /*int*/
        }
        throw new Exception('never get to this SkinMaterial::skinMaterialId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getSkinMaterialId(): int {
        if (SkinMaterial::validateSkinMaterialId($this->skinMaterialId))  {
            return $this->skinMaterialId;
        }
        throw new Exception('never get to getSkinMaterialId SkinMaterial::skinMaterialId');
    }

    /**
     * @return int
     */
    public static function sampleSkinMaterialId(): int {
        return 34; /*34:skinMaterialId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return SkinMaterial::validateKey($this->key)
        || SkinMaterial::validateDisplayName($this->displayName)
        || SkinMaterial::validateMaterialSetId($this->materialSetId)
        || SkinMaterial::validateSkinMaterialId($this->skinMaterialId);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'displayName'} = $this->toDisplayName();
        $out->{'materialSetID'} = $this->toMaterialSetId();
        $out->{'skinMaterialID'} = $this->toSkinMaterialId();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return SkinMaterial
     * @throws Exception
     */
    public static function from(stdClass $obj): SkinMaterial {
        return new SkinMaterial(
         SkinMaterial::fromKey($obj->{'_key'})
        ,SkinMaterial::fromDisplayName($obj->{'displayName'})
        ,SkinMaterial::fromMaterialSetId($obj->{'materialSetID'})
        ,SkinMaterial::fromSkinMaterialId($obj->{'skinMaterialID'})
        );
    }

    /**
     * @return SkinMaterial
     */
    public static function sample(): SkinMaterial {
        return new SkinMaterial(
         SkinMaterial::sampleKey()
        ,SkinMaterial::sampleDisplayName()
        ,SkinMaterial::sampleMaterialSetId()
        ,SkinMaterial::sampleSkinMaterialId()
        );
    }
}

// This is a autogenerated file:DisplayName

class DisplayName {
    private ?string $de; // json:de Optional
    private string $en; // json:en Required
    private ?string $es; // json:es Optional
    private ?string $fr; // json:fr Optional
    private ?string $ja; // json:ja Optional
    private ?string $ko; // json:ko Optional
    private ?string $ru; // json:ru Optional
    private ?string $zh; // json:zh Optional

    /**
     * @param string|null $de
     * @param string $en
     * @param string|null $es
     * @param string|null $fr
     * @param string|null $ja
     * @param string|null $ko
     * @param string|null $ru
     * @param string|null $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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateDe(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateEs(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateFr(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateJa(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateKo(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateRu(?string $value): bool {
        if (!is_null($value)) {
            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 {
        if (!is_null($value)) {
            return $value; /*string*/
        } else {
            return null;
        }
    }

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

    /**
     * @param string|null
     * @return bool
     * @throws Exception
     */
    public static function validateZh(?string $value): bool {
        if (!is_null($value)) {
            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 Optional, Any, TypeVar, Type, cast


T = TypeVar("T")


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_int(x: Any) -> int:
    assert isinstance(x, int) and not isinstance(x, bool)
    return x


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


class DisplayName:
    de: Optional[str]
    en: str
    es: Optional[str]
    fr: Optional[str]
    ja: Optional[str]
    ko: Optional[str]
    ru: Optional[str]
    zh: Optional[str]

    def __init__(self, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[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_union([from_str, from_none], obj.get("de"))
        en = from_str(obj.get("en"))
        es = from_union([from_str, from_none], obj.get("es"))
        fr = from_union([from_str, from_none], obj.get("fr"))
        ja = from_union([from_str, from_none], obj.get("ja"))
        ko = from_union([from_str, from_none], obj.get("ko"))
        ru = from_union([from_str, from_none], obj.get("ru"))
        zh = from_union([from_str, from_none], obj.get("zh"))
        return DisplayName(de, en, es, fr, ja, ko, ru, zh)

    def to_dict(self) -> dict:
        result: dict = {}
        if self.de is not None:
            result["de"] = from_union([from_str, from_none], self.de)
        result["en"] = from_str(self.en)
        if self.es is not None:
            result["es"] = from_union([from_str, from_none], self.es)
        if self.fr is not None:
            result["fr"] = from_union([from_str, from_none], self.fr)
        if self.ja is not None:
            result["ja"] = from_union([from_str, from_none], self.ja)
        if self.ko is not None:
            result["ko"] = from_union([from_str, from_none], self.ko)
        if self.ru is not None:
            result["ru"] = from_union([from_str, from_none], self.ru)
        if self.zh is not None:
            result["zh"] = from_union([from_str, from_none], self.zh)
        return result


class SkinMaterial:
    key: int
    display_name: Optional[DisplayName]
    material_set_id: int
    skin_material_id: int

    def __init__(self, key: int, display_name: Optional[DisplayName], material_set_id: int, skin_material_id: int) -> None:
        self.key = key
        self.display_name = display_name
        self.material_set_id = material_set_id
        self.skin_material_id = skin_material_id

    @staticmethod
    def from_dict(obj: Any) -> 'SkinMaterial':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        display_name = from_union([DisplayName.from_dict, from_none], obj.get("displayName"))
        material_set_id = from_int(obj.get("materialSetID"))
        skin_material_id = from_int(obj.get("skinMaterialID"))
        return SkinMaterial(key, display_name, material_set_id, skin_material_id)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        if self.display_name is not None:
            result["displayName"] = from_union([lambda x: to_class(DisplayName, x), from_none], self.display_name)
        result["materialSetID"] = from_int(self.material_set_id)
        result["skinMaterialID"] = from_int(self.skin_material_id)
        return result


def skin_material_from_dict(s: Any) -> SkinMaterial:
    return SkinMaterial.from_dict(s)


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

export interface SkinMaterial {
    _key:           number;
    displayName?:   DisplayName;
    materialSetID:  number;
    skinMaterialID: number;
    [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 toSkinMaterial(json: string): SkinMaterial {
        return cast(JSON.parse(json), r("SkinMaterial"));
    }

    public static skinMaterialToJson(value: SkinMaterial): string {
        return JSON.stringify(uncast(value, r("SkinMaterial")), 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 = {
    "SkinMaterial": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "displayName", js: "displayName", typ: u(undefined, r("DisplayName")) },
        { json: "materialSetID", js: "materialSetID", typ: 0 },
        { json: "skinMaterialID", js: "skinMaterialID", typ: 0 },
    ], "any"),
    "DisplayName": o([
        { json: "de", js: "de", typ: u(undefined, "") },
        { json: "en", js: "en", typ: "" },
        { json: "es", js: "es", typ: u(undefined, "") },
        { json: "fr", js: "fr", typ: u(undefined, "") },
        { json: "ja", js: "ja", typ: u(undefined, "") },
        { json: "ko", js: "ko", typ: u(undefined, "") },
        { json: "ru", js: "ru", typ: u(undefined, "") },
        { json: "zh", js: "zh", typ: u(undefined, "") },
    ], "any"),
};