Skip to content

EVE SDE Schema

Documentation for third-party developers

dbuffCollections.jsonl

Schema

  • _key (required): integer
    Range: 1 .. 2442
  • aggregateMode (required): enum
    Enum values: Maximum, Minimum
  • developerDescription (required): string
  • displayName: object

    • de (required): string
    • en (required): string
    • es (required): string
    • fr (required): string
    • ja (required): string
    • ko (required): string
    • ru (required): string
    • zh (required): string
  • itemModifiers: array of object

    • dogmaAttributeID (required): integer
      Range: 4 .. 5796
  • locationGroupModifiers: array of object

    • dogmaAttributeID (required): integer
      Range: 20 .. 2044
    • groupID (required): integer
      Range: 46 .. 650
  • locationModifiers: array of object

    • dogmaAttributeID (required): integer
      Range: 51 .. 1937
  • locationRequiredSkillModifiers: array of object

    • dogmaAttributeID (required): integer
      Range: 6 .. 2586
    • skillID (required): integer
      Range: 3300 .. 28585
  • operationName (required): enum
    Enum values: PostMul, PostPercent, ModAdd, PostAssignment

  • showOutputValueInUI (required): enum
    Enum values: ShowNormal, Hide, ShowInverted

Code snippets

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

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

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

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

        [JsonProperty("aggregateMode")]
        public AggregateMode AggregateMode { get; set; }

        [JsonProperty("developerDescription")]
        [JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
        public string DeveloperDescription { get; set; }

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

        [JsonProperty("itemModifiers", NullValueHandling = NullValueHandling.Ignore)]
        public ItemModifier[] ItemModifiers { get; set; }

        [JsonProperty("locationGroupModifiers", NullValueHandling = NullValueHandling.Ignore)]
        public LocationGroupModifier[] LocationGroupModifiers { get; set; }

        [JsonProperty("locationModifiers", NullValueHandling = NullValueHandling.Ignore)]
        public LocationModifier[] LocationModifiers { get; set; }

        [JsonProperty("locationRequiredSkillModifiers", NullValueHandling = NullValueHandling.Ignore)]
        public LocationRequiredSkillModifier[] LocationRequiredSkillModifiers { get; set; }

        [JsonProperty("operationName")]
        public OperationName OperationName { get; set; }

        [JsonProperty("showOutputValueInUI")]
        public ShowOutputValueInUi ShowOutputValueInUi { get; set; }
    }

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

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

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

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

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

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

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

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

    public partial class ItemModifier
    {
        [JsonProperty("dogmaAttributeID")]
        public long DogmaAttributeId { get; set; }
    }

    public partial class LocationGroupModifier
    {
        [JsonProperty("dogmaAttributeID")]
        public long DogmaAttributeId { get; set; }

        [JsonProperty("groupID")]
        public long GroupId { get; set; }
    }

    public partial class LocationModifier
    {
        [JsonProperty("dogmaAttributeID")]
        public long DogmaAttributeId { get; set; }
    }

    public partial class LocationRequiredSkillModifier
    {
        [JsonProperty("dogmaAttributeID")]
        public long DogmaAttributeId { get; set; }

        [JsonProperty("skillID")]
        public long SkillId { get; set; }
    }

    public enum AggregateMode { Maximum, Minimum };

    public enum OperationName { ModAdd, PostAssignment, PostMul, PostPercent };

    public enum ShowOutputValueInUi { Hide, ShowInverted, ShowNormal };

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

    public static class Serialize
    {
        public static string ToJson(this DbuffCollection 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 =
            {
                AggregateModeConverter.Singleton,
                OperationNameConverter.Singleton,
                ShowOutputValueInUiConverter.Singleton,
                new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
            },
        };
    }

    internal class AggregateModeConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(AggregateMode) || t == typeof(AggregateMode?);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null) return null;
            var value = serializer.Deserialize<string>(reader);
            switch (value)
            {
                case "Maximum":
                    return AggregateMode.Maximum;
                case "Minimum":
                    return AggregateMode.Minimum;
            }
            throw new Exception("Cannot unmarshal type AggregateMode");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            if (untypedValue == null)
            {
                serializer.Serialize(writer, null);
                return;
            }
            var value = (AggregateMode)untypedValue;
            switch (value)
            {
                case AggregateMode.Maximum:
                    serializer.Serialize(writer, "Maximum");
                    return;
                case AggregateMode.Minimum:
                    serializer.Serialize(writer, "Minimum");
                    return;
            }
            throw new Exception("Cannot marshal type AggregateMode");
        }

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

    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 >= 9 && value.Length <= 66)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

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

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

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

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

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            var value = (string)untypedValue;
            if (value.Length >= 8 && value.Length <= 80)
            {
                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 >= 12 && value.Length <= 66)
            {
                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 >= 12 && value.Length <= 66)
            {
                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 >= 15 && value.Length <= 86)
            {
                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 >= 15 && value.Length <= 86)
            {
                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 >= 11 && value.Length <= 110)
            {
                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 >= 11 && value.Length <= 110)
            {
                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 >= 4 && value.Length <= 32)
            {
                return value;
            }
            throw new Exception("Cannot unmarshal type string");
        }

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

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

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

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

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

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

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

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            var value = serializer.Deserialize<string>(reader);
            if (value.Length >= 4 && 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 >= 4 && value.Length <= 24)
            {
                serializer.Serialize(writer, value);
                return;
            }
            throw new Exception("Cannot marshal type string");
        }

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

    internal class OperationNameConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(OperationName) || t == typeof(OperationName?);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null) return null;
            var value = serializer.Deserialize<string>(reader);
            switch (value)
            {
                case "ModAdd":
                    return OperationName.ModAdd;
                case "PostAssignment":
                    return OperationName.PostAssignment;
                case "PostMul":
                    return OperationName.PostMul;
                case "PostPercent":
                    return OperationName.PostPercent;
            }
            throw new Exception("Cannot unmarshal type OperationName");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            if (untypedValue == null)
            {
                serializer.Serialize(writer, null);
                return;
            }
            var value = (OperationName)untypedValue;
            switch (value)
            {
                case OperationName.ModAdd:
                    serializer.Serialize(writer, "ModAdd");
                    return;
                case OperationName.PostAssignment:
                    serializer.Serialize(writer, "PostAssignment");
                    return;
                case OperationName.PostMul:
                    serializer.Serialize(writer, "PostMul");
                    return;
                case OperationName.PostPercent:
                    serializer.Serialize(writer, "PostPercent");
                    return;
            }
            throw new Exception("Cannot marshal type OperationName");
        }

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

    internal class ShowOutputValueInUiConverter : JsonConverter
    {
        public override bool CanConvert(Type t) => t == typeof(ShowOutputValueInUi) || t == typeof(ShowOutputValueInUi?);

        public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null) return null;
            var value = serializer.Deserialize<string>(reader);
            switch (value)
            {
                case "Hide":
                    return ShowOutputValueInUi.Hide;
                case "ShowInverted":
                    return ShowOutputValueInUi.ShowInverted;
                case "ShowNormal":
                    return ShowOutputValueInUi.ShowNormal;
            }
            throw new Exception("Cannot unmarshal type ShowOutputValueInUi");
        }

        public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
        {
            if (untypedValue == null)
            {
                serializer.Serialize(writer, null);
                return;
            }
            var value = (ShowOutputValueInUi)untypedValue;
            switch (value)
            {
                case ShowOutputValueInUi.Hide:
                    serializer.Serialize(writer, "Hide");
                    return;
                case ShowOutputValueInUi.ShowInverted:
                    serializer.Serialize(writer, "ShowInverted");
                    return;
                case ShowOutputValueInUi.ShowNormal:
                    serializer.Serialize(writer, "ShowNormal");
                    return;
            }
            throw new Exception("Cannot marshal type ShowOutputValueInUi");
        }

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

package model

import "encoding/json"

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

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

type DbuffCollection struct {
    Key                            int64                           `json:"_key"`
    AggregateMode                  AggregateMode                   `json:"aggregateMode"`
    DeveloperDescription           string                          `json:"developerDescription"`
    DisplayName                    *DisplayName                    `json:"displayName,omitempty"`
    ItemModifiers                  []ItemModifier                  `json:"itemModifiers,omitempty"`
    LocationGroupModifiers         []LocationGroupModifier         `json:"locationGroupModifiers,omitempty"`
    LocationModifiers              []LocationModifier              `json:"locationModifiers,omitempty"`
    LocationRequiredSkillModifiers []LocationRequiredSkillModifier `json:"locationRequiredSkillModifiers,omitempty"`
    OperationName                  OperationName                   `json:"operationName"`
    ShowOutputValueInUI            ShowOutputValueInUI             `json:"showOutputValueInUI"`
}

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

type ItemModifier struct {
    DogmaAttributeID int64 `json:"dogmaAttributeID"`
}

type LocationGroupModifier struct {
    DogmaAttributeID int64 `json:"dogmaAttributeID"`
    GroupID          int64 `json:"groupID"`
}

type LocationModifier struct {
    DogmaAttributeID int64 `json:"dogmaAttributeID"`
}

type LocationRequiredSkillModifier struct {
    DogmaAttributeID int64 `json:"dogmaAttributeID"`
    SkillID          int64 `json:"skillID"`
}

type AggregateMode string

const (
    Maximum AggregateMode = "Maximum"
    Minimum AggregateMode = "Minimum"
)

type OperationName string

const (
    ModAdd         OperationName = "ModAdd"
    PostAssignment OperationName = "PostAssignment"
    PostMul        OperationName = "PostMul"
    PostPercent    OperationName = "PostPercent"
)

type ShowOutputValueInUI string

const (
    Hide         ShowOutputValueInUI = "Hide"
    ShowInverted ShowOutputValueInUI = "ShowInverted"
    ShowNormal   ShowOutputValueInUI = "ShowNormal"
)
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "_key": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2442
        },
        "aggregateMode": {
            "type": "string",
            "enum": [
                "Maximum",
                "Minimum"
            ]
        },
        "developerDescription": {
            "type": "string",
            "minLength": 9,
            "maxLength": 66
        },
        "displayName": {
            "type": "object",
            "properties": {
                "de": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 80
                },
                "en": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 66
                },
                "es": {
                    "type": "string",
                    "minLength": 15,
                    "maxLength": 86
                },
                "fr": {
                    "type": "string",
                    "minLength": 11,
                    "maxLength": 110
                },
                "ja": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 32
                },
                "ko": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 34
                },
                "ru": {
                    "type": "string",
                    "minLength": 11,
                    "maxLength": 73
                },
                "zh": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 24
                }
            },
            "required": [
                "de",
                "en",
                "es",
                "fr",
                "ja",
                "ko",
                "ru",
                "zh"
            ]
        },
        "itemModifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "dogmaAttributeID": {
                        "type": "integer",
                        "minimum": 4,
                        "maximum": 5796
                    }
                },
                "required": [
                    "dogmaAttributeID"
                ]
            },
            "minItems": 1,
            "maxItems": 12
        },
        "locationGroupModifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "dogmaAttributeID": {
                        "type": "integer",
                        "minimum": 20,
                        "maximum": 2044
                    },
                    "groupID": {
                        "type": "integer",
                        "minimum": 46,
                        "maximum": 650
                    }
                },
                "required": [
                    "dogmaAttributeID",
                    "groupID"
                ]
            },
            "minItems": 1,
            "maxItems": 22
        },
        "locationModifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "dogmaAttributeID": {
                        "type": "integer",
                        "minimum": 51,
                        "maximum": 1937
                    }
                },
                "required": [
                    "dogmaAttributeID"
                ]
            },
            "minItems": 1,
            "maxItems": 14
        },
        "locationRequiredSkillModifiers": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "dogmaAttributeID": {
                        "type": "integer",
                        "minimum": 6,
                        "maximum": 2586
                    },
                    "skillID": {
                        "type": "integer",
                        "minimum": 3300,
                        "maximum": 28585
                    }
                },
                "required": [
                    "dogmaAttributeID",
                    "skillID"
                ]
            },
            "minItems": 1,
            "maxItems": 6
        },
        "operationName": {
            "type": "string",
            "enum": [
                "PostMul",
                "PostPercent",
                "ModAdd",
                "PostAssignment"
            ]
        },
        "showOutputValueInUI": {
            "type": "string",
            "enum": [
                "ShowNormal",
                "Hide",
                "ShowInverted"
            ]
        }
    },
    "required": [
        "_key",
        "aggregateMode",
        "developerDescription",
        "operationName",
        "showOutputValueInUI"
    ]
}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json            = Json { allowStructuredMapKeys = true }
// val dbuffCollection = json.parse(DbuffCollection.serializer(), jsonString)

package model

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

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

    val aggregateMode: AggregateMode,
    val developerDescription: String,
    val displayName: DisplayName? = null,
    val itemModifiers: List<ItemModifier>? = null,
    val locationGroupModifiers: List<LocationGroupModifier>? = null,
    val locationModifiers: List<LocationModifier>? = null,
    val locationRequiredSkillModifiers: List<LocationRequiredSkillModifier>? = null,
    val operationName: OperationName,

    @SerialName("showOutputValueInUI")
    val showOutputValueInUi: ShowOutputValueInUi
)

@Serializable
enum class AggregateMode(val value: String) {
    @SerialName("Maximum") Maximum("Maximum"),
    @SerialName("Minimum") Minimum("Minimum");
}

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

@Serializable
data class ItemModifier (
    @SerialName("dogmaAttributeID")
    val dogmaAttributeId: Long
)

@Serializable
data class LocationGroupModifier (
    @SerialName("dogmaAttributeID")
    val dogmaAttributeId: Long,

    @SerialName("groupID")
    val groupId: Long
)

@Serializable
data class LocationModifier (
    @SerialName("dogmaAttributeID")
    val dogmaAttributeId: Long
)

@Serializable
data class LocationRequiredSkillModifier (
    @SerialName("dogmaAttributeID")
    val dogmaAttributeId: Long,

    @SerialName("skillID")
    val skillId: Long
)

@Serializable
enum class OperationName(val value: String) {
    @SerialName("ModAdd") ModAdd("ModAdd"),
    @SerialName("PostAssignment") PostAssignment("PostAssignment"),
    @SerialName("PostMul") PostMul("PostMul"),
    @SerialName("PostPercent") PostPercent("PostPercent");
}

@Serializable
enum class ShowOutputValueInUi(val value: String) {
    @SerialName("Hide") Hide("Hide"),
    @SerialName("ShowInverted") ShowInverted("ShowInverted"),
    @SerialName("ShowNormal") ShowNormal("ShowNormal");
}
<?php

// This is a autogenerated file:DbuffCollection

class DbuffCollection {
    private int $key; // json:_key Required
    private AggregateMode $aggregateMode; // json:aggregateMode Required
    private string $developerDescription; // json:developerDescription Required
    private ?DisplayName $displayName; // json:displayName Optional
    private ?array $itemModifiers; // json:itemModifiers Optional
    private ?array $locationGroupModifiers; // json:locationGroupModifiers Optional
    private ?array $locationModifiers; // json:locationModifiers Optional
    private ?array $locationRequiredSkillModifiers; // json:locationRequiredSkillModifiers Optional
    private OperationName $operationName; // json:operationName Required
    private ShowOutputValueInUi $showOutputValueInUi; // json:showOutputValueInUI Required

    /**
     * @param int $key
     * @param AggregateMode $aggregateMode
     * @param string $developerDescription
     * @param DisplayName|null $displayName
     * @param array|null $itemModifiers
     * @param array|null $locationGroupModifiers
     * @param array|null $locationModifiers
     * @param array|null $locationRequiredSkillModifiers
     * @param OperationName $operationName
     * @param ShowOutputValueInUi $showOutputValueInUi
     */
    public function __construct(int $key, AggregateMode $aggregateMode, string $developerDescription, ?DisplayName $displayName, ?array $itemModifiers, ?array $locationGroupModifiers, ?array $locationModifiers, ?array $locationRequiredSkillModifiers, OperationName $operationName, ShowOutputValueInUi $showOutputValueInUi) {
        $this->key = $key;
        $this->aggregateMode = $aggregateMode;
        $this->developerDescription = $developerDescription;
        $this->displayName = $displayName;
        $this->itemModifiers = $itemModifiers;
        $this->locationGroupModifiers = $locationGroupModifiers;
        $this->locationModifiers = $locationModifiers;
        $this->locationRequiredSkillModifiers = $locationRequiredSkillModifiers;
        $this->operationName = $operationName;
        $this->showOutputValueInUi = $showOutputValueInUi;
    }

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

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

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

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

    /**
     * @param string $value
     * @throws Exception
     * @return AggregateMode
     */
    public static function fromAggregateMode(string $value): AggregateMode {
        return AggregateMode::from($value); /*enum*/
    }

    /**
     * @throws Exception
     * @return string
     */
    public function toAggregateMode(): string {
        if (DbuffCollection::validateAggregateMode($this->aggregateMode))  {
            return AggregateMode::to($this->aggregateMode); /*enum*/
        }
        throw new Exception('never get to this DbuffCollection::aggregateMode');
    }

    /**
     * @param AggregateMode
     * @return bool
     * @throws Exception
     */
    public static function validateAggregateMode(AggregateMode $value): bool {
        AggregateMode::to($value);
        return true;
    }

    /**
     * @throws Exception
     * @return AggregateMode
     */
    public function getAggregateMode(): AggregateMode {
        if (DbuffCollection::validateAggregateMode($this->aggregateMode))  {
            return $this->aggregateMode;
        }
        throw new Exception('never get to getAggregateMode DbuffCollection::aggregateMode');
    }

    /**
     * @return AggregateMode
     */
    public static function sampleAggregateMode(): AggregateMode {
        return AggregateMode::sample(); /*enum*/
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function toDeveloperDescription(): string {
        if (DbuffCollection::validateDeveloperDescription($this->developerDescription))  {
            return $this->developerDescription; /*string*/
        }
        throw new Exception('never get to this DbuffCollection::developerDescription');
    }

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

    /**
     * @throws Exception
     * @return string
     */
    public function getDeveloperDescription(): string {
        if (DbuffCollection::validateDeveloperDescription($this->developerDescription))  {
            return $this->developerDescription;
        }
        throw new Exception('never get to getDeveloperDescription DbuffCollection::developerDescription');
    }

    /**
     * @return string
     */
    public static function sampleDeveloperDescription(): string {
        return 'DbuffCollection::developerDescription::33'; /*33:developerDescription*/
    }

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

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

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

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

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getItemModifiers(): ?array {
        if (DbuffCollection::validateItemModifiers($this->itemModifiers))  {
            return $this->itemModifiers;
        }
        throw new Exception('never get to getItemModifiers DbuffCollection::itemModifiers');
    }

    /**
     * @return ?array
     */
    public static function sampleItemModifiers(): ?array {
        return  array(
            ItemModifier::sample() /*35:*/
        ); /* 35:itemModifiers*/
    }

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

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

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getLocationGroupModifiers(): ?array {
        if (DbuffCollection::validateLocationGroupModifiers($this->locationGroupModifiers))  {
            return $this->locationGroupModifiers;
        }
        throw new Exception('never get to getLocationGroupModifiers DbuffCollection::locationGroupModifiers');
    }

    /**
     * @return ?array
     */
    public static function sampleLocationGroupModifiers(): ?array {
        return  array(
            LocationGroupModifier::sample() /*36:*/
        ); /* 36:locationGroupModifiers*/
    }

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

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

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getLocationModifiers(): ?array {
        if (DbuffCollection::validateLocationModifiers($this->locationModifiers))  {
            return $this->locationModifiers;
        }
        throw new Exception('never get to getLocationModifiers DbuffCollection::locationModifiers');
    }

    /**
     * @return ?array
     */
    public static function sampleLocationModifiers(): ?array {
        return  array(
            LocationModifier::sample() /*37:*/
        ); /* 37:locationModifiers*/
    }

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

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

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

    /**
     * @throws Exception
     * @return ?array
     */
    public function getLocationRequiredSkillModifiers(): ?array {
        if (DbuffCollection::validateLocationRequiredSkillModifiers($this->locationRequiredSkillModifiers))  {
            return $this->locationRequiredSkillModifiers;
        }
        throw new Exception('never get to getLocationRequiredSkillModifiers DbuffCollection::locationRequiredSkillModifiers');
    }

    /**
     * @return ?array
     */
    public static function sampleLocationRequiredSkillModifiers(): ?array {
        return  array(
            LocationRequiredSkillModifier::sample() /*38:*/
        ); /* 38:locationRequiredSkillModifiers*/
    }

    /**
     * @param string $value
     * @throws Exception
     * @return OperationName
     */
    public static function fromOperationName(string $value): OperationName {
        return OperationName::from($value); /*enum*/
    }

    /**
     * @throws Exception
     * @return string
     */
    public function toOperationName(): string {
        if (DbuffCollection::validateOperationName($this->operationName))  {
            return OperationName::to($this->operationName); /*enum*/
        }
        throw new Exception('never get to this DbuffCollection::operationName');
    }

    /**
     * @param OperationName
     * @return bool
     * @throws Exception
     */
    public static function validateOperationName(OperationName $value): bool {
        OperationName::to($value);
        return true;
    }

    /**
     * @throws Exception
     * @return OperationName
     */
    public function getOperationName(): OperationName {
        if (DbuffCollection::validateOperationName($this->operationName))  {
            return $this->operationName;
        }
        throw new Exception('never get to getOperationName DbuffCollection::operationName');
    }

    /**
     * @return OperationName
     */
    public static function sampleOperationName(): OperationName {
        return OperationName::sample(); /*enum*/
    }

    /**
     * @param string $value
     * @throws Exception
     * @return ShowOutputValueInUi
     */
    public static function fromShowOutputValueInUi(string $value): ShowOutputValueInUi {
        return ShowOutputValueInUi::from($value); /*enum*/
    }

    /**
     * @throws Exception
     * @return string
     */
    public function toShowOutputValueInUi(): string {
        if (DbuffCollection::validateShowOutputValueInUi($this->showOutputValueInUi))  {
            return ShowOutputValueInUi::to($this->showOutputValueInUi); /*enum*/
        }
        throw new Exception('never get to this DbuffCollection::showOutputValueInUi');
    }

    /**
     * @param ShowOutputValueInUi
     * @return bool
     * @throws Exception
     */
    public static function validateShowOutputValueInUi(ShowOutputValueInUi $value): bool {
        ShowOutputValueInUi::to($value);
        return true;
    }

    /**
     * @throws Exception
     * @return ShowOutputValueInUi
     */
    public function getShowOutputValueInUi(): ShowOutputValueInUi {
        if (DbuffCollection::validateShowOutputValueInUi($this->showOutputValueInUi))  {
            return $this->showOutputValueInUi;
        }
        throw new Exception('never get to getShowOutputValueInUi DbuffCollection::showOutputValueInUi');
    }

    /**
     * @return ShowOutputValueInUi
     */
    public static function sampleShowOutputValueInUi(): ShowOutputValueInUi {
        return ShowOutputValueInUi::sample(); /*enum*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return DbuffCollection::validateKey($this->key)
        || DbuffCollection::validateAggregateMode($this->aggregateMode)
        || DbuffCollection::validateDeveloperDescription($this->developerDescription)
        || DbuffCollection::validateDisplayName($this->displayName)
        || DbuffCollection::validateItemModifiers($this->itemModifiers)
        || DbuffCollection::validateLocationGroupModifiers($this->locationGroupModifiers)
        || DbuffCollection::validateLocationModifiers($this->locationModifiers)
        || DbuffCollection::validateLocationRequiredSkillModifiers($this->locationRequiredSkillModifiers)
        || DbuffCollection::validateOperationName($this->operationName)
        || DbuffCollection::validateShowOutputValueInUi($this->showOutputValueInUi);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'_key'} = $this->toKey();
        $out->{'aggregateMode'} = $this->toAggregateMode();
        $out->{'developerDescription'} = $this->toDeveloperDescription();
        $out->{'displayName'} = $this->toDisplayName();
        $out->{'itemModifiers'} = $this->toItemModifiers();
        $out->{'locationGroupModifiers'} = $this->toLocationGroupModifiers();
        $out->{'locationModifiers'} = $this->toLocationModifiers();
        $out->{'locationRequiredSkillModifiers'} = $this->toLocationRequiredSkillModifiers();
        $out->{'operationName'} = $this->toOperationName();
        $out->{'showOutputValueInUI'} = $this->toShowOutputValueInUi();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return DbuffCollection
     * @throws Exception
     */
    public static function from(stdClass $obj): DbuffCollection {
        return new DbuffCollection(
         DbuffCollection::fromKey($obj->{'_key'})
        ,DbuffCollection::fromAggregateMode($obj->{'aggregateMode'})
        ,DbuffCollection::fromDeveloperDescription($obj->{'developerDescription'})
        ,DbuffCollection::fromDisplayName($obj->{'displayName'})
        ,DbuffCollection::fromItemModifiers($obj->{'itemModifiers'})
        ,DbuffCollection::fromLocationGroupModifiers($obj->{'locationGroupModifiers'})
        ,DbuffCollection::fromLocationModifiers($obj->{'locationModifiers'})
        ,DbuffCollection::fromLocationRequiredSkillModifiers($obj->{'locationRequiredSkillModifiers'})
        ,DbuffCollection::fromOperationName($obj->{'operationName'})
        ,DbuffCollection::fromShowOutputValueInUi($obj->{'showOutputValueInUI'})
        );
    }

    /**
     * @return DbuffCollection
     */
    public static function sample(): DbuffCollection {
        return new DbuffCollection(
         DbuffCollection::sampleKey()
        ,DbuffCollection::sampleAggregateMode()
        ,DbuffCollection::sampleDeveloperDescription()
        ,DbuffCollection::sampleDisplayName()
        ,DbuffCollection::sampleItemModifiers()
        ,DbuffCollection::sampleLocationGroupModifiers()
        ,DbuffCollection::sampleLocationModifiers()
        ,DbuffCollection::sampleLocationRequiredSkillModifiers()
        ,DbuffCollection::sampleOperationName()
        ,DbuffCollection::sampleShowOutputValueInUi()
        );
    }
}

// This is a autogenerated file:AggregateMode

class AggregateMode {
    public static AggregateMode $MAXIMUM;
    public static AggregateMode $MINIMUM;
    public static function init() {
        AggregateMode::$MAXIMUM = new AggregateMode('Maximum');
        AggregateMode::$MINIMUM = new AggregateMode('Minimum');
    }
    private string $enum;
    public function __construct(string $enum) {
        $this->enum = $enum;
    }

    /**
     * @param AggregateMode
     * @return string
     * @throws Exception
     */
    public static function to(AggregateMode $obj): string {
        switch ($obj->enum) {
            case AggregateMode::$MAXIMUM->enum: return 'Maximum';
            case AggregateMode::$MINIMUM->enum: return 'Minimum';
        }
        throw new Exception('the give value is not an enum-value.');
    }

    /**
     * @param mixed
     * @return AggregateMode
     * @throws Exception
     */
    public static function from($obj): AggregateMode {
        switch ($obj) {
            case 'Maximum': return AggregateMode::$MAXIMUM;
            case 'Minimum': return AggregateMode::$MINIMUM;
        }
        throw new Exception("Cannot deserialize AggregateMode");
    }

    /**
     * @return AggregateMode
     */
    public static function sample(): AggregateMode {
        return AggregateMode::$MAXIMUM;
    }
}
AggregateMode::init();

// This is a autogenerated file:DisplayName

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

    /**
     * @param string $de
     * @param string $en
     * @param string $es
     * @param string $fr
     * @param string $ja
     * @param string $ko
     * @param string $ru
     * @param string $zh
     */
    public function __construct(string $de, string $en, string $es, string $fr, string $ja, string $ko, string $ru, string $zh) {
        $this->de = $de;
        $this->en = $en;
        $this->es = $es;
        $this->fr = $fr;
        $this->ja = $ja;
        $this->ko = $ko;
        $this->ru = $ru;
        $this->zh = $zh;
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleDe(): string {
        return 'DisplayName::de::31'; /*31:de*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleEn(): string {
        return 'DisplayName::en::32'; /*32:en*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleEs(): string {
        return 'DisplayName::es::33'; /*33:es*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleFr(): string {
        return 'DisplayName::fr::34'; /*34:fr*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleJa(): string {
        return 'DisplayName::ja::35'; /*35:ja*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleKo(): string {
        return 'DisplayName::ko::36'; /*36:ko*/
    }

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

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

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

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

    /**
     * @return string
     */
    public static function sampleRu(): string {
        return 'DisplayName::ru::37'; /*37:ru*/
    }

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

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

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

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

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

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return DisplayName::validateDe($this->de)
        || DisplayName::validateEn($this->en)
        || DisplayName::validateEs($this->es)
        || DisplayName::validateFr($this->fr)
        || DisplayName::validateJa($this->ja)
        || DisplayName::validateKo($this->ko)
        || DisplayName::validateRu($this->ru)
        || DisplayName::validateZh($this->zh);
    }

    /**
     * @return stdClass
     * @throws Exception
     */
    public function to(): stdClass  {
        $out = new stdClass();
        $out->{'de'} = $this->toDe();
        $out->{'en'} = $this->toEn();
        $out->{'es'} = $this->toEs();
        $out->{'fr'} = $this->toFr();
        $out->{'ja'} = $this->toJa();
        $out->{'ko'} = $this->toKo();
        $out->{'ru'} = $this->toRu();
        $out->{'zh'} = $this->toZh();
        return $out;
    }

    /**
     * @param stdClass $obj
     * @return DisplayName
     * @throws Exception
     */
    public static function from(stdClass $obj): DisplayName {
        return new DisplayName(
         DisplayName::fromDe($obj->{'de'})
        ,DisplayName::fromEn($obj->{'en'})
        ,DisplayName::fromEs($obj->{'es'})
        ,DisplayName::fromFr($obj->{'fr'})
        ,DisplayName::fromJa($obj->{'ja'})
        ,DisplayName::fromKo($obj->{'ko'})
        ,DisplayName::fromRu($obj->{'ru'})
        ,DisplayName::fromZh($obj->{'zh'})
        );
    }

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

// This is a autogenerated file:ItemModifier

class ItemModifier {
    private int $dogmaAttributeId; // json:dogmaAttributeID Required

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toDogmaAttributeId(): int {
        if (ItemModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId; /*int*/
        }
        throw new Exception('never get to this ItemModifier::dogmaAttributeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getDogmaAttributeId(): int {
        if (ItemModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId;
        }
        throw new Exception('never get to getDogmaAttributeId ItemModifier::dogmaAttributeId');
    }

    /**
     * @return int
     */
    public static function sampleDogmaAttributeId(): int {
        return 31; /*31:dogmaAttributeId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return ItemModifier::validateDogmaAttributeId($this->dogmaAttributeId);
    }

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

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

    /**
     * @return ItemModifier
     */
    public static function sample(): ItemModifier {
        return new ItemModifier(
         ItemModifier::sampleDogmaAttributeId()
        );
    }
}

// This is a autogenerated file:LocationGroupModifier

class LocationGroupModifier {
    private int $dogmaAttributeId; // json:dogmaAttributeID Required
    private int $groupId; // json:groupID Required

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toDogmaAttributeId(): int {
        if (LocationGroupModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId; /*int*/
        }
        throw new Exception('never get to this LocationGroupModifier::dogmaAttributeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getDogmaAttributeId(): int {
        if (LocationGroupModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId;
        }
        throw new Exception('never get to getDogmaAttributeId LocationGroupModifier::dogmaAttributeId');
    }

    /**
     * @return int
     */
    public static function sampleDogmaAttributeId(): int {
        return 31; /*31:dogmaAttributeId*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toGroupId(): int {
        if (LocationGroupModifier::validateGroupId($this->groupId))  {
            return $this->groupId; /*int*/
        }
        throw new Exception('never get to this LocationGroupModifier::groupId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getGroupId(): int {
        if (LocationGroupModifier::validateGroupId($this->groupId))  {
            return $this->groupId;
        }
        throw new Exception('never get to getGroupId LocationGroupModifier::groupId');
    }

    /**
     * @return int
     */
    public static function sampleGroupId(): int {
        return 32; /*32:groupId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return LocationGroupModifier::validateDogmaAttributeId($this->dogmaAttributeId)
        || LocationGroupModifier::validateGroupId($this->groupId);
    }

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

    /**
     * @param stdClass $obj
     * @return LocationGroupModifier
     * @throws Exception
     */
    public static function from(stdClass $obj): LocationGroupModifier {
        return new LocationGroupModifier(
         LocationGroupModifier::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
        ,LocationGroupModifier::fromGroupId($obj->{'groupID'})
        );
    }

    /**
     * @return LocationGroupModifier
     */
    public static function sample(): LocationGroupModifier {
        return new LocationGroupModifier(
         LocationGroupModifier::sampleDogmaAttributeId()
        ,LocationGroupModifier::sampleGroupId()
        );
    }
}

// This is a autogenerated file:LocationModifier

class LocationModifier {
    private int $dogmaAttributeId; // json:dogmaAttributeID Required

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toDogmaAttributeId(): int {
        if (LocationModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId; /*int*/
        }
        throw new Exception('never get to this LocationModifier::dogmaAttributeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getDogmaAttributeId(): int {
        if (LocationModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId;
        }
        throw new Exception('never get to getDogmaAttributeId LocationModifier::dogmaAttributeId');
    }

    /**
     * @return int
     */
    public static function sampleDogmaAttributeId(): int {
        return 31; /*31:dogmaAttributeId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return LocationModifier::validateDogmaAttributeId($this->dogmaAttributeId);
    }

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

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

    /**
     * @return LocationModifier
     */
    public static function sample(): LocationModifier {
        return new LocationModifier(
         LocationModifier::sampleDogmaAttributeId()
        );
    }
}

// This is a autogenerated file:LocationRequiredSkillModifier

class LocationRequiredSkillModifier {
    private int $dogmaAttributeId; // json:dogmaAttributeID Required
    private int $skillId; // json:skillID Required

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

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

    /**
     * @throws Exception
     * @return int
     */
    public function toDogmaAttributeId(): int {
        if (LocationRequiredSkillModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId; /*int*/
        }
        throw new Exception('never get to this LocationRequiredSkillModifier::dogmaAttributeId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getDogmaAttributeId(): int {
        if (LocationRequiredSkillModifier::validateDogmaAttributeId($this->dogmaAttributeId))  {
            return $this->dogmaAttributeId;
        }
        throw new Exception('never get to getDogmaAttributeId LocationRequiredSkillModifier::dogmaAttributeId');
    }

    /**
     * @return int
     */
    public static function sampleDogmaAttributeId(): int {
        return 31; /*31:dogmaAttributeId*/
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function toSkillId(): int {
        if (LocationRequiredSkillModifier::validateSkillId($this->skillId))  {
            return $this->skillId; /*int*/
        }
        throw new Exception('never get to this LocationRequiredSkillModifier::skillId');
    }

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

    /**
     * @throws Exception
     * @return int
     */
    public function getSkillId(): int {
        if (LocationRequiredSkillModifier::validateSkillId($this->skillId))  {
            return $this->skillId;
        }
        throw new Exception('never get to getSkillId LocationRequiredSkillModifier::skillId');
    }

    /**
     * @return int
     */
    public static function sampleSkillId(): int {
        return 32; /*32:skillId*/
    }

    /**
     * @throws Exception
     * @return bool
     */
    public function validate(): bool {
        return LocationRequiredSkillModifier::validateDogmaAttributeId($this->dogmaAttributeId)
        || LocationRequiredSkillModifier::validateSkillId($this->skillId);
    }

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

    /**
     * @param stdClass $obj
     * @return LocationRequiredSkillModifier
     * @throws Exception
     */
    public static function from(stdClass $obj): LocationRequiredSkillModifier {
        return new LocationRequiredSkillModifier(
         LocationRequiredSkillModifier::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
        ,LocationRequiredSkillModifier::fromSkillId($obj->{'skillID'})
        );
    }

    /**
     * @return LocationRequiredSkillModifier
     */
    public static function sample(): LocationRequiredSkillModifier {
        return new LocationRequiredSkillModifier(
         LocationRequiredSkillModifier::sampleDogmaAttributeId()
        ,LocationRequiredSkillModifier::sampleSkillId()
        );
    }
}

// This is a autogenerated file:OperationName

class OperationName {
    public static OperationName $MOD_ADD;
    public static OperationName $POST_ASSIGNMENT;
    public static OperationName $POST_MUL;
    public static OperationName $POST_PERCENT;
    public static function init() {
        OperationName::$MOD_ADD = new OperationName('ModAdd');
        OperationName::$POST_ASSIGNMENT = new OperationName('PostAssignment');
        OperationName::$POST_MUL = new OperationName('PostMul');
        OperationName::$POST_PERCENT = new OperationName('PostPercent');
    }
    private string $enum;
    public function __construct(string $enum) {
        $this->enum = $enum;
    }

    /**
     * @param OperationName
     * @return string
     * @throws Exception
     */
    public static function to(OperationName $obj): string {
        switch ($obj->enum) {
            case OperationName::$MOD_ADD->enum: return 'ModAdd';
            case OperationName::$POST_ASSIGNMENT->enum: return 'PostAssignment';
            case OperationName::$POST_MUL->enum: return 'PostMul';
            case OperationName::$POST_PERCENT->enum: return 'PostPercent';
        }
        throw new Exception('the give value is not an enum-value.');
    }

    /**
     * @param mixed
     * @return OperationName
     * @throws Exception
     */
    public static function from($obj): OperationName {
        switch ($obj) {
            case 'ModAdd': return OperationName::$MOD_ADD;
            case 'PostAssignment': return OperationName::$POST_ASSIGNMENT;
            case 'PostMul': return OperationName::$POST_MUL;
            case 'PostPercent': return OperationName::$POST_PERCENT;
        }
        throw new Exception("Cannot deserialize OperationName");
    }

    /**
     * @return OperationName
     */
    public static function sample(): OperationName {
        return OperationName::$MOD_ADD;
    }
}
OperationName::init();

// This is a autogenerated file:ShowOutputValueInUi

class ShowOutputValueInUi {
    public static ShowOutputValueInUi $HIDE;
    public static ShowOutputValueInUi $SHOW_INVERTED;
    public static ShowOutputValueInUi $SHOW_NORMAL;
    public static function init() {
        ShowOutputValueInUi::$HIDE = new ShowOutputValueInUi('Hide');
        ShowOutputValueInUi::$SHOW_INVERTED = new ShowOutputValueInUi('ShowInverted');
        ShowOutputValueInUi::$SHOW_NORMAL = new ShowOutputValueInUi('ShowNormal');
    }
    private string $enum;
    public function __construct(string $enum) {
        $this->enum = $enum;
    }

    /**
     * @param ShowOutputValueInUi
     * @return string
     * @throws Exception
     */
    public static function to(ShowOutputValueInUi $obj): string {
        switch ($obj->enum) {
            case ShowOutputValueInUi::$HIDE->enum: return 'Hide';
            case ShowOutputValueInUi::$SHOW_INVERTED->enum: return 'ShowInverted';
            case ShowOutputValueInUi::$SHOW_NORMAL->enum: return 'ShowNormal';
        }
        throw new Exception('the give value is not an enum-value.');
    }

    /**
     * @param mixed
     * @return ShowOutputValueInUi
     * @throws Exception
     */
    public static function from($obj): ShowOutputValueInUi {
        switch ($obj) {
            case 'Hide': return ShowOutputValueInUi::$HIDE;
            case 'ShowInverted': return ShowOutputValueInUi::$SHOW_INVERTED;
            case 'ShowNormal': return ShowOutputValueInUi::$SHOW_NORMAL;
        }
        throw new Exception("Cannot deserialize ShowOutputValueInUi");
    }

    /**
     * @return ShowOutputValueInUi
     */
    public static function sample(): ShowOutputValueInUi {
        return ShowOutputValueInUi::$HIDE;
    }
}
ShowOutputValueInUi::init();
from enum import Enum
from typing import Any, Optional, List, TypeVar, Callable, Type, cast


T = TypeVar("T")
EnumT = TypeVar("EnumT", bound=Enum)


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


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


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


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


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


def to_enum(c: Type[EnumT], x: Any) -> EnumT:
    assert isinstance(x, c)
    return x.value


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


class AggregateMode(Enum):
    MAXIMUM = "Maximum"
    MINIMUM = "Minimum"


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

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

    @staticmethod
    def from_dict(obj: Any) -> 'DisplayName':
        assert isinstance(obj, dict)
        de = from_str(obj.get("de"))
        en = from_str(obj.get("en"))
        es = from_str(obj.get("es"))
        fr = from_str(obj.get("fr"))
        ja = from_str(obj.get("ja"))
        ko = from_str(obj.get("ko"))
        ru = from_str(obj.get("ru"))
        zh = from_str(obj.get("zh"))
        return DisplayName(de, en, es, fr, ja, ko, ru, zh)

    def to_dict(self) -> dict:
        result: dict = {}
        result["de"] = from_str(self.de)
        result["en"] = from_str(self.en)
        result["es"] = from_str(self.es)
        result["fr"] = from_str(self.fr)
        result["ja"] = from_str(self.ja)
        result["ko"] = from_str(self.ko)
        result["ru"] = from_str(self.ru)
        result["zh"] = from_str(self.zh)
        return result


class ItemModifier:
    dogma_attribute_id: int

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

    @staticmethod
    def from_dict(obj: Any) -> 'ItemModifier':
        assert isinstance(obj, dict)
        dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
        return ItemModifier(dogma_attribute_id)

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


class LocationGroupModifier:
    dogma_attribute_id: int
    group_id: int

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

    @staticmethod
    def from_dict(obj: Any) -> 'LocationGroupModifier':
        assert isinstance(obj, dict)
        dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
        group_id = from_int(obj.get("groupID"))
        return LocationGroupModifier(dogma_attribute_id, group_id)

    def to_dict(self) -> dict:
        result: dict = {}
        result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
        result["groupID"] = from_int(self.group_id)
        return result


class LocationModifier:
    dogma_attribute_id: int

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

    @staticmethod
    def from_dict(obj: Any) -> 'LocationModifier':
        assert isinstance(obj, dict)
        dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
        return LocationModifier(dogma_attribute_id)

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


class LocationRequiredSkillModifier:
    dogma_attribute_id: int
    skill_id: int

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

    @staticmethod
    def from_dict(obj: Any) -> 'LocationRequiredSkillModifier':
        assert isinstance(obj, dict)
        dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
        skill_id = from_int(obj.get("skillID"))
        return LocationRequiredSkillModifier(dogma_attribute_id, skill_id)

    def to_dict(self) -> dict:
        result: dict = {}
        result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
        result["skillID"] = from_int(self.skill_id)
        return result


class OperationName(Enum):
    MOD_ADD = "ModAdd"
    POST_ASSIGNMENT = "PostAssignment"
    POST_MUL = "PostMul"
    POST_PERCENT = "PostPercent"


class ShowOutputValueInUI(Enum):
    HIDE = "Hide"
    SHOW_INVERTED = "ShowInverted"
    SHOW_NORMAL = "ShowNormal"


class DbuffCollection:
    key: int
    aggregate_mode: AggregateMode
    developer_description: str
    display_name: Optional[DisplayName]
    item_modifiers: Optional[List[ItemModifier]]
    location_group_modifiers: Optional[List[LocationGroupModifier]]
    location_modifiers: Optional[List[LocationModifier]]
    location_required_skill_modifiers: Optional[List[LocationRequiredSkillModifier]]
    operation_name: OperationName
    show_output_value_in_ui: ShowOutputValueInUI

    def __init__(self, key: int, aggregate_mode: AggregateMode, developer_description: str, display_name: Optional[DisplayName], item_modifiers: Optional[List[ItemModifier]], location_group_modifiers: Optional[List[LocationGroupModifier]], location_modifiers: Optional[List[LocationModifier]], location_required_skill_modifiers: Optional[List[LocationRequiredSkillModifier]], operation_name: OperationName, show_output_value_in_ui: ShowOutputValueInUI) -> None:
        self.key = key
        self.aggregate_mode = aggregate_mode
        self.developer_description = developer_description
        self.display_name = display_name
        self.item_modifiers = item_modifiers
        self.location_group_modifiers = location_group_modifiers
        self.location_modifiers = location_modifiers
        self.location_required_skill_modifiers = location_required_skill_modifiers
        self.operation_name = operation_name
        self.show_output_value_in_ui = show_output_value_in_ui

    @staticmethod
    def from_dict(obj: Any) -> 'DbuffCollection':
        assert isinstance(obj, dict)
        key = from_int(obj.get("_key"))
        aggregate_mode = AggregateMode(obj.get("aggregateMode"))
        developer_description = from_str(obj.get("developerDescription"))
        display_name = from_union([DisplayName.from_dict, from_none], obj.get("displayName"))
        item_modifiers = from_union([lambda x: from_list(ItemModifier.from_dict, x), from_none], obj.get("itemModifiers"))
        location_group_modifiers = from_union([lambda x: from_list(LocationGroupModifier.from_dict, x), from_none], obj.get("locationGroupModifiers"))
        location_modifiers = from_union([lambda x: from_list(LocationModifier.from_dict, x), from_none], obj.get("locationModifiers"))
        location_required_skill_modifiers = from_union([lambda x: from_list(LocationRequiredSkillModifier.from_dict, x), from_none], obj.get("locationRequiredSkillModifiers"))
        operation_name = OperationName(obj.get("operationName"))
        show_output_value_in_ui = ShowOutputValueInUI(obj.get("showOutputValueInUI"))
        return DbuffCollection(key, aggregate_mode, developer_description, display_name, item_modifiers, location_group_modifiers, location_modifiers, location_required_skill_modifiers, operation_name, show_output_value_in_ui)

    def to_dict(self) -> dict:
        result: dict = {}
        result["_key"] = from_int(self.key)
        result["aggregateMode"] = to_enum(AggregateMode, self.aggregate_mode)
        result["developerDescription"] = from_str(self.developer_description)
        if self.display_name is not None:
            result["displayName"] = from_union([lambda x: to_class(DisplayName, x), from_none], self.display_name)
        if self.item_modifiers is not None:
            result["itemModifiers"] = from_union([lambda x: from_list(lambda x: to_class(ItemModifier, x), x), from_none], self.item_modifiers)
        if self.location_group_modifiers is not None:
            result["locationGroupModifiers"] = from_union([lambda x: from_list(lambda x: to_class(LocationGroupModifier, x), x), from_none], self.location_group_modifiers)
        if self.location_modifiers is not None:
            result["locationModifiers"] = from_union([lambda x: from_list(lambda x: to_class(LocationModifier, x), x), from_none], self.location_modifiers)
        if self.location_required_skill_modifiers is not None:
            result["locationRequiredSkillModifiers"] = from_union([lambda x: from_list(lambda x: to_class(LocationRequiredSkillModifier, x), x), from_none], self.location_required_skill_modifiers)
        result["operationName"] = to_enum(OperationName, self.operation_name)
        result["showOutputValueInUI"] = to_enum(ShowOutputValueInUI, self.show_output_value_in_ui)
        return result


def dbuff_collection_from_dict(s: Any) -> DbuffCollection:
    return DbuffCollection.from_dict(s)


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

export interface DbuffCollection {
    _key:                            number;
    aggregateMode:                   AggregateMode;
    developerDescription:            string;
    displayName?:                    DisplayName;
    itemModifiers?:                  ItemModifier[];
    locationGroupModifiers?:         LocationGroupModifier[];
    locationModifiers?:              LocationModifier[];
    locationRequiredSkillModifiers?: LocationRequiredSkillModifier[];
    operationName:                   OperationName;
    showOutputValueInUI:             ShowOutputValueInUi;
    [property: string]: any;
}

export enum AggregateMode {
    Maximum = "Maximum",
    Minimum = "Minimum",
}

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

export interface ItemModifier {
    dogmaAttributeID: number;
    [property: string]: any;
}

export interface LocationGroupModifier {
    dogmaAttributeID: number;
    groupID:          number;
    [property: string]: any;
}

export interface LocationModifier {
    dogmaAttributeID: number;
    [property: string]: any;
}

export interface LocationRequiredSkillModifier {
    dogmaAttributeID: number;
    skillID:          number;
    [property: string]: any;
}

export enum OperationName {
    ModAdd = "ModAdd",
    PostAssignment = "PostAssignment",
    PostMul = "PostMul",
    PostPercent = "PostPercent",
}

export enum ShowOutputValueInUi {
    Hide = "Hide",
    ShowInverted = "ShowInverted",
    ShowNormal = "ShowNormal",
}

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

    public static dbuffCollectionToJson(value: DbuffCollection): string {
        return JSON.stringify(uncast(value, r("DbuffCollection")), 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 = {
    "DbuffCollection": o([
        { json: "_key", js: "_key", typ: 0 },
        { json: "aggregateMode", js: "aggregateMode", typ: r("AggregateMode") },
        { json: "developerDescription", js: "developerDescription", typ: "" },
        { json: "displayName", js: "displayName", typ: u(undefined, r("DisplayName")) },
        { json: "itemModifiers", js: "itemModifiers", typ: u(undefined, a(r("ItemModifier"))) },
        { json: "locationGroupModifiers", js: "locationGroupModifiers", typ: u(undefined, a(r("LocationGroupModifier"))) },
        { json: "locationModifiers", js: "locationModifiers", typ: u(undefined, a(r("LocationModifier"))) },
        { json: "locationRequiredSkillModifiers", js: "locationRequiredSkillModifiers", typ: u(undefined, a(r("LocationRequiredSkillModifier"))) },
        { json: "operationName", js: "operationName", typ: r("OperationName") },
        { json: "showOutputValueInUI", js: "showOutputValueInUI", typ: r("ShowOutputValueInUi") },
    ], "any"),
    "DisplayName": o([
        { json: "de", js: "de", typ: "" },
        { json: "en", js: "en", typ: "" },
        { json: "es", js: "es", typ: "" },
        { json: "fr", js: "fr", typ: "" },
        { json: "ja", js: "ja", typ: "" },
        { json: "ko", js: "ko", typ: "" },
        { json: "ru", js: "ru", typ: "" },
        { json: "zh", js: "zh", typ: "" },
    ], "any"),
    "ItemModifier": o([
        { json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
    ], "any"),
    "LocationGroupModifier": o([
        { json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
        { json: "groupID", js: "groupID", typ: 0 },
    ], "any"),
    "LocationModifier": o([
        { json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
    ], "any"),
    "LocationRequiredSkillModifier": o([
        { json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
        { json: "skillID", js: "skillID", typ: 0 },
    ], "any"),
    "AggregateMode": [
        "Maximum",
        "Minimum",
    ],
    "OperationName": [
        "ModAdd",
        "PostAssignment",
        "PostMul",
        "PostPercent",
    ],
    "ShowOutputValueInUi": [
        "Hide",
        "ShowInverted",
        "ShowNormal",
    ],
};